(globalThis["__googlesitekit_webpackJsonp"] = globalThis["__googlesitekit_webpackJsonp"] || []).push([["googlesitekit-modules-adsense"],{

/***/ "./js/api-fetch-shim.js":
/*!******************************!*\
  !*** ./js/api-fetch-shim.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/api-fetch__non-shim */ "../node_modules/@wordpress/api-fetch/build/index.js");
/* harmony import */ var _wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _googlesitekit_api_middleware_preloading_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./googlesitekit/api/middleware/preloading.js */ "./js/googlesitekit/api/middleware/preloading.js");
/* harmony import */ var _js_googlesitekit_api_middleware_deduplication__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/api/middleware/deduplication */ "./js/googlesitekit/api/middleware/deduplication.ts");
/* harmony reexport (unknown) */ var __WEBPACK_REEXPORT_OBJECT__ = {};
/* harmony reexport (unknown) */ for(const __WEBPACK_IMPORT_KEY__ in _wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0__) if(__WEBPACK_IMPORT_KEY__ !== "default") __WEBPACK_REEXPORT_OBJECT__[__WEBPACK_IMPORT_KEY__] = () => _wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0__[__WEBPACK_IMPORT_KEY__]
/* harmony reexport (unknown) */ __webpack_require__.d(__webpack_exports__, __WEBPACK_REEXPORT_OBJECT__);
/**
 * API Fetch Shim.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


const {
  nonce,
  nonceEndpoint,
  preloadedData,
  rootURL
} = __webpack_require__.g._googlesitekitAPIFetchData || {};
(_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().nonceEndpoint) = nonceEndpoint;
(_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().nonceMiddleware) = _wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().createNonceMiddleware(nonce);
(_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().rootURLMiddleware) = _wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().createRootURLMiddleware(rootURL);
(_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().dedupeMiddleware) = (0,_js_googlesitekit_api_middleware_deduplication__WEBPACK_IMPORTED_MODULE_2__["default"])({
  onDuplicate: _js_googlesitekit_api_middleware_deduplication__WEBPACK_IMPORTED_MODULE_2__.logDuplicate
});
(_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().preloadingMiddleware) = (0,_googlesitekit_api_middleware_preloading_js__WEBPACK_IMPORTED_MODULE_1__["default"])(preloadedData);
_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().use((_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().nonceMiddleware));
_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().use((_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().mediaUploadMiddleware));
_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().use((_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().rootURLMiddleware));
_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().use((_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().dedupeMiddleware));
_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().use((_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().preloadingMiddleware));

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default()));

/***/ }),

/***/ "./js/components/AccessibleWarningIcon.js":
/*!************************************************!*\
  !*** ./js/components/AccessibleWarningIcon.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AccessibleWarningIcon)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _VisuallyHidden__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VisuallyHidden */ "./js/components/VisuallyHidden.js");
/* harmony import */ var _svg_icons_warning_v2_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/warning-v2.svg */ "./svg/icons/warning-v2.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AccessibleWarningIcon component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */



function AccessibleWarningIcon({
  height = 12,
  screenReaderText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error', 'google-site-kit'),
  width = 14
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_VisuallyHidden__WEBPACK_IMPORTED_MODULE_1__["default"], {
      children: screenReaderText
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_svg_icons_warning_v2_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
      width: width,
      height: height
    })]
  });
}
AccessibleWarningIcon.propTypes = {
  height: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number),
  screenReaderText: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number)
};

/***/ }),

/***/ "./js/components/AdminScreenTooltip/AdminScreenTooltip.js":
/*!****************************************************************!*\
  !*** ./js/components/AdminScreenTooltip/AdminScreenTooltip.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AdminScreenTooltip: () => (/* binding */ AdminScreenTooltip)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_JoyrideTooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/JoyrideTooltip */ "./js/components/JoyrideTooltip.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdminMenuTooltip component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







function AdminScreenTooltip() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.useBreakpoint)();
  const {
    isTooltipVisible = false,
    target,
    placement,
    className,
    tooltipSlug,
    title,
    content,
    dismissLabel,
    gaTrackingEventLabel
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI).getValue('admin-screen-tooltip') || {
    isTooltipVisible: false
  });
  function handleViewTooltip() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_${tooltipSlug}`, 'tooltip_view', gaTrackingEventLabel);
  }
  const handleDismissTooltip = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(() => {
    // Track dismiss event.
    if (tooltipSlug) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_${tooltipSlug}`, 'tooltip_dismiss', gaTrackingEventLabel);
    }
    setValue('admin-screen-tooltip', undefined);
  }, [setValue, tooltipSlug, viewContext, gaTrackingEventLabel]);
  if (!isTooltipVisible) {
    return null;
  }
  const isMobileTablet = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.BREAKPOINT_TABLET;
  const desktopTarget = target !== null && target !== void 0 ? target : '#adminmenu [href*="page=googlesitekit-settings"]';
  const desktopPlacement = placement !== null && placement !== void 0 ? placement : 'right';
  function desktopClassName() {
    if (className) {
      return className;
    }
    return !target ? 'googlesitekit-tour-tooltip__fixed-settings-tooltip' : undefined;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_JoyrideTooltip__WEBPACK_IMPORTED_MODULE_1__["default"], {
    target: isMobileTablet ? 'body' : desktopTarget,
    placement: isMobileTablet ? 'center' : desktopPlacement,
    className: isMobileTablet ? 'googlesitekit-tour-tooltip__modal_step' : desktopClassName(),
    disableOverlay: !isMobileTablet,
    slug: "admin-screen-tooltip",
    title: title,
    content: content,
    dismissLabel: dismissLabel,
    onView: handleViewTooltip,
    onDismiss: handleDismissTooltip
  });
}

/***/ }),

/***/ "./js/components/AdminScreenTooltip/index.js":
/*!***************************************************!*\
  !*** ./js/components/AdminScreenTooltip/index.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AdminScreenTooltip: () => (/* reexport safe */ _AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_1__.AdminScreenTooltip),
/* harmony export */   useShowTooltip: () => (/* reexport safe */ _useShowTooltip__WEBPACK_IMPORTED_MODULE_0__.useShowTooltip)
/* harmony export */ });
/* harmony import */ var _useShowTooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useShowTooltip */ "./js/components/AdminScreenTooltip/useShowTooltip.js");
/* harmony import */ var _AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AdminScreenTooltip */ "./js/components/AdminScreenTooltip/AdminScreenTooltip.js");



/***/ }),

/***/ "./js/components/AdminScreenTooltip/useShowTooltip.js":
/*!************************************************************!*\
  !*** ./js/components/AdminScreenTooltip/useShowTooltip.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useShowTooltip: () => (/* binding */ useShowTooltip)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");



function useShowTooltip(tooltipSettings) {
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_UI);
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    setValue('admin-screen-tooltip', {
      isTooltipVisible: true,
      ...tooltipSettings
    });
  }, [setValue, tooltipSettings]);
}

/***/ }),

/***/ "./js/components/Badge.js":
/*!********************************!*\
  !*** ./js/components/Badge.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Badge component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


const Badge = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(({
  label,
  className,
  hasLeftSpacing = false,
  ...rest
}, ref) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
  ref: ref,
  ...rest,
  className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-badge', className, {
    'googlesitekit-badge--has-left-spacing': hasLeftSpacing
  }),
  children: label
}));
Badge.displayName = 'Badge';
Badge.propTypes = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string).isRequired,
  hasLeftSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Badge);

/***/ }),

/***/ "./js/components/Banner/CTAButton.js":
/*!*******************************************!*\
  !*** ./js/components/Banner/CTAButton.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CTAButton)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/svg/icons/external.svg */ "./svg/icons/external.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */



function CTAButton({
  label,
  ariaLabel,
  disabled,
  inProgress,
  onClick,
  href,
  external = false,
  hideExternalIndicator = false
}) {
  if (!label || !onClick && !href) {
    return null;
  }
  let trailingIconToUse;
  if (external && !hideExternalIndicator) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_1__["default"], {
      width: 14,
      height: 14
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.SpinnerButton, {
    className: "googlesitekit-banner__cta",
    "aria-label": ariaLabel,
    disabled: disabled || inProgress,
    isSaving: inProgress,
    onClick: onClick,
    href: href,
    target: external ? '_blank' : undefined,
    trailingIcon: trailingIconToUse,
    children: label
  });
}
CTAButton.propTypes = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  ariaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  inProgress: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  dismissOnClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  dismissOptions: prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
    expiresInSeconds: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
    skipHidingFromQueue: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
  })
};

/***/ }),

/***/ "./js/components/Banner/Description.js":
/*!*********************************************!*\
  !*** ./js/components/Banner/Description.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Description)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _LearnMoreLink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LearnMoreLink */ "./js/components/Banner/LearnMoreLink.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function Description({
  className,
  description,
  learnMoreLink,
  additionalDescription,
  children
}) {
  function renderDescription() {
    if ((0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.isValidElement)(description)) {
      return description;
    }
    if ('string' === typeof description) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
        dangerouslySetInnerHTML: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.sanitizeHTML)(description, {
          ALLOWED_TAGS: ['strong', 'em', 'br', 'a'],
          ALLOWED_ATTR: ['href']
        })
      });
    }
    return description;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__description', className),
    children: [renderDescription(), ' ', learnMoreLink?.href && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_LearnMoreLink__WEBPACK_IMPORTED_MODULE_2__["default"], {
      ...learnMoreLink
    }), additionalDescription && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-banner__additional-description",
      children: additionalDescription
    }), children]
  });
}
Description.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node)]),
  learnMoreLink: prop_types__WEBPACK_IMPORTED_MODULE_5___default().shape(_LearnMoreLink__WEBPACK_IMPORTED_MODULE_2__["default"].propTypes),
  additionalDescription: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node)]),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node)
};

/***/ }),

/***/ "./js/components/Banner/DismissButton.js":
/*!***********************************************!*\
  !*** ./js/components/Banner/DismissButton.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DismissButton)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function DismissButton({
  className,
  label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maybe later', 'google-site-kit'),
  onClick,
  disabled,
  tertiary = true
}) {
  if (!onClick) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
    className: className,
    onClick: onClick,
    disabled: disabled,
    tertiary: tertiary,
    children: label
  });
}
DismissButton.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  tertiary: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  dismissOptions: prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
    expiresInSeconds: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
    skipHidingFromQueue: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
  })
};

/***/ }),

/***/ "./js/components/Banner/Footer.js":
/*!****************************************!*\
  !*** ./js/components/Banner/Footer.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Footer)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function Footer({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__footer', className),
    children: children
  });
}
Footer.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};

/***/ }),

/***/ "./js/components/Banner/HelpText.js":
/*!******************************************!*\
  !*** ./js/components/Banner/HelpText.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ HelpText)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function HelpText({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__help-text', className),
    children: children
  });
}
HelpText.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};

/***/ }),

/***/ "./js/components/Banner/LearnMoreLink.tsx":
/*!************************************************!*\
  !*** ./js/components/Banner/LearnMoreLink.tsx ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */

/**
 * Renders a "Learn More" link component, usually used to append "Learn more" with a
 * specified URL to content like a paragraph.
 *
 * @since 1.153.0
 *
 * @param props            The props for the component.
 * @param props.className  The class name for the link.
 * @param [props.external] Whether the link is external. Optional, defaults to true.
 * @param props.href       The URL for the link.
 * @param props.label      The label for the link.
 * @param [props.onClick]  The function to call when the link is clicked. Optional, defaults to an empty function.
 * @return The rendered component.
 */
const LearnMoreLink = ({
  className,
  external = true,
  href,
  label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more', 'google-site-kit'),
  onClick = () => {}
}) => {
  // Return null if no href is provided.
  //
  // This arguably shouldn't be optional, but until all usage of this
  // component are via typed code, we need this safeguard.
  if (!href) {
    return null;
  }
  return (
    /*#__PURE__*/
    // @ts-expect-error `Link` component is not currently typed, so this
    // results in an error because we're supplying a `children` prop.
    React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_1__["default"], {
      href: href,
      className: className,
      onClick: onClick,
      external: external
    }, label)
  );
};
LearnMoreLink.propTypes = {
  href: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string).isRequired,
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LearnMoreLink);

/***/ }),

/***/ "./js/components/Banner/Title.js":
/*!***************************************!*\
  !*** ./js/components/Banner/Title.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Title)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function Title({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__title', className),
    children: children
  });
}
Title.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};

/***/ }),

/***/ "./js/components/Banner/TitleIcon.js":
/*!*******************************************!*\
  !*** ./js/components/Banner/TitleIcon.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ TitleIcon)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function TitleIcon({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__title-icon', className),
    children: children
  });
}
TitleIcon.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};

/***/ }),

/***/ "./js/components/Banner/index.js":
/*!***************************************!*\
  !*** ./js/components/Banner/index.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _TitleIcon__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TitleIcon */ "./js/components/Banner/TitleIcon.js");
/* harmony import */ var _Title__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Title */ "./js/components/Banner/Title.js");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Description */ "./js/components/Banner/Description.js");
/* harmony import */ var _HelpText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HelpText */ "./js/components/Banner/HelpText.js");
/* harmony import */ var _LearnMoreLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./LearnMoreLink */ "./js/components/Banner/LearnMoreLink.tsx");
/* harmony import */ var _CTAButton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CTAButton */ "./js/components/Banner/CTAButton.js");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./DismissButton */ "./js/components/Banner/DismissButton.js");
/* harmony import */ var _Footer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Footer */ "./js/components/Banner/Footer.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */











const Banner = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.forwardRef)(({
  className,
  titleIcon,
  title,
  description,
  additionalDescription,
  errorText,
  helpText,
  learnMoreLink,
  dismissButton,
  ctaButton,
  svg,
  // NOTE: SVGs must be imported with the ?url suffix for use as a backgroundImage in this component.
  footer
}, ref) => {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.useBreakpoint)();
  const isMobileOrTablet = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_TABLET;
  let SVGData = null;
  if (isMobileOrTablet && svg?.mobile) {
    SVGData = svg.mobile;
  } else if (!isMobileOrTablet && svg?.desktop) {
    SVGData = svg.desktop;
  }
  const svgMode = svg?.verticalPosition ? svg.verticalPosition : 'center';
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
    ref: ref,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner', className),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
      className: "googlesitekit-banner__content",
      children: [titleIcon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_TitleIcon__WEBPACK_IMPORTED_MODULE_2__["default"], {
        children: titleIcon
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_Title__WEBPACK_IMPORTED_MODULE_3__["default"], {
        children: title
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_Description__WEBPACK_IMPORTED_MODULE_4__["default"], {
        description: description,
        learnMoreLink: learnMoreLink,
        additionalDescription: additionalDescription
      }), helpText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_HelpText__WEBPACK_IMPORTED_MODULE_5__["default"], {
        children: helpText
      }), errorText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_10__["default"], {
        type: "error",
        description: errorText
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
        className: "googlesitekit-notice__action",
        children: [ctaButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_CTAButton__WEBPACK_IMPORTED_MODULE_7__["default"], {
          ...ctaButton
        }), dismissButton?.onClick && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_DismissButton__WEBPACK_IMPORTED_MODULE_8__["default"], {
          ...dismissButton
        })]
      })]
    }), SVGData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__svg-wrapper', {
        [`googlesitekit-banner__svg-wrapper--${svgMode}`]: svgMode
      }),
      style: {
        backgroundImage: `url(${SVGData})`
      }
    }), footer && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_Footer__WEBPACK_IMPORTED_MODULE_9__["default"], {
      children: footer
    })]
  });
});
Banner.propTypes = {
  titleIcon: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().node),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_13___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_13___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_13___default().node)]),
  additionalDescription: prop_types__WEBPACK_IMPORTED_MODULE_13___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_13___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_13___default().node)]),
  errorText: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string),
  helpText: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string),
  learnMoreLink: prop_types__WEBPACK_IMPORTED_MODULE_13___default().shape(_LearnMoreLink__WEBPACK_IMPORTED_MODULE_6__["default"].propTypes),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_13___default().shape(_DismissButton__WEBPACK_IMPORTED_MODULE_8__["default"].propTypes),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_13___default().shape(_CTAButton__WEBPACK_IMPORTED_MODULE_7__["default"].propTypes),
  svg: prop_types__WEBPACK_IMPORTED_MODULE_13___default().shape({
    desktop: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().elementType),
    mobile: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().elementType),
    verticalPosition: prop_types__WEBPACK_IMPORTED_MODULE_13___default().oneOf(['top', 'center', 'bottom'])
  }),
  footer: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().node)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Banner);

/***/ }),

/***/ "./js/components/ChangeArrow.js":
/*!**************************************!*\
  !*** ./js/components/ChangeArrow.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * External dependencies
 */



function ChangeArrow({
  direction,
  invertColor,
  width,
  height
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("svg", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-change-arrow', `googlesitekit-change-arrow--${direction}`, {
      'googlesitekit-change-arrow--inverted-color': invertColor
    }),
    width: width,
    height: height,
    viewBox: "0 0 10 10",
    fill: "none",
    xmlns: "http://www.w3.org/2000/svg",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("path", {
      d: "M5.625 10L5.625 2.375L9.125 5.875L10 5L5 -1.76555e-07L-2.7055e-07 5L0.875 5.875L4.375 2.375L4.375 10L5.625 10Z",
      fill: "currentColor"
    })
  });
}
ChangeArrow.propTypes = {
  direction: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  invertColor: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  height: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number)
};
ChangeArrow.defaultProps = {
  direction: 'up',
  invertColor: false,
  width: 9,
  height: 9
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChangeArrow);

/***/ }),

/***/ "./js/components/ChangeBadge.js":
/*!**************************************!*\
  !*** ./js/components/ChangeBadge.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChangeBadge)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ChangeBadge component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */


function ChangeBadge(props) {
  const {
    previousValue,
    currentValue,
    isAbsolute
  } = props;
  const change = isAbsolute ? currentValue - previousValue : (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.calculateChange)(previousValue, currentValue);
  const isNegative = change < 0;
  const isZero = change === 0;

  // Do not display the change badge if the change value can't be calculated.
  if (change === null) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-change-badge', {
      'googlesitekit-change-badge--negative': isNegative,
      'googlesitekit-change-badge--zero': isZero
    }),
    children: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.numFmt)(change, {
      style: 'percent',
      signDisplay: 'exceptZero',
      maximumFractionDigits: 1
    })
  });
}
ChangeBadge.propTypes = {
  isAbsolute: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  previousValue: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number).isRequired,
  currentValue: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number).isRequired
};

/***/ }),

/***/ "./js/components/DashboardNavigation/Navigation/hooks/useNavChipHelpers.js":
/*!*********************************************************************************!*\
  !*** ./js/components/DashboardNavigation/Navigation/hooks/useNavChipHelpers.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useNavChipHelpers)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/**
 * Navigation `useNavChipHelpers` hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





/**
 * Returns helper data and functions for navigation chips.
 *
 * @since 1.159.0
 *
 * @param {Object}        params                 Parameters for the hook.
 * @param {Array<string>} params.visibleSections The sections that are currently visible.
 * @return {Object} An object containing helper data and functions for navigation chips.
 */
function useNavChipHelpers({
  visibleSections
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.useBreakpoint)();
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_2__["default"])();

  /**
   * Gets the default chip ID based on the visibility of various sections.
   *
   * @since 1.159.0
   *
   * @return {string} The default chip ID.
   */
  const getDefaultChipID = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(() => {
    if (visibleSections.includes(_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_3__.ANCHOR_ID_KEY_METRICS)) {
      return _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_3__.ANCHOR_ID_KEY_METRICS;
    }
    if (!viewOnlyDashboard) {
      return _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_3__.ANCHOR_ID_TRAFFIC;
    }
    return visibleSections[0] || '';
  }, [viewOnlyDashboard, visibleSections]);
  const defaultChipID = getDefaultChipID();

  /**
   * Checks if a chip ID is valid based on the visible sections.
   *
   * @since 1.159.0
   *
   * @param {string} chipID The chip ID to validate.
   * @return {boolean} True if the chip ID is valid, false otherwise.
   */
  const isValidChipID = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(chipID => visibleSections.includes(chipID), [visibleSections]);

  /**
   * Updates the URL hash to reflect the selected chip ID.
   *
   * @since 1.159.0
   *
   * @param {string} chipID The chip ID to update in the URL hash.
   * @return {void}
   */
  const updateURLHash = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(chipID => {
    __webpack_require__.g.history.replaceState({}, '', `#${chipID}`);
  }, []);

  /**
   * Calculates the scroll position for a given chip ID.
   *
   * @since 1.159.0
   *
   * @param {string} chipID The chip ID for which to calculate the scroll position.
   * @return {number} The calculated scroll position.
   */
  const calculateScrollPosition = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(chipID => {
    return chipID !== defaultChipID ? (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_0__.getNavigationalScrollTop)(`#${chipID}`, breakpoint) : 0;
  }, [breakpoint, defaultChipID]);

  /**
   * Scrolls to the position of a given chip ID.
   *
   * @since 1.159.0
   *
   * @param {string} chipID The chip ID to scroll to.
   * @return {void}
   */
  const scrollToChip = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(chipID => {
    __webpack_require__.g.scrollTo({
      top: calculateScrollPosition(chipID, breakpoint, defaultChipID),
      behavior: 'smooth'
    });
  }, [breakpoint, calculateScrollPosition, defaultChipID]);

  /**
   * Finds the closest section ID based on the current scroll position.
   *
   * @since 1.159.0
   *
   * @param {Object} ref The reference to the navigation element.
   * @return {string} The ID of the closest section.
   */
  const findClosestSection = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(ref => {
    var _ref$current$getBound;
    const entityHeader = document.querySelector('.googlesitekit-entity-header')?.getBoundingClientRect?.()?.bottom;
    const {
      bottom
    } = (_ref$current$getBound = ref?.current?.getBoundingClientRect?.()) !== null && _ref$current$getBound !== void 0 ? _ref$current$getBound : {};
    const margin = 20;
    let closest;
    let closestID = defaultChipID;
    for (const areaID of visibleSections) {
      const area = document.getElementById(areaID);
      if (!area) {
        continue;
      }
      const top = area.getBoundingClientRect().top - margin - (entityHeader || bottom || 0);
      if (top < 0 && (closest === undefined || closest < top)) {
        closest = top;
        closestID = areaID;
      }
    }
    return closestID;
  }, [defaultChipID, visibleSections]);
  return {
    calculateScrollPosition,
    defaultChipID,
    findClosestSection,
    isValidChipID,
    scrollToChip,
    updateURLHash
  };
}

/***/ }),

/***/ "./js/components/DashboardNavigation/Navigation/hooks/useVisibleSections.js":
/*!**********************************************************************************!*\
  !*** ./js/components/DashboardNavigation/Navigation/hooks/useVisibleSections.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   contexts: () => (/* binding */ contexts),
/* harmony export */   "default": () => (/* binding */ useVisibleSections)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-contexts */ "./js/googlesitekit/widgets/default-contexts.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/* harmony import */ var _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/**
 * Navigation `useVisibleSections` hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */







const contexts = {
  [_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_5__.DASHBOARD_TYPE_MAIN]: {
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_KEY_METRICS]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_KEY_METRICS,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_TRAFFIC]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_TRAFFIC,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_CONTENT]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_CONTENT,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SPEED]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_SPEED,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_MONETIZATION]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_MONETIZATION
  },
  [_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_5__.DASHBOARD_TYPE_ENTITY]: {
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_TRAFFIC]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_ENTITY_DASHBOARD_TRAFFIC,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_CONTENT]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_ENTITY_DASHBOARD_CONTENT,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SPEED]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_ENTITY_DASHBOARD_SPEED,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_MONETIZATION]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_ENTITY_DASHBOARD_MONETIZATION
  }
};

/**
 * Returns the visible sections for the dashboard navigation.
 *
 * @since 1.159.0
 *
 * @return {Array<string>} The visible sections.
 */
function useVisibleSections() {
  const dashboardType = (0,_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_6__["default"])();
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const viewableModules = viewOnlyDashboard ? select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getViewableModules() : null;
    const isKeyMetricsWidgetHidden = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricsWidgetHidden();
    const widgetContextOptions = {
      modules: viewableModules ? viewableModules : undefined
    };
    return Object.keys(contexts[dashboardType]).reduce((visibleSections, section) => {
      // Skip key metrics section if it's hidden.
      if (section === _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_KEY_METRICS && isKeyMetricsWidgetHidden) {
        return visibleSections;
      }
      if (select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_WIDGETS).isWidgetContextActive(contexts[dashboardType][section], widgetContextOptions)) {
        visibleSections.push(section);
      }
      return visibleSections;
    }, []);
  });
}

/***/ }),

/***/ "./js/components/DashboardNavigation/Navigation/index.js":
/*!***************************************************************!*\
  !*** ./js/components/DashboardNavigation/Navigation/index.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Navigation)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var _material_react_chips__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material/react-chips */ "../node_modules/@material/react-chips/dist/index.js");
/* harmony import */ var _material_react_chips__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_material_react_chips__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-throttle/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.js");
/* harmony import */ var _hooks_useNavChipHelpers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./hooks/useNavChipHelpers */ "./js/components/DashboardNavigation/Navigation/hooks/useNavChipHelpers.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _hooks_useVisibleSections__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./hooks/useVisibleSections */ "./js/components/DashboardNavigation/Navigation/hooks/useVisibleSections.js");
/* harmony import */ var _svg_icons_nav_content_icon_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/svg/icons/nav-content-icon.svg */ "./svg/icons/nav-content-icon.svg");
/* harmony import */ var _svg_icons_nav_key_metrics_icon_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/svg/icons/nav-key-metrics-icon.svg */ "./svg/icons/nav-key-metrics-icon.svg");
/* harmony import */ var _svg_icons_nav_monetization_icon_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/svg/icons/nav-monetization-icon.svg */ "./svg/icons/nav-monetization-icon.svg");
/* harmony import */ var _svg_icons_nav_speed_icon_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/svg/icons/nav-speed-icon.svg */ "./svg/icons/nav-speed-icon.svg");
/* harmony import */ var _svg_icons_nav_traffic_icon_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/svg/icons/nav-traffic-icon.svg */ "./svg/icons/nav-traffic-icon.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Navigation component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */














function Navigation() {
  const dashboardType = (0,_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const elementRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const visibleSections = (0,_hooks_useVisibleSections__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const {
    calculateScrollPosition,
    defaultChipID,
    findClosestSection,
    isValidChipID,
    scrollToChip,
    updateURLHash
  } = (0,_hooks_useNavChipHelpers__WEBPACK_IMPORTED_MODULE_8__["default"])({
    visibleSections
  });
  const initialHash = __webpack_require__.g.location.hash?.substring(1);
  const [isJumpingTo, setIsJumpingTo] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useState)(initialHash || undefined);
  const [isSticky, setIsSticky] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useState)(false);
  const [selectedID, setSelectedID] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useState)(initialHash);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI);

  /**
   * Handles the selection of a chip.
   *
   * @since 1.159.0
   *
   * @param {Object} event The click event.
   * @return {void}
   */
  const handleSelect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useCallback)(({
    target
  }) => {
    const chip = target.closest('.mdc-chip');
    const chipID =
    // Uses non-acronym case to meet DOM data attribute standards.
    // eslint-disable-next-line sitekit/acronym-case
    chip?.dataset?.contextId;

    // Update URL and scroll to the selected chip.
    updateURLHash(chipID);
    setIsJumpingTo(chipID);
    scrollToChip(chipID);

    // Track user event.
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_navigation`, 'tab_select', chipID);
    setTimeout(() => {
      setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.ACTIVE_CONTEXT_ID, chipID);
    }, 50);
  }, [scrollToChip, setValue, updateURLHash, viewContext]);

  /**
   * Determines the sticky state of navigation based on scroll position.
   *
   * @since 1.159.0
   *
   * @return {void}
   */
  const handleSticky = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useCallback)(() => {
    if (!elementRef?.current) {
      return;
    }
    const {
      top
    } = elementRef?.current?.getBoundingClientRect();
    if (__webpack_require__.g.scrollY === 0) {
      setIsSticky(false);
    } else {
      const headerBottom = document.querySelector('.googlesitekit-header')?.getBoundingClientRect?.()?.bottom;
      setIsSticky(top === headerBottom);
    }
  }, []);

  /**
   * Determines the selected state of a chip based on scroll position.
   *
   * @since 1.159.0
   *
   * @param {Event} event The scroll event.
   * @return {void}
   */
  const handleSelectedChip = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useCallback)(event => {
    function changeSelectedChip(chipID) {
      setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.ACTIVE_CONTEXT_ID, undefined);
      setSelectedID(chipID);
      setIsJumpingTo(undefined);
    }
    const closestID = findClosestSection(elementRef);

    // Check if user clicked on a chip and is actively jumping to it.
    if (isJumpingTo) {
      if (isJumpingTo === closestID) {
        changeSelectedChip(closestID);
      }
    } else {
      const {
        hash
      } = __webpack_require__.g.location;
      if (closestID !== hash?.substring(1)) {
        if (event) {
          (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_navigation`, 'tab_scroll', closestID);
        }
        updateURLHash(closestID);
        changeSelectedChip(closestID);
      }
    }
  }, [findClosestSection, isJumpingTo, setValue, updateURLHash, viewContext]);

  // Set up initial chip on mount.
  (0,react_use__WEBPACK_IMPORTED_MODULE_18__["default"])(() => {
    // If no initial hash is set, set the default chip as selected.
    if (!initialHash) {
      setSelectedID(defaultChipID);
      setTimeout(() => updateURLHash(defaultChipID));
      return;
    }
    const chipID = isValidChipID(initialHash) ? initialHash : defaultChipID;

    // Set initial/default chip ID in state.
    setSelectedID(chipID);
    setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.ACTIVE_CONTEXT_ID, chipID);

    // Scroll to the chip position.
    setTimeout(() => {
      const scrollTo = calculateScrollPosition(chipID);
      if (__webpack_require__.g.scrollY === scrollTo) {
        setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.ACTIVE_CONTEXT_ID, undefined);
        return;
      }
      scrollToChip(chipID);
    }, 50);
  });
  const onScroll = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useCallback)(event => {
    handleSticky();
    handleSelectedChip(event);
  }, [handleSelectedChip, handleSticky]);
  const throttledOnScroll = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_19__["default"])(onScroll, 150);

  // Handle scroll events to update sticky state and selected chip.
  (0,react_use__WEBPACK_IMPORTED_MODULE_20__["default"])('scroll', throttledOnScroll);
  const chips = {
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__.ANCHOR_ID_KEY_METRICS]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Key metrics', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_svg_icons_nav_key_metrics_icon_svg__WEBPACK_IMPORTED_MODULE_12__["default"], {
        width: "18",
        height: "16"
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__.ANCHOR_ID_TRAFFIC]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Traffic', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_svg_icons_nav_traffic_icon_svg__WEBPACK_IMPORTED_MODULE_15__["default"], {
        width: "18",
        height: "16"
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__.ANCHOR_ID_CONTENT]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Content', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_svg_icons_nav_content_icon_svg__WEBPACK_IMPORTED_MODULE_11__["default"], {
        width: "18",
        height: "18"
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__.ANCHOR_ID_SPEED]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Speed', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_svg_icons_nav_speed_icon_svg__WEBPACK_IMPORTED_MODULE_14__["default"], {
        width: "20",
        height: "16"
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__.ANCHOR_ID_MONETIZATION]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Monetization', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_svg_icons_nav_monetization_icon_svg__WEBPACK_IMPORTED_MODULE_13__["default"], {
        width: "18",
        height: "16"
      })
    }
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("nav", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-chip-set', 'googlesitekit-navigation', `googlesitekit-navigation--${dashboardType}`, {
      'googlesitekit-navigation--is-sticky': isSticky
    }),
    ref: elementRef,
    children: visibleSections.map(anchorID => {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_material_react_chips__WEBPACK_IMPORTED_MODULE_1__.Chip, {
        id: anchorID,
        label: chips[anchorID].label,
        leadingIcon: chips[anchorID].icon,
        onClick: handleSelect,
        selected: selectedID === anchorID,
        "data-context-id": anchorID
      }, anchorID);
    })
  });
}

/***/ }),

/***/ "./js/components/DashboardNavigation/index.js":
/*!****************************************************!*\
  !*** ./js/components/DashboardNavigation/index.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DashboardNavigation)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_components_LoadingWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/LoadingWrapper */ "./js/components/LoadingWrapper.js");
/* harmony import */ var _Navigation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Navigation */ "./js/components/DashboardNavigation/Navigation/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * DashboardNavigation component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */






function DashboardNavigation() {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_2__["default"])();
  const viewableModules = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (!viewOnlyDashboard) {
      return null;
    }
    return select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getViewableModules();
  });
  const keyMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getKeyMetrics());

  // The Navigation component relies on the resolution of the above selectors to check if individual
  // widgetContexts are active. The results of these checks are used to determine the `defaultChipID`
  // which 'highlights' the first chip and sets the corresponding hash on page load.
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_LoadingWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
    loading: viewableModules === undefined || keyMetrics === undefined,
    width: "100%",
    smallHeight: "59px",
    height: "71px",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Navigation__WEBPACK_IMPORTED_MODULE_4__["default"], {})
  });
}

/***/ }),

/***/ "./js/components/DataBlock/Change.js":
/*!*******************************************!*\
  !*** ./js/components/DataBlock/Change.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ChangeArrow */ "./js/components/ChangeArrow.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Change component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function Change({
  change,
  changeDataUnit,
  period,
  invertChangeColor
}) {
  let changeFormatted = change;

  // If changeDataUnit is given, try using it as currency first, otherwise add it as suffix.
  if (changeDataUnit) {
    if (changeDataUnit === '%') {
      // Format percentage change with only 1 digit instead of the usual 2.
      changeFormatted = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.numFmt)(change, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      });
    } else {
      changeFormatted = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.numFmt)(change, changeDataUnit);
    }
  }

  // If period is given (requires %s placeholder), add it.
  if (period) {
    changeFormatted = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(period, changeFormatted);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-data-block__change', {
      'googlesitekit-data-block__change--no-change': !change
    }),
    children: [!!change && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      className: "googlesitekit-data-block__arrow",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_3__["default"], {
        direction: 0 < parseFloat(change) ? 'up' : 'down',
        invertColor: invertChangeColor
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      className: "googlesitekit-data-block__value",
      children: changeFormatted
    })]
  });
}
Change.propTypes = {
  change: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number)]),
  changeDataUnit: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool)]),
  period: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Change);

/***/ }),

/***/ "./js/components/DataBlock/Content.js":
/*!********************************************!*\
  !*** ./js/components/DataBlock/Content.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Content)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _Sparkline__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Sparkline */ "./js/components/DataBlock/Sparkline.js");
/* harmony import */ var _js_components_Badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Badge */ "./js/components/Badge.js");
/* harmony import */ var _Change__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Change */ "./js/components/DataBlock/Change.js");
/* harmony import */ var _js_components_SourceLink__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Content component for DataBlock.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







function Content({
  title = '',
  datapoint = null,
  datapointUnit = '',
  change = null,
  changeDataUnit = '',
  period = '',
  source,
  sparkline,
  invertChangeColor = false,
  gatheringData = false,
  badge
}) {
  const datapointFormatted = datapoint === undefined ? datapoint : (0,_js_util__WEBPACK_IMPORTED_MODULE_0__.numFmt)(datapoint, datapointUnit);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      className: "googlesitekit-data-block__title-datapoint-wrapper",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_5__["default"], {
        as: "h3",
        size: "small",
        type: "title",
        className: " googlesitekit-subheading-1 googlesitekit-data-block__title ",
        children: [badge === true ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Badge__WEBPACK_IMPORTED_MODULE_2__["default"], {
          "aria-hidden": "true",
          className: "googlesitekit-badge--hidden",
          label: "X" // This is a minimal placeholder value to provide the correct height without too much width.
        }) : badge, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
          className: "googlesitekit-data-block__title-inner",
          children: title
        })]
      }), !gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
        className: "googlesitekit-data-block__datapoint",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
          className: "googlesitekit-data-block__datapoint--resize",
          children: datapointFormatted
        })
      })]
    }), !gatheringData && sparkline && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Sparkline__WEBPACK_IMPORTED_MODULE_1__["default"], {
      sparkline: sparkline,
      invertChangeColor: invertChangeColor
    }), !gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      className: "googlesitekit-data-block__change-source-wrapper",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Change__WEBPACK_IMPORTED_MODULE_3__["default"], {
        change: change,
        changeDataUnit: changeDataUnit,
        period: period,
        invertChangeColor: invertChangeColor
      }), source && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_4__["default"], {
        className: "googlesitekit-data-block__source",
        name: source.name,
        href: source.link,
        external: source?.external
      })]
    })]
  });
}
Content.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  datapoint: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_8___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_8___default().number)]),
  datapointUnit: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  change: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_8___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_8___default().number)]),
  changeDataUnit: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_8___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool)]),
  period: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  source: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().object),
  sparkline: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().element),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool),
  badge: prop_types__WEBPACK_IMPORTED_MODULE_8___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_8___default().node)])
};

/***/ }),

/***/ "./js/components/DataBlock/Sparkline.js":
/*!**********************************************!*\
  !*** ./js/components/DataBlock/Sparkline.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Sparkline component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


function Sparkline({
  sparkline,
  invertChangeColor
}) {
  // The `sparkline` prop is passed as a component, but if `invertChangeColor`
  // is set, we should pass that to `<Sparkline>`. In that case, we clone
  // the element and add the prop.
  let sparklineComponent = sparkline;
  if (sparklineComponent && invertChangeColor) {
    sparklineComponent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.cloneElement)(sparkline, {
      invertChangeColor
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("div", {
    className: "googlesitekit-data-block__sparkline",
    children: sparklineComponent
  });
}
Sparkline.propTypes = {
  sparkline: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Sparkline);

/***/ }),

/***/ "./js/components/DataBlock/index.js":
/*!******************************************!*\
  !*** ./js/components/DataBlock/index.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/GatheringDataNotice */ "./js/components/GatheringDataNotice.js");
/* harmony import */ var _Content__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Content */ "./js/components/DataBlock/Content.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * DataBlock component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function DataBlock({
  stat = null,
  className = '',
  title = '',
  datapoint = null,
  datapointUnit = '',
  change = null,
  changeDataUnit = '',
  context = 'default',
  period = '',
  selected = false,
  source,
  sparkline,
  handleStatSelection = null,
  invertChangeColor = false,
  gatheringData = false,
  gatheringDataNoticeStyle = _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_1__.NOTICE_STYLE.DEFAULT,
  badge
}) {
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(() => {
    if (!gatheringData && handleStatSelection) {
      handleStatSelection(stat);
    }
  }, [gatheringData, handleStatSelection, stat]);
  const handleKeyDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(event => {
    if ('Enter' === event.key || ' ' === event.key) {
      event.preventDefault();
      handleClick();
    }
  }, [handleClick]);
  const isButtonContext = 'button' === context;
  const role = isButtonContext ? 'button' : '';
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-data-block', className, `googlesitekit-data-block--${context}`, {
      'googlesitekit-data-block--selected': selected,
      'googlesitekit-data-block--is-gathering-data': gatheringData
    }),
    tabIndex: isButtonContext && !gatheringData ? '0' : '-1',
    role: handleStatSelection && role,
    onClick: handleClick,
    onKeyDown: handleKeyDown,
    "aria-disabled": gatheringData || undefined,
    "aria-label": handleStatSelection && title,
    "aria-pressed": handleStatSelection && selected,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_Content__WEBPACK_IMPORTED_MODULE_2__["default"], {
      title: title,
      datapoint: datapoint,
      datapointUnit: datapointUnit,
      change: change,
      changeDataUnit: changeDataUnit,
      period: period,
      source: source,
      sparkline: sparkline,
      invertChangeColor: invertChangeColor,
      gatheringData: gatheringData,
      badge: badge
    }), gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_1__["default"], {
      style: gatheringDataNoticeStyle
    })]
  });
}
DataBlock.propTypes = {
  stat: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  datapoint: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number)]),
  datapointUnit: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  change: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number)]),
  changeDataUnit: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool)]),
  context: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  period: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  selected: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  source: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  sparkline: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().element),
  handleStatSelection: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().func),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  gatheringDataNoticeStyle: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOf(Object.values(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_1__.NOTICE_STYLE)),
  badge: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node)])
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DataBlock);

/***/ }),

/***/ "./js/components/DataBlockGroup.js":
/*!*****************************************!*\
  !*** ./js/components/DataBlockGroup.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DataBlockGroup)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * DataBlockGroup component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



function DataBlockGroup({
  className,
  children
}) {
  const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)();
  function adjustFontSize() {
    const blocks = ref?.current?.querySelectorAll('.googlesitekit-data-block');
    if (!blocks?.length) {
      return;
    }

    // Find the smallest font size needed across all blocks to fit without overflow.
    let smallestScaleFactor = 1;

    // Reset font sizes first to get accurate measurement, specifically on resize.
    setFontSizes(blocks, '');
    blocks.forEach(block => {
      const dataPoint = block.querySelector('.googlesitekit-data-block__datapoint');
      if (!dataPoint) {
        return;
      }
      const parentWidth = dataPoint?.parentElement?.offsetWidth;
      if (dataPoint.scrollWidth > parentWidth) {
        // Calculate the exact scale factor needed to resize the content to the parent.
        const scaleFactor = parentWidth / dataPoint.scrollWidth;

        // Round the scale factor down to one decimal place. This creates a
        // small visual buffer to prevent the text from appearing cramped.
        // It also improves stability by preventing minor pixel fluctuations
        // during resize from causing distracting font size changes.
        const roundedScaleFactor = Math.floor(scaleFactor * 10) / 10;
        if (roundedScaleFactor < smallestScaleFactor) {
          smallestScaleFactor = roundedScaleFactor;
        }
      }
    });

    // Apply the smallest font size to all blocks if adjustment is needed.
    if (smallestScaleFactor < 1 && smallestScaleFactor > 0) {
      const fontSize = parseInt(__webpack_require__.g?.getComputedStyle(blocks[0].querySelector('.googlesitekit-data-block__datapoint'))?.fontSize, 10);
      const newSize = Math.floor(fontSize * smallestScaleFactor);
      const clampedNewSize = Math.max(newSize, 14); // Don't allow the font size to go below 14px.
      setFontSizes(blocks, `${clampedNewSize}px`);
    }
  }
  function setFontSizes(blocks, adjustedSize) {
    blocks.forEach(block => {
      const dataPoint = block?.querySelector('.googlesitekit-data-block__datapoint');
      if (!dataPoint) {
        return;
      }
      dataPoint.style.fontSize = adjustedSize;
    });
  }

  // Debounce the adjustFontSize function to prevent excessive calls on resize.
  const debouncedAdjustFontSize = (0,_js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_0__.useDebounce)(adjustFontSize, 50);
  (0,react_use__WEBPACK_IMPORTED_MODULE_3__["default"])('resize', debouncedAdjustFontSize);
  (0,react_use__WEBPACK_IMPORTED_MODULE_4__["default"])(() => {
    debouncedAdjustFontSize();
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    ref: ref,
    className: className,
    children: children
  });
}

/***/ }),

/***/ "./js/components/DisplaySetting.js":
/*!*****************************************!*\
  !*** ./js/components/DisplaySetting.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BLANK_SPACE: () => (/* binding */ BLANK_SPACE),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_0__);
/**
 * DisplaySetting component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


const BLANK_SPACE = '\u00A0';
function DisplaySetting({
  value
}) {
  return value || BLANK_SPACE;
}
DisplaySetting.propTypes = {
  value: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)])
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DisplaySetting);

/***/ }),

/***/ "./js/components/EntityHeader.js":
/*!***************************************!*\
  !*** ./js/components/EntityHeader.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-throttle/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _svg_icons_keyboard_backspace_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/keyboard-backspace.svg */ "./svg/icons/keyboard-backspace.svg");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var _Typography_P__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_util_urls__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/urls */ "./js/util/urls.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EntityHeader component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */




/**
 * External dependencies
 */


/**
 * Internal dependencies
 */












function EntityHeader() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const dashboardType = (0,_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const currentEntityTitle = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getCurrentEntityTitle());
  const entityURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getCurrentEntityURL());
  const headerDetailsRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useRef)();
  const [url, setURL] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useState)(entityURL);
  const shortenEntityURL = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useCallback)(() => {
    if (!headerDetailsRef.current) {
      return;
    }

    // Remove 40 px for margins + SVG at the end of the URL link.
    const availableWidth = headerDetailsRef.current.clientWidth - 40;
    const urlFontSize = __webpack_require__.g.getComputedStyle(headerDetailsRef.current.lastChild, null).getPropertyValue('font-size');
    const fontSize = parseFloat(urlFontSize);

    // 2 is appox. the minimum character constant for sans-serif fonts:
    // https://pearsonified.com/characters-per-line/
    const maxChars = availableWidth * 2 / fontSize;
    setURL((0,_js_util_urls__WEBPACK_IMPORTED_MODULE_8__.shortenURL)(entityURL, maxChars));
  }, [entityURL]);
  const throttledShortenEntityURL = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_14__["default"])(shortenEntityURL, 150);
  (0,react_use__WEBPACK_IMPORTED_MODULE_15__["default"])('resize', throttledShortenEntityURL);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_LOCATION);
  const returnURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getAdminURL('googlesitekit-dashboard'));
  const onClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}_navigation`, 'return_to_dashboard');
    navigateTo(returnURL);
  }, [returnURL, navigateTo, viewContext]);
  if (_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_10__.DASHBOARD_TYPE_ENTITY !== dashboardType || entityURL === null || currentEntityTitle === null) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
    className: "googlesitekit-entity-header",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
      className: "googlesitekit-entity-header__back",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_svg_icons_keyboard_backspace_svg__WEBPACK_IMPORTED_MODULE_4__["default"], {
          width: 24,
          height: 24
        })
        // This is duplicated because on small screens, the text supplied to the
        // Button is rendered as a sub-component and is set to `display: none`,
        // but the button itself remains on-screen (and thus this aria-label is
        // accessible to screen-readers).
        ,
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back to dashboard', 'google-site-kit'),
        onClick: onClick,
        text: true,
        tertiary: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back to dashboard', 'google-site-kit')
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      ref: headerDetailsRef,
      className: "googlesitekit-entity-header__details",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Typography_P__WEBPACK_IMPORTED_MODULE_7__["default"], {
        children: currentEntityTitle
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
        href: entityURL,
        "aria-label": entityURL,
        secondary: true,
        external: true,
        children: url
      })]
    })]
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EntityHeader);

/***/ }),

/***/ "./js/components/ErrorNotice.js":
/*!**************************************!*\
  !*** ./js/components/ErrorNotice.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ErrorNotice)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/is-url.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _Notice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Notice */ "./js/components/Notice/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ErrorNotice component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */





function ErrorNotice({
  className,
  error,
  hasButton = false,
  storeName,
  message = error.message,
  noPrefix = false,
  skipRetryMessage,
  hideIcon = false
}) {
  const dispatch = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
  const selectorData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (!storeName) {
      return null;
    }
    return select(storeName).getSelectorDataForError(error);
  });
  const handleRetry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useCallback)(() => {
    dispatch(selectorData.storeName).invalidateResolution(selectorData.name, selectorData.args);
  }, [dispatch, selectorData]);

  // Do not display if there is no error and no direct message text is passed as a direct prop.
  // Also do not display if the error is for missing scopes as these are handled by a popup modal.
  if (!message || (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_2__.isPermissionScopeError)(error)) {
    return null;
  }
  const shouldDisplayRetry = hasButton && (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_2__.isErrorRetryable)(error, selectorData);

  /**
   * Error message to display to the user. Sometimes we append a retry message
   * or a reconnect URL, so we create a new variable for the message to display.
   */
  let errorMessageWithModifications = message;

  // Append "Try again" messaging if no retry button is present.
  if (!hasButton && !skipRetryMessage) {
    errorMessageWithModifications = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: Error message from Google API. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('%s (Please try again.)', 'google-site-kit'), errorMessageWithModifications);
  }
  if (!noPrefix) {
    errorMessageWithModifications = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: $%s: Error message */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Error: %s', 'google-site-kit'), errorMessageWithModifications);
  }
  const reconnectURL = error?.data?.reconnectURL;
  if (reconnectURL && (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_7__.isURL)(reconnectURL)) {
    /**
     * This error message uses HTML tags without using
     * `createInterpolateElement` because the error messages
     * that come from the server/API can also contain HTML (eg. links)
     * we want to render.
     *
     * Instead of creating a React node using `createInterpolateElement`,
     * we use `dangerouslySetInnerHTML` to allow the HTML we create and from
     * the server/API to be rendered as-intended.
     */
    errorMessageWithModifications = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: 1: Original error message 2: Reconnect URL */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('%1$s To fix this, <a href="%2$s">redo the plugin setup</a>.', 'google-site-kit'), errorMessageWithModifications, reconnectURL);
  }
  const sanitizeArgs = {
    ALLOWED_TAGS: ['a'],
    ALLOWED_ATTR: ['href']
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Notice__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: className,
    type: _Notice__WEBPACK_IMPORTED_MODULE_3__["default"].TYPES.ERROR,
    description:
    /*#__PURE__*/
    // The error messages that come from the server/API can contain
    // HTML (eg. links), so we use `dangerouslySetInnerHTML` and sanitize
    // the HTML to render these links.
    //
    // We tried to use `createInterpolateElement` but it does not work
    // with HTML tags that come from the server/API.
    (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
      dangerouslySetInnerHTML: (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.sanitizeHTML)(errorMessageWithModifications, sanitizeArgs)
    }),
    ctaButton: shouldDisplayRetry ? {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Retry', 'google-site-kit'),
      onClick: handleRetry
    } : undefined,
    hideIcon: hideIcon
  });
}
ErrorNotice.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  error: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
    message: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string)
  }),
  hasButton: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool),
  storeName: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  message: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  noPrefix: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool),
  skipRetryMessage: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool),
  hideIcon: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool)
};

/***/ }),

/***/ "./js/components/FeaturesProvider/FeaturesContext.js":
/*!***********************************************************!*\
  !*** ./js/components/FeaturesProvider/FeaturesContext.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/features */ "./js/features/index.js");
/**
 * Feature Flags context for React components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */

const FeaturesContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.createContext)(_js_features__WEBPACK_IMPORTED_MODULE_0__.enabledFeatures);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (FeaturesContext);

/***/ }),

/***/ "./js/components/GatheringDataNotice.js":
/*!**********************************************!*\
  !*** ./js/components/GatheringDataNotice.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   NOTICE_STYLE: () => (/* binding */ NOTICE_STYLE),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GatheringDataNotice component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


const NOTICE_STYLE = {
  DEFAULT: 'default',
  OVERLAY: 'overlay',
  SMALL: 'small',
  SMALL_OVERLAY: 'small-overlay',
  LARGE: 'large'
};
function GatheringDataNotice({
  style
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-gathering-data-notice', {
      [`googlesitekit-gathering-data-notice--has-style-${style}`]: !!style
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Gathering data…', 'google-site-kit')
    })
  });
}
GatheringDataNotice.propTypes = {
  style: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(Object.values(NOTICE_STYLE))
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GatheringDataNotice);

/***/ }),

/***/ "./js/components/GenericErrorHandlerActions.js":
/*!*****************************************************!*\
  !*** ./js/components/GenericErrorHandlerActions.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ GenericErrorHandlerActions)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var _ReportErrorButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ReportErrorButton */ "./js/components/ReportErrorButton/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GenericErrorHandlerActions component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function GenericErrorHandlerActions({
  message,
  componentStack
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: "googlesitekit-generic-error-handler-actions",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_ReportErrorButton__WEBPACK_IMPORTED_MODULE_2__["default"], {
      message: message,
      componentStack: componentStack
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_1__["default"], {
      href: "https://wordpress.org/support/plugin/google-site-kit/",
      external: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Report this problem', 'google-site-kit')
    })]
  });
}
GenericErrorHandlerActions.propTypes = {
  message: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  componentStack: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string)
};

/***/ }),

/***/ "./js/components/GoogleChart/DateMarker.js":
/*!*************************************************!*\
  !*** ./js/components/GoogleChart/DateMarker.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DateMarker)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/icon/index.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/library/info.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GoogleChart DateMarker component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





function DateMarker({
  id,
  text
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__["default"])();
  const eventCategory = `${viewContext}_ga4-data-collection-line`;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(eventCategory, 'chart_line_view');
  }, [eventCategory]);
  const trackTooltipOpen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(eventCategory, 'chart_tooltip_view');
  }, [eventCategory]);
  const handleTooltipOpen = (0,_js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_2__.useDebounce)(trackTooltipOpen, 5000, {
    leading: true,
    trailing: false
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      id: `googlesitekit-chart__date-marker-line--${id}`,
      className: "googlesitekit-chart__date-marker-line"
    }), text && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      id: `googlesitekit-chart__date-marker-tooltip--${id}`,
      className: "googlesitekit-chart__date-marker-tooltip",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.Tooltip, {
        title: text,
        onOpen: handleTooltipOpen,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"], {
            fill: "currentColor",
            icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"],
            size: 18
          })
        })
      })
    })]
  });
}

/***/ }),

/***/ "./js/components/GoogleChart/index.js":
/*!********************************************!*\
  !*** ./js/components/GoogleChart/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ GoogleChart)
/* harmony export */ });
/* harmony import */ var _js_util_initialize_google_global__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/util/initialize-google-global */ "./js/util/initialize-google-global.js");
/* harmony import */ var _js_util_initialize_google_global__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_js_util_initialize_google_global__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_20__);
/* harmony import */ var react_google_charts__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-google-charts */ "../node_modules/react-google-charts/dist/index.esm.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/GatheringDataNotice */ "./js/components/GatheringDataNotice.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _js_components_GoogleChartErrorHandler__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/GoogleChartErrorHandler */ "./js/components/GoogleChartErrorHandler/index.js");
/* harmony import */ var _DateMarker__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./DateMarker */ "./js/components/GoogleChart/DateMarker.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util_is_site_kit_screen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util/is-site-kit-screen */ "./js/util/is-site-kit-screen.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils */ "./js/components/GoogleChart/utils.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GoogleChart component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/* eslint-disable react-hooks/exhaustive-deps */

/* Ensures `google` global is undefined before loading `react-google-charts` library */


/**
 * External dependencies
 */






/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */













function GoogleChart(props) {
  const {
    chartEvents,
    chartType,
    children,
    className,
    data,
    dateMarkers,
    getChartWrapper,
    height,
    loaded,
    loadingHeight,
    loadingWidth,
    onMouseOver,
    onMouseOut,
    onReady,
    onSelect,
    selectedStats,
    width,
    options,
    gatheringData,
    ...otherProps
  } = props;

  /**
   * Size of the icons (in pixels) used in the tooltip.
   */
  const iconSize = 18;
  const instanceID = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_17__["default"])(GoogleChart);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_15__.useBreakpoint)();
  const {
    startDate,
    endDate
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    offsetDays: 0
  }));
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const googleChartsCollisionError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_UI).getValue('googleChartsCollisionError'));
  const [isChartLoaded, setIsChartLoaded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useState)(false);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_UI);
  const filteredData = (0,_utils__WEBPACK_IMPORTED_MODULE_13__.getFilteredChartData)(data, selectedStats);
  const loadingShape = chartType === 'PieChart' ? 'circular' : 'square';
  const loadingDimensions = (0,_utils__WEBPACK_IMPORTED_MODULE_13__.getLoadingDimensions)(loadingHeight, height, loadingWidth, width);
  const loader = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", {
    className: "googlesitekit-chart-loading",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_4__["default"], {
      className: "googlesitekit-chart-loading__wrapper",
      shape: loadingShape,
      ...loadingDimensions
    })
  });
  const chartWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useRef)();
  const googleRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useRef)();

  // Don't load Google Charts if another script on the page has already loaded
  // Google Charts.
  //
  // If another plugin loads Google Charts somewhere on the page, our charts
  // will likely encounter an error due to a version mismatch.
  //
  // This is because Google Charts is a singleton, and if another plugin loads
  // it first, our charts will use the same instance of Google Charts.
  //
  // See:
  // * https://github.com/google/site-kit-wp/issues/6350
  // * https://github.com/google/site-kit-wp/issues/6355
  (0,react_use__WEBPACK_IMPORTED_MODULE_19__["default"])(() => {
    if (googleChartsCollisionError !== undefined) {
      return;
    }

    // If we're on a Site Kit screen, we want "priority" over the
    // `google.charts` global so we don't render a bunch of charts errors,
    // see: https://github.com/google/site-kit-wp/issues/6439#issuecomment-1404491940
    //
    // The only way to do this is to remove the `google.charts` global
    // and allow the `react-google-charts` library to re-initialize it.
    if ((0,_js_util_is_site_kit_screen__WEBPACK_IMPORTED_MODULE_12__.isSiteKitScreen)(viewContext) && __webpack_require__.g?.google?.charts) {
      __webpack_require__.g.google.charts = undefined;
    }
    if (!(0,_js_util_is_site_kit_screen__WEBPACK_IMPORTED_MODULE_12__.isSiteKitScreen)(viewContext) && __webpack_require__.g?.google?.charts) {
      setValue('googleChartsCollisionError', true);
    } else {
      setValue('googleChartsCollisionError', false);
    }
  });
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useEffect)(() => {
    // Remove all event listeners after the component has unmounted.
    return () => {
      // eslint-disable-next-line no-unused-expressions
      if (googleRef.current && chartWrapperRef.current) {
        const {
          events
        } = googleRef.current.visualization;
        events.removeAllListeners(chartWrapperRef.current.getChart());
        events.removeAllListeners(chartWrapperRef.current);
      }
    };
  }, []);

  // These event listeners are added manually to the current chart because
  // `react-google-charts` doesn't support `mouseOver` or `mouseOut` events
  // in its `chartEvents` prop.
  // See: https://github.com/google/site-kit-wp/pull/2805#discussion_r579172660
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useLayoutEffect)(() => {
    if (onMouseOver) {
      // eslint-disable-next-line no-unused-expressions
      googleRef.current?.visualization.events.addListener(chartWrapperRef.current.getChart(), 'onmouseover', event => {
        onMouseOver(event, {
          chartWrapper: chartWrapperRef.current,
          google: googleRef.current
        });
      });
    }
    if (onMouseOut) {
      // eslint-disable-next-line no-unused-expressions
      googleRef.current?.visualization.events.addListener(chartWrapperRef.current.getChart(), 'onmouseout', event => {
        onMouseOut(event, {
          chartWrapper: chartWrapperRef.current,
          google: googleRef.current
        });
      });
    }
  }, [onMouseOver, onMouseOut]);

  // Checks to see if the date is within the date range.
  function isDateWithinRange(date) {
    // If any of the dates are not set, return false.
    if (!date || !startDate || !endDate) {
      return false;
    }
    if (
    // Don't render this marker if the date is before the first date
    // in the current date range.
    date.getTime() < (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.stringToDate)(startDate).getTime() ||
    // Don't render this marker if the date is after the last date
    // in the current date range.
    date.getTime() > (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.stringToDate)(endDate).getTime()) {
      return false;
    }
    return true;
  }

  // Only use markers if the date is within the current date range.
  const dateMarkersInRange = dateMarkers.filter(dateMarker => {
    // Valid use of `new Date()` with an argument.
    // eslint-disable-next-line sitekit/no-direct-date
    return isDateWithinRange(new Date(dateMarker.date));
  });

  /**
   * Adds any "key date" vertical lines/tooltips to the charts.
   */
  function addKeyDateLinesToChart() {
    if (!chartWrapperRef.current) {
      return;
    }
    if (!dateMarkersInRange.length) {
      return;
    }
    const chart = chartWrapperRef.current.getChart();
    const chartLayoutInterface = chart?.getChartLayoutInterface();
    const chartArea = chartLayoutInterface?.getChartAreaBoundingBox();
    const dataTable = chartWrapperRef.current.getDataTable();
    if (!chartLayoutInterface || !chartArea || !dataTable) {
      return;
    }

    // Add the dotted line and tooltip for each date marker.
    dateMarkersInRange.forEach((dateMarker, index) => {
      // Valid use of `new Date()` with an argument.
      // eslint-disable-next-line sitekit/no-direct-date
      const dateFromMarker = new Date(dateMarker.date);
      const chartLine = document.getElementById(`googlesitekit-chart__date-marker-line--${instanceID}-${index}`);
      invariant__WEBPACK_IMPORTED_MODULE_2___default()(chartLine, `#googlesitekit-chart__date-marker-line--${instanceID}-${index} is missing from the DOM, but required to render date markers.`);

      // We need to make sure the dates we use on the chart and on
      // this line are exactly the same, so we get the position on the
      // chart that matches the date we create from the date string.
      //
      // This prevents the line and the chart data from being
      // slightly out-of-alignment, see:
      // https://github.com/google/site-kit-wp/pull/6822#pullrequestreview-1376066844.
      const dateCoordinateX = Math.floor(chartLayoutInterface.getXLocation((0,_js_util__WEBPACK_IMPORTED_MODULE_14__.stringToDate)((0,_js_util__WEBPACK_IMPORTED_MODULE_14__.getDateString)(dateFromMarker))));

      // Align the dotted line with the date for this marker.
      Object.assign(chartLine.style, {
        left: `${dateCoordinateX - 1}px`,
        top: `${Math.floor(chartArea.top)}px`,
        height: `${Math.floor(chartArea.height)}px`,
        opacity: 1
      });

      // Text is optional, so only modify the DOM elements for the tooltip
      // text if the property was provided.
      if (dateMarker.text) {
        const tooltip = document.getElementById(`googlesitekit-chart__date-marker-tooltip--${instanceID}-${index}`);
        invariant__WEBPACK_IMPORTED_MODULE_2___default()(tooltip, `#googlesitekit-chart__date-marker-tooltip--${instanceID}-${index} is missing from the DOM, but required to render date marker tooltips.`);

        // Align the tooltip component with the date line.
        Object.assign(tooltip.style, {
          left: `${dateCoordinateX - iconSize / 2}px`,
          top: `${Math.floor(chartArea.top) - iconSize}px`,
          opacity: 1
        });
      }
    });
    const legendElement = document.querySelector(`#googlesitekit-chart-${instanceID} svg:first-of-type > g:first-of-type > g > g > text`)?.parentElement.parentElement.parentElement;

    // A legend is present if there are more than three `g` elements; charts
    // without legends won't have that many `g` elements so we don't need to
    // modify anything.
    const hasLegend = !!legendElement && document.querySelectorAll(`#googlesitekit-chart-${instanceID} svg:first-of-type > g`).length >= 3;

    // If there is a legend, move it up to make room for the date marker icon.
    if (hasLegend) {
      // `10px` is the best size to use to accommodate the bounding box of the
      // chart without needing to modify the chart's height.
      //
      // It allows the legend and the icon to fit without moving anything else
      // and without things feeling cramped or being cut off.
      legendElement.style.transform = 'translateY(-10px)';
    }
  }
  if (googleChartsCollisionError) {
    return null;
  }
  if (!loaded) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-chart', 'googlesitekit-chart-loading__forced', className),
      children: loader
    });
  }
  const combinedChartEvents = (0,_utils__WEBPACK_IMPORTED_MODULE_13__.getCombinedChartEvents)([...(chartEvents || []),
  // Call the `addKeyDateLinesToChart` function after the chart
  // has been rendered.
  //
  // This is to ensure that the chart has finished rendering before
  // we try to add the lines. If we don't do this, the `chart`
  // variable (from `chartWrapper.getChart()`) will be `null`.
  {
    eventName: 'ready',
    callback: addKeyDateLinesToChart
  }], onReady, onSelect);
  const chartOptions = (0,_utils__WEBPACK_IMPORTED_MODULE_13__.getChartOptions)(options, {
    gatheringData,
    chartType,
    startDate,
    endDate,
    breakpoint
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_GoogleChartErrorHandler__WEBPACK_IMPORTED_MODULE_8__["default"], {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-chart', `googlesitekit-chart--${chartType}`, className),
      id: `googlesitekit-chart-${instanceID}`,
      tabIndex: -1,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(react_google_charts__WEBPACK_IMPORTED_MODULE_3__.Chart, {
        className: "googlesitekit-chart__inner",
        chartEvents: combinedChartEvents,
        chartLanguage: (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.getLocale)(),
        chartType: chartType,
        chartVersion: "49",
        data: filteredData,
        loader: loader,
        height: height,
        getChartWrapper: (chartWrapper, google) => {
          // An issue with `react-google-charts` v4 causes the chart to
          // render the overlay before the chart in some cases when using
          // their own `onLoad` callback. This is a workaround to prevent
          // that issue but still provide notice that the chart is loaded.
          // See: https://github.com/google/site-kit-wp/issues/4945
          if (!isChartLoaded) {
            setIsChartLoaded(true);
          }

          // Remove all the event listeners on the old chart before we draw
          // a new one. Only run this if the old chart and the new chart
          // aren't the same reference though, otherwise we'll remove
          // existing `onReady` events and other event listeners, which will
          // cause bugs.
          if (chartWrapper !== chartWrapperRef.current) {
            // eslint-disable-next-line no-unused-expressions
            googleRef.current?.visualization.events.removeAllListeners(chartWrapperRef.current?.getChart());
            // eslint-disable-next-line no-unused-expressions
            googleRef.current?.visualization.events.removeAllListeners(chartWrapperRef.current);
          }
          chartWrapperRef.current = chartWrapper;
          googleRef.current = google;
          if (getChartWrapper) {
            getChartWrapper(chartWrapper, google);
          }
        },
        width: width,
        options: chartOptions,
        ...otherProps
      }), gatheringData && isChartLoaded && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_6__["default"], {
        style: _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_6__.NOTICE_STYLE.OVERLAY
      }), !!dateMarkersInRange.length && dateMarkersInRange.map((dateMarker, index) => {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_DateMarker__WEBPACK_IMPORTED_MODULE_9__["default"], {
          id: `${instanceID}-${index}`,
          text: dateMarker.text
        }, `googlesitekit-chart__date-marker--${instanceID}-${index}`);
      }), children]
    })
  });
}
GoogleChart.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().node),
  chartEvents: prop_types__WEBPACK_IMPORTED_MODULE_20___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_20___default().shape({
    eventName: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string),
    callback: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().func)
  })),
  // Note: technically we support all types of charts that `react-google-charts`
  // supports, which is _all_ chart types from Google Charts. But we only list
  // the charts currently used in our codebase here, and only ones that we have
  // explicit support/styles/handling for.
  // See: https://github.com/google/site-kit-wp/pull/2916#discussion_r626620601
  chartType: prop_types__WEBPACK_IMPORTED_MODULE_20___default().oneOf(['LineChart', 'PieChart']).isRequired,
  data: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().array),
  dateMarkers: prop_types__WEBPACK_IMPORTED_MODULE_20___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_20___default().shape({
    /**
     * The date to mark on the chart, in the format `'YYYY-MM-DD'`.
     */
    date: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string).isRequired,
    /**
     * Text to display in a tooltip when the date marker is hovered.
     */
    text: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string)
  })),
  getChartWrapper: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().func),
  height: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string),
  loaded: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().bool),
  loadingHeight: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string),
  loadingWidth: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string),
  onMouseOut: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().func),
  onMouseOver: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().func),
  onReady: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().func),
  onSelect: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().func),
  selectedStats: prop_types__WEBPACK_IMPORTED_MODULE_20___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_20___default().number)),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().string),
  options: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().object),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().bool)
};
GoogleChart.defaultProps = {
  ...react_google_charts__WEBPACK_IMPORTED_MODULE_3__.Chart.defaultProps,
  dateMarkers: [],
  gatheringData: false,
  loaded: true
};

/***/ }),

/***/ "./js/components/GoogleChart/utils.js":
/*!********************************************!*\
  !*** ./js/components/GoogleChart/utils.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getChartOptions: () => (/* binding */ getChartOptions),
/* harmony export */   getCombinedChartEvents: () => (/* binding */ getCombinedChartEvents),
/* harmony export */   getCurrencyPattern: () => (/* binding */ getCurrencyPattern),
/* harmony export */   getFilteredChartData: () => (/* binding */ getFilteredChartData),
/* harmony export */   getLoadingDimensions: () => (/* binding */ getLoadingDimensions)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * Google Chart utilities.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Returns the Google chart data, filtered by selected stats if present.
 *
 * @since 1.93.0
 *
 * @param {Array|undefined} data          Chart data.
 * @param {Array|undefined} selectedStats The columns that should be displayed for the data set.
 * @return {Object} The chart data, filtered by selected stats if present.
 */
function getFilteredChartData(data, selectedStats) {
  if (!selectedStats?.length) {
    return data;
  }

  // Ensure we don't filter out columns that aren't data, but are things like
  // tooltips or other content.
  let nonDataColumns = [];
  if (data?.length) {
    nonDataColumns = data[0].reduce((acc, row, rowIndex) => {
      return row?.role ? [...acc, rowIndex] : acc;
    }, []);
  }
  return data.map(row => {
    return row.filter((_columnValue, columnIndex) => {
      return columnIndex === 0 || selectedStats.includes(columnIndex - 1) || nonDataColumns.includes(columnIndex - 1);
    });
  });
}

/**
 * Returns the optimal height and width for a preview element.
 *
 * @since 1.93.0
 *
 * @param {string|undefined} loadingHeight Preview height.
 * @param {string|undefined} height        Chart height.
 * @param {string|undefined} loadingWidth  Preview width.
 * @param {string|undefined} width         Chart width.
 * @return {Object} The optimal height and width to use in a preview element.
 */
function getLoadingDimensions(loadingHeight, height, loadingWidth, width) {
  const dimensions = {
    height: loadingHeight || height,
    width: loadingWidth || width
  };
  // If a loading height is set but a width is not (or a loading width is set
  // but not a height), change the "unset" value to 100% to avoid visual bugs.
  // See: https://github.com/google/site-kit-wp/pull/2916#discussion_r623866269
  if (dimensions.width && !dimensions.height) {
    dimensions.height = '100%';
  }
  if (dimensions.height && !dimensions.width) {
    dimensions.width = '100%';
  }
  return dimensions;
}

/**
 * Returns a combined chart events object.
 *
 * @since 1.93.0
 *
 * @param {Array.<Object>|undefined} chartEvents Event names and its callbacks.
 * @param {Function|undefined}       onReady     Chart event.
 * @param {Function|undefined}       onSelect    Chart event.
 * @return {Object} The object containig all events.
 */
function getCombinedChartEvents(chartEvents, onReady, onSelect) {
  const combinedChartEvents = [...(chartEvents || [])];
  if (onReady) {
    combinedChartEvents.push({
      eventName: 'ready',
      callback: onReady
    });
  }
  if (onSelect) {
    combinedChartEvents.push({
      eventName: 'select',
      callback: onSelect
    });
  }
  return combinedChartEvents;
}

/**
 * Returns a chart configuration object.
 *
 * @since 1.93.0
 * @since 1.119.0 Added `breakpoint` parameter.
 * @since 1.160.0 Refactored `gatheringData`, `chartType`, `startDate`, `endDate`, and `breakpoint` to be named parameters.
 *
 * @param {Object}  options                     Chart options to extend.
 * @param {Object}  configuration               Configuration for the extended chart options.
 * @param {boolean} configuration.gatheringData If chart is in gathering info state.
 * @param {string}  configuration.chartType     Chart types: PieChart, LineChart.
 * @param {string}  configuration.startDate     Start date for a user data range.
 * @param {string}  configuration.endDate       End date for a user data range.
 * @param {string}  configuration.breakpoint    Current breakpoint.
 * @return {Object} Chart options object.
 */
function getChartOptions(options, {
  gatheringData,
  chartType,
  startDate,
  endDate,
  breakpoint
}) {
  const chartOptions = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(options);
  if (gatheringData && chartType === 'LineChart') {
    if (!options?.vAxis?.viewWindow?.min) {
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'vAxis.viewWindow.min', 0);
    }
    if (!options?.vAxis?.viewWindow?.max) {
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'vAxis.viewWindow.max', 100);
    }
    if (!options?.hAxis?.viewWindow?.min) {
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'hAxis.viewWindow.min', (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.stringToDate)(startDate));
      delete chartOptions.hAxis.ticks;
    }
    if (!options?.hAxis?.viewWindow?.max) {
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'hAxis.viewWindow.max', (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.stringToDate)(endDate));
      delete chartOptions.hAxis.ticks;
    }
  }
  if (chartType === 'LineChart') {
    if (!options?.hAxis?.maxTextLines) {
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'hAxis.maxTextLines', 1);
    }
    if (!options?.hAxis?.minTextSpacing) {
      const minTextSpacing = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_SMALL ? 50 : 100;
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'hAxis.minTextSpacing', minTextSpacing);
    }
    // eslint-disable-next-line sitekit/acronym-case
    if (options?.tooltip?.isHtml === undefined) {
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'tooltip.isHtml', true);
      (0,lodash__WEBPACK_IMPORTED_MODULE_0__.set)(chartOptions, 'tooltip.trigger', 'both');
    }
  }
  (0,lodash__WEBPACK_IMPORTED_MODULE_0__.merge)(chartOptions, {
    hAxis: {
      textStyle: {
        fontSize: 10,
        color: '#5f6561'
      }
    },
    vAxis: {
      textStyle: {
        color: '#5f6561',
        fontSize: 10
      }
    },
    legend: {
      textStyle: {
        color: '#131418',
        fontSize: 12
      }
    }
  });
  return chartOptions;
}

/**
 * Returns the Google Charts currency pattern for a given currency code and locale.
 *
 * @since 1.118.0
 *
 * @param {string} currencyCode ISO 4217 currency code.
 * @param {string} locale       Locale to use for formatting.
 * @return {string} The currency pattern.
 */
function getCurrencyPattern(currencyCode, locale = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.getLocale)()) {
  const formatter = Intl.NumberFormat(locale, {
    style: 'currency',
    currency: currencyCode
  });
  const parts = formatter.formatToParts(1000000);
  return parts.reduce((pattern, part) => {
    const {
      value
    } = part;
    switch (part.type) {
      case 'group':
        // The group and decimal separators will be replaced with the
        // locale-specific versions by the chart.
        // See: https://groups.google.com/g/google-visualization-api/c/hBF9daxe8qY/m/_aPk3EfQLgAJ
        return pattern + ',';
      case 'decimal':
        return pattern + '.';
      case 'currency':
        return pattern + value;
      case 'literal':
        const sanitizedValue = /^\s*$/.test(value) ? value : '';
        return pattern + sanitizedValue;
      case 'integer':
        const integerPattern = value.replace(/\d/g, '#');
        const isLastIntegerGroup = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.findLast)(parts, ({
          type
        }) => 'integer' === type) === part;
        return pattern + (isLastIntegerGroup ? integerPattern.replace(/#$/, '0') : integerPattern);
      case 'fraction':
        return pattern + value.replace(/\d/g, '0');
      default:
        return pattern;
    }
  }, '');
}

/***/ }),

/***/ "./js/components/GoogleChartErrorHandler/index.js":
/*!********************************************************!*\
  !*** ./js/components/GoogleChartErrorHandler/index.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clipboard-copy */ "../node_modules/clipboard-copy/index.js");
/* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(clipboard_copy__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/notifications/CTA */ "./js/components/notifications/CTA.js");
/* harmony import */ var _js_components_GenericErrorHandlerActions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/GenericErrorHandlerActions */ "./js/components/GenericErrorHandlerActions.js");
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Root/ViewContextContext */ "./js/components/Root/ViewContextContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GoogleChartErrorHandler component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






class GoogleChartErrorHandler extends _wordpress_element__WEBPACK_IMPORTED_MODULE_8__.Component {
  constructor(props) {
    super(props);
    this.state = {
      error: null,
      info: null
    };
    this.onErrorClick = this.onErrorClick.bind(this);
  }
  componentDidCatch(error, info) {
    __webpack_require__.g.console.error('Google Charts error:', error, info);
    this.setState({
      error,
      info
    });
    (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEvent)('google_chart_error', `handle_${this.context || 'unknown'}_error`,
    // label has a max-length of 500 bytes.
    `${error?.message}\n${info?.componentStack}`.slice(0, 500));
  }
  onErrorClick() {
    const {
      error,
      info
    } = this.state;

    // Copy message with wrapping backticks for code block formatting on wp.org.
    clipboard_copy__WEBPACK_IMPORTED_MODULE_0___default()(`\`${error?.message}\n${info?.componentStack}\``);
  }
  render() {
    const {
      children
    } = this.props;
    const {
      error,
      info
    } = this.state;

    // If there is no caught error, render the children components normally.
    if (!error) {
      return children;
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "googlesitekit-googlechart-error-handler",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_2__["default"], {
        description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('An error prevented this Google chart from being displayed properly. Report the exact contents of the error on the support forum to find out what caused it.', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_GenericErrorHandlerActions__WEBPACK_IMPORTED_MODULE_3__["default"], {
            message: error.message,
            componentStack: info.componentStack
          })]
        }),
        onErrorClick: this.onErrorClick,
        onClick: this.onErrorClick,
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error in Google Chart', 'google-site-kit'),
        error: true
      })
    });
  }
}
GoogleChartErrorHandler.contextType = _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_4__["default"];
GoogleChartErrorHandler.propTypes = {
  /** @ignore */
  children: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().node).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GoogleChartErrorHandler);

/***/ }),

/***/ "./js/components/Header.js":
/*!*********************************!*\
  !*** ./js/components/Header.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_21__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_use_observer__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! react-use-observer */ "../node_modules/react-use-observer/es/useMutationObserver.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Logo__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Logo */ "./js/components/Logo.js");
/* harmony import */ var _UserMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./UserMenu */ "./js/components/UserMenu/index.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _DashboardNavigation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./DashboardNavigation */ "./js/components/DashboardNavigation/index.js");
/* harmony import */ var _EntityHeader__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./EntityHeader */ "./js/components/EntityHeader.js");
/* harmony import */ var _ViewOnlyMenu__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ViewOnlyMenu */ "./js/components/ViewOnlyMenu/index.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var _notifications_LegacyNotifications__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./notifications/LegacyNotifications */ "./js/components/notifications/LegacyNotifications.js");
/* harmony import */ var _notifications_Notifications__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./notifications/Notifications */ "./js/components/notifications/Notifications.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_hooks_useGlobalTrackingEffect__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/hooks/useGlobalTrackingEffect */ "./js/hooks/useGlobalTrackingEffect.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Header component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */

















function Header({
  children,
  subHeader,
  showNavigation
}) {
  const isDashboard = !!(0,_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__["default"])();
  (0,_js_hooks_useGlobalTrackingEffect__WEBPACK_IMPORTED_MODULE_17__.useGlobalTrackingEffect)();
  const dashboardURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_16__.CORE_SITE).getAdminURL('googlesitekit-dashboard'));
  const isAuthenticated = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isAuthenticated());
  const [subHeaderRef, subHeaderMutation] = (0,react_use_observer__WEBPACK_IMPORTED_MODULE_19__["default"])({
    childList: true
  });
  const hasSubheader = !!subHeaderMutation.target?.childElementCount;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_20__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("header", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-header', {
        'googlesitekit-header--has-subheader': hasSubheader,
        'googlesitekit-header--has-navigation': showNavigation
      }),
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_6__.Grid, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_6__.Row, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_6__.Cell, {
            smSize: 1,
            mdSize: 2,
            lgSize: 4,
            className: "googlesitekit-header__logo",
            alignMiddle: true,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_12__["default"], {
              "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Go to dashboard', 'google-site-kit'),
              className: "googlesitekit-header__logo-link",
              href: dashboardURL,
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_Logo__WEBPACK_IMPORTED_MODULE_3__["default"], {})
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_6__.Cell, {
            smSize: 3,
            mdSize: 6,
            lgSize: 8,
            className: "googlesitekit-header__children",
            alignMiddle: true,
            children: [children, !isAuthenticated && isDashboard && isViewOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_ViewOnlyMenu__WEBPACK_IMPORTED_MODULE_9__["default"], {}), isAuthenticated && !isViewOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_UserMenu__WEBPACK_IMPORTED_MODULE_4__["default"], {})]
          })]
        })
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div", {
      className: "googlesitekit-subheader",
      ref: subHeaderRef,
      children: subHeader
    }), showNavigation && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_DashboardNavigation__WEBPACK_IMPORTED_MODULE_7__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_EntityHeader__WEBPACK_IMPORTED_MODULE_8__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_notifications_LegacyNotifications__WEBPACK_IMPORTED_MODULE_13__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_notifications_Notifications__WEBPACK_IMPORTED_MODULE_14__["default"], {
      areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_15__.NOTIFICATION_AREAS.HEADER
    })]
  });
}
Header.displayName = 'Header';
Header.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_21___default().node),
  subHeader: (prop_types__WEBPACK_IMPORTED_MODULE_21___default().element),
  showNavigation: (prop_types__WEBPACK_IMPORTED_MODULE_21___default().bool)
};
Header.defaultProps = {
  children: null,
  subHeader: null
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Header);

/***/ }),

/***/ "./js/components/HeaderMenu/Divider.js":
/*!*********************************************!*\
  !*** ./js/components/HeaderMenu/Divider.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Divider)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * HeaderMenu Divider component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function Divider({
  className
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("li", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-list-divider', className),
    role: "separator"
  });
}
Divider.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
};

/***/ }),

/***/ "./js/components/HeaderMenu/MenuItem.js":
/*!**********************************************!*\
  !*** ./js/components/HeaderMenu/MenuItem.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MenuItem)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * HeaderMenu MenuItem component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function MenuItem({
  id,
  className,
  role,
  isInteractive = true,
  onClick,
  icon,
  label,
  description,
  trailing,
  children,
  itemClassName = 'googlesitekit-header-menu__item',
  iconClassName = 'googlesitekit-header-menu__item-icon',
  labelClassName = 'googlesitekit-header-menu__item-label',
  descriptionClassName = 'googlesitekit-header-menu__item-description',
  trailingClassName = 'googlesitekit-header-menu__item-trailing'
}) {
  const content = children || /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
    className: itemClassName,
    children: [icon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
      className: iconClassName,
      children: icon
    }), label && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
      className: labelClassName,
      children: label
    }), description && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
      className: descriptionClassName,
      children: description
    }), trailing && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
      className: trailingClassName,
      children: trailing
    })]
  });
  const listRole = role === undefined && isInteractive ? 'menuitem' : role;
  const listClassName = classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, {
    'mdc-list-item': isInteractive
  });
  const hasAction = typeof onClick === 'function';
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("li", {
    id: id,
    className: listClassName || undefined,
    role: listRole,
    children: hasAction ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("button", {
      type: "button",
      className: "googlesitekit-header-menu__item-button",
      onClick: onClick,
      children: content
    }) : content
  });
}
MenuItem.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  role: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  isInteractive: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
  icon: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  trailing: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  itemClassName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  iconClassName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  labelClassName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  descriptionClassName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  trailingClassName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
};

/***/ }),

/***/ "./js/components/HeaderMenu/MenuSection.js":
/*!*************************************************!*\
  !*** ./js/components/HeaderMenu/MenuSection.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MenuSection)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * HeaderMenu MenuSection component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


function MenuSection({
  id,
  className,
  role,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("li", {
    id: id,
    className: className,
    role: role,
    children: children
  });
}
MenuSection.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  role: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)
};

/***/ }),

/***/ "./js/components/HeaderMenu/MenuWithHeading.js":
/*!*****************************************************!*\
  !*** ./js/components/HeaderMenu/MenuWithHeading.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MenuWithHeading)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _MenuSection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./MenuSection */ "./js/components/HeaderMenu/MenuSection.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * HeaderMenu MenuWithHeading component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


function MenuWithHeading({
  heading,
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_MenuSection__WEBPACK_IMPORTED_MODULE_0__["default"], {
    className: className,
    children: [heading, children]
  });
}
MenuWithHeading.propTypes = {
  heading: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};

/***/ }),

/***/ "./js/components/HeaderMenu/index.js":
/*!*******************************************!*\
  !*** ./js/components/HeaderMenu/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Divider: () => (/* reexport safe */ _Divider__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   MenuItem: () => (/* reexport safe */ _MenuItem__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   MenuSection: () => (/* reexport safe */ _MenuSection__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   MenuWithHeading: () => (/* reexport safe */ _MenuWithHeading__WEBPACK_IMPORTED_MODULE_3__["default"])
/* harmony export */ });
/* harmony import */ var _Divider__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Divider */ "./js/components/HeaderMenu/Divider.js");
/* harmony import */ var _MenuItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MenuItem */ "./js/components/HeaderMenu/MenuItem.js");
/* harmony import */ var _MenuSection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MenuSection */ "./js/components/HeaderMenu/MenuSection.js");
/* harmony import */ var _MenuWithHeading__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MenuWithHeading */ "./js/components/HeaderMenu/MenuWithHeading.js");
/**
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */






/***/ }),

/***/ "./js/components/IconWrapper.js":
/*!**************************************!*\
  !*** ./js/components/IconWrapper.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ IconWrapper)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * IconWrapper component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


function IconWrapper({
  children,
  marginLeft,
  marginRight
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("span", {
    className: "googlesitekit-icon-wrapper",
    style: {
      marginLeft,
      marginRight
    },
    children: children
  });
}
IconWrapper.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node).isRequired,
  marginLeft: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  marginRight: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)
};

/***/ }),

/***/ "./js/components/InViewProvider/InViewContext.js":
/*!*******************************************************!*\
  !*** ./js/components/InViewProvider/InViewContext.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * InView context for React components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */

const InViewContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)(false);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InViewContext);

/***/ }),

/***/ "./js/components/InfoTooltip.js":
/*!**************************************!*\
  !*** ./js/components/InfoTooltip.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ InfoTooltip)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _svg_icons_info_green_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/info-green.svg */ "./svg/icons/info-green.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * InfoTooltip component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */



function InfoTooltip({
  onOpen,
  title,
  tooltipClassName
}) {
  if (!title) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Tooltip, {
    className: "googlesitekit-info-tooltip",
    tooltipClassName: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-info-tooltip__content', tooltipClassName),
    title: title,
    placement: "top",
    enterTouchDelay: 0,
    leaveTouchDelay: 5000,
    onOpen: onOpen,
    interactive: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      tabIndex: "0",
      role: "tooltip",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_svg_icons_info_green_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
        width: "16",
        height: "16"
      })
    })
  });
}
InfoTooltip.propTypes = {
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func),
  title: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().element)]),
  tooltipClassName: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string)
};

/***/ }),

/***/ "./js/components/JoyrideTooltip.js":
/*!*****************************************!*\
  !*** ./js/components/JoyrideTooltip.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ JoyrideTooltip)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var react_joyride__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react-joyride */ "../node_modules/react-joyride/dist/index.mjs");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useInterval.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _TourTooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TourTooltip */ "./js/components/TourTooltip.js");
/* harmony import */ var _Portal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Portal */ "./js/components/Portal.js");
/* harmony import */ var _TourTooltips__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./TourTooltips */ "./js/components/TourTooltips.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * JoyRideTooltip component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





function JoyrideTooltip(props) {
  const {
    title,
    content,
    dismissLabel,
    disableOverlay = true,
    target,
    cta = false,
    className,
    styles = {},
    slug = '',
    placement = 'auto',
    onDismiss = () => {},
    onView = () => {},
    onTourStart = () => {},
    onTourEnd = () => {}
  } = props;
  function checkIfTargetExists() {
    return !!__webpack_require__.g.document.querySelector(target);
  }
  const [targetExists, setTargetExists] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(checkIfTargetExists);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.useBreakpoint)();
  const isMobileTablet = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.BREAKPOINT_TABLET;
  const [shouldRun, setShouldRun] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(true);
  const previousIsMobileTabletRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useRef)(isMobileTablet);
  (0,react_use__WEBPACK_IMPORTED_MODULE_6__["default"])(() => {
    if (checkIfTargetExists()) {
      setTargetExists(true);
    }
  },
  // An delay of null will stop the interval.
  targetExists ? null : 250);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
    // eslint-disable-next-line sitekit/function-declaration-consistency
    let disconnect = () => {};
    if (typeof __webpack_require__.g.ResizeObserver === 'function') {
      const targetElement = __webpack_require__.g.document.querySelector(target);
      if (targetElement) {
        const resizeObserver = new ResizeObserver(() => {
          // Dispatch a window resize event to trigger the tooltip to reposition.
          __webpack_require__.g.dispatchEvent(new Event('resize'));
        });
        resizeObserver.observe(targetElement);
        disconnect = () => resizeObserver.disconnect();
      }
    }
    return disconnect;
  }, [target, targetExists]);

  // Reset the component between mobile and desktop layouts they use different
  // targets which requires the tooltip to be re-rendered to display correctly.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
    let timeoutID;
    if (previousIsMobileTabletRef.current !== isMobileTablet) {
      setShouldRun(false);
      timeoutID = setTimeout(() => {
        setShouldRun(true);
      }, 50);
      previousIsMobileTabletRef.current = isMobileTablet;
    }
    return () => {
      if (timeoutID) {
        clearTimeout(timeoutID);
      }
    };
  }, [isMobileTablet]);

  // Joyride expects the step's target to be in the DOM immediately
  // so we need to wait for it in some cases, e.g. loading data.
  if (!targetExists) {
    return null;
  }
  const steps = [{
    title,
    target,
    content,
    disableBeacon: true,
    isFixed: true,
    placement,
    cta,
    className
  }];

  // Provides button content as well as aria-label & title attribute values.
  const joyrideLocale = {
    close: dismissLabel,
    last: dismissLabel
  };
  function callback({
    type
  }) {
    switch (type) {
      case react_joyride__WEBPACK_IMPORTED_MODULE_7__.EVENTS.TOUR_START:
        onTourStart();
        __webpack_require__.g.document.body.classList.add('googlesitekit-showing-tooltip');
        break;
      case react_joyride__WEBPACK_IMPORTED_MODULE_7__.EVENTS.TOUR_END:
        onTourEnd();
        __webpack_require__.g.document.body.classList.remove('googlesitekit-showing-tooltip');
        break;
      case react_joyride__WEBPACK_IMPORTED_MODULE_7__.EVENTS.STEP_AFTER:
        // This is not strictly necessary as the tooltip will hide without it,
        // but this allows the consumer of the component to clean up
        // post-dismiss.
        onDismiss();
        break;
      case react_joyride__WEBPACK_IMPORTED_MODULE_7__.EVENTS.TOOLTIP:
        onView();
        break;
    }
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Portal__WEBPACK_IMPORTED_MODULE_1__["default"], {
    slug: slug,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(react_joyride__WEBPACK_IMPORTED_MODULE_7__["default"], {
      callback: callback,
      disableOverlay: disableOverlay,
      spotlightPadding: 0,
      floaterProps: _TourTooltips__WEBPACK_IMPORTED_MODULE_2__.floaterProps,
      locale: joyrideLocale,
      steps: steps,
      styles: {
        ..._TourTooltips__WEBPACK_IMPORTED_MODULE_2__.joyrideStyles,
        ...styles,
        options: {
          ..._TourTooltips__WEBPACK_IMPORTED_MODULE_2__.joyrideStyles.options,
          ...styles?.options
        },
        spotlight: {
          ..._TourTooltips__WEBPACK_IMPORTED_MODULE_2__.joyrideStyles.spotlight,
          ...styles?.spotlight
        }
      },
      tooltipComponent: _TourTooltip__WEBPACK_IMPORTED_MODULE_0__["default"],
      run: shouldRun,
      disableScrolling: true
    })
  });
}
JoyrideTooltip.propTypes = {
  title: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.node,
  content: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.string,
  disableOverlay: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.bool,
  dismissLabel: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.string,
  target: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.string.isRequired,
  onDismiss: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.func,
  onShow: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.func,
  className: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.string,
  styles: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.object,
  slug: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.string,
  placement: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.string,
  onView: prop_types__WEBPACK_IMPORTED_MODULE_8__.PropTypes.func
};

/***/ }),

/***/ "./js/components/KeyMetrics/ChangeMetricsLink.js":
/*!*******************************************************!*\
  !*** ./js/components/KeyMetrics/ChangeMetricsLink.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChangeMetricsLink)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/icons/pencil-alt.svg */ "./svg/icons/pencil-alt.svg");
/* harmony import */ var _SetupCompletedSurveyTrigger__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SetupCompletedSurveyTrigger */ "./js/components/KeyMetrics/SetupCompletedSurveyTrigger.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _hooks_useChangeMetricsFeatureTourEffect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./hooks/useChangeMetricsFeatureTourEffect */ "./js/components/KeyMetrics/hooks/useChangeMetricsFeatureTourEffect.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Key Metrics ChangeMetricsLink component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */











function ChangeMetricsLink() {
  const keyMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getKeyMetrics());
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI);
  const openMetricsSelectionPanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.useCallback)(() => {
    setValue(_constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_SELECTION_PANEL_OPENED_KEY, true);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_kmw`, 'change_metrics');
  }, [setValue, viewContext]);
  const renderChangeMetricLink = Array.isArray(keyMetrics) && keyMetrics?.length > 0;
  (0,_hooks_useChangeMetricsFeatureTourEffect__WEBPACK_IMPORTED_MODULE_10__.useChangeMetricsFeatureTourEffect)({
    renderChangeMetricLink
  });
  if (!renderChangeMetricLink) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
      className: "googlesitekit-widget-area__cta-link googlesitekit-km-change-metrics-cta",
      onClick: openMetricsSelectionPanel,
      leadingIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_6__["default"], {
        width: 22,
        height: 22
      }),
      secondary: true,
      linkButton: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Change metrics', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_SetupCompletedSurveyTrigger__WEBPACK_IMPORTED_MODULE_7__["default"], {})]
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/ChipTabGroup/Chip.js":
/*!*******************************************************!*\
  !*** ./js/components/KeyMetrics/ChipTabGroup/Chip.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Chip)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/check-2.svg */ "./svg/icons/check-2.svg");
/* harmony import */ var _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/star-fill.svg */ "./svg/icons/star-fill.svg");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Chip component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */






const icons = {
  [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_METRICS_GROUP_CURRENT.SLUG]: _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
  [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_METRICS_GROUP_SUGGESTED.SLUG]: _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_4__["default"]
};
function Chip({
  slug,
  label,
  isActive,
  onClick,
  hasNewBadge = false,
  selectedCount = 0
}) {
  const Icon = icons[slug] || _js_components_Null__WEBPACK_IMPORTED_MODULE_5__["default"];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-chip-tab-group__chip-item', {
      'googlesitekit-chip-tab-group__chip-item--active': isActive
    }),
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Icon, {
      width: 12,
      height: 12,
      className: `googlesitekit-chip-tab-group__chip-item-svg googlesitekit-chip-tab-group__chip-item-svg__${slug}`
    }),
    trailingIcon: selectedCount > 0 ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("span", {
      className: "googlesitekit-chip-tab-group__chip-item-count",
      children: ["(", selectedCount, ")"]
    }) : null,
    onClick: () => onClick(slug),
    children: [label, hasNewBadge && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
      className: "googlesitekit-chip-tab-group__chip-item-new-dot"
    })]
  });
}
Chip.propTypes = {
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string).isRequired,
  label: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string).isRequired,
  isActive: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  hasNewBadge: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  selectedCount: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().number),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func).isRequired
};

/***/ }),

/***/ "./js/components/KeyMetrics/ChipTabGroup/TabContent.js":
/*!*************************************************************!*\
  !*** ./js/components/KeyMetrics/ChipTabGroup/TabContent.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ TabContent)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_KeyMetrics_MetricsSelectionPanel_MetricItem__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricsSelectionPanel/MetricItem */ "./js/components/KeyMetrics/MetricsSelectionPanel/MetricItem.js");
/* harmony import */ var _svg_graphics_key_metrics_no_selected_items_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/graphics/key-metrics-no-selected-items.svg */ "./svg/graphics/key-metrics-no-selected-items.svg");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TabContent component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




function TabContent({
  activeMetricItems,
  newlyDetectedMetrics,
  savedItemSlugs
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
    className: "googlesitekit-chip-tab-group__tab-item",
    children: [Object.keys(activeMetricItems).map(slug => {
      const metricGroup = activeMetricItems[slug].group;
      const isNewlyDetected = newlyDetectedMetrics?.[metricGroup]?.includes(slug);
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_KeyMetrics_MetricsSelectionPanel_MetricItem__WEBPACK_IMPORTED_MODULE_1__["default"], {
        slug: slug,
        savedItemSlugs: savedItemSlugs,
        isNewlyDetected: isNewlyDetected,
        ...activeMetricItems[slug]
      }, slug);
    }), !Object.keys(activeMetricItems).length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "googlesitekit-chip-tab-group__graphic",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_svg_graphics_key_metrics_no_selected_items_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
        height: 250
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No metrics were selected yet', 'google-site-kit')
      })]
    })]
  });
}
TabContent.propTypes = {
  activeMetricItems: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object).isRequired,
  newlyDetectedMetrics: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object).isRequired,
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().array)
};

/***/ }),

/***/ "./js/components/KeyMetrics/ChipTabGroup/TabItems.js":
/*!***********************************************************!*\
  !*** ./js/components/KeyMetrics/ChipTabGroup/TabItems.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ TabItems)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _Chip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Chip */ "./js/components/KeyMetrics/ChipTabGroup/Chip.js");
/* harmony import */ var _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/check-2.svg */ "./svg/icons/check-2.svg");
/* harmony import */ var _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/star-fill.svg */ "./svg/icons/star-fill.svg");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TabItems component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */







const icons = {
  [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CURRENT.SLUG]: _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_SUGGESTED.SLUG]: _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_3__["default"]
};
function TabItems({
  containerRef,
  isMobileBreakpoint,
  chipItemRows,
  allGroups,
  isActive,
  onChipChange,
  selectedCounts,
  newlyDetectedMetrics,
  activeGroupIndex
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
    className: "googlesitekit-chip-tab-group__tab-items",
    ref: containerRef,
    children: [!isMobileBreakpoint && chipItemRows.map(row => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
      className: "googlesitekit-chip-tab-group__tab-items-row",
      children: row.map(group => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Chip__WEBPACK_IMPORTED_MODULE_1__["default"], {
        slug: group.SLUG,
        label: group.LABEL,
        hasNewBadge: !!newlyDetectedMetrics?.[group.SLUG],
        isActive: group.SLUG === isActive,
        onClick: onChipChange,
        selectedCount: selectedCounts[group.SLUG]
      }, group.SLUG))
    }, `row-${row[0].SLUG}`)), isMobileBreakpoint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.TabBar, {
      activeIndex: activeGroupIndex,
      handleActiveIndexUpdate: index => onChipChange(null, index),
      children: allGroups.map((group, index) => {
        const Icon = icons[group.SLUG] || _js_components_Null__WEBPACK_IMPORTED_MODULE_4__["default"];
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.Tab, {
          "aria-label": group.LABEL,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Icon, {
            width: 12,
            height: 12,
            className: `googlesitekit-chip-tab-group__chip-item-svg googlesitekit-chip-tab-group__tab-item-mobile-svg googlesitekit-chip-tab-group__chip-item-svg__${group.SLUG}`
          }), group.LABEL, selectedCounts[group.SLUG] > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("span", {
            className: "googlesitekit-chip-tab-group__chip-item-count",
            children: ["(", selectedCounts[group.SLUG], ")"]
          }), !!newlyDetectedMetrics?.[group.SLUG] && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("span", {
            className: "googlesitekit-chip-tab-group__chip-item-new-dot"
          })]
        }, index);
      })
    })]
  });
}
TabItems.propTypes = {
  containerRef: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().object),
  isMobileBreakpoint: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  chipItemRows: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().array).isRequired,
  allGroups: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().array).isRequired,
  isActive: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string).isRequired,
  onChipChange: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func).isRequired,
  selectedCounts: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().object).isRequired,
  newlyDetectedMetrics: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().object).isRequired,
  activeGroupIndex: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().number).isRequired
};

/***/ }),

/***/ "./js/components/KeyMetrics/ChipTabGroup/index.js":
/*!********************************************************!*\
  !*** ./js/components/KeyMetrics/ChipTabGroup/index.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ChipTabGroup)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useCurrentlyActiveEvents__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useCurrentlyActiveEvents */ "./js/components/KeyMetrics/hooks/useCurrentlyActiveEvents.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useKeyMetricsGroups__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useKeyMetricsGroups */ "./js/components/KeyMetrics/hooks/useKeyMetricsGroups.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useFilteredKeyMetrics__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useFilteredKeyMetrics */ "./js/components/KeyMetrics/hooks/useFilteredKeyMetrics.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useOverflowingTabs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useOverflowingTabs */ "./js/components/KeyMetrics/hooks/useOverflowingTabs.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useNewBadgeEvents__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useNewBadgeEvents */ "./js/components/KeyMetrics/hooks/useNewBadgeEvents.js");
/* harmony import */ var _TabItems__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./TabItems */ "./js/components/KeyMetrics/ChipTabGroup/TabItems.js");
/* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./TabContent */ "./js/components/KeyMetrics/ChipTabGroup/TabContent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ChipTabGroup component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */


















const emptyArray = Object.freeze([]);
function ChipTabGroup({
  allMetricItems,
  savedItemSlugs
}) {
  const containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useRef)();
  const [isActive, setIsActive] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useState)(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_CURRENT.SLUG);
  // Used for mobile chip tabs, which leverages the TabBar component for seemless horizontal scroll
  // but it accepts a numerical index for the active tab.
  const [activeGroupIndex, setActiveGroupIndex] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useState)(0);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__.useBreakpoint)();
  const isMobileBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__.BREAKPOINT_SMALL;
  const selectedMetrics = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_SELECTED);
  const effectiveSelection = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.EFFECTIVE_SELECTION) || emptyArray;
  const unstagedSelection = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.UNSTAGED_SELECTION) || emptyArray;
  const isUserInputCompleted = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).isUserInputCompleted());
  const currentlyActiveEvents = (0,_js_components_KeyMetrics_hooks_useCurrentlyActiveEvents__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const isGA4Connected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ANALYTICS_4));
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (!isGA4Connected) {
      return [];
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getDetectedEvents();
  });
  const answerBasedMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getAnswerBasedMetrics(null, [...(currentlyActiveEvents || []), ...(detectedEvents || [])]));
  const {
    keyMetricsGroups,
    dynamicGroups
  } = (0,_js_components_KeyMetrics_hooks_useKeyMetricsGroups__WEBPACK_IMPORTED_MODULE_11__["default"])({
    detectedEvents,
    currentlyActiveEvents,
    isUserInputCompleted,
    answerBasedMetrics
  });
  const allGroups = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useMemo)(() => [...dynamicGroups, ...keyMetricsGroups], [dynamicGroups, keyMetricsGroups]);
  const newBadgeEvents = (0,_js_components_KeyMetrics_hooks_useNewBadgeEvents__WEBPACK_IMPORTED_MODULE_14__["default"])();
  const conversionReportingEventWidgets = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (!isGA4Connected) {
      return [];
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getKeyMetricsConversionEventWidgets();
  });
  const {
    selectedCounts,
    activeMetricItems,
    newlyDetectedMetrics
  } = (0,_js_components_KeyMetrics_hooks_useFilteredKeyMetrics__WEBPACK_IMPORTED_MODULE_12__["default"])({
    allMetricItems,
    isActive,
    effectiveSelection,
    answerBasedMetrics,
    selectedMetrics,
    newBadgeEvents,
    conversionReportingEventWidgets
  });
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_FORMS);
  const resetUnstagedSelection = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useCallback)(() => {
    setValues(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_SELECTION_FORM, {
      [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_SELECTED]: selectedMetrics,
      [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.EFFECTIVE_SELECTION]: [...effectiveSelection, ...unstagedSelection],
      [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.UNSTAGED_SELECTION]: []
    });
  }, [selectedMetrics, effectiveSelection, unstagedSelection, setValues]);
  const onChipChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useCallback)((slug, index) => {
    if (!slug) {
      // Set active group for mobile tabs.
      const activeGroup = allGroups[index];
      setActiveGroupIndex(index);
      setIsActive(activeGroup.SLUG);
    } else {
      setIsActive(slug);
    }
    if (unstagedSelection.length) {
      resetUnstagedSelection();
    }
  }, [allGroups, unstagedSelection, setIsActive, resetUnstagedSelection]);
  const isSelectionPanelOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI).getValue(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_SELECTION_PANEL_OPENED_KEY));
  const isSelectionPanelOpenPrevious = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_19__["default"])(isSelectionPanelOpen);
  const newlyDetectedMetricsKeys = Object.keys(newlyDetectedMetrics);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useEffect)(() => {
    // Ensure that current selection group is always active when selection panel re-opens.
    if (!isSelectionPanelOpenPrevious && isSelectionPanelOpen) {
      setIsActive(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_CURRENT.SLUG);
      setActiveGroupIndex(0);
      if (newlyDetectedMetricsKeys.length && isMobileBreakpoint) {
        const firstNewlyDetectedGroup = allGroups.find(group => group.SLUG === newlyDetectedMetricsKeys[0]);
        setActiveGroupIndex(allGroups.indexOf(firstNewlyDetectedGroup));
        setIsActive(firstNewlyDetectedGroup.SLUG);
      } else {
        setActiveGroupIndex(0);
        setIsActive(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_CURRENT.SLUG);
      }
    }
    if (isSelectionPanelOpenPrevious && !isSelectionPanelOpen) {
      // Reset the unstaged selection when selection panel is closed.
      resetUnstagedSelection();
    }
  }, [isSelectionPanelOpen, isSelectionPanelOpenPrevious, unstagedSelection, allGroups, isMobileBreakpoint, newlyDetectedMetricsKeys, resetUnstagedSelection]);
  (0,_js_components_KeyMetrics_hooks_useOverflowingTabs__WEBPACK_IMPORTED_MODULE_13__["default"])({
    containerRef,
    isMobileBreakpoint,
    isSelectionPanelOpen,
    isSelectionPanelOpenPrevious
  });
  const chipItemRows = [[...dynamicGroups, ...keyMetricsGroups.slice(0, 2)], [...keyMetricsGroups.slice(2)]];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("div", {
    className: "googlesitekit-chip-tab-group",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_TabItems__WEBPACK_IMPORTED_MODULE_15__["default"], {
      containerRef: containerRef,
      isMobileBreakpoint: isMobileBreakpoint,
      chipItemRows: chipItemRows,
      allGroups: allGroups,
      isActive: isActive,
      onChipChange: onChipChange,
      selectedCounts: selectedCounts,
      newlyDetectedMetrics: newlyDetectedMetrics,
      activeGroupIndex: activeGroupIndex
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_TabContent__WEBPACK_IMPORTED_MODULE_16__["default"], {
      activeMetricItems: activeMetricItems,
      newlyDetectedMetrics: newlyDetectedMetrics,
      savedItemSlugs: savedItemSlugs
    })]
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/ConnectModuleCTATile.js":
/*!**********************************************************!*\
  !*** ./js/components/KeyMetrics/ConnectModuleCTATile.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ConnectModuleCTATile)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useActivateModuleCallback */ "./js/hooks/useActivateModuleCallback.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _GhostCardGreenSVG__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./GhostCardGreenSVG */ "./js/components/KeyMetrics/GhostCardGreenSVG.js");
/* harmony import */ var _GhostCardRedSVG__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./GhostCardRedSVG */ "./js/components/KeyMetrics/GhostCardRedSVG.js");
/* harmony import */ var _MetricTileHeader__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./MetricTileHeader */ "./js/components/KeyMetrics/MetricTileHeader.js");
/* harmony import */ var _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./key-metrics-widgets */ "./js/components/KeyMetrics/key-metrics-widgets.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ConnectModuleCTATile component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */











function ConnectModuleCTATile({
  moduleSlug
}) {
  const handleConnectModule = (0,_js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_5__["default"])(moduleSlug);
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).getModule(moduleSlug));
  const Icon = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).getModuleIcon(moduleSlug));
  const widgets = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_WIDGETS).getWidgets(_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_4__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY) || []);
  const moduleWidgets = widgets.filter(widget => widget.modules.includes(moduleSlug));
  const firstWidget = _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_10__.KEY_METRICS_WIDGETS[moduleWidgets[0]?.slug];

  // If there are more than one metric tiles combined into this metric notice, update
  // the widget to remove the title and change the description copy.
  const combinedMetrics = moduleWidgets.length > 1;
  if (!module) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
    className: `googlesitekit-widget--connectModuleCTATile googlesitekit-km-widget-tile ${combinedMetrics && ' googlesitekit-km-widget-tile--combined'}`,
    children: [!combinedMetrics && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_MetricTileHeader__WEBPACK_IMPORTED_MODULE_9__["default"], {
      title: firstWidget?.title,
      infoTooltip: firstWidget?.description,
      loading: false
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
      className: "googlesitekit-km-widget-tile__body",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
        className: "googlesitekit-km-connect-module-cta-tile",
        children: [Icon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
          className: "googlesitekit-km-connect-module-cta-tile__icon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(Icon, {
            width: "32",
            height: "32"
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
          className: "googlesitekit-km-connect-module-cta-tile__content",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
            className: "googlesitekit-km-connect-module-cta-tile__text",
            children: combinedMetrics ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: module name */
            (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('%s is disconnected, some of your metrics can’t be displayed', 'google-site-kit'), module.name) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: module name */
            (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('%s is disconnected, metric can’t be displayed', 'google-site-kit'), module.name)
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
            onClick: handleConnectModule,
            secondary: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: module name */
            (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Connect %s', 'google-site-kit'), module.name)
          })]
        })]
      })
    }), combinedMetrics && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
        className: "googlesitekit-km-connect-module-cta-tile__ghost-card",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_GhostCardGreenSVG__WEBPACK_IMPORTED_MODULE_7__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
        className: "googlesitekit-km-connect-module-cta-tile__ghost-card",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_GhostCardGreenSVG__WEBPACK_IMPORTED_MODULE_7__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
        className: "googlesitekit-km-connect-module-cta-tile__ghost-card",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_GhostCardRedSVG__WEBPACK_IMPORTED_MODULE_8__["default"], {})
      })]
    })]
  });
}
ConnectModuleCTATile.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string).isRequired
};

/***/ }),

/***/ "./js/components/KeyMetrics/GetHelpLink.js":
/*!*************************************************!*\
  !*** ./js/components/KeyMetrics/GetHelpLink.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ GetHelpLink)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GetHelpLink component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */


function GetHelpLink({
  linkURL
}) {
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])(/* translators: %s: get help text. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Trouble getting access? <HelpLink />', 'google-site-kit'), {
    HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_1__["default"], {
      href: linkURL,
      external: true,
      hideExternalIndicator: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get help', 'google-site-kit')
    })
  });
}
GetHelpLink.propTypes = {
  linkURL: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string).isRequired
};

/***/ }),

/***/ "./js/components/KeyMetrics/GhostCardGreenSVG.js":
/*!*******************************************************!*\
  !*** ./js/components/KeyMetrics/GhostCardGreenSVG.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ GhostCardGreenSVG)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/MediaErrorHandler */ "./js/components/MediaErrorHandler/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GhostCardGreenSVG component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */



const LazyGhostCardGreenSVG = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.lazy)(() => __webpack_require__.e(/*! import() */ "svg_graphics_ghost-card-green_svg").then(__webpack_require__.bind(__webpack_require__, /*! ../../../svg/graphics/ghost-card-green.svg */ "./svg/graphics/ghost-card-green.svg")));
function GhostCardGreenSVG() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.Suspense, {
    fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
      width: "100%",
      height: "90px"
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__["default"], {
      errorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to load graphic', 'google-site-kit'),
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(LazyGhostCardGreenSVG, {})
    })
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/GhostCardRedSVG.js":
/*!*****************************************************!*\
  !*** ./js/components/KeyMetrics/GhostCardRedSVG.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ GhostCardRedSVG)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/MediaErrorHandler */ "./js/components/MediaErrorHandler/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GhostCardRedSVG component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */



const LazyGhostCardRedSVG = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.lazy)(() => __webpack_require__.e(/*! import() */ "svg_graphics_ghost-card-red_svg").then(__webpack_require__.bind(__webpack_require__, /*! ../../../svg/graphics/ghost-card-red.svg */ "./svg/graphics/ghost-card-red.svg")));
function GhostCardRedSVG() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.Suspense, {
    fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
      width: "100%",
      height: "90px"
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__["default"], {
      errorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to load graphic', 'google-site-kit'),
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(LazyGhostCardRedSVG, {})
    })
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/InsufficientPermissionsError.js":
/*!******************************************************************!*\
  !*** ./js/components/KeyMetrics/InsufficientPermissionsError.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ InsufficientPermissionsError)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _MetricTileError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MetricTileError */ "./js/components/KeyMetrics/MetricTileError.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







function InsufficientPermissionsError(props) {
  const {
    moduleSlug,
    onRetry,
    infoTooltip,
    headerText
  } = props;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const helpLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getErrorTroubleshootingLinkURL({
    code: `${moduleSlug}_insufficient_permissions`
  }));
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEventOnce)(`${viewContext}_kmw`, 'insufficient_permissions_error');
  }, [viewContext]);
  const retry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(`${viewContext}_kmw`, 'insufficient_permissions_error_retry');
    onRetry?.();
  }, [onRetry, viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_MetricTileError__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Insufficient permissions', 'google-site-kit'),
    headerText: headerText,
    infoTooltip: infoTooltip,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
      className: "googlesitekit-report-error-actions",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Permissions updated? <a>Retry</a>', 'google-site-kit'), {
          a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
            onClick: retry
          })
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You’ll need to contact your administrator. <a>Learn more</a>', 'google-site-kit'), {
          a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
            href: helpLink,
            external: true,
            hideExternalIndicator: true
          })
        })
      })]
    })
  });
}
InsufficientPermissionsError.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func).isRequired,
  headerText: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
  infoTooltip: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string)
};

/***/ }),

/***/ "./js/components/KeyMetrics/KeyMetricsSetupCTAWidget.js":
/*!**************************************************************!*\
  !*** ./js/components/KeyMetrics/KeyMetricsSetupCTAWidget.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_20___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_20__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useIntersection.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/AdminScreenTooltip */ "./js/components/AdminScreenTooltip/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _hooks_useDisplayCTAWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./hooks/useDisplayCTAWidget */ "./js/components/KeyMetrics/hooks/useDisplayCTAWidget.js");
/* harmony import */ var _js_components_Banner__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/components/Banner */ "./js/components/Banner/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _svg_graphics_banner_conversions_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/svg/graphics/banner-conversions-setup-cta.svg?url */ "./svg/graphics/banner-conversions-setup-cta.svg?url");
/* harmony import */ var _svg_graphics_banner_conversions_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/svg/graphics/banner-conversions-setup-cta-mobile.svg?url */ "./svg/graphics/banner-conversions-setup-cta-mobile.svg?url");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * KeyMetricsSetupCTAWidget component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */

















function KeyMetricsSetupCTAWidget({
  Widget,
  WidgetNull
}) {
  const trackingRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const trackEventCategory = `${viewContext}_kmw-cta-notification`;
  const displayCTAWidget = (0,_hooks_useDisplayCTAWidget__WEBPACK_IMPORTED_MODULE_12__["default"])();
  const ctaLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getAdminURL('googlesitekit-user-input'));
  const fullScreenSelectionLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getAdminURL('googlesitekit-metric-selection'));
  const isNavigatingToCTALink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => ctaLink && select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_LOCATION).isNavigatingTo(ctaLink));
  const intersectionEntry = (0,react_use__WEBPACK_IMPORTED_MODULE_19__["default"])(trackingRef, {
    threshold: 0.25
  });
  const [hasBeenInView, setHasBeenInView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useState)(false);
  const inView = !!intersectionEntry?.intersectionRatio;
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useEffect)(() => {
    if (!inView || hasBeenInView) {
      return;
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_kmw-cta-notification`, 'view_notification');
    triggerSurvey('view_kmw_setup_cta', {
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_10__.WEEK_IN_SECONDS
    });
    setHasBeenInView(true);
  }, [inView, hasBeenInView, viewContext, triggerSurvey]);
  const tooltipSettings = {
    tooltipSlug: _constants__WEBPACK_IMPORTED_MODULE_6__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can always set up goals in Settings later', 'google-site-kit'),
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The Key Metrics section will be added back to your dashboard once you set your goals in Settings', 'google-site-kit'),
    dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Got it', 'google-site-kit')
  };
  const showTooltip = (0,_js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_9__.useShowTooltip)(tooltipSettings);
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI);
  const handleDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useCallback)(async () => {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(trackEventCategory, 'dismiss_notification');
    showTooltip();
    setValue('keepKeyMetricsSetupCTAWidgetVisible', false);
    await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_6__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);
  }, [trackEventCategory, showTooltip, setValue, dismissItem]);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_LOCATION);
  const openMetricsSelectionPanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useCallback)(async () => {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(trackEventCategory, 'confirm_pick_own_metrics');
    setValue('keepKeyMetricsSetupCTAWidgetVisible', true);
    await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_6__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);
    navigateTo(fullScreenSelectionLink);
  }, [trackEventCategory, setValue, dismissItem, navigateTo, fullScreenSelectionLink]);
  const onGetTailoredMetricsClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__.useCallback)(async () => {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(trackEventCategory, 'confirm_get_tailored_metrics');
    setValue('keepKeyMetricsSetupCTAWidgetVisible', true);
    await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_6__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);
    navigateTo(ctaLink);
  }, [trackEventCategory, setValue, dismissItem, navigateTo, ctaLink]);
  if (!displayCTAWidget) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(WidgetNull, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_Banner__WEBPACK_IMPORTED_MODULE_13__["default"], {
      ref: trackingRef,
      className: "googlesitekit-banner--setup-cta",
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get personalized suggestions for user interaction metrics based on your goals', 'google-site-kit'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Answer 3 questions and we’ll suggest relevant metrics for your dashboard. These metrics will help you track how users interact with your site.', 'google-site-kit'),
      dismissButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maybe later', 'google-site-kit'),
        onClick: handleDismiss
      },
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get tailored metrics', 'google-site-kit'),
        onClick: onGetTailoredMetricsClick,
        disabled: isNavigatingToCTALink,
        inProgress: isNavigatingToCTALink
      },
      svg: {
        desktop: _svg_graphics_banner_conversions_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_15__["default"],
        mobile: _svg_graphics_banner_conversions_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_16__["default"],
        verticalPosition: 'top'
      },
      footer: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("div", {
        className: "googlesitekit-widget-key-metrics-footer",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("span", {
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Interested in specific metrics?', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_14__["default"], {
          onClick: openMetricsSelectionPanel,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select your own metrics', 'google-site-kit')
        })]
      })
    })
  });
}
KeyMetricsSetupCTAWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_20___default().elementType)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_8__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4
})(KeyMetricsSetupCTAWidget));

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileError.js":
/*!*****************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileError.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileError)
/* harmony export */ });
/* harmony import */ var _js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/notifications/CTA */ "./js/components/notifications/CTA.js");
/* harmony import */ var _js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MetricTileError component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */



function MetricTileError(props) {
  const {
    children,
    headerText,
    infoTooltip,
    title
  } = props;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: "googlesitekit-km-widget-tile--error",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_0__["default"], {
      title: title,
      headerText: headerText,
      headerContent: infoTooltip && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__["default"], {
        title: infoTooltip
      }),
      description: "",
      error: true,
      children: children
    })
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileHeader.js":
/*!******************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileHeader.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileHeader)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.js");
/* harmony import */ var _js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/VisuallyHidden */ "./js/components/VisuallyHidden.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MetricTileHeader component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function MetricTileHeader({
  title,
  infoTooltip,
  loading
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: "googlesitekit-km-widget-tile__title-container",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
      as: "h3",
      size: "small",
      type: "label",
      className: "googlesitekit-km-widget-tile__title",
      children: title
    }), loading ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_1__["default"], {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_0__["default"], {
        title: infoTooltip
      })
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_0__["default"], {
      title: infoTooltip
    })]
  });
}
MetricTileHeader.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  infoTooltip: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().element)]),
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool)
};

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileLoader.js":
/*!******************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileLoader.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileLoader)
/* harmony export */ });
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Loader for `MetricTile` components.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */


function MetricTileLoader() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
    className: "googlesitekit-km-widget-tile__loading",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      className: "googlesitekit-km-widget-tile__loading-header",
      width: "100%",
      height: "14px"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      className: "googlesitekit-km-widget-tile__loading-body",
      width: "100%",
      height: "53px"
    })]
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileNumeric.js":
/*!*******************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileNumeric.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileNumeric)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/ChangeBadge */ "./js/components/ChangeBadge.js");
/* harmony import */ var _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MetricTileNumeric component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function MetricTileNumeric({
  metricValue,
  metricValueFormat,
  subText,
  previousValue,
  currentValue,
  ...props
}) {
  const formatOptions = (0,_js_util__WEBPACK_IMPORTED_MODULE_0__.expandNumFmtOptions)(metricValueFormat);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_MetricTileWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], {
    className: "googlesitekit-km-widget-tile--numeric",
    ...props,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "googlesitekit-km-widget-tile__metric-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "googlesitekit-km-widget-tile__metric",
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_0__.numFmt)(metricValue, formatOptions)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
        className: "googlesitekit-km-widget-tile__subtext",
        children: subText
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-km-widget-tile__metric-change-container",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_1__["default"], {
        previousValue: previousValue,
        currentValue: currentValue,
        isAbsolute: formatOptions?.style === 'percent'
      })
    })]
  });
}
MetricTileNumeric.propTypes = {
  metricValue: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number)]),
  metricValueFormat: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().object)]),
  subtext: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  previousValue: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
  currentValue: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number)
};

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileTable.js":
/*!*****************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileTable.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileTable)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * Internal dependencies
 */


function MetricTileTable({
  rows = [],
  columns = [],
  limit,
  ZeroState,
  ...props
}) {
  let tileBody = null;
  if (rows?.length > 0) {
    tileBody = rows.slice(0, limit || rows.length).map((row, rowIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-table__body-row",
      children: columns.map(({
        Component,
        field,
        className
      }, colIndex) => {
        const fieldValue = field !== undefined ? (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, field) : undefined;
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-table__body-item', className),
          children: [Component && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Component, {
            row: row,
            fieldValue: fieldValue
          }), !Component && fieldValue]
        }, colIndex);
      })
    }, rowIndex));
  } else if (!!ZeroState) {
    tileBody = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-table__body-row googlesitekit-table__body-row--no-data",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "googlesitekit-table__body-zero-data",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ZeroState, {})
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_MetricTileWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], {
    className: "googlesitekit-km-widget-tile--table",
    ...props,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-km-widget-tile__table",
      children: tileBody
    })
  });
}
MetricTileTable.propTypes = {
  rows: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().array),
  columns: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().array),
  limit: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
  ZeroState: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().elementType)
};

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileTablePlainText.js":
/*!**************************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileTablePlainText.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileTablePlainText)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MetricTileTablePlainText component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


function MetricTileTablePlainText({
  content
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
    className: "googlesitekit-km-widget-tile__table-plain-text",
    children: content
  });
}
MetricTileTablePlainText.propTypes = {
  content: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired
};

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileText.js":
/*!****************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileText.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileText)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/ChangeBadge */ "./js/components/ChangeBadge.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MetricTileText component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function MetricTileText({
  metricValue,
  metricValueFormat,
  subText,
  previousValue,
  currentValue,
  ...props
}) {
  const formatOptions = (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.expandNumFmtOptions)(metricValueFormat);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_MetricTileWrapper__WEBPACK_IMPORTED_MODULE_2__["default"], {
    className: "googlesitekit-km-widget-tile--text",
    ...props,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "googlesitekit-km-widget-tile__metric-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "googlesitekit-km-widget-tile__metric",
        children: metricValue
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
        className: "googlesitekit-km-widget-tile__subtext",
        children: subText
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-km-widget-tile__metric-change-container",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_0__["default"], {
        previousValue: previousValue,
        currentValue: currentValue,
        isAbsolute: formatOptions?.style === 'percent'
      })
    })]
  });
}
MetricTileText.propTypes = {
  metricValue: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_4___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number)]),
  subtext: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  previousValue: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number),
  currentValue: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().number)
};

/***/ }),

/***/ "./js/components/KeyMetrics/MetricTileWrapper.js":
/*!*******************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileWrapper.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricTileWrapper)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./key-metrics-widgets */ "./js/components/KeyMetrics/key-metrics-widgets.js");
/* harmony import */ var _GetHelpLink__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./GetHelpLink */ "./js/components/KeyMetrics/GetHelpLink.js");
/* harmony import */ var _MetricTileLoader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MetricTileLoader */ "./js/components/KeyMetrics/MetricTileLoader.js");
/* harmony import */ var _MetricTileError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetricTileError */ "./js/components/KeyMetrics/MetricTileError.js");
/* harmony import */ var _MetricTileHeader__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./MetricTileHeader */ "./js/components/KeyMetrics/MetricTileHeader.js");
/* harmony import */ var _js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/ReportErrorActions */ "./js/components/ReportErrorActions.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MetricTileWrapper component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */










function MetricTileWrapper(props) {
  const {
    className,
    children,
    error,
    loading,
    moduleSlug,
    Widget,
    widgetSlug,
    title = _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_WIDGETS[widgetSlug]?.title,
    infoTooltip = _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_WIDGETS[widgetSlug]?.infoTooltip || _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_WIDGETS[widgetSlug]?.description
  } = props;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const hasInsufficientPermissionsReportError = error ? (0,lodash__WEBPACK_IMPORTED_MODULE_1__.castArray)(error).some(_js_util_errors__WEBPACK_IMPORTED_MODULE_9__.isInsufficientPermissionsError) : false;
  const trackRetryEvent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_kmw`, 'data_loading_error_retry');
  }, [viewContext]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useEffect)(() => {
    if (!!error) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_kmw`, 'data_loading_error');
    }
  }, [viewContext, error]);
  if (error) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_MetricTileError__WEBPACK_IMPORTED_MODULE_6__["default"], {
      title: hasInsufficientPermissionsReportError ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Insufficient permissions', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Data loading failed', 'google-site-kit'),
      headerText: title,
      infoTooltip: infoTooltip,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_8__["default"], {
        moduleSlug: moduleSlug,
        error: error,
        onRetry: trackRetryEvent,
        GetHelpLink: hasInsufficientPermissionsReportError ? _GetHelpLink__WEBPACK_IMPORTED_MODULE_4__["default"] : undefined,
        getHelpClassName: "googlesitekit-error-retry-text"
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-km-widget-tile', className),
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_MetricTileHeader__WEBPACK_IMPORTED_MODULE_7__["default"], {
        title: title,
        infoTooltip: infoTooltip,
        loading: loading
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-km-widget-tile__body",
        children: [loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_MetricTileLoader__WEBPACK_IMPORTED_MODULE_5__["default"], {}), !loading && children]
      })]
    })
  });
}
MetricTileWrapper.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_14___default().elementType).isRequired,
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_14___default().bool),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_14___default().string),
  infoTooltip: prop_types__WEBPACK_IMPORTED_MODULE_14___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_14___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_14___default().element)]),
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_14___default().string).isRequired
};

/***/ }),

/***/ "./js/components/KeyMetrics/MetricsSelectionPanel/MetricItem.js":
/*!**********************************************************************!*\
  !*** ./js/components/KeyMetrics/MetricsSelectionPanel/MetricItem.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ MetricItem)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/SelectionPanel */ "./js/components/SelectionPanel/index.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Key Metrics Selection Panel MetricItem
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








function MetricItem({
  slug,
  title,
  description,
  isNewlyDetected,
  savedItemSlugs = []
}) {
  const disconnectedModules = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const {
      getModule
    } = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES);
    const widget = select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_WIDGETS).getWidget(slug);
    return widget?.modules.reduce((modulesAcc, widgetSlug) => {
      const module = getModule(widgetSlug);
      if (module?.connected || !module?.name) {
        return modulesAcc;
      }
      return [...modulesAcc, module.name];
    }, []);
  });
  const selectedMetrics = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_7__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_SELECTED);
  const {
    getValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_FORMS));
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_FORMS);
  const onCheckboxChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(event => {
    const metrics = getValue(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_SELECTED);
    const currentlySelectedMetrics = event.target.checked ? metrics.concat([slug]) : metrics.filter(selectedMetric => selectedMetric !== slug);
    setValues(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_SELECTION_FORM, {
      [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_SELECTED]: currentlySelectedMetrics,
      // Unstaged list creates a copy of KM selected list, but unstaged
      // is stored temporary to collect the final selection that will
      // be transfered over to effective selection on tab change and then it is reset.
      [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_5__.UNSTAGED_SELECTION]: currentlySelectedMetrics
    });
  }, [getValue, setValues, slug]);
  const isMetricSelected = selectedMetrics?.includes(slug);
  const isMetricDisabled = !savedItemSlugs.includes(slug) && disconnectedModules.length > 0;
  const id = `key-metric-selection-checkbox-${slug}`;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_6__.SelectionPanelItem, {
    id: id,
    slug: slug,
    title: title,
    description: description,
    isNewlyDetected: isNewlyDetected,
    isItemSelected: isMetricSelected,
    isItemDisabled: isMetricDisabled,
    onCheckboxChange: onCheckboxChange,
    children: disconnectedModules.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
      className: "googlesitekit-selection-panel-item-error",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: module names. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._n)('%s is disconnected, no data to show', '%s are disconnected, no data to show', disconnectedModules.length, 'google-site-kit'), disconnectedModules.join((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)(' and ', 'google-site-kit')))
    })
  });
}
MetricItem.propTypes = {
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string).isRequired,
  description: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string).isRequired,
  isNewlyDetected: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().array)
};

/***/ }),

/***/ "./js/components/KeyMetrics/SetupCompletedSurveyTrigger.js":
/*!*****************************************************************!*\
  !*** ./js/components/KeyMetrics/SetupCompletedSurveyTrigger.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupCompletedSurveyTrigger)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/surveys/SurveyViewTrigger */ "./js/components/surveys/SurveyViewTrigger.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Key Metrics SetupCompletedSurveyTrigger component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */






function SetupCompletedSurveyTrigger() {
  const isKeyMetricsSetupCompleted = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).isKeyMetricsSetupCompleted());
  const isKeyMetricsSetupCompletedBy = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getKeyMetricsSetupCompletedBy());
  const currentUserID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getID());
  if (!isKeyMetricsSetupCompleted) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_4__["default"], {
      triggerID: "view_kmw",
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_3__.WEEK_IN_SECONDS
    }), isKeyMetricsSetupCompletedBy === currentUserID && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_4__["default"], {
      triggerID: "view_kmw_setup_completed",
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_3__.WEEK_IN_SECONDS
    })]
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/constants.js":
/*!***********************************************!*\
  !*** ./js/components/KeyMetrics/constants.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   EFFECTIVE_SELECTION: () => (/* binding */ EFFECTIVE_SELECTION),
/* harmony export */   KEY_METRICS_GROUP_CONTENT_PERFORMANCE: () => (/* binding */ KEY_METRICS_GROUP_CONTENT_PERFORMANCE),
/* harmony export */   KEY_METRICS_GROUP_CURRENT: () => (/* binding */ KEY_METRICS_GROUP_CURRENT),
/* harmony export */   KEY_METRICS_GROUP_DRIVING_TRAFFIC: () => (/* binding */ KEY_METRICS_GROUP_DRIVING_TRAFFIC),
/* harmony export */   KEY_METRICS_GROUP_GENERATING_LEADS: () => (/* binding */ KEY_METRICS_GROUP_GENERATING_LEADS),
/* harmony export */   KEY_METRICS_GROUP_SELLING_PRODUCTS: () => (/* binding */ KEY_METRICS_GROUP_SELLING_PRODUCTS),
/* harmony export */   KEY_METRICS_GROUP_SUGGESTED: () => (/* binding */ KEY_METRICS_GROUP_SUGGESTED),
/* harmony export */   KEY_METRICS_GROUP_VISITORS: () => (/* binding */ KEY_METRICS_GROUP_VISITORS),
/* harmony export */   KEY_METRICS_SELECTED: () => (/* binding */ KEY_METRICS_SELECTED),
/* harmony export */   KEY_METRICS_SELECTION_FORM: () => (/* binding */ KEY_METRICS_SELECTION_FORM),
/* harmony export */   KEY_METRICS_SELECTION_PANEL_OPENED_KEY: () => (/* binding */ KEY_METRICS_SELECTION_PANEL_OPENED_KEY),
/* harmony export */   KEY_METRICS_SETUP_CTA_WIDGET_SLUG: () => (/* binding */ KEY_METRICS_SETUP_CTA_WIDGET_SLUG),
/* harmony export */   MAX_SELECTED_METRICS_COUNT: () => (/* binding */ MAX_SELECTED_METRICS_COUNT),
/* harmony export */   MIN_SELECTED_METRICS_COUNT: () => (/* binding */ MIN_SELECTED_METRICS_COUNT),
/* harmony export */   UNSTAGED_SELECTION: () => (/* binding */ UNSTAGED_SELECTION)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Key Metrics components - constants.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */

const KEY_METRICS_SETUP_CTA_WIDGET_SLUG = 'key-metrics-setup-cta-widget';
const KEY_METRICS_SELECTION_PANEL_OPENED_KEY = 'googlesitekit-key-metrics-selection-panel-opened';
const KEY_METRICS_SELECTION_FORM = 'key-metrics-selection-form';
const KEY_METRICS_SELECTED = 'key-metrics-selected';
const EFFECTIVE_SELECTION = 'key-metrics-effective-selection';
const UNSTAGED_SELECTION = 'key-metrics-unstaged-selection';
const MIN_SELECTED_METRICS_COUNT = 2;
const MAX_SELECTED_METRICS_COUNT = 8;
const KEY_METRICS_GROUP_CURRENT = {
  SLUG: 'current-selection',
  LABEL: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Current selection', 'google-site-kit')
};
const KEY_METRICS_GROUP_SUGGESTED = {
  SLUG: 'suggested',
  LABEL: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Suggested', 'google-site-kit')
};
const KEY_METRICS_GROUP_VISITORS = {
  SLUG: 'visitors',
  LABEL: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Visitors', 'google-site-kit')
};
const KEY_METRICS_GROUP_DRIVING_TRAFFIC = {
  SLUG: 'driving-traffic',
  LABEL: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Driving traffic', 'google-site-kit')
};
const KEY_METRICS_GROUP_GENERATING_LEADS = {
  SLUG: 'generating-leads',
  LABEL: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Generating leads', 'google-site-kit')
};
const KEY_METRICS_GROUP_SELLING_PRODUCTS = {
  SLUG: 'selling-products',
  LABEL: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Selling products', 'google-site-kit')
};
const KEY_METRICS_GROUP_CONTENT_PERFORMANCE = {
  SLUG: 'content-performance',
  LABEL: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Content performance', 'google-site-kit')
};

/***/ }),

/***/ "./js/components/KeyMetrics/hooks/useChangeMetricsFeatureTourEffect.js":
/*!*****************************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useChangeMetricsFeatureTourEffect.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useChangeMetricsFeatureTourEffect: () => (/* binding */ useChangeMetricsFeatureTourEffect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/feature-tours/shared-key-metrics */ "./js/feature-tours/shared-key-metrics.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_util_welcome_modal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util/welcome-modal */ "./js/util/welcome-modal.ts");
/**
 * Change metrics feature tour hook.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */







/**
 * Triggers on demand tour for shared key metrics if all conditions are met.
 *
 * @since 1.113.0
 *
 * @param {Object}  options                        Options object.
 * @param {boolean} options.renderChangeMetricLink If metric link meets the conditions to render.
 */
function useChangeMetricsFeatureTourEffect({
  renderChangeMetricLink
}) {
  const keyMetricsSetupCompletedBy = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getKeyMetricsSetupCompletedBy());
  const currentUserID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getID());
  const {
    triggerOnDemandTour,
    dismissTour
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER);
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__.useFeature)('setupFlowRefresh');
  const isTourDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).isTourDismissed(_js_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_3__["default"].slug));
  const isUserEligibleForTour = Number.isInteger(keyMetricsSetupCompletedBy) && Number.isInteger(currentUserID) && keyMetricsSetupCompletedBy > 0 && currentUserID !== keyMetricsSetupCompletedBy;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
    if (setupFlowRefreshEnabled && (0,_js_util_welcome_modal__WEBPACK_IMPORTED_MODULE_5__.isInitialWelcomeModalActive)()) {
      if (isTourDismissed === false) {
        dismissTour(_js_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_3__["default"].slug);
      }
      return;
    }
    if (renderChangeMetricLink && isUserEligibleForTour) {
      triggerOnDemandTour(_js_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_3__["default"]);
    }
  }, [renderChangeMetricLink, isUserEligibleForTour, triggerOnDemandTour, dismissTour, isTourDismissed, setupFlowRefreshEnabled]);
}

/***/ }),

/***/ "./js/components/KeyMetrics/hooks/useCurrentlyActiveEvents.js":
/*!********************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useCurrentlyActiveEvents.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useCurrentlyActiveEvents)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/**
 * The useCurrentlyActiveEvents hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */




/**
 * Gets the list of currently active conversion events based on user selection
 * or user input settings.
 *
 * @since 1.163.0
 *
 * @return {Array<string>|undefined} List of currently active conversion events.
 */
function useCurrentlyActiveEvents() {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const userPickedMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getUserPickedMetrics();
    if (userPickedMetrics?.length) {
      // Safe to access without GA4 connection; no network request.
      const keyMetricsConversionEventWidgets = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getKeyMetricsConversionEventWidgets();
      return Object.keys(keyMetricsConversionEventWidgets).filter(event => userPickedMetrics.some(metric => keyMetricsConversionEventWidgets[event].includes(metric)));
    }
    const userInputSettings = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getUserInputSettings();
    return userInputSettings?.includeConversionEvents?.values;
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/hooks/useDisplayCTAWidget.js":
/*!***************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useDisplayCTAWidget.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useDisplayCTAWidget)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_search_console_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/search-console/datastore/constants */ "./js/modules/search-console/datastore/constants.js");
/* harmony import */ var _js_modules_search_console_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/search-console/constants */ "./js/modules/search-console/constants.js");
/**
 * Determines whether the CTA widget should be displayed.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */










/**
 * Determines whether the CTA widget should be displayed.
 *
 * @since 1.140.0
 *
 * @return {boolean} Whether the CTA widget should be displayed.
 */
function useDisplayCTAWidget() {
  const keepKeyMetricsSetupCTAWidgetVisible = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI).getValue('keepKeyMetricsSetupCTAWidgetVisible'));
  const shouldDisplayCTAWidget = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const isDismissed = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isItemDismissed(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);
    const isDismissingItem = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isDismissingItem(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);

    // We call isGatheringData() within this hook for completeness as we do
    // not want to rely on it being called in other components. This selector
    // makes report requests—if they return data, the `data-available`
    // transients are set.
    //
    // These transients are prefetched as a global on the next page load.
    const searchConsoleDataAvailableOnLoad = isModuleDataAvailableOnLoad(select, _js_modules_search_console_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_SEARCH_CONSOLE, _js_modules_search_console_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_SEARCH_CONSOLE);
    const analyticsDataAvailableOnLoad = isModuleDataAvailableOnLoad(select, _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4);
    return isDismissed === false && isDismissingItem === false && searchConsoleDataAvailableOnLoad && analyticsDataAvailableOnLoad;
  }, []);
  return keepKeyMetricsSetupCTAWidgetVisible || shouldDisplayCTAWidget;
}
function isModuleDataAvailableOnLoad(select, slug, storeName) {
  if (select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_MODULES).isModuleConnected(slug)) {
    const {
      isGatheringData,
      isDataAvailableOnLoad
    } = select(storeName);
    isGatheringData();
    return isDataAvailableOnLoad();
  }
  return false;
}

/***/ }),

/***/ "./js/components/KeyMetrics/hooks/useFilteredKeyMetrics.js":
/*!*****************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useFilteredKeyMetrics.js ***!
  \*****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useFilteredKeyMetrics)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/**
 * The useFilteredKeyMetrics hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Filters and aggregates key metrics for the active group.
 *
 * @since 1.163.0
 *
 * @param {Object} args                                 Arguments.
 * @param {Object} args.allMetricItems                  All metric items keyed by slug.
 * @param {string} args.isActive                        Active group slug.
 * @param {Array}  args.effectiveSelection              Effective selection list.
 * @param {Array}  args.answerBasedMetrics              Tailored metrics for suggested group.
 * @param {Array}  args.selectedMetrics                 Currently selected metrics.
 * @param {Array}  args.newBadgeEvents                  Events that should show the "New" badge.
 * @param {Object} args.conversionReportingEventWidgets Mapping of event => [metric slugs].
 * @return {Object}                                     Object with `selectedCounts`, `activeMetricItems`, and `newlyDetectedMetrics`.
 */
function useFilteredKeyMetrics({
  allMetricItems = {},
  isActive,
  effectiveSelection = [],
  answerBasedMetrics = [],
  selectedMetrics = [],
  newBadgeEvents = [],
  conversionReportingEventWidgets = {}
}) {
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    // Currently selected group does not include total selected number, so it will always be 0.
    const selectedCounts = {
      [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_METRICS_GROUP_CURRENT.SLUG]: 0
    };
    const activeMetricItems = {};
    const newlyDetectedMetrics = {};
    for (const metricItemSlug in allMetricItems) {
      const metricGroup = allMetricItems[metricItemSlug].group;
      if (metricGroup === isActive || isActive === _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_METRICS_GROUP_CURRENT.SLUG && effectiveSelection.includes(metricItemSlug)) {
        activeMetricItems[metricItemSlug] = allMetricItems[metricItemSlug];
      }
      if (isActive === _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_0__.KEY_METRICS_GROUP_SUGGESTED.SLUG && answerBasedMetrics.includes(metricItemSlug)) {
        if (answerBasedMetrics.includes(metricItemSlug)) {
          activeMetricItems[metricItemSlug] = allMetricItems[metricItemSlug];
        }
      }
      if (!selectedCounts[metricGroup]) {
        const selectedCount = Object.keys(allMetricItems).filter(slug => {
          // Check if metric slug is in selectedMetrics, so the group count is reflected in real time as metrics are checked/unchecked.
          if (allMetricItems[slug].group === metricGroup && selectedMetrics?.includes(slug)) {
            return true;
          }
          return false;
        }).length;
        selectedCounts[metricGroup] = selectedCount;
      }

      // Check if metric is conversion event related and if new badge should be included.
      if (newBadgeEvents?.length) {
        const isNewlyDetectedKeyMetrics = newBadgeEvents.some(conversionEvent => conversionReportingEventWidgets[conversionEvent].includes(metricItemSlug));
        if (isNewlyDetectedKeyMetrics) {
          var _newlyDetectedMetrics;
          newlyDetectedMetrics[metricGroup] = [...((_newlyDetectedMetrics = newlyDetectedMetrics[metricGroup]) !== null && _newlyDetectedMetrics !== void 0 ? _newlyDetectedMetrics : []), metricItemSlug];
        }
      }
    }
    return {
      selectedCounts,
      activeMetricItems,
      newlyDetectedMetrics
    };
  }, [allMetricItems, isActive, effectiveSelection, answerBasedMetrics, selectedMetrics, newBadgeEvents, conversionReportingEventWidgets]);
}

/***/ }),

/***/ "./js/components/KeyMetrics/hooks/useKeyMetricsGroups.js":
/*!***************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useKeyMetricsGroups.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useKeyMetricsGroups)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/**
 * The useKeyMetricsGroups hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Computes the key metrics groups and supporting flags for tailoring.
 *
 * @since 1.163.0
 *
 * @param {Object}  args                       Arguments.
 * @param {Array}   args.detectedEvents        Detected GA4 events.
 * @param {Array}   args.currentlyActiveEvents Currently active events from settings/user picks.
 * @param {boolean} args.isUserInputCompleted  Whether user input is completed.
 * @param {Array}   args.answerBasedMetrics    Tailored metrics based on answers/events.
 * @return {Object}                            Object with `hasGeneratingLeadsGroup`, `hasSellingProductsGroup`, `keyMetricsGroups`, and `dynamicGroups`.
 */
function useKeyMetricsGroups({
  detectedEvents = [],
  currentlyActiveEvents = [],
  isUserInputCompleted,
  answerBasedMetrics = []
}) {
  const hasGeneratingLeadsGroup = [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD].filter(item => detectedEvents?.includes(item) || currentlyActiveEvents?.includes(item));
  const hasSellingProductsGroup = [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.ENUM_CONVERSION_EVENTS.ADD_TO_CART, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.ENUM_CONVERSION_EVENTS.PURCHASE].filter(item => detectedEvents?.includes(item) || currentlyActiveEvents?.includes(item));
  const keyMetricsGroups = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
    return [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_VISITORS, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_DRIVING_TRAFFIC, ...(hasGeneratingLeadsGroup?.length ? [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_GENERATING_LEADS] : []), ...(hasSellingProductsGroup?.length ? [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_SELLING_PRODUCTS] : []), _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE];
  }, [hasGeneratingLeadsGroup, hasSellingProductsGroup]);
  const dynamicGroups = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
    if (isUserInputCompleted && answerBasedMetrics?.length) {
      return [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_CURRENT, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_SUGGESTED];
    }
    return [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.KEY_METRICS_GROUP_CURRENT];
  }, [isUserInputCompleted, answerBasedMetrics]);
  return {
    hasGeneratingLeadsGroup,
    hasSellingProductsGroup,
    keyMetricsGroups,
    dynamicGroups
  };
}

/***/ }),

/***/ "./js/components/KeyMetrics/hooks/useNewBadgeEvents.js":
/*!*************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useNewBadgeEvents.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useNewBadgeEvents)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/**
 * UseNewBadgeEvents hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */





/**
 * Returns the list of conversion events for which the "New" badge should be shown.
 *
 * Mirrors the logic previously in ChipTabGroup for computing `newBadgeEvents`.
 *
 * @since 1.163.0
 *
 * @return {Array<string>} List of events for which to show the "New" badge.
 */
function useNewBadgeEvents() {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const isGA4Connected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_2__.MODULE_SLUG_ANALYTICS_4);
    if (!isGA4Connected) {
      return [];
    }
    const detectedEvents = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getDetectedEvents();
    const badgeEvents = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getNewBadgeEvents();
    if (detectedEvents?.length && badgeEvents?.length) {
      const detectedLeadEvents = detectedEvents.filter(event => _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CONVERSION_REPORTING_LEAD_EVENTS.includes(event));
      const newLeadEvents = badgeEvents.filter(event => _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CONVERSION_REPORTING_LEAD_EVENTS.includes(event));
      const newNonLeadEvents = badgeEvents.filter(event => !_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CONVERSION_REPORTING_LEAD_EVENTS.includes(event));
      if (detectedLeadEvents?.length > 1 && newLeadEvents.length > 0) {
        return newNonLeadEvents;
      }
    }
    return badgeEvents;
  });
}

/***/ }),

/***/ "./js/components/KeyMetrics/hooks/useOverflowingTabs.js":
/*!**************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useOverflowingTabs.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useOverflowingTabs)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.js");
/**
 * The useOverflowingTabs hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Ensures that on small screens the last tab is visually cut off to imply
 * scroll, and wires up resize handling and open transitions.
 *
 * @since 1.163.0
 *
 * @param {Object}  args                              Arguments.
 * @param {Object}  args.containerRef                 Ref to the container element.
 * @param {boolean} args.isMobileBreakpoint           Whether current breakpoint is small.
 * @param {boolean} args.isSelectionPanelOpen         Current open state for selection panel.
 * @param {boolean} args.isSelectionPanelOpenPrevious Previous open state for selection panel.
 */
function useOverflowingTabs({
  containerRef,
  isMobileBreakpoint,
  isSelectionPanelOpen,
  isSelectionPanelOpenPrevious
}) {
  // It is not always clear that tabs are scrollable on mobile, so we need to ensure that the last tab item
  // is cutoff to indicate that there are more tabs to scroll to.
  const maybeCutOffLastTabItem = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    const scrollContainer = containerRef.current?.querySelector('.mdc-tab-scroller__scroll-content');
    if (!isMobileBreakpoint) {
      return;
    }
    const tabItems = containerRef.current?.querySelectorAll('.googlesitekit-chip-tab-group__tab-items .mdc-tab');
    if (!tabItems?.length || !scrollContainer) {
      return;
    }
    const containerRect = containerRef.current?.getBoundingClientRect();
    const visibleItems = [];
    tabItems.forEach((tabItem, index) => {
      const tabItemRect = tabItem.getBoundingClientRect();
      if (tabItemRect.left >= containerRect.left && tabItemRect.right <= containerRect.right) {
        visibleItems.push(index);
      }
    });
    const nextTabItem = tabItems[visibleItems.length];
    if (!nextTabItem) {
      return;
    }
    const nextTabItemRect = nextTabItem.getBoundingClientRect();

    // If the next tab item is either completely off-screen or only barely
    // visible (i.e. cut off by 15px or less, meaning most likely it is still
    // outside the visible area), reduce the column gap so that the last tab
    // item appears properly truncated.
    if (nextTabItemRect.left >= containerRect.right || nextTabItemRect.left - containerRect.right < 0 && -(nextTabItemRect.left - containerRect.right) <= 20) {
      // If there is an inline gap of 2px we already adjusted it once, and
      // the last item is still not cut off, we need to adjust the column
      // gap to 20px to ensure the last item is cut off.
      if (scrollContainer.style.columnGap === '2px') {
        scrollContainer.style.columnGap = '20px';
      } else {
        scrollContainer.style.columnGap = '2px';
      }
      maybeCutOffLastTabItem();
    }
  }, [containerRef, isMobileBreakpoint]);

  // Debounce the maybeCutOffLastTabItem function
  const debouncedMaybeCutOffLastTabItem = (0,_js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_0__.useDebounce)(maybeCutOffLastTabItem, 50);
  (0,react_use__WEBPACK_IMPORTED_MODULE_2__["default"])('resize', debouncedMaybeCutOffLastTabItem);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!isSelectionPanelOpenPrevious && isSelectionPanelOpen) {
      maybeCutOffLastTabItem();
    }
  }, [isSelectionPanelOpen, isSelectionPanelOpenPrevious, maybeCutOffLastTabItem]);
}

/***/ }),

/***/ "./js/components/KeyMetrics/index.js":
/*!*******************************************!*\
  !*** ./js/components/KeyMetrics/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ChangeMetricsLink: () => (/* reexport safe */ _ChangeMetricsLink__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   ChipTabGroup: () => (/* reexport safe */ _ChipTabGroup__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   InsufficientPermissionsError: () => (/* reexport safe */ _InsufficientPermissionsError__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   KeyMetricsSetupCTAWidget: () => (/* reexport safe */ _KeyMetricsSetupCTAWidget__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   MetricTileNumeric: () => (/* reexport safe */ _MetricTileNumeric__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   MetricTileTable: () => (/* reexport safe */ _MetricTileTable__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   MetricTileTablePlainText: () => (/* reexport safe */ _MetricTileTablePlainText__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   MetricTileText: () => (/* reexport safe */ _MetricTileText__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   MetricTileWrapper: () => (/* reexport safe */ _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_7__["default"])
/* harmony export */ });
/* harmony import */ var _ChangeMetricsLink__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ChangeMetricsLink */ "./js/components/KeyMetrics/ChangeMetricsLink.js");
/* harmony import */ var _InsufficientPermissionsError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./InsufficientPermissionsError */ "./js/components/KeyMetrics/InsufficientPermissionsError.js");
/* harmony import */ var _KeyMetricsSetupCTAWidget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./KeyMetricsSetupCTAWidget */ "./js/components/KeyMetrics/KeyMetricsSetupCTAWidget.js");
/* harmony import */ var _MetricTileNumeric__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MetricTileNumeric */ "./js/components/KeyMetrics/MetricTileNumeric.js");
/* harmony import */ var _MetricTileTable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MetricTileTable */ "./js/components/KeyMetrics/MetricTileTable.js");
/* harmony import */ var _MetricTileTablePlainText__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MetricTileTablePlainText */ "./js/components/KeyMetrics/MetricTileTablePlainText.js");
/* harmony import */ var _MetricTileText__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetricTileText */ "./js/components/KeyMetrics/MetricTileText.js");
/* harmony import */ var _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* harmony import */ var _ChipTabGroup__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ChipTabGroup */ "./js/components/KeyMetrics/ChipTabGroup/index.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */











/***/ }),

/***/ "./js/components/KeyMetrics/key-metrics-widgets.js":
/*!*********************************************************!*\
  !*** ./js/components/KeyMetrics/key-metrics-widgets.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   KEY_METRICS_WIDGETS: () => (/* binding */ KEY_METRICS_WIDGETS)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./shouldDisplayWidgetWithConversionEvent */ "./js/components/KeyMetrics/shouldDisplayWidgetWithConversionEvent.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./js/components/KeyMetrics/constants.js");
/**
 * Key Metrics widgets metadata.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */






/**
 * Determines whether to show a widget the requires Analytics 4 and AdSense to be linked.
 *
 * For admin dashboards, the widget will be shown if both modules are activate so that
 * the connection CTA can be shown if they have not been linked.
 *
 * For view-only dashboards, the widget will only be displayed if both modules are linked.
 *
 * @since 1.121.0
 *
 * @param {Object}   options                     Options object.
 * @param {Function} options.select              Data store select function.
 * @param {boolean}  options.isViewOnlyDashboard Whether the current dashboard is view only.
 * @return {boolean} Whether to display the widget.
 */
function shouldDisplayWidgetWithAnalytics4AndAdSenseLinked({
  select,
  isViewOnlyDashboard
}) {
  if (!isViewOnlyDashboard) {
    return true;
  }
  if (isViewOnlyDashboard && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getAdSenseLinked()) {
    return true;
  }
  return false;
}

/**
 * Determines whether to display a widget that requires custom dimensions in the key
 * metrics selection panel.
 *
 * All widgets are displayed in authenticated dashboard. However, in view only dashboard,
 * widgets that require custom dimensions will only be displayed if the required custom
 * dimensions are available in the shared property.
 *
 * This function is attached to the widget object that requires the custom dimensions and
 * has the `requiredCustomDimensions` property.
 *
 * @since 1.113.0
 *
 * @param {Object}   options                     Options object.
 * @param {Function} options.select              Data store select function.
 * @param {boolean}  options.isViewOnlyDashboard Whether the current dashboard is view only.
 * @return {boolean} Whether to display the widget.
 */
function shouldDisplayWidgetWithCustomDimensions({
  select,
  isViewOnlyDashboard
}) {
  if (!isViewOnlyDashboard) {
    return true;
  }
  return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).hasCustomDimensions(
  // This property is available to the widget object that requires the
  // custom dimensions, where the function is attached.
  this.requiredCustomDimensions);
}
const KEY_METRICS_WIDGETS = {
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top earning pages', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages that generated the most AdSense revenue', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages that generated the most AdSense revenue', 'google-site-kit'),
    displayInSelectionPanel: shouldDisplayWidgetWithAnalytics4AndAdSenseLinked,
    displayInList: shouldDisplayWidgetWithAnalytics4AndAdSenseLinked,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top recent trending pages', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages with the most pageviews published in the last 3 days', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages with the most pageviews published in the last 3 days', 'google-site-kit'),
    requiredCustomDimensions: ['googlesitekit_post_date'],
    displayInSelectionPanel: shouldDisplayWidgetWithCustomDimensions,
    displayInWidgetArea: shouldDisplayWidgetWithCustomDimensions,
    displayInList: shouldDisplayWidgetWithCustomDimensions,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_POPULAR_AUTHORS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Most popular authors by pageviews', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Authors whose posts got the most visits', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Authors whose posts got the most visits', 'google-site-kit'),
    requiredCustomDimensions: ['googlesitekit_post_author'],
    displayInSelectionPanel: shouldDisplayWidgetWithCustomDimensions,
    displayInWidgetArea: shouldDisplayWidgetWithCustomDimensions,
    displayInList: shouldDisplayWidgetWithCustomDimensions,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_CATEGORIES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top categories by pageviews', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Categories that your site visitors viewed the most', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Categories that your site visitors viewed the most', 'google-site-kit'),
    requiredCustomDimensions: ['googlesitekit_post_categories'],
    displayInSelectionPanel: shouldDisplayWidgetWithCustomDimensions,
    displayInWidgetArea: shouldDisplayWidgetWithCustomDimensions,
    displayInList: shouldDisplayWidgetWithCustomDimensions,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_POPULAR_CONTENT]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Most popular content by pageviews', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages that brought in the most visitors', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages your visitors read the most', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_POPULAR_PRODUCTS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Most popular products by pageviews', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Products that brought in the most visitors', 'google-site-kit'),
    requiredCustomDimensions: ['googlesitekit_post_type'],
    displayInSelectionPanel: ({
      select
    }) => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_POPULAR_PRODUCTS) || select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getProductPostType(),
    displayInWidgetArea: shouldDisplayWidgetWithCustomDimensions,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_PAGES_PER_VISIT]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages per visit', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Number of pages visitors viewed per session on average', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Number of pages visitors viewed per session on average', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_VISIT_LENGTH]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Visit length', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Average duration of engaged visits', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Average duration of engaged visits', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_VISITS_PER_VISITOR]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Visits per visitor', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Average number of sessions per site visitor', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Average number of sessions per site visitor', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_MOST_ENGAGING_PAGES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Most engaging pages', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages with the highest engagement rate', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages with the highest engagement rate', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_LEAST_ENGAGING_PAGES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Least engaging pages', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages with the highest percentage of visitors that left without engagement with your site', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Percentage of visitors that left without engagement with your site', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top pages by returning visitors', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages that attracted the most returning visitors', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages that attracted the most returning visitors', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_NEW_VISITORS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('New visitors', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('How many new visitors you got and how the overall audience changed', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Portion of visitors who visited your site for the first time in this timeframe', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_RETURNING_VISITORS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Returning visitors', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Portion of people who visited your site more than once', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Portion of your site’s visitors that returned at least once in this timeframe', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic source', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel which brought in the most visitors to your site', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel (e.g. social, paid, search) that brought in the most visitors to your site', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic source driving add to cart', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel which brought in the most add to cart events to your site', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel (e.g. social, paid, search) that brought in the most add to cart events to your site', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.ADD_TO_CART],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic source driving leads', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel which brought in the most leads to your site', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel (e.g. social, paid, search) that brought in the most leads to your site', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_GENERATING_LEADS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic source driving purchases', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel which brought in the most purchases to your site', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel (e.g. social, paid, search) that brought in the most purchases to your site', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.PURCHASE],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Most engaged traffic source', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Visitors coming via this channel spent the most time on your site', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel (e.g. social, paid, search) that brought in the most visitors who had a meaningful engagement with your site', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top converting traffic source', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel which brought in the most visits that resulted in key events', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Channel (e.g. social, paid, search) that brought in visitors who generated the most key events', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_CITIES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top cities driving traffic', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which cities you get the most visitors from', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The cities where most of your visitors came from', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top cities driving leads', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cities driving the most contact form submissions', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cities driving the most contact form submissions', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_GENERATING_LEADS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top cities driving add to cart', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cities where visitors most frequently add products to their carts', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cities where visitors most frequently add products to their carts', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.ADD_TO_CART],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top cities driving purchases', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cities driving the most purchases', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cities driving the most purchases', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.PURCHASE],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top device driving purchases', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top device driving the most purchases', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top device driving the most purchases', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.PURCHASE],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_COUNTRIES]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top countries driving traffic', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which countries you get the most visitors from', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The countries where most of your visitors came from', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_SEARCH_CONSOLE_POPULAR_KEYWORDS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top performing keywords', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('What people searched for before they came to your site', 'google-site-kit'),
    infoTooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The top search queries for your site by highest clickthrough rate', 'google-site-kit'),
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS]: {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top pages driving leads', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pages on which forms are most frequently submitted', 'google-site-kit'),
    requiredConversionEventName: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD],
    displayInSelectionPanel: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_4__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_5__.KEY_METRICS_GROUP_GENERATING_LEADS.SLUG
    }
  }
};


/***/ }),

/***/ "./js/components/KeyMetrics/shouldDisplayWidgetWithConversionEvent.js":
/*!****************************************************************************!*\
  !*** ./js/components/KeyMetrics/shouldDisplayWidgetWithConversionEvent.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   shouldDisplayWidgetWithConversionEvent: () => (/* binding */ shouldDisplayWidgetWithConversionEvent)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/**
 * Key Metrics shouldDisplayWidgetWithConversionEvent function.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */



/**
 * Determines whether to display a widget that requires conversion reporting events
 * in the key metrics selection panel.
 *
 * This function is attached to the widget object that requires the conversion reporting events and
 * has the `requiredConversionEventName` property.
 *
 * @since 1.136.0
 * @since 1.137.0 Moved function to its own file.
 *
 * @param {Object}   options        Options object.
 * @param {Function} options.select Data store select function.
 * @param {string}   options.slug   Key metric widget slug.
 * @return {boolean} Whether to display the widget.
 */
function shouldDisplayWidgetWithConversionEvent({
  select,
  slug
}) {
  return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).hasConversionReportingEvents(
  // This property is available to the widget object that requires the
  // conversion reporting events, where the function is attached.
  this.requiredConversionEventName) || select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_0__.CORE_USER).isKeyMetricActive(slug);
}

/***/ }),

/***/ "./js/components/Link.js":
/*!*******************************!*\
  !*** ./js/components/Link.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var react_router_dom__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-router-dom */ "../node_modules/react-router-dom/esm/react-router-dom.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _svg_icons_arrow_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/arrow.svg */ "./svg/icons/arrow.svg");
/* harmony import */ var _svg_icons_arrow_inverse_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/arrow-inverse.svg */ "./svg/icons/arrow-inverse.svg");
/* harmony import */ var _svg_icons_back_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/back.svg */ "./svg/icons/back.svg");
/* harmony import */ var _svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/icons/external.svg */ "./svg/icons/external.svg");
/* harmony import */ var _IconWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IconWrapper */ "./js/components/IconWrapper.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Link component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






const BUTTON = 'BUTTON';
const BUTTON_DISABLED = 'BUTTON_DISABLED';
const EXTERNAL_LINK = 'EXTERNAL_LINK';
const LINK = 'LINK';
const ROUTER_LINK = 'ROUTER_LINK';
const Link = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.forwardRef)((props, ref) => {
  const {
    'aria-label': ariaLabelProp,
    secondary = false,
    arrow = false,
    back = false,
    caps = false,
    children,
    className = '',
    danger = false,
    disabled = false,
    external = false,
    hideExternalIndicator = false,
    href = '',
    inverse = false,
    noFlex = false,
    onClick,
    small = false,
    standalone = false,
    linkButton = false,
    to,
    leadingIcon,
    trailingIcon,
    ...otherProps
  } = props;
  function getType() {
    // Force button element if `onClick` prop is passed and there's no `href`
    // or `to` prop.
    if (!href && !to && onClick) {
      if (disabled) {
        return BUTTON_DISABLED;
      }
      return BUTTON;
    }

    // Only `RouterLink` uses the `to` prop.
    if (to) {
      return ROUTER_LINK;
    }

    // The external prop means this is an external link, which will also output
    // an `<a>` tag.
    if (external) {
      return EXTERNAL_LINK;
    }

    // A regular `<a>` tag without external indicators.
    return LINK;
  }
  const type = getType();
  function getLinkComponent() {
    if (type === BUTTON || type === BUTTON_DISABLED) {
      return 'button';
    }
    if (type === ROUTER_LINK) {
      return react_router_dom__WEBPACK_IMPORTED_MODULE_9__.Link;
    }
    return 'a';
  }
  function getAriaLabel() {
    // Otherwise, create an ARIA label if the link opens in a new window
    // or is disabled, to add extra context to the link.
    let labelSuffix;
    if (type === EXTERNAL_LINK) {
      labelSuffix = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('(opens in a new tab)', 'screen reader text', 'google-site-kit');
    }
    if (type === BUTTON_DISABLED) {
      labelSuffix = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('(disabled)', 'screen reader text', 'google-site-kit');
    }
    if (!labelSuffix) {
      return ariaLabelProp;
    }

    // If an ARIA label was supplied, use that.
    if (ariaLabelProp) {
      return `${ariaLabelProp} ${labelSuffix}`;
    }

    // Otherwise, use the children prop if it's a string.
    if (typeof children === 'string') {
      return `${children} ${labelSuffix}`;
    }

    // If there isn't a string we can use to create the label, we shouldn't
    // make one; otherwise we'll only create an ARIA label that says
    // "(opens in a new tab)", which is not good.
    return undefined;
  }
  const LinkComponent = getLinkComponent();
  const ariaLabel = getAriaLabel();

  // Set the prefix/suffix icons, based on the type of link this is and
  // the props supplied.
  let leadingIconToUse = leadingIcon;
  let trailingIconToUse = trailingIcon;
  if (back) {
    leadingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_svg_icons_back_svg__WEBPACK_IMPORTED_MODULE_4__["default"], {
      width: 14,
      height: 14
    });
  }
  if (external && !hideExternalIndicator) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_5__["default"], {
      width: 14,
      height: 14
    });
  }
  if (arrow && !inverse) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_svg_icons_arrow_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
      width: 14,
      height: 14
    });
  }
  if (arrow && inverse) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_svg_icons_arrow_inverse_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
      width: 14,
      height: 14
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(LinkComponent, {
    "aria-label": ariaLabel,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-cta-link', className, {
      'googlesitekit-cta-link--secondary': secondary,
      'googlesitekit-cta-link--inverse': inverse,
      'googlesitekit-cta-link--small': small,
      'googlesitekit-cta-link--caps': caps,
      'googlesitekit-cta-link--danger': danger,
      'googlesitekit-cta-link--disabled': disabled,
      'googlesitekit-cta-link--standalone': standalone,
      'googlesitekit-cta-link--link-button': linkButton,
      'googlesitekit-cta-link--no-flex': !!noFlex
    }),
    disabled: disabled,
    href: (type === LINK || type === EXTERNAL_LINK) && !disabled ? href : undefined,
    onClick: onClick,
    rel: type === EXTERNAL_LINK ? 'noopener noreferrer' : undefined,
    ref: ref,
    target: type === EXTERNAL_LINK ? '_blank' : undefined,
    to: to,
    ...otherProps,
    children: [!!leadingIconToUse && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_IconWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
      marginRight: 5,
      children: leadingIconToUse
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
      className: "googlesitekit-cta-link__contents",
      children: children
    }), !!trailingIconToUse && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_IconWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
      marginLeft: 5,
      children: trailingIconToUse
    })]
  });
});
Link.propTypes = {
  arrow: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  back: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  caps: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
  danger: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  hideExternalIndicator: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
  inverse: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  leadingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().node),
  linkButton: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  noFlex: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func),
  small: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  standalone: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  to: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
  trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().node)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Link);

/***/ }),

/***/ "./js/components/LoadingWrapper.js":
/*!*****************************************!*\
  !*** ./js/components/LoadingWrapper.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ LoadingWrapper)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _PreviewBlock__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * LoadingWrapper component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


function LoadingWrapper({
  loading,
  children,
  ...previewBlockProps
}) {
  if (loading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      ...previewBlockProps
    });
  }
  return children;
}
LoadingWrapper.propTypes = {
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  ..._PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"].propTypes
};

/***/ }),

/***/ "./js/components/Logo.js":
/*!*******************************!*\
  !*** ./js/components/Logo.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _svg_graphics_logo_g_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/svg/graphics/logo-g.svg */ "./svg/graphics/logo-g.svg");
/* harmony import */ var _svg_graphics_logo_sitekit_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/graphics/logo-sitekit.svg */ "./svg/graphics/logo-sitekit.svg");
/* harmony import */ var _VisuallyHidden__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./VisuallyHidden */ "./js/components/VisuallyHidden.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Logo component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




function Logo() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
    className: "googlesitekit-logo",
    "aria-hidden": "true",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_svg_graphics_logo_g_svg__WEBPACK_IMPORTED_MODULE_1__["default"], {
      className: "googlesitekit-logo__logo-g",
      height: "34",
      width: "32"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_svg_graphics_logo_sitekit_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
      className: "googlesitekit-logo__logo-sitekit",
      height: "26",
      width: "99"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_VisuallyHidden__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit by Google Logo', 'google-site-kit')
    })]
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Logo);

/***/ }),

/***/ "./js/components/MediaErrorHandler/index.js":
/*!**************************************************!*\
  !*** ./js/components/MediaErrorHandler/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MediaErrorHandler component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */


class MediaErrorHandler extends _wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Component {
  constructor(props) {
    super(props);
    this.state = {
      error: null
    };
  }
  componentDidCatch(error, info) {
    __webpack_require__.g.console.error('Caught an error:', error, info);
    this.setState({
      error
    });
  }
  render() {
    const {
      children,
      errorMessage
    } = this.props;
    const {
      error
    } = this.state;

    // If there is no caught error, render the children components normally.
    if (!error) {
      return children;
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_1__["default"], {
      message: errorMessage
    });
  }
}
MediaErrorHandler.defaultProps = {
  errorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to load media', 'google-site-kit')
};
MediaErrorHandler.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().node).isRequired,
  errorMessage: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MediaErrorHandler);

/***/ }),

/***/ "./js/components/ModalDialog.js":
/*!**************************************!*\
  !*** ./js/components/ModalDialog.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _svg_icons_warning_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/warning.svg */ "./svg/icons/warning.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModalDialog component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */



function ModalDialog({
  className = '',
  dialogActive = false,
  handleCancel = null,
  onOpen = null,
  onClose = null,
  title = null,
  provides,
  handleConfirm,
  subtitle,
  confirmButton = null,
  notes = [],
  danger = false,
  inProgress = false,
  small = false,
  medium = false,
  buttonLink = null
}) {
  const instanceID = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_5__["default"])(ModalDialog);
  const describedByID = `googlesitekit-dialog-description-${instanceID}`;
  const hasProvides = !!(provides && provides.length);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Dialog, {
    open: dialogActive,
    onOpen: onOpen,
    onClose: onClose,
    "aria-describedby": hasProvides ? describedByID : undefined,
    tabIndex: "-1",
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, {
      'googlesitekit-dialog-sm': small,
      'googlesitekit-dialog-md': medium
    }),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.DialogTitle, {
      children: [danger && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_svg_icons_warning_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
        width: 28,
        height: 28
      }), title]
    }),
    // Ensure we don't render anything at all if subtitle is falsy, as Dialog expects all its children to be elements and a falsy value will result in an error.
    subtitle ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
      className: "mdc-dialog__lead",
      children: subtitle
    }) : [], /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.DialogContent, {
      children: [hasProvides && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("section", {
        id: describedByID,
        className: "mdc-dialog__provides",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ul", {
          className: "mdc-list mdc-list--underlined mdc-list--non-interactive",
          children: provides.map(attribute => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", {
            className: "mdc-list-item",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
              className: "mdc-list-item__text",
              children: attribute
            })
          }, attribute))
        })
      }), notes.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("section", {
        className: "mdc-dialog__notes",
        children: notes.map((Note, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("p", {
          className: "mdc-dialog__note",
          children: [typeof Note === 'string' && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s is replaced with some sub-note text. */
          (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('<strong>Note:</strong> %s', 'google-site-kit'), Note), {
            strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("strong", {})
          }), typeof Note === 'function' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Note, {})]
        }, `note-${index}`))
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.DialogFooter, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        className: "mdc-dialog__cancel-button",
        onClick: handleCancel,
        disabled: inProgress,
        tertiary: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cancel', 'google-site-kit')
      }), buttonLink ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        href: buttonLink,
        onClick: handleConfirm,
        target: "_blank",
        danger: danger,
        children: confirmButton
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.SpinnerButton, {
        onClick: handleConfirm,
        danger: danger,
        disabled: inProgress,
        isSaving: inProgress,
        children: confirmButton || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Disconnect', 'google-site-kit')
      })]
    })]
  });
}
ModalDialog.displayName = 'Dialog';
ModalDialog.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  dialogActive: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  handleDialog: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func),
  handleConfirm: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func).isRequired,
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func),
  onClose: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  provides: prop_types__WEBPACK_IMPORTED_MODULE_7___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_7___default().string)),
  confirmButton: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  notes: prop_types__WEBPACK_IMPORTED_MODULE_7___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_7___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_7___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_7___default().elementType)])),
  danger: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  small: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  medium: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  buttonLink: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ModalDialog);

/***/ }),

/***/ "./js/components/NewBadge.js":
/*!***********************************!*\
  !*** ./js/components/NewBadge.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Badge__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Badge */ "./js/components/Badge.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * NewBadge component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




function NewBadge({
  tooltipTitle,
  learnMoreLink,
  forceOpen,
  hasLeftSpacing,
  hasNoSpacing,
  onLearnMoreClick = () => {}
}) {
  const badgeComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Badge__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-new-badge', {
      'googlesitekit-new-badge--has-no-spacing': hasNoSpacing
    }),
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New', 'google-site-kit'),
    hasLeftSpacing: hasLeftSpacing
  });
  if (!tooltipTitle) {
    return badgeComponent;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Tooltip, {
    tooltipClassName: "googlesitekit-new-badge__tooltip",
    title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.Fragment, {
      children: [tooltipTitle, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: learnMoreLink,
        onClick: onLearnMoreClick,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more', 'google-site-kit')
      })]
    }),
    placement: "top",
    enterTouchDelay: 0,
    leaveTouchDelay: 5000,
    open: forceOpen,
    interactive: true,
    children: badgeComponent
  });
}
NewBadge.propTypes = {
  tooltipTitle: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  learnMoreLink: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  forceOpen: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  onLearnMoreClick: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func),
  hasLeftSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  hasNoSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NewBadge);

/***/ }),

/***/ "./js/components/Notice/CTAButton.js":
/*!*******************************************!*\
  !*** ./js/components/Notice/CTAButton.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CTAButton)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/external.svg */ "./svg/icons/external.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */



function CTAButton({
  label,
  disabled,
  inProgress,
  onClick,
  href,
  external = false,
  hideExternalIndicator = false
}) {
  let trailingIconToUse;
  if (external && !hideExternalIndicator) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
      width: 14,
      height: 14
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.SpinnerButton, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice__cta', {
      'googlesitekit-notice__cta--spinner__running': inProgress
    }),
    disabled: disabled,
    isSaving: inProgress,
    onClick: onClick,
    href: href,
    target: external ? '_blank' : undefined,
    trailingIcon: trailingIconToUse,
    children: label
  });
}
CTAButton.propTypes = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string).isRequired,
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
  inProgress: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
  hideExternalIndicator: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool)
};

/***/ }),

/***/ "./js/components/Notice/Description.js":
/*!*********************************************!*\
  !*** ./js/components/Notice/Description.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Description)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function Description({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice__description', className),
    children: children
  });
}
Description.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};

/***/ }),

/***/ "./js/components/Notice/DismissButton.js":
/*!***********************************************!*\
  !*** ./js/components/Notice/DismissButton.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DismissButton)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function DismissButton({
  label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Got it', 'google-site-kit'),
  onClick,
  disabled,
  href,
  external = false
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
    onClick: onClick,
    disabled: disabled,
    href: href,
    target: external ? '_blank' : undefined,
    tertiary: true,
    children: label
  });
}
DismissButton.propTypes = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func).isRequired,
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
};

/***/ }),

/***/ "./js/components/Notice/Icon.js":
/*!**************************************!*\
  !*** ./js/components/Notice/Icon.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Icon)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _svg_icons_check_fill_svg__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/svg/icons/check-fill.svg */ "./svg/icons/check-fill.svg");
/* harmony import */ var _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/svg/icons/warning-notice.svg */ "./svg/icons/warning-notice.svg");
/* harmony import */ var _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/star-fill.svg */ "./svg/icons/star-fill.svg");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/components/Notice/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */





const typeIconMap = {
  [_constants__WEBPACK_IMPORTED_MODULE_3__.TYPES.NEW]: _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_3__.TYPES.SUCCESS]: _svg_icons_check_fill_svg__WEBPACK_IMPORTED_MODULE_0__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_3__.TYPES.INFO]: _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_1__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_3__.TYPES.WARNING]: _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_1__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_3__.TYPES.ERROR]: _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_1__["default"]
};
function Icon({
  type
}) {
  const IconComponent = typeIconMap[type] || _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_1__["default"];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(IconComponent, {
    width: 24,
    height: 24
  });
}
Icon.propTypes = {
  type: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOf(Object.values(_constants__WEBPACK_IMPORTED_MODULE_3__.TYPES))
};

/***/ }),

/***/ "./js/components/Notice/Title.js":
/*!***************************************!*\
  !*** ./js/components/Notice/Title.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Title)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function Title({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice__title', className),
    children: children
  });
}
Title.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};

/***/ }),

/***/ "./js/components/Notice/constants.js":
/*!*******************************************!*\
  !*** ./js/components/Notice/constants.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   TYPES: () => (/* binding */ TYPES)
/* harmony export */ });
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const TYPES = {
  NEW: 'new',
  SUCCESS: 'success',
  WARNING: 'warning',
  INFO: 'info',
  // Grey background
  INFO_ALT: 'info-alt',
  // White background
  INFO_ALT_2: 'info-alt-2',
  // Black background
  ERROR: 'error'
};

/***/ }),

/***/ "./js/components/Notice/index.js":
/*!***************************************!*\
  !*** ./js/components/Notice/index.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Icon */ "./js/components/Notice/Icon.js");
/* harmony import */ var _Title__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Title */ "./js/components/Notice/Title.js");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Description */ "./js/components/Notice/Description.js");
/* harmony import */ var _CTAButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CTAButton */ "./js/components/Notice/CTAButton.js");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DismissButton */ "./js/components/Notice/DismissButton.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ "./js/components/Notice/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







const Notice = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.forwardRef)(({
  className,
  title,
  description,
  dismissButton,
  ctaButton,
  type = _constants__WEBPACK_IMPORTED_MODULE_6__.TYPES.INFO,
  children,
  hideIcon
}, ref) => {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
    className: "googlesitekit-notice-container",
    ref: ref,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice', `googlesitekit-notice--${type}`, className),
      children: [!hideIcon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
        className: "googlesitekit-notice__icon",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_Icon__WEBPACK_IMPORTED_MODULE_1__["default"], {
          type: type
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
        className: "googlesitekit-notice__content",
        children: [title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_Title__WEBPACK_IMPORTED_MODULE_2__["default"], {
          children: title
        }), description && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_Description__WEBPACK_IMPORTED_MODULE_3__["default"], {
          children: description
        })]
      }), (dismissButton?.label || dismissButton?.onClick || ctaButton?.label && (ctaButton?.onClick || ctaButton?.href) || children) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
        className: "googlesitekit-notice__action",
        children: [children, (dismissButton?.label || dismissButton?.onClick) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_DismissButton__WEBPACK_IMPORTED_MODULE_5__["default"], {
          label: dismissButton.label,
          onClick: dismissButton.onClick,
          disabled: dismissButton.disabled,
          href: dismissButton.href,
          external: dismissButton.external
        }), ctaButton?.label && (ctaButton?.onClick || ctaButton?.href) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_CTAButton__WEBPACK_IMPORTED_MODULE_4__["default"], {
          label: ctaButton.label,
          onClick: ctaButton.onClick,
          inProgress: ctaButton.inProgress,
          disabled: ctaButton.disabled,
          href: ctaButton.href,
          external: ctaButton.external,
          hideExternalIndicator: ctaButton.hideExternalIndicator
        })]
      })]
    })
  });
});
Notice.TYPES = _constants__WEBPACK_IMPORTED_MODULE_6__.TYPES;
Notice.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().string),
  title: prop_types__WEBPACK_IMPORTED_MODULE_9___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_9___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_9___default().object)]),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().node),
  type: prop_types__WEBPACK_IMPORTED_MODULE_9___default().oneOf(Object.values(_constants__WEBPACK_IMPORTED_MODULE_6__.TYPES)),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_9___default().shape(_DismissButton__WEBPACK_IMPORTED_MODULE_5__["default"].propTypes),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_9___default().shape({
    ..._CTAButton__WEBPACK_IMPORTED_MODULE_4__["default"].propTypes,
    label: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().string) // CTAButton label should not be required for this parent component.
  }),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().node),
  hideIcon: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Notice);

/***/ }),

/***/ "./js/components/NotificationFromServer.js":
/*!*************************************************!*\
  !*** ./js/components/NotificationFromServer.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/BannerNotification */ "./js/googlesitekit/notifications/components/layout/BannerNotification.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * NotificationFromServer component.
 *
 * Component used to render notifications from the server, such as
 * those from `CORE_SITE` or `MODULES_*` data stores.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Maps props received from the server (e.g. from a `select( CORE_SITE ).getNotifications()`
 * selector call) to the props expected by the new BannerNotification component.
 *
 * @since 1.157.0
 *
 * @param {Object}     props                     Component props.
 * @param {string}     props.id                  Notification ID/slug.
 * @param {?ReactNode} props.titleIcon           Icon to display above the title.
 * @param {string}     props.title               Notification title/heading.
 * @param {?ReactNode} props.content             Description for notification.
 * @param {string}     props.ctaLabel            Label for the call-to-action button.
 * @param {?string}    props.ctaTarget           `target` for the call-to-action link, e.g. `_blank`. Optional.
 * @param {?string}    props.ctaURL              URL for the call-to-action link.
 * @param {?boolean}   props.dismissible         Whether the notification is dismissible. Optional.
 * @param {?string}    props.dismissLabel        Label for the dismiss button. Optional.
 * @param {?string}    props.learnMoreLabel      Label for the "Learn More" link. Optional.
 * @param {?string}    props.learnMoreURL        URL for the "Learn More" link. Optional.
 * @param {?Function}  props.onCTAClick          Callback to run when CTA is clicked. Optional.
 * @param {?Function}  props.onDismissClick      Callback to run when the Dismiss button is clicked. Optional.
 * @param {?Object}    props.gaTrackingEventArgs Custom GA tracking event category and label options. Optional.
 * @return {JSX.Element} Notification component.
 */

function NotificationFromServer({
  id,
  titleIcon,
  title,
  content,
  ctaLabel,
  ctaTarget,
  ctaURL,
  dismissible,
  dismissLabel,
  learnMoreLabel,
  learnMoreURL,
  onCTAClick,
  onDismissClick,
  gaTrackingEventArgs
}) {
  // Notifications from the server should not be dismissed permanently in the database.
  // CoreSiteBannerNotifications are "marked as accepted/dismissed" on the server.
  // AdSense Alerts are not dismissed permanently either, they keep coming back until the
  // issue that raises the alert is resolved. Thus we expire the dismissal after an hour,
  // which was the behaviour prevalent in the legacy BannerNotification component that cached
  // dismissals for an hour in browser storage.
  const dismissOptions = {
    expiresInSeconds: _js_util__WEBPACK_IMPORTED_MODULE_1__.HOUR_IN_SECONDS
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_0__["default"], {
    notificationID: id,
    type: _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_0__.TYPES.WARNING,
    titleIcon: titleIcon ? titleIcon : undefined,
    title: title,
    description: content,
    learnMoreLink: learnMoreURL ? {
      label: learnMoreLabel,
      href: learnMoreURL
    } : undefined,
    ctaButton: {
      label: ctaLabel,
      href: ctaURL,
      onClick: onCTAClick,
      dismissOptions,
      // In the case of notifications, other `target="_blank"` CTA URLs
      // are external, and adding a new, more explicit/clear `external`
      // prop would be a refactor of the service, JS, and PHP code all
      // for mildly more "intuitive" prop names/API.
      //
      // In this case it's not worth the refactor (as of writing this
      // logic), so we allow for any "open in a new window" URLs
      // to also be "external".
      external: ctaTarget === '_blank'
    },
    dismissButton: dismissible ? {
      label: dismissLabel,
      onClick: onDismissClick,
      dismissOptions
    } : undefined,
    gaTrackingEventArgs: gaTrackingEventArgs
  });
}
NotificationFromServer.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string).isRequired,
  content: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node),
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  ctaTarget: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  ctaURL: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  dismissible: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  dismissLabel: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  learnMoreLabel: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  learnMoreURL: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  onCTAClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  onDismissClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  gaTrackingEventArgs: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NotificationFromServer);

/***/ }),

/***/ "./js/components/Null.js":
/*!*******************************!*\
  !*** ./js/components/Null.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Null)
/* harmony export */ });
/**
 * Null component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

function Null() {
  return null;
}

/***/ }),

/***/ "./js/components/OptIn/LayoutDefault.js":
/*!**********************************************!*\
  !*** ./js/components/OptIn/LayoutDefault.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ LayoutDefault)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OptIn LayoutDefault component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


function LayoutDefault({
  checkboxProps,
  label
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.Checkbox, {
    ...checkboxProps,
    children: label
  });
}
LayoutDefault.propTypes = {
  checkboxProps: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object).isRequired,
  label: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node).isRequired
};

/***/ }),

/***/ "./js/components/OptIn/LayoutStacked.js":
/*!**********************************************!*\
  !*** ./js/components/OptIn/LayoutStacked.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ LayoutStacked)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OptIn LayoutStacked component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function LayoutStacked({
  checkboxProps,
  title,
  description
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.Checkbox, {
      ...checkboxProps,
      children: title
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
      className: "googlesitekit-opt-in__description",
      children: description
    })]
  });
}
LayoutStacked.propTypes = {
  checkboxProps: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node).isRequired,
  description: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node).isRequired
};

/***/ }),

/***/ "./js/components/OptIn/index.js":
/*!**************************************!*\
  !*** ./js/components/OptIn/index.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ OptIn)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_13__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_util_tracking__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/tracking */ "./js/util/tracking/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.js");
/* harmony import */ var _LayoutDefault__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./LayoutDefault */ "./js/components/OptIn/LayoutDefault.js");
/* harmony import */ var _LayoutStacked__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./LayoutStacked */ "./js/components/OptIn/LayoutStacked.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OptIn component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */









const DEFAULT_LAYOUT = 'default';
const STACKED_LAYOUT = 'stacked';
function OptIn({
  id = 'googlesitekit-opt-in',
  name = 'optIn',
  className,
  layout = DEFAULT_LAYOUT,
  title = null,
  description = null,
  trackEventCategory,
  trackEventAction = 'tracking_optin'
}) {
  const [checked, setChecked] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useState)();
  const enabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isTrackingEnabled());
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getErrorForAction('setTrackingEnabled', [!enabled]));
  const {
    setTrackingEnabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const handleOptIn = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(async isChecked => {
    const {
      response,
      error: responseError
    } = await setTrackingEnabled(isChecked);
    if (!responseError) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_4__.toggleTracking)(response.enabled);
      if (response.enabled) {
        (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(trackEventCategory || viewContext, trackEventAction);
      }
    } else {
      setChecked(enabled);
    }
  }, [enabled, setTrackingEnabled, trackEventCategory, trackEventAction, viewContext]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
    if (enabled !== undefined && checked === undefined) {
      setChecked(enabled);
    }
  }, [enabled, checked]);
  const debouncedHandleOptIn = (0,_js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_7__.useDebounce)(handleOptIn, 300);
  const handleCheck = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(event => {
    const isChecked = event.target.checked;
    setChecked(isChecked);
    debouncedHandleOptIn(isChecked);
  }, [debouncedHandleOptIn]);
  const labelTitle = title !== null && title !== void 0 ? title : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Help us improve Site Kit by sharing anonymous usage data.', 'google-site-kit')
  });
  const labelDescription = description !== null && description !== void 0 ? description : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_12__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('<span>All collected data is treated in accordance with the <a>Google Privacy Policy</a></span>', 'google-site-kit'), {
    a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
      href: "https://policies.google.com/privacy",
      external: true
    }, "link"),
    span: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {})
  });
  const checkboxProps = {
    id,
    name,
    value: '1',
    checked,
    onChange: handleCheck,
    loading: enabled === undefined
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-opt-in', className, layout === STACKED_LAYOUT && 'googlesitekit-opt-in--layout-stacked'),
    children: [layout === STACKED_LAYOUT ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_LayoutStacked__WEBPACK_IMPORTED_MODULE_9__["default"], {
      checkboxProps: checkboxProps,
      title: labelTitle,
      description: labelDescription
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_LayoutDefault__WEBPACK_IMPORTED_MODULE_8__["default"], {
      checkboxProps: checkboxProps,
      label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
        children: [labelTitle, " ", labelDescription]
      })
    }), error?.message && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "googlesitekit-error-text",
      children: error?.message
    })]
  });
}
OptIn.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string),
  name: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().node),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().node),
  layout: prop_types__WEBPACK_IMPORTED_MODULE_13___default().oneOf([DEFAULT_LAYOUT, STACKED_LAYOUT]),
  trackEventCategory: (prop_types__WEBPACK_IMPORTED_MODULE_13___default().string)
};

/***/ }),

/***/ "./js/components/OverlayCard/Body.js":
/*!*******************************************!*\
  !*** ./js/components/OverlayCard/Body.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Body)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _Title__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Title */ "./js/components/OverlayCard/Title.js");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Description */ "./js/components/OverlayCard/Description.js");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DismissButton */ "./js/components/OverlayCard/DismissButton.js");
/* harmony import */ var _CTAButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CTAButton */ "./js/components/OverlayCard/CTAButton.js");
/* harmony import */ var _js_components_NewBadge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/NewBadge */ "./js/components/NewBadge.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OverlayCard Body component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







function Body({
  title,
  description,
  ctaButton,
  dismissButton,
  GraphicDesktop,
  GraphicMobile,
  newBadge
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__.useBreakpoint)();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
    children: [breakpoint !== _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__.BREAKPOINT_SMALL && GraphicDesktop && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
      className: "googlesitekit-overlay-card__graphic",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(GraphicDesktop, {})
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      className: "googlesitekit-overlay-card__body",
      children: [newBadge && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
        className: "googlesitekit-overlay-card__badge",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_NewBadge__WEBPACK_IMPORTED_MODULE_5__["default"], {
          hasNoSpacing: true
        })
      }), title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Title__WEBPACK_IMPORTED_MODULE_1__["default"], {
        children: title
      }), description && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Description__WEBPACK_IMPORTED_MODULE_2__["default"], {
        children: description
      })]
    }), (ctaButton || dismissButton) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      className: "googlesitekit-overlay-card__actions",
      children: [dismissButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_DismissButton__WEBPACK_IMPORTED_MODULE_3__["default"], {
        ...dismissButton
      }), ctaButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_CTAButton__WEBPACK_IMPORTED_MODULE_4__["default"], {
        ...ctaButton
      })]
    }), breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__.BREAKPOINT_SMALL && GraphicMobile && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(GraphicMobile, {})]
  });
}
Body.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().node),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().node),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
    ..._DismissButton__WEBPACK_IMPORTED_MODULE_3__.buttonProps,
    href: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
    target: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
    trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().element)
  }),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_8___default().shape({
    ..._DismissButton__WEBPACK_IMPORTED_MODULE_3__.buttonProps
  }),
  GraphicDesktop: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().elementType),
  GraphicMobile: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().elementType),
  newBadge: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool)
};

/***/ }),

/***/ "./js/components/OverlayCard/CTAButton.js":
/*!************************************************!*\
  !*** ./js/components/OverlayCard/CTAButton.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CTAButton)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DismissButton */ "./js/components/OverlayCard/DismissButton.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OverlayCard CTAButton component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */



function CTAButton(props) {
  const {
    label,
    ...otherProps
  } = props;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.Button, {
    ...otherProps,
    children: label
  });
}
CTAButton.propTypes = {
  ..._DismissButton__WEBPACK_IMPORTED_MODULE_1__.buttonProps,
  href: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  target: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object)
};

/***/ }),

/***/ "./js/components/OverlayCard/Description.js":
/*!**************************************************!*\
  !*** ./js/components/OverlayCard/Description.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Description)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OverlayCard Description component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


function Description({
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx)("p", {
    className: "googlesitekit-overlay-card__description",
    children: children
  });
}
Description.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node).isRequired
};

/***/ }),

/***/ "./js/components/OverlayCard/DismissButton.js":
/*!****************************************************!*\
  !*** ./js/components/OverlayCard/DismissButton.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   buttonProps: () => (/* binding */ buttonProps),
/* harmony export */   "default": () => (/* binding */ DismissButton)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OverlayCard DismissButton component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function DismissButton({
  label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maybe later', 'google-site-kit'),
  onClick,
  disabled
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
    onClick: onClick,
    disabled: disabled,
    tertiary: true,
    children: label
  });
}
const buttonProps = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
};
DismissButton.propTypes = buttonProps;

/***/ }),

/***/ "./js/components/OverlayCard/Title.js":
/*!********************************************!*\
  !*** ./js/components/OverlayCard/Title.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Title)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OverlayCard Title component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function Title({
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_0__["default"], {
    as: "h3",
    size: "medium",
    type: "title",
    className: "googlesitekit-overlay-card__title",
    children: children
  });
}
Title.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node).isRequired
};

/***/ }),

/***/ "./js/components/OverlayCard/index.js":
/*!********************************************!*\
  !*** ./js/components/OverlayCard/index.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ OverlayCard)
/* harmony export */ });
/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material-ui/core */ "../node_modules/@material-ui/core/esm/Slide/Slide.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _Body__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Body */ "./js/components/OverlayCard/Body.js");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./DismissButton */ "./js/components/OverlayCard/DismissButton.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OverlayCard component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * Internal dependencies
 */




function OverlayCard(props) {
  const {
    visible,
    className,
    ...cardProps
  } = props;
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.useBreakpoint)();
  if (!visible) {
    return null;
  }
  const body = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-overlay-card', className),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Body__WEBPACK_IMPORTED_MODULE_2__["default"], {
      ...cardProps
    })
  });
  if (breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_SMALL) {
    return body;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_5__["default"], {
    direction: "up",
    in: visible,
    children: body
  });
}
OverlayCard.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object)]),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_6___default().shape({
    ..._DismissButton__WEBPACK_IMPORTED_MODULE_3__.buttonProps,
    href: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
    target: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
    trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object)
  }),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_6___default().shape(_DismissButton__WEBPACK_IMPORTED_MODULE_3__.buttonProps),
  GraphicDesktop: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().elementType),
  GraphicMobile: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().elementType),
  newBadge: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
  visible: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool)
};
OverlayCard.defaultProps = {
  visible: false
};

/***/ }),

/***/ "./js/components/OverlayNotification/AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification.js":
/*!*************************************************************************************************************!*\
  !*** ./js/components/OverlayNotification/AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification.js ***!
  \*************************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ANALYTICS_ADSENSE_LINKED_OVERLAY_NOTIFICATION: () => (/* binding */ ANALYTICS_ADSENSE_LINKED_OVERLAY_NOTIFICATION),
/* harmony export */   "default": () => (/* binding */ AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _svg_graphics_analytics_adsense_linked_desktop_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/graphics/analytics-adsense-linked-desktop.svg */ "./svg/graphics/analytics-adsense-linked-desktop.svg");
/* harmony import */ var _svg_graphics_analytics_adsense_linked_mobile_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/graphics/analytics-adsense-linked-mobile.svg */ "./svg/graphics/analytics-adsense-linked-mobile.svg");
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.js");
/* harmony import */ var _js_googlesitekit_notifications_components_layout_OverlayNotification__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/OverlayNotification */ "./js/googlesitekit/notifications/components/layout/OverlayNotification.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */










const ANALYTICS_ADSENSE_LINKED_OVERLAY_NOTIFICATION = 'AnalyticsAndAdSenseLinkedOverlayNotification';
function AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification({
  id,
  Notification
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_6__.useBreakpoint)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_NOTIFICATIONS);
  function scrollToWidgetAndDismissNotification(event) {
    event.preventDefault();
    dismissNotification(id);
    setTimeout(() => {
      const widgetClass = '.googlesitekit-widget--adsenseTopEarningPagesGA4';
      __webpack_require__.g.history.replaceState({}, '', `#${_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__.ANCHOR_ID_MONETIZATION}`);
      __webpack_require__.g.scrollTo({
        top: (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_7__.getNavigationalScrollTop)(widgetClass, breakpoint),
        behavior: 'smooth'
      });
    }, 50);
  }
  const gaTrackingEventArgs = {
    category: `${viewContext}_top-earning-pages-widget`,
    viewAction: 'view_overlay_CTA',
    dismissAction: 'dismiss_overlay_CTA',
    confirmAction: 'confirm_overlay_CTA'
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Notification, {
    gaTrackingEventArgs: gaTrackingEventArgs,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_googlesitekit_notifications_components_layout_OverlayNotification__WEBPACK_IMPORTED_MODULE_8__["default"], {
      notificationID: id,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See your top earning content', 'google-site-kit'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Data is now available for the pages that earn the most AdSense revenue.', 'google-site-kit'),
      GraphicDesktop: _svg_graphics_analytics_adsense_linked_desktop_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
      GraphicMobile: _svg_graphics_analytics_adsense_linked_mobile_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Show me', 'google-site-kit'),
        onClick: scrollToWidgetAndDismissNotification
      },
      gaTrackingEventArgs: gaTrackingEventArgs,
      dismissButton: true
    })
  });
}
AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().elementType).isRequired
};

/***/ }),

/***/ "./js/components/OverlayNotification/LinkAnalyticsAndAdSenseAccountsOverlayNotification.js":
/*!*************************************************************************************************!*\
  !*** ./js/components/OverlayNotification/LinkAnalyticsAndAdSenseAccountsOverlayNotification.js ***!
  \*************************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   LINK_ANALYTICS_ADSENSE_OVERLAY_NOTIFICATION: () => (/* binding */ LINK_ANALYTICS_ADSENSE_OVERLAY_NOTIFICATION),
/* harmony export */   "default": () => (/* binding */ LinkAnalyticsAndAdSenseAccountsOverlayNotification)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _svg_graphics_analytics_adsense_connect_desktop_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/graphics/analytics-adsense-connect-desktop.svg */ "./svg/graphics/analytics-adsense-connect-desktop.svg");
/* harmony import */ var _svg_graphics_analytics_adsense_connect_mobile_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/graphics/analytics-adsense-connect-mobile.svg */ "./svg/graphics/analytics-adsense-connect-mobile.svg");
/* harmony import */ var _js_googlesitekit_notifications_components_layout_OverlayNotification__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/OverlayNotification */ "./js/googlesitekit/notifications/components/layout/OverlayNotification.js");
/* harmony import */ var _svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/icons/external.svg */ "./svg/icons/external.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * LinkAnalyticsAndAdSenseAccountsOverlayNotification component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */








const LINK_ANALYTICS_ADSENSE_OVERLAY_NOTIFICATION = 'LinkAnalyticsAndAdSenseAccountsOverlayNotification';
function LinkAnalyticsAndAdSenseAccountsOverlayNotification({
  id,
  Notification
}) {
  const supportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getGoogleSupportURL({
    path: '/adsense/answer/6084409'
  }));
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_NOTIFICATIONS);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(Notification, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_googlesitekit_notifications_components_layout_OverlayNotification__WEBPACK_IMPORTED_MODULE_6__["default"], {
      notificationID: id,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See which content earns you the most', 'google-site-kit'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Link your Analytics and AdSense accounts to find out which content brings you the most revenue.', 'google-site-kit'),
      GraphicDesktop: _svg_graphics_analytics_adsense_connect_desktop_svg__WEBPACK_IMPORTED_MODULE_4__["default"],
      GraphicMobile: _svg_graphics_analytics_adsense_connect_mobile_svg__WEBPACK_IMPORTED_MODULE_5__["default"],
      ctaButton: {
        href: supportURL,
        target: '_blank',
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn how', 'google-site-kit'),
        trailingIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
          width: 13,
          height: 13
        }),
        onClick: () => dismissNotification(id)
      },
      dismissButton: true
    })
  });
}
LinkAnalyticsAndAdSenseAccountsOverlayNotification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().elementType).isRequired
};

/***/ }),

/***/ "./js/components/PageHeader.js":
/*!*************************************!*\
  !*** ./js/components/PageHeader.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PageHeader)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _svg_icons_connected_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/connected.svg */ "./svg/icons/connected.svg");
/* harmony import */ var _svg_icons_exclamation_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/exclamation.svg */ "./svg/icons/exclamation.svg");
/* harmony import */ var _IconWrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./IconWrapper */ "./js/components/IconWrapper.js");
/* harmony import */ var _Typography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PageHeader component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * External dependencies
 */



/**
 * Internal dependencies
 */






function PageHeader(props) {
  const {
    title,
    icon,
    className,
    status,
    statusText,
    fullWidth,
    children
  } = props;
  const titleCellProps = fullWidth ? {
    size: 12
  } : {
    smSize: 4,
    mdSize: 4,
    lgSize: 6
  };

  // Determine whether the details cell should display.
  const hasDetails = '' !== status || Boolean(children);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("header", {
    className: "googlesitekit-page-header",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_1__.Row, {
      children: [title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_1__.Cell, {
        ...titleCellProps,
        children: [icon, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Typography__WEBPACK_IMPORTED_MODULE_5__["default"], {
          as: "h1",
          className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-page-header__title', className),
          size: "medium",
          type: "title",
          children: title
        })]
      }), hasDetails && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_1__.Cell, {
        smSize: 4,
        mdSize: 4,
        lgSize: 6,
        alignBottom: true,
        mdAlignRight: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
          className: "googlesitekit-page-header__details",
          children: [status && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("span", {
            className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-page-header__status', `googlesitekit-page-header__status--${status}`),
            children: [statusText, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_IconWrapper__WEBPACK_IMPORTED_MODULE_4__["default"], {
              children: 'connected' === status ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_svg_icons_connected_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
                width: 10,
                height: 8
              }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_svg_icons_exclamation_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
                width: 2,
                height: 12
              })
            })]
          }), children]
        })
      })]
    })
  });
}
PageHeader.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  icon: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  status: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  statusText: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  fullWidth: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool)
};
PageHeader.defaultProps = {
  title: '',
  icon: null,
  className: 'googlesitekit-heading-3',
  status: '',
  statusText: '',
  fullWidth: false
};

/***/ }),

/***/ "./js/components/Portal.js":
/*!*********************************!*\
  !*** ./js/components/Portal.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEffectOnce.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react-dom/index.js");
/**
 * Portal component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */

function Portal({
  children,
  slug
}) {
  // Using state as we need `el` to not change when the component re-renders
  const [element] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(document.createElement('div'));
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    if (slug) {
      element.classList.add(`googlesitekit-portal-${slug}`);
    }
    const root = document.querySelector('.googlesitekit-plugin') || document.body;
    root.appendChild(element);
    return () => root.removeChild(element);
  });
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.createPortal)(children, element);
}
Portal.propTypes = {
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)
};
Portal.defaultProps = {
  slug: '',
  children: null
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Portal);

/***/ }),

/***/ "./js/components/PreviewBlock.js":
/*!***************************************!*\
  !*** ./js/components/PreviewBlock.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PreviewBlock component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */


function PreviewBlock({
  className,
  width,
  height,
  shape,
  padding,
  smallWidth,
  smallHeight,
  tabletWidth,
  tabletHeight,
  desktopWidth,
  desktopHeight
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.useBreakpoint)();
  const blockDimensions = {
    width: {
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_SMALL]: smallWidth,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_TABLET]: tabletWidth,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_DESKTOP]: desktopWidth,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_XLARGE]: desktopWidth
    },
    height: {
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_SMALL]: smallHeight,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_TABLET]: tabletHeight,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_DESKTOP]: desktopHeight,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_XLARGE]: desktopWidth
    }
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-preview-block', className, {
      'googlesitekit-preview-block--padding': padding
    }),
    style: {
      width: blockDimensions.width[breakpoint] || width,
      height: blockDimensions.height[breakpoint] || height
    },
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-preview-block__wrapper', {
        'googlesitekit-preview-block__wrapper--circle': shape === 'circular'
      })
    })
  });
}
PreviewBlock.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  height: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  shape: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  padding: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  smallWidth: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  smallHeight: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  tabletWidth: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  tabletHeight: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  desktopWidth: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  desktopHeight: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)
};
PreviewBlock.defaultProps = {
  className: undefined,
  width: '100px',
  height: '100px',
  shape: 'square',
  padding: false,
  smallWidth: undefined,
  smallHeight: undefined,
  tabletWidth: undefined,
  tabletHeight: undefined,
  desktopWidth: undefined,
  desktopHeight: undefined
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PreviewBlock);

/***/ }),

/***/ "./js/components/PreviewTable.js":
/*!***************************************!*\
  !*** ./js/components/PreviewTable.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _PreviewBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PreviewTable component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */


function PreviewTable({
  rows,
  rowHeight,
  padding
}) {
  const rowData = [];
  for (let x = 0; rows > x; x++) {
    rowData.push(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: "googlesitekit-preview-table__row",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
        width: "100%",
        height: rowHeight + 'px'
      })
    }, 'table-row-' + x));
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-preview-table', {
      'googlesitekit-preview-table--padding': padding
    }),
    children: rowData
  });
}
PreviewTable.propTypes = {
  rows: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
  rowHeight: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
  padding: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
};
PreviewTable.defaultProps = {
  rows: 11,
  rowHeight: 35,
  padding: false
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PreviewTable);

/***/ }),

/***/ "./js/components/ReportErrorActions.js":
/*!*********************************************!*\
  !*** ./js/components/ReportErrorActions.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ReportErrorActions)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ReportErrorActions component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








function ReportErrorActions(props) {
  const {
    moduleSlug,
    error,
    GetHelpLink,
    hideGetHelpLink,
    buttonVariant,
    onRetry,
    onRequestAccess,
    getHelpClassName,
    RequestAccessButton,
    RetryButton
  } = props;
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const storeName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).getModuleStoreName(moduleSlug));
  const requestAccessURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => typeof select(storeName)?.getServiceEntityAccessURL === 'function' ? select(storeName).getServiceEntityAccessURL() : null);
  const errors = Array.isArray(error) ? error : [error];
  const errorsWithSelectorData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => errors.map(err => {
    const selectorData = select(storeName)?.getSelectorDataForError(err);
    return {
      ...err,
      selectorData
    };
  }));
  const retryableErrors = errorsWithSelectorData?.filter(err => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_5__.isErrorRetryable)(err, err.selectorData) && err.selectorData.name === 'getReport');
  const showRetry = !!retryableErrors.length;
  const errorTroubleshootingLinkURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const err = {
      ...(showRetry ? retryableErrors[0] : errors[0])
    };
    if ((0,_js_util_errors__WEBPACK_IMPORTED_MODULE_5__.isInsufficientPermissionsError)(err)) {
      err.code = `${moduleSlug}_insufficient_permissions`;
    }
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getErrorTroubleshootingLinkURL(err);
  });
  const dispatch = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)();
  const hasInsufficientPermissionsError = errors.some(err => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_5__.isInsufficientPermissionsError)(err));
  const handleRetry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(() => {
    retryableErrors.forEach(err => {
      const {
        selectorData
      } = err;
      dispatch(selectorData.storeName).invalidateResolution(selectorData.name, selectorData.args);
    });
    onRetry?.();
  }, [dispatch, retryableErrors, onRetry]);
  const showRequestAccessURL = requestAccessURL && hasInsufficientPermissionsError && !isViewOnly;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
    className: "googlesitekit-report-error-actions",
    children: [showRequestAccessURL && (typeof RequestAccessButton === 'function' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(RequestAccessButton, {
      requestAccessURL: requestAccessURL
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
      onClick: onRequestAccess,
      href: requestAccessURL,
      target: "_blank",
      danger: buttonVariant === 'danger',
      tertiary: buttonVariant === 'tertiary',
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Request access', 'google-site-kit')
    })), showRetry && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
      children: [typeof RetryButton === 'function' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(RetryButton, {
        handleRetry: handleRetry
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        onClick: handleRetry,
        danger: buttonVariant === 'danger',
        tertiary: buttonVariant === 'tertiary',
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Retry', 'google-site-kit')
      }), !hideGetHelpLink && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Retry didn’t work? <HelpLink />', 'google-site-kit'), {
          HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_7__["default"], {
            href: errorTroubleshootingLinkURL,
            external: true,
            hideExternalIndicator: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get help', 'google-site-kit')
          })
        })
      })]
    }), !showRetry && !hideGetHelpLink && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
      className: getHelpClassName,
      children: typeof GetHelpLink === 'function' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(GetHelpLink, {
        linkURL: errorTroubleshootingLinkURL
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_7__["default"], {
        href: errorTroubleshootingLinkURL,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get help', 'google-site-kit')
      })
    })]
  });
}
ReportErrorActions.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string).isRequired,
  error: prop_types__WEBPACK_IMPORTED_MODULE_11___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_11___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_11___default().object)), (prop_types__WEBPACK_IMPORTED_MODULE_11___default().object)]).isRequired,
  GetHelpLink: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().elementType),
  hideGetHelpLink: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().bool),
  buttonVariant: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().func),
  onRequestAccess: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().func),
  getHelpClassName: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
  RequestAccessButton: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().elementType),
  RetryButton: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().elementType)
};

/***/ }),

/***/ "./js/components/ReportErrorButton/index.js":
/*!**************************************************!*\
  !*** ./js/components/ReportErrorButton/index.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! clipboard-copy */ "../node_modules/clipboard-copy/index.js");
/* harmony import */ var clipboard_copy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(clipboard_copy__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/icon/index.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/library/check.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/library/stack.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ReportErrorButton component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */


function ReportErrorButton({
  message,
  componentStack
}) {
  const [copied, setCopied] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
  function onErrorClick() {
    // Copy message with wrapping backticks for code block formatting on wp.org.
    clipboard_copy__WEBPACK_IMPORTED_MODULE_0___default()(`\`\`\`\n${message}\n${componentStack}\n\`\`\``);
    setCopied(true);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
    "aria-label": copied ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error message copied to clipboard. Click to copy the error message again.', 'google-site-kit') : undefined,
    onClick: onErrorClick,
    trailingIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"], {
      className: "mdc-button__icon",
      icon: copied ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_7__["default"]
    }),
    children: copied ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Copied to clipboard', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Copy error contents', 'google-site-kit')
  });
}
ReportErrorButton.propTypes = {
  message: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  componentStack: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ReportErrorButton);

/***/ }),

/***/ "./js/components/ReportTable.js":
/*!**************************************!*\
  !*** ./js/components/ReportTable.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ReportTable)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _GatheringDataNotice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./GatheringDataNotice */ "./js/components/GatheringDataNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Report Table component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */





/**
 * WordPress dependencies
 */


/**
 * Internal dependencies.
 */



function ReportTable(props) {
  const {
    rows,
    columns,
    className,
    limit,
    zeroState: ZeroState,
    gatheringData = false,
    tabbedLayout = false
  } = props;
  invariant__WEBPACK_IMPORTED_MODULE_1___default()(Array.isArray(rows), 'rows must be an array.');
  invariant__WEBPACK_IMPORTED_MODULE_1___default()(Array.isArray(columns), 'columns must be an array.');
  columns.forEach(({
    Component,
    field = null
  }) => {
    invariant__WEBPACK_IMPORTED_MODULE_1___default()(Component || field !== null, 'each column must define a Component and/or a field.');
  });
  invariant__WEBPACK_IMPORTED_MODULE_1___default()(Number.isInteger(limit) || limit === undefined, 'limit must be an integer, if provided.');
  const hasBadges = columns.some(({
    badge
  }) => !!badge);
  const [activeColumnIndex, setActiveColumnIndex] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(0);

  // The first column is expected to be the row title or label, which will always be
  // shown so we exclude it from the tab list.
  const tabColumns = tabbedLayout && columns.slice(1);
  const contentColumns = tabbedLayout ? [columns[0], tabColumns[activeColumnIndex]] : columns;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
    className: className,
    children: [tabbedLayout && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.TabBar, {
      className: "googlesitekit-tab-bar--start-aligned-high-contrast",
      activeIndex: activeColumnIndex,
      handleActiveIndexUpdate: setActiveColumnIndex,
      children: tabColumns.map(({
        title,
        badge
      }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Tab, {
        "aria-label": title,
        children: [title, badge]
      }, title))
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-table', 'googlesitekit-table--with-list', {
        'googlesitekit-table--gathering-data': gatheringData
      }),
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("table", {
        className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-table__wrapper', `googlesitekit-table__wrapper--${contentColumns.length}-col`, {
          'googlesitekit-table__wrapper--tabbed-layout': tabbedLayout
        }),
        children: [!tabbedLayout && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("thead", {
          className: "googlesitekit-table__head",
          children: [hasBadges && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("tr", {
            className: "googlesitekit-table__head-badges",
            children: columns.map(({
              badge,
              primary,
              className: columnClassName,
              columnHeaderClassName
            }, colIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("th", {
              className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-table__head-item', 'googlesitekit-table__head-item--badge', {
                'googlesitekit-table__head-item--primary': primary
              }, columnClassName, columnHeaderClassName),
              children: badge
            }, `googlesitekit-table__head-row-badge-${colIndex}`))
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("tr", {
            className: "googlesitekit-table__head-row",
            children: columns.map(({
              title,
              description,
              primary,
              className: columnClassName,
              columnHeaderClassName
            }, colIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("th", {
              className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-table__head-item', {
                'googlesitekit-table__head-item--primary': primary
              }, columnClassName, columnHeaderClassName),
              "data-tooltip": description,
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
                className: "googlesitekit-table__head-item-title",
                children: title
              })
            }, `googlesitekit-table__head-row-${colIndex}`))
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("tbody", {
          className: "googlesitekit-table__body",
          children: [gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("tr", {
            className: "googlesitekit-table__body-row googlesitekit-table__body-row--no-data",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("td", {
              className: "googlesitekit-table__body-item",
              colSpan: contentColumns.length,
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_4__["default"], {})
            })
          }), !gatheringData && !rows?.length && ZeroState && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("tr", {
            className: "googlesitekit-table__body-row googlesitekit-table__body-row--no-data",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("td", {
              className: "googlesitekit-table__body-item",
              colSpan: contentColumns.length,
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(ZeroState, {})
            })
          }), !gatheringData && rows.slice(0, limit).map((row, rowIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("tr", {
            className: "googlesitekit-table__body-row",
            children: contentColumns.map(({
              Component,
              field,
              className: columnClassName
            }, colIndex) => {
              const fieldValue = field !== undefined ? (0,lodash__WEBPACK_IMPORTED_MODULE_2__.get)(row, field) : undefined;
              return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("td", {
                className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-table__body-item', columnClassName),
                children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
                  className: "googlesitekit-table__body-item-content",
                  children: [Component && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(Component, {
                    row: row,
                    fieldValue: fieldValue
                  }), !Component && fieldValue]
                })
              }, `googlesitekit-table__body-item-${colIndex}`);
            })
          }, `googlesitekit-table__body-row-${rowIndex}`))]
        })]
      })
    })]
  });
}
ReportTable.propTypes = {
  rows: prop_types__WEBPACK_IMPORTED_MODULE_7___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_7___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_7___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_7___default().object)])).isRequired,
  columns: prop_types__WEBPACK_IMPORTED_MODULE_7___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_7___default().shape({
    title: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
    description: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
    primary: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
    className: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
    field: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
    Component: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().elementType),
    badge: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().node)
  })).isRequired,
  className: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  limit: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().number),
  zeroState: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool),
  tabbedLayout: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().bool)
};

/***/ }),

/***/ "./js/components/Root/ViewContextContext.js":
/*!**************************************************!*\
  !*** ./js/components/Root/ViewContextContext.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Consumer: () => (/* binding */ Consumer),
/* harmony export */   Provider: () => (/* binding */ Provider),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * View Context context for React components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */

const ViewContextContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)('');
const {
  Consumer,
  Provider
} = ViewContextContext;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ViewContextContext);

/***/ }),

/***/ "./js/components/SelectionBox.js":
/*!***************************************!*\
  !*** ./js/components/SelectionBox.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SelectionBox)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SelectionBox component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */


function SelectionBox({
  badge,
  checked,
  children,
  disabled,
  id,
  onChange,
  title,
  value
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-selection-box', {
      'googlesitekit-selection-box--disabled': disabled
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Checkbox, {
      checked: checked,
      description: children,
      disabled: disabled,
      id: id,
      name: id,
      onChange: onChange,
      value: value,
      badge: badge,
      children: title
    })
  });
}
SelectionBox.propTypes = {
  badge: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node),
  checked: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  onChange: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  value: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)
};

/***/ }),

/***/ "./js/components/SelectionPanel/SelectionPanel.js":
/*!********************************************************!*\
  !*** ./js/components/SelectionPanel/SelectionPanel.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SelectionPanel)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_components_SideSheet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/SideSheet */ "./js/components/SideSheet.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Selection Panel component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */


function SelectionPanel({
  children,
  isOpen,
  isLoading,
  onOpen,
  closePanel,
  className
}) {
  const classNameSelector = className?.split(/\s+/).map(name => `.${name}`).join('');
  const initialFocus = classNameSelector ? `${classNameSelector} .googlesitekit-selection-panel-item .googlesitekit-selection-box input` : '.googlesitekit-selection-panel-item .googlesitekit-selection-box input';
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_SideSheet__WEBPACK_IMPORTED_MODULE_1__["default"], {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-selection-panel', className),
    isOpen: isOpen,
    isLoading: isLoading,
    onOpen: onOpen,
    closeSheet: closePanel,
    focusTrapOptions: {
      initialFocus
    },
    children: children
  });
}
SelectionPanel.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node),
  isOpen: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  isLoading: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  closePanel: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)
};

/***/ }),

/***/ "./js/components/SelectionPanel/SelectionPanelContent.js":
/*!***************************************************************!*\
  !*** ./js/components/SelectionPanel/SelectionPanelContent.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SelectionPanelContent)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Selection Panel Content component.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function SelectionPanelContent({
  children,
  className
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-selection-panel__content', className),
    children: children
  });
}
SelectionPanelContent.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
};

/***/ }),

/***/ "./js/components/SelectionPanel/SelectionPanelFooter.js":
/*!**************************************************************!*\
  !*** ./js/components/SelectionPanel/SelectionPanelFooter.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SelectionPanelFooter)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Selection Panel Footer component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function SelectionPanelFooter({
  savedItemSlugs = [],
  selectedItemSlugs = [],
  saveSettings = () => {},
  minSelectedItemCount = 0,
  maxSelectedItemCount = 0,
  isBusy,
  onSaveSuccess = () => {},
  onCancel = () => {},
  isOpen,
  closePanel = () => {}
}) {
  const [finalButtonText, setFinalButtonText] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useState)(null);
  const [wasSaved, setWasSaved] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).isFetchingSyncAvailableAudiences());
  const haveSettingsChanged = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useMemo)(() => {
    // Arrays need to be sorted to match in `isEqual`.
    return !(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isEqual)((0,_js_util__WEBPACK_IMPORTED_MODULE_4__.safelySort)(selectedItemSlugs), (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.safelySort)(savedItemSlugs));
  }, [savedItemSlugs, selectedItemSlugs]);
  const currentButtonText = savedItemSlugs?.length > 0 && haveSettingsChanged ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Apply changes', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Save selection', 'google-site-kit');
  const onSaveClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(async () => {
    const {
      error
    } = await saveSettings(selectedItemSlugs);
    if (!error) {
      onSaveSuccess();

      // Close the panel after saving.
      closePanel();

      // Lock the button label while panel is closing.
      setFinalButtonText(currentButtonText);
      setWasSaved(true);
    }
  }, [saveSettings, selectedItemSlugs, onSaveSuccess, closePanel, currentButtonText]);
  const onCancelClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(() => {
    closePanel();
    onCancel();
  }, [closePanel, onCancel]);
  const [prevIsOpen, setPrevIsOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useState)(null);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
    if (prevIsOpen !== null) {
      // If current isOpen is true, and different from prevIsOpen
      // meaning it transitioned from false to true and it is not
      // in closing transition, we should reset the button label
      // locked when save button was clicked.
      if (prevIsOpen !== isOpen) {
        if (isOpen) {
          setFinalButtonText(null);
          setWasSaved(false);
        }
      }
    }
    setPrevIsOpen(isOpen);
  }, [isOpen, prevIsOpen]);
  const selectedItemCount = selectedItemSlugs?.length || 0;
  const itemCountElement = isLoading ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_6__["default"], {
    width: "89px",
    height: "20px"
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
    className: "googlesitekit-selection-panel-footer__item-count",
    children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Number of selected items. 2: Maximum number of items that can be selected. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$d selected <MaxCount>(up to %2$d)</MaxCount>', 'google-site-kit'), selectedItemCount, maxSelectedItemCount), {
      MaxCount: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
        className: "googlesitekit-selection-panel-footer__item-count--max-count"
      })
    })
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("footer", {
    className: "googlesitekit-selection-panel-footer",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
      className: "googlesitekit-selection-panel-footer__content",
      children: [itemCountElement, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
        className: "googlesitekit-selection-panel-footer__actions",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
          onClick: onCancelClick,
          disabled: isBusy,
          tertiary: true,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Cancel', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.SpinnerButton, {
          onClick: onSaveClick,
          isSaving: isBusy,
          disabled: selectedItemCount < minSelectedItemCount || selectedItemCount > maxSelectedItemCount || isBusy || !isOpen && wasSaved,
          children: finalButtonText || currentButtonText
        })]
      })]
    })
  });
}
SelectionPanelFooter.propTypes = {
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().array),
  selectedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().array),
  saveSettings: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func),
  minSelectedItemCount: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().number),
  maxSelectedItemCount: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().number),
  isBusy: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  onSaveSuccess: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func),
  onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func),
  isOpen: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  closePanel: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func)
};

/***/ }),

/***/ "./js/components/SelectionPanel/SelectionPanelHeader.js":
/*!**************************************************************!*\
  !*** ./js/components/SelectionPanel/SelectionPanelHeader.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SelectionPanelHeader)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/svg/icons/close.svg */ "./svg/icons/close.svg");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Selection Panel Header component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function SelectionPanelHeader({
  children,
  title,
  onCloseClick
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("header", {
    className: "googlesitekit-selection-panel-header",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "googlesitekit-selection-panel-header__row",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
        as: "h3",
        size: "small",
        type: "headline",
        children: title
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_0__["default"], {
        className: "googlesitekit-selection-panel-header__close",
        onClick: onCloseClick,
        linkButton: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_1__["default"], {
          width: "15",
          height: "15"
        })
      })]
    }), children]
  });
}
SelectionPanelHeader.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().node),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  onCloseClick: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func)
};

/***/ }),

/***/ "./js/components/SelectionPanel/SelectionPanelItem.js":
/*!************************************************************!*\
  !*** ./js/components/SelectionPanel/SelectionPanelItem.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SelectionPanelItem)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_SelectionBox__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/SelectionBox */ "./js/components/SelectionBox.js");
/* harmony import */ var _js_components_Badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Badge */ "./js/components/Badge.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Selection Panel Item component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function SelectionPanelItem({
  children,
  id,
  slug,
  title,
  description,
  isItemSelected,
  isItemDisabled,
  onCheckboxChange,
  subtitle,
  suffix,
  badge,
  isNewlyDetected
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: "googlesitekit-selection-panel-item",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_js_components_SelectionBox__WEBPACK_IMPORTED_MODULE_1__["default"], {
      badge: badge,
      checked: isItemSelected,
      disabled: isItemDisabled,
      id: id,
      onChange: onCheckboxChange,
      title: title,
      value: slug,
      children: [subtitle && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
        className: "googlesitekit-selection-panel-item__subtitle",
        children: subtitle
      }), description, children]
    }), isNewlyDetected && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Badge__WEBPACK_IMPORTED_MODULE_2__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('New', 'google-site-kit')
    }), suffix && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      className: "googlesitekit-selection-panel-item__suffix",
      children: suffix
    })]
  });
}
SelectionPanelItem.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().node),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  isItemSelected: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
  isItemDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool),
  onCheckboxChange: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().func),
  subtitle: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  suffix: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().node),
  badge: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().node),
  isNewlyDetected: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool)
};

/***/ }),

/***/ "./js/components/SelectionPanel/SelectionPanelItems.js":
/*!*************************************************************!*\
  !*** ./js/components/SelectionPanel/SelectionPanelItems.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SelectionPanelItems)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Selection Panel Items component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



function SelectionPanelItems({
  currentSelectionTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Current selection', 'google-site-kit'),
  availableItemsTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Additional items', 'google-site-kit'),
  savedItemSlugs = [],
  availableSavedItems = {},
  availableUnsavedItems = {},
  ItemComponent,
  notice
}) {
  function renderItems(items) {
    return Object.keys(items).map(slug => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(ItemComponent, {
      slug: slug,
      savedItemSlugs: savedItemSlugs,
      ...items[slug]
    }, slug));
  }
  const availableUnsavedItemsCount = Object.keys(availableUnsavedItems).length;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
    className: "googlesitekit-selection-panel-items",
    children: [
    // Split list into two sections with sub-headings for current selection and
    // additional items if there are already saved items.
    savedItemSlugs.length !== 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
        className: "googlesitekit-selection-panel-items__subheading",
        children: currentSelectionTitle
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
        className: "googlesitekit-selection-panel-items__subsection",
        children: renderItems(availableSavedItems)
      }), availableUnsavedItemsCount > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
        className: "googlesitekit-selection-panel-items__subheading",
        children: availableItemsTitle
      })]
    }), availableUnsavedItemsCount > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
      className: "googlesitekit-selection-panel-items__subsection",
      children: renderItems(availableUnsavedItems)
    }), notice]
  });
}
SelectionPanelItems.propTypes = {
  currentSelectionTitle: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  availableItemsTitle: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().array),
  availableSavedItems: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object),
  availableUnsavedItems: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object),
  ItemComponent: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().elementType),
  notice: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)
};

/***/ }),

/***/ "./js/components/SelectionPanel/index.js":
/*!***********************************************!*\
  !*** ./js/components/SelectionPanel/index.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   SelectionPanelContent: () => (/* reexport safe */ _SelectionPanelContent__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   SelectionPanelFooter: () => (/* reexport safe */ _SelectionPanelFooter__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   SelectionPanelHeader: () => (/* reexport safe */ _SelectionPanelHeader__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   SelectionPanelItem: () => (/* reexport safe */ _SelectionPanelItem__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   SelectionPanelItems: () => (/* reexport safe */ _SelectionPanelItems__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _SelectionPanel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SelectionPanel */ "./js/components/SelectionPanel/SelectionPanel.js");
/* harmony import */ var _SelectionPanelHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SelectionPanelHeader */ "./js/components/SelectionPanel/SelectionPanelHeader.js");
/* harmony import */ var _SelectionPanelItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SelectionPanelItem */ "./js/components/SelectionPanel/SelectionPanelItem.js");
/* harmony import */ var _SelectionPanelItems__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SelectionPanelItems */ "./js/components/SelectionPanel/SelectionPanelItems.js");
/* harmony import */ var _SelectionPanelFooter__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SelectionPanelFooter */ "./js/components/SelectionPanel/SelectionPanelFooter.js");
/* harmony import */ var _SelectionPanelContent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SelectionPanelContent */ "./js/components/SelectionPanel/SelectionPanelContent.js");
/**
 * Selection Panel components.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */






/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_SelectionPanel__WEBPACK_IMPORTED_MODULE_0__["default"]);

/***/ }),

/***/ "./js/components/SideSheet.js":
/*!************************************!*\
  !*** ./js/components/SideSheet.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SideSheet)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var focus_trap_react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! focus-trap-react */ "../node_modules/focus-trap-react/dist/focus-trap-react.js");
/* harmony import */ var focus_trap_react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(focus_trap_react__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useKey.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _Portal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Portal */ "./js/components/Portal.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SideSheet component
 *
 * This component is named after Material Side Sheets
 * (https://m3.material.io/components/side-sheets/overview), which is
 * planned but not yet implemented for Web. Once available, we could look
 * into moving this to `googlesitekit-components` and replacing it with
 * the Material implementation.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */





/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */


function getSideSheetTopOffset() {
  const adminBar = __webpack_require__.g.document?.getElementById('wpadminbar');
  if (!adminBar) {
    return 0;
  }
  const {
    top,
    bottom,
    height
  } = adminBar.getBoundingClientRect();

  // The admin bar is hidden on mobile when the page is scrolled down.
  if (top < 0 || bottom <= 0) {
    return 0;
  }
  return height;
}
function SideSheet({
  className,
  children,
  isOpen,
  isLoading,
  onOpen = () => {},
  closeSheet = () => {},
  focusTrapOptions = {}
}) {
  const sideSheetRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)();
  const [sideSheetTopOffset, setSideSheetTopOffset] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(0);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    if (isOpen) {
      // Compute once when opening. Once the side sheet is open, scrolling
      // is locked so the admin bar visibility won't change until it is closed.
      setSideSheetTopOffset(getSideSheetTopOffset());
      onOpen();
      document.body.classList.add('googlesitekit-side-sheet-scroll-lock');
    } else {
      setSideSheetTopOffset(0);
      document.body.classList.remove('googlesitekit-side-sheet-scroll-lock');
    }
  }, [isOpen, onOpen]);
  function handleClickAway(event) {
    // Prevent closing side sheet when a link inside of a tooltip is clicked.
    if (event.target.closest?.('.googlesitekit-tooltip-popper')) {
      return;
    }
    closeSheet();
  }
  function allowOutsideClick(event) {
    // Allow clicks within a tooltip popup inside of the SideSheet.
    if (event.target.closest?.('.googlesitekit-tooltip-popper')) {
      return true;
    }
    return false;
  }
  (0,react_use__WEBPACK_IMPORTED_MODULE_5__["default"])(sideSheetRef, handleClickAway);
  (0,react_use__WEBPACK_IMPORTED_MODULE_6__["default"])(event => isOpen && _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_7__.ESCAPE === event.keyCode, closeSheet);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_Portal__WEBPACK_IMPORTED_MODULE_2__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)((focus_trap_react__WEBPACK_IMPORTED_MODULE_1___default()), {
      active: !!isOpen && !isLoading,
      focusTrapOptions: {
        fallbackFocus: 'body',
        allowOutsideClick,
        ...focusTrapOptions
      },
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("section", {
        ref: sideSheetRef,
        className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-side-sheet', className, {
          'googlesitekit-side-sheet--open': isOpen
        }),
        role: "dialog",
        "aria-modal": "true",
        "aria-hidden": !isOpen,
        tabIndex: "0",
        style: {
          '--googlesitekit-side-sheet-top': `${sideSheetTopOffset}px`
        },
        children: children
      })
    }), isOpen && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      className: "googlesitekit-side-sheet-overlay"
    })]
  });
}
SideSheet.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().node),
  isOpen: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool),
  isLoading: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool),
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func),
  closeSheet: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().func),
  focusTrapOptions: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().object)
};

/***/ }),

/***/ "./js/components/SourceLink.tsx":
/*!**************************************!*\
  !*** ./js/components/SourceLink.tsx ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_googlesitekit_widgets_hooks_useWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/widgets/hooks/useWidget */ "./js/googlesitekit/widgets/hooks/useWidget.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * SourceLink component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





function SourceLink({
  name = '',
  href = '',
  className = '',
  external = false
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const widget = (0,_js_googlesitekit_widgets_hooks_useWidget__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(() => {
    if (!widget.slug || !viewContext) {
      return;
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_widget`, 'click_source_link', widget.slug);
  }, [viewContext, widget]);
  if (viewOnlyDashboard) {
    return null;
  }
  return /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-source-link', className)
  }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: source link */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Source: %s', 'google-site-kit'), `<a>${name}</a>`), {
    a: /*#__PURE__*/React.createElement(_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
      key: "link"
      // @ts-expect-error - The `Link` component is not currently typed.
      ,
      href: href,
      external: external,
      onClick: handleClick
    })
  }));
}
SourceLink.propTypes = {
  name: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().string),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().string),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SourceLink);

/***/ }),

/***/ "./js/components/Stepper/Step.js":
/*!***************************************!*\
  !*** ./js/components/Stepper/Step.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Step)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./js/components/Stepper/constants.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Step component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */



function Step({
  children,
  title,
  stepStatus
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
    className: "googlesitekit-stepper__step-info",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_1__["default"], {
      as: "h2",
      className: "googlesitekit-stepper__step-title",
      size: "medium",
      type: "title",
      children: title
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: "googlesitekit-stepper__step-content-container",
      children: stepStatus === _constants__WEBPACK_IMPORTED_MODULE_0__.STEP_STATUS.ACTIVE && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
        className: "googlesitekit-stepper__step-content",
        children: children
      })
    })]
  });
}
Step.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string).isRequired,
  stepStatus: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(Object.values(_constants__WEBPACK_IMPORTED_MODULE_0__.STEP_STATUS))
};

/***/ }),

/***/ "./js/components/Stepper/constants.js":
/*!********************************************!*\
  !*** ./js/components/Stepper/constants.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   STEP_STATUS: () => (/* binding */ STEP_STATUS)
/* harmony export */ });
/**
 * Stepper constants.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const STEP_STATUS = {
  UPCOMING: 'upcoming',
  ACTIVE: 'active',
  COMPLETED: 'completed'
};

/***/ }),

/***/ "./js/components/Stepper/index.js":
/*!****************************************!*\
  !*** ./js/components/Stepper/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Stepper)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _svg_icons_tick_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/tick.svg */ "./svg/icons/tick.svg");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/components/Stepper/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Stepper component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */



function Stepper({
  children,
  activeStep,
  className
}) {
  const childCount = _wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Children.count(children);
  function getStepStatus(index = -1) {
    if (index < activeStep) {
      return _constants__WEBPACK_IMPORTED_MODULE_3__.STEP_STATUS.COMPLETED;
    }
    if (index === activeStep) {
      return _constants__WEBPACK_IMPORTED_MODULE_3__.STEP_STATUS.ACTIVE;
    }
    return _constants__WEBPACK_IMPORTED_MODULE_3__.STEP_STATUS.UPCOMING;
  }
  function getNumberTitle(childNumber, stepStatus) {
    switch (stepStatus) {
      case _constants__WEBPACK_IMPORTED_MODULE_3__.STEP_STATUS.UPCOMING:
        return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: The number of the current step. 2: The total number of steps. */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Step %1$s of %2$s (upcoming).', 'google-site-kit'), childNumber, childCount);
      case _constants__WEBPACK_IMPORTED_MODULE_3__.STEP_STATUS.ACTIVE:
        return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: The number of the current step. 2: The total number of steps. */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Step %1$s of %2$s (active).', 'google-site-kit'), childNumber, childCount);
      case _constants__WEBPACK_IMPORTED_MODULE_3__.STEP_STATUS.COMPLETED:
        return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: The number of the current step. 2: The total number of steps. */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Step %1$s of %2$s (completed).', 'google-site-kit'), childNumber, childCount);
      default:
        return '';
    }
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("ol", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-stepper', className),
    children: _wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Children.map(children, (child, childIndex) => {
      const stepStatus = getStepStatus(childIndex, activeStep);
      const childNumber = childIndex + 1;
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", {
        className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-stepper__step', `googlesitekit-stepper__step--${stepStatus}`, child.props.className),
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
          className: "googlesitekit-stepper__step-progress",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
            className: "googlesitekit-stepper__step-number",
            title: getNumberTitle(childNumber, stepStatus),
            children: stepStatus === _constants__WEBPACK_IMPORTED_MODULE_3__.STEP_STATUS.COMPLETED ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_svg_icons_tick_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {}) : childNumber
          }), childNumber < childCount && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
            className: "googlesitekit-stepper__step-progress-line"
          })]
        }), (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.cloneElement)(child, {
          stepStatus
        })]
      });
    })
  });
}
Stepper.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().node).isRequired,
  // The zero-based index of the active step. If omitted or negative, all steps are in the upcoming state. If greater than the number of steps - 1, all steps are complete.
  activeStep: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().number),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string)
};

/***/ }),

/***/ "./js/components/StoreErrorNotices.js":
/*!********************************************!*\
  !*** ./js/components/StoreErrorNotices.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ StoreErrorNotices)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _ErrorNotice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ErrorNotice */ "./js/components/ErrorNotice.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_util_insufficient_permissions_error_description__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/insufficient-permissions-error-description */ "./js/util/insufficient-permissions-error-description.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * StoreErrorNotices component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */






function StoreErrorNotices({
  hasButton = false,
  moduleSlug,
  storeName
}) {
  const errors = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(storeName).getErrors());
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).getModule(moduleSlug));
  const existingErrorMessages = [];
  return errors.filter(error => {
    if (!error?.message || existingErrorMessages.includes(error.message)) {
      return false;
    }
    existingErrorMessages.push(error.message);
    return true;
  }).map((error, key) => {
    let {
      message
    } = error;
    if ((0,_js_util_errors__WEBPACK_IMPORTED_MODULE_3__.isInsufficientPermissionsError)(error)) {
      message = (0,_js_util_insufficient_permissions_error_description__WEBPACK_IMPORTED_MODULE_4__.getInsufficientPermissionsErrorDescription)(message, module);
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ErrorNotice__WEBPACK_IMPORTED_MODULE_1__["default"], {
      error: error,
      hasButton: hasButton,
      storeName: storeName,
      message: message
    }, key);
  });
}
StoreErrorNotices.propTypes = {
  hasButton: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
  storeName: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string).isRequired,
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string)
};

/***/ }),

/***/ "./js/components/SupportLink.js":
/*!**************************************!*\
  !*** ./js/components/SupportLink.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SupportLink)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function SupportLink(props) {
  const {
    path,
    query,
    hash,
    ...otherProps
  } = props;
  const supportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getGoogleSupportURL({
    path,
    query,
    hash
  }));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
    ...otherProps,
    href: supportURL
  });
}
SupportLink.propTypes = {
  path: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string).isRequired,
  query: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().object),
  hash: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string)
};

/***/ }),

/***/ "./js/components/TableOverflowContainer.js":
/*!*************************************************!*\
  !*** ./js/components/TableOverflowContainer.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TableOverflowContainer component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */





/**
 * WordPress dependencies
 */


function TableOverflowContainer({
  children
}) {
  const [isScrolling, setScrolling] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
  const scrollRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
  const debouncedScrollCheck = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.debounce)(setIsScrolling, 100);
  (0,react_use__WEBPACK_IMPORTED_MODULE_4__["default"])('resize', debouncedScrollCheck);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    setIsScrolling();
  }, []);
  function setIsScrolling() {
    if (!scrollRef.current) {
      return;
    }
    const {
      scrollLeft,
      scrollWidth,
      offsetWidth
    } = scrollRef.current;
    const maxScroll = scrollWidth - offsetWidth;
    const scrolling = scrollLeft < maxScroll - 16 && 0 < maxScroll - 16; // 16 = $grid-gap-phone

    setScrolling(scrolling);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    onScroll: (0,lodash__WEBPACK_IMPORTED_MODULE_0__.debounce)(setIsScrolling, 100),
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-table-overflow', {
      'googlesitekit-table-overflow--gradient': isScrolling
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      ref: scrollRef,
      className: "googlesitekit-table-overflow__container",
      children: children
    })
  });
}
TableOverflowContainer.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().element)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableOverflowContainer);

/***/ }),

/***/ "./js/components/TourTooltip.js":
/*!**************************************!*\
  !*** ./js/components/TourTooltip.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ TourTooltip)
/* harmony export */ });
/* harmony import */ var _material_react_card__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material/react-card */ "../node_modules/@material/react-card/dist/index.js");
/* harmony import */ var _material_react_card__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_material_react_card__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_util_create_incremental_array_by_size__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/create-incremental-array-by-size */ "./js/util/create-incremental-array-by-size.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/icons/close.svg */ "./svg/icons/close.svg");
/* harmony import */ var _Typography__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TourTooltip component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */






function TourTooltip({
  backProps,
  closeProps,
  index,
  primaryProps,
  size,
  step,
  tooltipProps
}) {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefresh');
  const indicatorArray = size > 1 ? (0,_js_util_create_incremental_array_by_size__WEBPACK_IMPORTED_MODULE_4__.createIncrementalArrayBySize)(size) : [];
  function getIndicatorClassName(indicatorIndex) {
    return classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-tooltip-indicator', {
      active: indicatorIndex === index
    });
  }

  // Determine close icon size based on feature flag.
  const closeIconSize = setupFlowRefreshEnabled ? 10 : 14;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-tour-tooltip', step.className, {
      'googlesitekit-tour-tooltip--setupFlowRefresh': setupFlowRefreshEnabled
    }),
    ...tooltipProps,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)((_material_react_card__WEBPACK_IMPORTED_MODULE_0___default()), {
      className: "googlesitekit-tooltip-card",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
        className: "googlesitekit-tooltip-body",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
          as: "h2",
          className: "googlesitekit-tooltip-title",
          size: "medium",
          type: "title",
          children: step.title
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
          className: "googlesitekit-tooltip-content",
          children: step.content
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_material_react_card__WEBPACK_IMPORTED_MODULE_0__.CardActions, {
        className: "googlesitekit-tooltip-actions",
        children: [!setupFlowRefreshEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("ul", {
          className: "googlesitekit-tooltip-indicators",
          children: indicatorArray.map(indicatorIndex => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("li", {
            className: getIndicatorClassName(indicatorIndex)
          }, `indicator-${indicatorIndex}`))
        }), setupFlowRefreshEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("p", {
          className: "googlesitekit-tooltip-steps",
          children: [index + 1, " / ", size]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
          className: "googlesitekit-tooltip-buttons",
          children: [index !== 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
            className: "googlesitekit-tooltip-button",
            text: !setupFlowRefreshEnabled,
            tertiary: setupFlowRefreshEnabled,
            ...backProps,
            children: backProps.title
          }), step.cta, primaryProps.title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
            className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-tooltip-button', {
              'googlesitekit-tooltip-button--primary': setupFlowRefreshEnabled
            }),
            text: !setupFlowRefreshEnabled,
            ...primaryProps,
            children: primaryProps.title
          })]
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
        className: "googlesitekit-tooltip-close",
        icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_6__["default"], {
          width: closeIconSize,
          height: closeIconSize
        }),
        onClick: closeProps.onClick,
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close', 'google-site-kit'),
        text: true,
        hideTooltipTitle: true
      })]
    })
  });
}

/**
 * All props are provided directly from `react-joyride`, intended for custom components.
 *
 * @since 1.28.0
 * @see {@link https://docs.react-joyride.com/custom-components#props-1}.
 */
TourTooltip.propTypes = {
  backProps: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().object).isRequired,
  closeProps: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().object).isRequired,
  index: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().number).isRequired,
  isLastStep: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().bool).isRequired,
  primaryProps: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().object).isRequired,
  size: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().number).isRequired,
  step: prop_types__WEBPACK_IMPORTED_MODULE_9___default().shape({
    content: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().node),
    title: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().node),
    cta: prop_types__WEBPACK_IMPORTED_MODULE_9___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_9___default().element), (prop_types__WEBPACK_IMPORTED_MODULE_9___default().bool)]),
    className: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().string)
  }).isRequired,
  tooltipProps: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().object).isRequired
};

/***/ }),

/***/ "./js/components/TourTooltips.js":
/*!***************************************!*\
  !*** ./js/components/TourTooltips.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   GA_ACTIONS: () => (/* binding */ GA_ACTIONS),
/* harmony export */   "default": () => (/* binding */ TourTooltips),
/* harmony export */   floaterProps: () => (/* binding */ floaterProps),
/* harmony export */   joyrideStyles: () => (/* binding */ joyrideStyles)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var react_joyride__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react-joyride */ "../node_modules/react-joyride/dist/index.mjs");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_util_tracking__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/tracking */ "./js/util/tracking/index.js");
/* harmony import */ var _TourTooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TourTooltip */ "./js/components/TourTooltip.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/features */ "./js/features/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TourTooltips component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */








const setupFlowRefreshEnabled = (0,_js_features__WEBPACK_IMPORTED_MODULE_7__.isFeatureEnabled)('setupFlowRefresh');

/** For available options, see: {@link https://github.com/gilbarbara/react-joyride/blob/3e08384415a831b20ce21c8423b6c271ad419fbf/src/styles.js}. */
const joyrideStyles = {
  options: {
    arrowColor: '#3c7251',
    // $c-content-primary
    backgroundColor: '#3c7251',
    // $c-content-primary
    overlayColor: setupFlowRefreshEnabled ? 'rgba(0, 0, 0, 0.25)' : 'rgba(0, 0, 0, 0.6)',
    textColor: '#fff',
    // $c-content-on-primary
    zIndex: 20000
  },
  spotlight: {
    border: setupFlowRefreshEnabled ? 'none' : '2px solid #3c7251',
    // $c-content-primary
    backgroundColor: '#fff'
  }
};

// Provides button content as well as aria-label & title attribute values.
const joyrideLocale = {
  back: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back', 'google-site-kit'),
  close: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Close', 'google-site-kit'),
  last: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Got it', 'google-site-kit'),
  next: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Next', 'google-site-kit')
};

/** For available options, see: {@link https://github.com/gilbarbara/react-floater#props}. */
const floaterProps = {
  disableAnimation: true,
  styles: {
    arrow: {
      length: 8,
      margin: 56,
      spread: 16
    },
    floater: {
      filter: 'drop-shadow(rgba(60, 64, 67, 0.3) 0px 1px 2px) drop-shadow(rgba(60, 64, 67, 0.15) 0px 2px 6px)'
    }
  }
};

// GA Event Tracking actions (do not change!)
const GA_ACTIONS = {
  VIEW: 'feature_tooltip_view',
  NEXT: 'feature_tooltip_advance',
  PREV: 'feature_tooltip_return',
  DISMISS: 'feature_tooltip_dismiss',
  COMPLETE: 'feature_tooltip_complete'
};
function TourTooltips({
  steps,
  tourID,
  gaEventCategory,
  isRepeatable,
  callback
}) {
  const stepKey = `${tourID}-step`;
  const runKey = `${tourID}-run`;
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI);
  const {
    dismissTour,
    receiveCurrentTour
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER);
  const registry = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useRegistry)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const stepIndex = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI).getValue(stepKey) || 0);
  const run = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const notDismissedOrRepeatable = isRepeatable || select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isTourDismissed(tourID) === false;
    return select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI).getValue(runKey) && notDismissedOrRepeatable;
  });
  function getStepClassName(index) {
    return `googlesitekit-showing-feature-tour--${tourID}-${steps[index].slug || index}`;
  }
  function changeStep(index, action) {
    const newStepIndex = index + (action === react_joyride__WEBPACK_IMPORTED_MODULE_9__.ACTIONS.PREV ? -1 : 1);
    __webpack_require__.g.document.body.classList.remove(getStepClassName(index));
    if (steps[newStepIndex]) {
      __webpack_require__.g.document.body.classList.add(getStepClassName(newStepIndex));
    }
    return setValue(stepKey, newStepIndex);
  }
  function startTour() {
    __webpack_require__.g.document.body.classList.add('googlesitekit-showing-feature-tour', `googlesitekit-showing-feature-tour--${tourID}`, getStepClassName(stepIndex));
    setValue(runKey, true);
  }
  function endTour() {
    __webpack_require__.g.document.body.classList.remove('googlesitekit-showing-feature-tour', `googlesitekit-showing-feature-tour--${tourID}`);

    // `stepIndex` may be out of bounds if the user has advanced beyond the last step.
    if (steps[stepIndex]) {
      __webpack_require__.g.document.body.classList.remove(getStepClassName(stepIndex));
    }
    if (isRepeatable) {
      setValue(runKey, false);
      setValue(stepKey, null);
      receiveCurrentTour(null);
    } else {
      // Dismiss tour to avoid unwanted repeat viewing.
      dismissTour(tourID);
    }
  }
  function trackAllTourEvents({
    index,
    action,
    lifecycle,
    size,
    status,
    type
  }) {
    // The index is 0-based, but step numbers are 1-based.
    const stepNumber = index + 1;
    const eventCategory = typeof gaEventCategory === 'function' ? gaEventCategory(viewContext) : gaEventCategory;
    if (type === react_joyride__WEBPACK_IMPORTED_MODULE_9__.EVENTS.TOOLTIP && lifecycle === react_joyride__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.TOOLTIP) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(eventCategory, GA_ACTIONS.VIEW, stepNumber);
    } else if (action === react_joyride__WEBPACK_IMPORTED_MODULE_9__.ACTIONS.CLOSE && lifecycle === react_joyride__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.COMPLETE) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(eventCategory, GA_ACTIONS.DISMISS, stepNumber);
    } else if (action === react_joyride__WEBPACK_IMPORTED_MODULE_9__.ACTIONS.NEXT && status === react_joyride__WEBPACK_IMPORTED_MODULE_9__.STATUS.FINISHED && type === react_joyride__WEBPACK_IMPORTED_MODULE_9__.EVENTS.TOUR_END &&
    // Here we need to additionally check the size === stepNumber because
    // it is the only way to differentiate the status/event combination
    // from an identical combination that happens immediately after completion
    // on index `0` to avoid duplicate measurement.
    size === stepNumber) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(eventCategory, GA_ACTIONS.COMPLETE, stepNumber);
    }
    if (lifecycle !== react_joyride__WEBPACK_IMPORTED_MODULE_9__.LIFECYCLE.COMPLETE || status === react_joyride__WEBPACK_IMPORTED_MODULE_9__.STATUS.FINISHED) {
      return;
    }
    if (action === react_joyride__WEBPACK_IMPORTED_MODULE_9__.ACTIONS.PREV) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(eventCategory, GA_ACTIONS.PREV, stepNumber);
    }
    if (action === react_joyride__WEBPACK_IMPORTED_MODULE_9__.ACTIONS.NEXT) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(eventCategory, GA_ACTIONS.NEXT, stepNumber);
    }
  }

  /**
   * Handles `react-joyride` state changes using callback function.
   *
   * @typedef {Object} JoyrideCallbackData
   * @property {string} action The action that updated the state.
   * @property {status} status The tour's status.
   * @property {number} index  Step index.
   * @property {string} type   Specific type (tour, step, beacon).
   *
   * @since 1.28.0
   * @since 1.38.0 Calls new callback prop.
   * @see {@link https://docs.react-joyride.com/callback} Example data provided by `react-joyride`.
   * @see {@link https://docs.react-joyride.com/constants} State & lifecycle constants used by `react-joyride`.
   *
   * @param {JoyrideCallbackData} data Data object provided via `react-joyride` callback prop.
   */
  function handleJoyrideCallback(data) {
    trackAllTourEvents(data);
    const {
      action,
      index,
      status,
      step,
      type
    } = data;
    const hasCloseAction = action === react_joyride__WEBPACK_IMPORTED_MODULE_9__.ACTIONS.CLOSE;
    const shouldChangeStep = !hasCloseAction && [react_joyride__WEBPACK_IMPORTED_MODULE_9__.EVENTS.STEP_AFTER, react_joyride__WEBPACK_IMPORTED_MODULE_9__.EVENTS.TARGET_NOT_FOUND].includes(type);
    const isFinishedOrSkipped = [react_joyride__WEBPACK_IMPORTED_MODULE_9__.STATUS.FINISHED, react_joyride__WEBPACK_IMPORTED_MODULE_9__.STATUS.SKIPPED].includes(status);
    const shouldCloseFromButtonClick = hasCloseAction && type === react_joyride__WEBPACK_IMPORTED_MODULE_9__.EVENTS.STEP_AFTER;
    const shouldEndTour = isFinishedOrSkipped || shouldCloseFromButtonClick;

    // Center the target in the viewport when transitioning to the step.
    if (react_joyride__WEBPACK_IMPORTED_MODULE_9__.EVENTS.STEP_BEFORE === type) {
      let element = step.target;
      if ('string' === typeof step.target) {
        element = __webpack_require__.g.document.querySelector(step.target);
      }
      element?.scrollIntoView?.({
        block: 'center'
      });
    }
    if (shouldChangeStep) {
      changeStep(index, action);
    } else if (shouldEndTour) {
      endTour();
    }
    if (callback) {
      callback(data, registry);
    }
  }

  // Start tour on initial render.
  (0,react_use__WEBPACK_IMPORTED_MODULE_10__["default"])(startTour);
  const parsedSteps = steps.map(step => ({
    disableBeacon: true,
    isFixed: true,
    placement: 'auto',
    ...step
  }));

  // Customize floater props based on feature flag.
  const customFloaterProps = setupFlowRefreshEnabled ? {
    ...floaterProps,
    styles: {
      ...floaterProps.styles,
      floater: {
        filter: 'drop-shadow(rgba(0, 0, 0, 0.25) 0px 4px 16px)'
      }
    }
  } : floaterProps;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react_joyride__WEBPACK_IMPORTED_MODULE_9__["default"], {
    callback: handleJoyrideCallback,
    floaterProps: customFloaterProps,
    locale: joyrideLocale,
    run: run,
    stepIndex: stepIndex,
    steps: parsedSteps,
    styles: joyrideStyles,
    tooltipComponent: _TourTooltip__WEBPACK_IMPORTED_MODULE_5__["default"],
    showProgress: !setupFlowRefreshEnabled,
    continuous: true,
    disableOverlayClose: true,
    disableScrolling: true
  });
}

/** For available properties & docs for `steps`, see: {@link https://docs.react-joyride.com/step#options}. */
TourTooltips.propTypes = {
  steps: prop_types__WEBPACK_IMPORTED_MODULE_11___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_11___default().object)).isRequired,
  tourID: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string).isRequired,
  gaEventCategory: prop_types__WEBPACK_IMPORTED_MODULE_11___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_11___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_11___default().func)]).isRequired,
  isRepeatable: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().bool),
  callback: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().func)
};

/***/ }),

/***/ "./js/components/Typography/P.js":
/*!***************************************!*\
  !*** ./js/components/Typography/P.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ P)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! . */ "./js/components/Typography/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./js/components/Typography/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function P({
  type = _constants__WEBPACK_IMPORTED_MODULE_2__.TYPE_BODY,
  size,
  children,
  ...props
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__.useBreakpoint)();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(___WEBPACK_IMPORTED_MODULE_1__["default"], {
    as: "p",
    type: type,
    size: size || (breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__.BREAKPOINT_SMALL ? _constants__WEBPACK_IMPORTED_MODULE_2__.SIZE_SMALL : _constants__WEBPACK_IMPORTED_MODULE_2__.SIZE_MEDIUM),
    ...props,
    children: children
  });
}
P.propTypes = {
  type: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(_constants__WEBPACK_IMPORTED_MODULE_2__.VALID_TYPES),
  size: prop_types__WEBPACK_IMPORTED_MODULE_4___default().oneOf(_constants__WEBPACK_IMPORTED_MODULE_2__.VALID_SIZES)
};

/***/ }),

/***/ "./js/components/Typography/constants.js":
/*!***********************************************!*\
  !*** ./js/components/Typography/constants.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   SIZE_LARGE: () => (/* binding */ SIZE_LARGE),
/* harmony export */   SIZE_MEDIUM: () => (/* binding */ SIZE_MEDIUM),
/* harmony export */   SIZE_SMALL: () => (/* binding */ SIZE_SMALL),
/* harmony export */   TYPE_BODY: () => (/* binding */ TYPE_BODY),
/* harmony export */   TYPE_DISPLAY: () => (/* binding */ TYPE_DISPLAY),
/* harmony export */   TYPE_HEADLINE: () => (/* binding */ TYPE_HEADLINE),
/* harmony export */   TYPE_LABEL: () => (/* binding */ TYPE_LABEL),
/* harmony export */   TYPE_TITLE: () => (/* binding */ TYPE_TITLE),
/* harmony export */   VALID_SIZES: () => (/* binding */ VALID_SIZES),
/* harmony export */   VALID_TYPES: () => (/* binding */ VALID_TYPES)
/* harmony export */ });
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const TYPE_DISPLAY = 'display';
const TYPE_HEADLINE = 'headline';
const TYPE_TITLE = 'title';
const TYPE_BODY = 'body';
const TYPE_LABEL = 'label';
const VALID_TYPES = [TYPE_BODY, TYPE_DISPLAY, TYPE_HEADLINE, TYPE_LABEL, TYPE_TITLE];
const SIZE_SMALL = 'small';
const SIZE_MEDIUM = 'medium';
const SIZE_LARGE = 'large';
const VALID_SIZES = [SIZE_SMALL, SIZE_MEDIUM, SIZE_LARGE];

/***/ }),

/***/ "./js/components/Typography/index.js":
/*!*******************************************!*\
  !*** ./js/components/Typography/index.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Typography)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./js/components/Typography/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */


function Typography({
  className,
  type,
  size,
  as: Component = 'span',
  children,
  ...props
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Component, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-typography', className, {
      [`googlesitekit-typography--${type}`]: type && _constants__WEBPACK_IMPORTED_MODULE_1__.VALID_TYPES.includes(type),
      [`googlesitekit-typography--${size}`]: size && _constants__WEBPACK_IMPORTED_MODULE_1__.VALID_SIZES.includes(size)
    }),
    ...props,
    children: children
  });
}
Typography.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  type: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(_constants__WEBPACK_IMPORTED_MODULE_1__.VALID_TYPES),
  size: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOf(_constants__WEBPACK_IMPORTED_MODULE_1__.VALID_SIZES),
  as: prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().elementType)])
};

/***/ }),

/***/ "./js/components/UserMenu/Details.js":
/*!*******************************************!*\
  !*** ./js/components/UserMenu/Details.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Details)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * UserMenu Details component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function Details() {
  const userPicture = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getPicture());
  const userFullName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getFullName());
  const userEmail = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getEmail());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: "googlesitekit-user-menu__details",
    "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Google account', 'google-site-kit'),
    children: [!!userPicture && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
      className: "googlesitekit-user-menu__details-avatar",
      src: userPicture,
      alt: ""
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "googlesitekit-user-menu__details-info",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
        className: "googlesitekit-user-menu__details-info__name",
        children: userFullName
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
        className: "googlesitekit-user-menu__details-info__email",
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Email', 'google-site-kit'),
        children: userEmail
      })]
    })]
  });
}

/***/ }),

/***/ "./js/components/UserMenu/index.js":
/*!*****************************************!*\
  !*** ./js/components/UserMenu/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ UserMenu)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_ModalDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ModalDialog */ "./js/components/ModalDialog.js");
/* harmony import */ var _js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/HeaderMenu */ "./js/components/HeaderMenu/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.js");
/* harmony import */ var _js_components_Portal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Portal */ "./js/components/Portal.js");
/* harmony import */ var _Details__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Details */ "./js/components/UserMenu/Details.js");
/* harmony import */ var _svg_icons_disconnect_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/icons/disconnect.svg */ "./svg/icons/disconnect.svg");
/* harmony import */ var _svg_icons_manage_sites_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/svg/icons/manage-sites.svg */ "./svg/icons/manage-sites.svg");
/* harmony import */ var _svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/svg/icons/manage-email-reports.svg */ "./svg/icons/manage-email-reports.svg");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_components_email_reporting_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/components/email-reporting/constants */ "./js/components/email-reporting/constants.js");
/* harmony import */ var _js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/hooks/useKeyCodesInside */ "./js/hooks/useKeyCodesInside.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * UserMenu component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */






















function UserMenu() {
  const emailReportingEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_21__.useFeature)('proactiveUserEngagement');
  const proxyPermissionsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__.CORE_SITE).getProxyPermissionsURL());
  const userEmail = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).getEmail());
  const userPicture = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).getPicture());
  const userFullName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).getFullName());
  const postDisconnectURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__.CORE_SITE).getAdminURL('googlesitekit-splash', {
    googlesitekit_context: 'revoked'
  }));
  const isAutoCreatingCustomDimensionsForAudience = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_20__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_16__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isAutoCreatingCustomDimensionsForAudience');
  const {
    isTooltipVisible = false,
    className
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_UI).getValue('admin-screen-tooltip') || {
    isTooltipVisible: false
  });
  const [dialogActive, toggleDialog] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useState)(false);
  const [menuOpen, setMenuOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useState)(false);
  const menuWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useRef)();
  const menuButtonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_19__["default"])();
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_15__.CORE_LOCATION);
  (0,react_use__WEBPACK_IMPORTED_MODULE_24__["default"])(menuWrapperRef, () => setMenuOpen(false));
  (0,_js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_18__.useKeyCodesInside)([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_25__.ESCAPE, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_25__.TAB], menuWrapperRef, () => {
    setMenuOpen(false);
    // Reinstate menu button focus when menu is closed.
    menuButtonRef.current?.focus();
  });
  const handleClose = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useCallback)(() => {
    toggleDialog(false);
    setMenuOpen(false);
  }, [toggleDialog, setMenuOpen]);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_UI);
  const handleMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useCallback)(() => {
    if (!menuOpen) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(`${viewContext}_headerbar`, 'open_usermenu');
      if (isTooltipVisible && className?.includes('googlesitekit-tour-tooltip--user-menu')) {
        setValue('admin-screen-tooltip', undefined);
      }
    }
    setMenuOpen(!menuOpen);
  }, [menuOpen, viewContext, setValue, isTooltipVisible, className]);
  const handleDialog = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useCallback)(() => {
    toggleDialog(!dialogActive);
    setMenuOpen(false);
  }, [dialogActive]);
  const handleMenuItemSelect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useCallback)(async (_index, event) => {
    const {
      detail: {
        item
      }
    } = event;
    switch (item?.id) {
      case 'manage-sites':
        if (proxyPermissionsURL) {
          await (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(`${viewContext}_headerbar_usermenu`, 'manage_sites');
          navigateTo(proxyPermissionsURL);
        }
        break;
      case 'disconnect':
        handleDialog();
        break;
      case 'manage-email-reports':
        setValue(_js_components_email_reporting_constants__WEBPACK_IMPORTED_MODULE_17__.USER_SETTINGS_SELECTION_PANEL_OPENED_KEY, true);
        break;
      default:
        handleMenu();
    }
  }, [proxyPermissionsURL, handleMenu, handleDialog, navigateTo, setValue, viewContext]);

  // Log the user out if they confirm the dialog.
  const handleUnlinkConfirm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.useCallback)(async () => {
    // Close the modal.
    toggleDialog(false);
    await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_6__.clearCache)();
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(`${viewContext}_headerbar_usermenu`, 'disconnect_user');

    // Navigate back to the splash screen to reconnect.
    navigateTo(postDisconnectURL);
  }, [postDisconnectURL, navigateTo, viewContext]);
  if (!userEmail) {
    return null;
  }
  let accountLabel;
  if (userFullName && userEmail) {
    accountLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: Account info text. 1: User's (full) name 2: User's email address. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Google Account for %1$s (Email: %2$s)', 'google-site-kit'), userFullName, userEmail);
  }
  if (userFullName && !userEmail) {
    accountLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: Account info text. 1: User's (full) name. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Google Account for %1$s', 'google-site-kit'), userFullName);
  }
  if (!userFullName && userEmail) {
    accountLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: Account info text. 1: User's email address. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Google Account (Email: %1$s)', 'google-site-kit'), userEmail);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_23__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("div", {
      ref: menuWrapperRef,
      className: "googlesitekit-user-selector googlesitekit-dropdown-menu googlesitekit-dropdown-menu__icon-menu mdc-menu-surface--anchor",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        disabled: isAutoCreatingCustomDimensionsForAudience,
        ref: menuButtonRef,
        className: "googlesitekit-header__dropdown mdc-button--dropdown googlesitekit-border-radius-round--tablet googlesitekit-border-radius-round--phone googlesitekit-border-radius-round googlesitekit-button-icon",
        onClick: handleMenu,
        icon: !!userPicture && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("i", {
          className: "mdc-button__icon mdc-button__account",
          "aria-hidden": "true",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("img", {
            className: "mdc-button__icon--image",
            src: userPicture,
            alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('User Avatar', 'google-site-kit')
          })
        }),
        "aria-haspopup": "menu",
        "aria-expanded": menuOpen,
        "aria-controls": "user-menu",
        "aria-label": isAutoCreatingCustomDimensionsForAudience ? undefined : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Account', 'google-site-kit'),
        tooltipEnterDelayInMS: 500,
        customizedTooltip: isAutoCreatingCustomDimensionsForAudience ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("span", {
          "aria-label": accountLabel,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("strong", {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Google Account', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("br", {}), userFullName, userFullName && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("br", {}), userEmail]
        }),
        text: true,
        tooltip: true
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Menu, {
        className: "googlesitekit-user-menu",
        menuOpen: menuOpen,
        onSelected: handleMenuItemSelect,
        id: "user-menu",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__.MenuSection, {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_Details__WEBPACK_IMPORTED_MODULE_8__["default"], {})
        }), emailReportingEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__.MenuItem, {
          id: "manage-email-reports",
          icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_11__["default"], {
            width: "24"
          }),
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Manage email reports', 'google-site-kit'),
          itemClassName: "googlesitekit-user-menu__item",
          iconClassName: "googlesitekit-user-menu__item-icon",
          labelClassName: "googlesitekit-user-menu__item-label"
        }), !!proxyPermissionsURL && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__.MenuItem, {
          id: "manage-sites",
          icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_svg_icons_manage_sites_svg__WEBPACK_IMPORTED_MODULE_10__["default"], {
            width: "24"
          }),
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Manage Sites', 'google-site-kit'),
          itemClassName: "googlesitekit-user-menu__item",
          iconClassName: "googlesitekit-user-menu__item-icon",
          labelClassName: "googlesitekit-user-menu__item-label"
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__.MenuItem, {
          id: "disconnect",
          icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_svg_icons_disconnect_svg__WEBPACK_IMPORTED_MODULE_9__["default"], {
            width: "24"
          }),
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Disconnect', 'google-site-kit'),
          itemClassName: "googlesitekit-user-menu__item",
          iconClassName: "googlesitekit-user-menu__item-icon",
          labelClassName: "googlesitekit-user-menu__item-label"
        })]
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_Portal__WEBPACK_IMPORTED_MODULE_7__["default"], {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_ModalDialog__WEBPACK_IMPORTED_MODULE_3__["default"], {
        dialogActive: dialogActive,
        handleConfirm: handleUnlinkConfirm,
        handleCancel: handleClose,
        onClose: handleClose,
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Disconnect', 'google-site-kit'),
        subtitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Disconnecting Site Kit by Google will remove your access to all services. After disconnecting, you will need to re-authorize to restore service.', 'google-site-kit'),
        confirmButton: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Disconnect', 'google-site-kit'),
        danger: true,
        small: true
      })
    })]
  });
}

/***/ }),

/***/ "./js/components/ViewOnlyMenu/Description.js":
/*!***************************************************!*\
  !*** ./js/components/ViewOnlyMenu/Description.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Description)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ViewOnlyMenu > Description component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */











function Description() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const canAuthenticate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.PERMISSION_AUTHENTICATE));
  const proxySetupURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getProxySetupURL());
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('dashboard-sharing');
  });
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_LOCATION);
  const onButtonClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.useCallback)(async event => {
    event.preventDefault();
    await Promise.all([
    // Cache the start of the user setup journey.
    // This will be used for event tracking logic after successful setup.
    (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_10__.setItem)('start_user_setup', true), (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_headerbar_viewonly`, 'start_user_setup', proxySetupURL ? 'proxy' : 'custom-oauth')]);
    navigateTo(proxySetupURL);
  }, [proxySetupURL, navigateTo, viewContext]);
  const onLinkClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_headerbar_viewonly`, 'click_learn_more_link');
  }, [viewContext]);
  const description = canAuthenticate ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("You can see stats from all shared Google services, but you can't make any changes. Sign in to connect more services and control sharing access.", 'google-site-kit') : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)("You can see stats from all shared Google services, but you can't make any changes. <a>Learn more</a>", 'google-site-kit'), {
    a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_8__["default"], {
      href: documentationURL,
      onClick: onLinkClick,
      "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more about dashboard sharing', 'google-site-kit'),
      external: true
    })
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      className: "googlesitekit-view-only-menu__signin",
      children: description
    }), canAuthenticate && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
      onClick: onButtonClick,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Sign in with Google', 'Service name', 'google-site-kit')
    })]
  });
}

/***/ }),

/***/ "./js/components/ViewOnlyMenu/ManageEmailReports.js":
/*!**********************************************************!*\
  !*** ./js/components/ViewOnlyMenu/ManageEmailReports.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ManageEmailReports)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit-data */ "./js/googlesitekit-data.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_components_email_reporting_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/email-reporting/constants */ "./js/components/email-reporting/constants.js");
/* harmony import */ var _svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/icons/manage-email-reports.svg */ "./svg/icons/manage-email-reports.svg");
/* harmony import */ var _js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/HeaderMenu */ "./js/components/HeaderMenu/index.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ViewOnlyMenu > ManageEmailReports component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








function ManageEmailReports() {
  const {
    setValue
  } = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI);
  const hasEmailReportingDataAccess = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const viewableModules = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getViewableModules();
    if (viewableModules === undefined) {
      return undefined;
    }
    return viewableModules.includes('analytics-4') || viewableModules.includes('search-console');
  });

  // Don't render if user doesn't have access to any email report data modules.
  if (!hasEmailReportingDataAccess) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_6__.Divider, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_6__.MenuItem, {
      className: "googlesitekit-view-only-menu__list-item googlesitekit-view-only-menu__email-reporting",
      isInteractive: false,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_7__.Button, {
        className: "googlesitekit-view-only-menu__email-reporting-item",
        onClick: () => setValue(_js_components_email_reporting_constants__WEBPACK_IMPORTED_MODULE_4__.USER_SETTINGS_SELECTION_PANEL_OPENED_KEY, true),
        icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", {
          className: "googlesitekit-view-only-menu__email-reporting-item--icon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_5__["default"], {
            width: "24"
          })
        }),
        tertiary: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", {
          className: "googlesitekit-view-only-menu__email-reporting-item--name",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Manage email reports', 'google-site-kit')
        })
      })
    })]
  });
}

/***/ }),

/***/ "./js/components/ViewOnlyMenu/Service.js":
/*!***********************************************!*\
  !*** ./js/components/ViewOnlyMenu/Service.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Service)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ViewOnlyMenu > Service component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function Service({
  module
}) {
  const canAuthenticate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.PERMISSION_AUTHENTICATE));
  const {
    name,
    owner
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_MODULES).getModule(module) || {});
  const Icon = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_MODULES).getModuleIcon(module));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("li", {
    className: "googlesitekit-view-only-menu__service",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      className: "googlesitekit-view-only-menu__service--icon",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Icon, {
        height: 26
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      className: "googlesitekit-view-only-menu__service--name",
      children: name
    }), canAuthenticate && owner?.login && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      className: "googlesitekit-view-only-menu__service--owner",
      children: owner.login
    })]
  });
}
Service.propTypes = {
  module: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string).isRequired
};

/***/ }),

/***/ "./js/components/ViewOnlyMenu/SharedServices.js":
/*!******************************************************!*\
  !*** ./js/components/ViewOnlyMenu/SharedServices.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SharedServices)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _Service__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Service */ "./js/components/ViewOnlyMenu/Service.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ViewOnlyMenu > SharedServices component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


function SharedServices({
  viewableModules
}) {
  if (!Array.isArray(viewableModules)) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("ul", {
    children: viewableModules.map(moduleSlug => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_Service__WEBPACK_IMPORTED_MODULE_0__["default"], {
      module: moduleSlug
    }, moduleSlug))
  });
}
SharedServices.propTypes = {
  viewableModules: prop_types__WEBPACK_IMPORTED_MODULE_2___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_2___default().string))
};

/***/ }),

/***/ "./js/components/ViewOnlyMenu/Tracking.js":
/*!************************************************!*\
  !*** ./js/components/ViewOnlyMenu/Tracking.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Tracking)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_OptIn__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/OptIn */ "./js/components/OptIn/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ViewOnlyMenu > Tracking component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




function Tracking() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_2__["default"])();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_OptIn__WEBPACK_IMPORTED_MODULE_1__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Help us improve Site Kit', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share anonymous usage data. All collected data is treated in accordance with the <a>Google Privacy Policy</a>', 'google-site-kit'), {
      a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
        href: "https://policies.google.com/privacy",
        external: true
      })
    }),
    trackEventCategory: `${viewContext}_headerbar_viewonly`,
    layout: "stacked"
  });
}

/***/ }),

/***/ "./js/components/ViewOnlyMenu/index.js":
/*!*********************************************!*\
  !*** ./js/components/ViewOnlyMenu/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ViewOnlyMenu)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/HeaderMenu */ "./js/components/HeaderMenu/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useKeyCodesInside */ "./js/hooks/useKeyCodesInside.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_view_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/icons/view.svg */ "./svg/icons/view.svg");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Description */ "./js/components/ViewOnlyMenu/Description.js");
/* harmony import */ var _SharedServices__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SharedServices */ "./js/components/ViewOnlyMenu/SharedServices.js");
/* harmony import */ var _Tracking__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Tracking */ "./js/components/ViewOnlyMenu/Tracking.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_components_ViewOnlyMenu_ManageEmailReports__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/components/ViewOnlyMenu/ManageEmailReports */ "./js/components/ViewOnlyMenu/ManageEmailReports.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ViewOnlyMenu component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */















function ViewOnlyMenu() {
  const emailReportingEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('proactiveUserEngagement');
  const [menuOpen, setMenuOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useState)(false);
  const menuWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__["default"])();
  (0,react_use__WEBPACK_IMPORTED_MODULE_18__["default"])(menuWrapperRef, () => setMenuOpen(false));
  (0,_js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_6__.useKeyCodesInside)([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_19__.ESCAPE, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_19__.TAB], menuWrapperRef, () => setMenuOpen(false));
  const toggleMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_17__.useCallback)(() => {
    if (!menuOpen) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_headerbar`, 'open_viewonly');
    }
    setMenuOpen(!menuOpen);
  }, [menuOpen, viewContext]);
  const canAuthenticate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_12__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_13__.PERMISSION_AUTHENTICATE));
  const viewableModules = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_12__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_USER).getViewableModules());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
    ref: menuWrapperRef,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-view-only-menu', 'googlesitekit-dropdown-menu', 'googlesitekit-dropdown-menu__icon-menu', 'mdc-menu-surface--anchor', {
      'googlesitekit-view-only-menu--user-can-authenticate': canAuthenticate
    }),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
      className: "googlesitekit-header__dropdown mdc-button--dropdown googlesitekit-border-radius-round--phone googlesitekit-button-icon",
      onClick: toggleMenu,
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span", {
        className: "mdc-button__icon",
        "aria-hidden": "true",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_svg_icons_view_svg__WEBPACK_IMPORTED_MODULE_8__["default"], {
          className: "mdc-button__icon--image"
        })
      }),
      "aria-haspopup": "menu",
      "aria-expanded": menuOpen,
      "aria-controls": "view-only-menu",
      "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View only', 'google-site-kit'),
      tooltipEnterDelayInMS: 500,
      text: true,
      tooltip: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View only', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Menu, {
      menuOpen: menuOpen,
      onSelected: toggleMenu,
      id: "view-only-menu",
      nonInteractive: true,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_3__.MenuSection, {
        className: "googlesitekit-view-only-menu__list-item googlesitekit-view-only-menu__description",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_Description__WEBPACK_IMPORTED_MODULE_9__["default"], {})
      }), Array.isArray(viewableModules) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_3__.MenuWithHeading, {
        className: "googlesitekit-view-only-menu__list-item",
        heading: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_15__["default"], {
          as: "h4",
          size: "medium",
          type: "label",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Shared services', 'google-site-kit')
        }),
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_SharedServices__WEBPACK_IMPORTED_MODULE_10__["default"], {
          viewableModules: viewableModules
        })
      }), emailReportingEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_ViewOnlyMenu_ManageEmailReports__WEBPACK_IMPORTED_MODULE_14__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_3__.Divider, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_3__.MenuSection, {
        className: "googlesitekit-view-only-menu__list-item",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_Tracking__WEBPACK_IMPORTED_MODULE_11__["default"], {})
      })]
    })]
  });
}

/***/ }),

/***/ "./js/components/VisuallyHidden.js":
/*!*****************************************!*\
  !*** ./js/components/VisuallyHidden.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Visually Hidden component, mainly used for screen-reader text.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function VisuallyHidden({
  className,
  children,
  ...otherProps
}) {
  if (!children) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
    ...otherProps,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('screen-reader-text', className),
    children: children
  });
}
VisuallyHidden.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};
VisuallyHidden.defaultProps = {
  className: ''
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VisuallyHidden);

/***/ }),

/***/ "./js/components/conversion-tracking/SetupPluginConversionTrackingNotice.js":
/*!**********************************************************************************!*\
  !*** ./js/components/conversion-tracking/SetupPluginConversionTrackingNotice.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupPluginConversionTrackingNotice)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */



function SetupPluginConversionTrackingNotice({
  className,
  message
}) {
  const isCTEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).isConversionTrackingEnabled());
  if (isCTEnabled || isCTEnabled === undefined) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, 'googlesitekit-color--surfaces-on-background-variant googlesitekit-plugin-conversion-tracking-notice'),
    children: message
  });
}

/***/ }),

/***/ "./js/components/email-reporting/constants.js":
/*!****************************************************!*\
  !*** ./js/components/email-reporting/constants.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   USER_SETTINGS_SELECTION_PANEL_OPENED_KEY: () => (/* binding */ USER_SETTINGS_SELECTION_PANEL_OPENED_KEY)
/* harmony export */ });
/**
 * Email Reporting constants
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const USER_SETTINGS_SELECTION_PANEL_OPENED_KEY = 'emailReportingUserSettingsSelectionPanelOpened';

/***/ }),

/***/ "./js/components/help/HelpMenu.js":
/*!****************************************!*\
  !*** ./js/components/help/HelpMenu.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ HelpMenu)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_24__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _HelpMenuLink__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./HelpMenuLink */ "./js/components/help/HelpMenuLink.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useKeyCodesInside */ "./js/hooks/useKeyCodesInside.js");
/* harmony import */ var _js_feature_tours_hooks_useWelcomeTour__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/feature-tours/hooks/useWelcomeTour */ "./js/feature-tours/hooks/useWelcomeTour.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _svg_icons_feedback_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/svg/icons/feedback.svg */ "./svg/icons/feedback.svg");
/* harmony import */ var _svg_icons_compass_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/svg/icons/compass.svg */ "./svg/icons/compass.svg");
/* harmony import */ var _svg_icons_support_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/svg/icons/support.svg */ "./svg/icons/support.svg");
/* harmony import */ var _svg_icons_documentation_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/svg/icons/documentation.svg */ "./svg/icons/documentation.svg");
/* harmony import */ var _svg_icons_help_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/svg/icons/help.svg */ "./svg/icons/help.svg");
/* harmony import */ var _svg_icons_adsense_help_svg__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/svg/icons/adsense-help.svg */ "./svg/icons/adsense-help.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * HelpMenu component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */



















function HelpMenu({
  children
}) {
  const [menuOpen, setMenuOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useState)(false);
  const menuWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_13__["default"])();
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_10__.useFeature)('setupFlowRefresh');
  (0,react_use__WEBPACK_IMPORTED_MODULE_22__["default"])(menuWrapperRef, () => setMenuOpen(false));
  (0,_js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_11__.useKeyCodesInside)([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_23__.ESCAPE, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_23__.TAB], menuWrapperRef, () => setMenuOpen(false));
  const adSenseModuleActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES).isModuleActive(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ADSENSE));
  const handleMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useCallback)(() => {
    if (!menuOpen) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_headerbar`, 'open_helpmenu');
    }
    setMenuOpen(!menuOpen);
  }, [menuOpen, viewContext]);
  const handleMenuSelected = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useCallback)(() => {
    setMenuOpen(false);
  }, []);
  const fixCommonIssuesURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getDocumentationLinkURL('fix-common-issues');
  });
  const {
    triggerOnDemandTour
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER);
  const welcomeTour = (0,_js_feature_tours_hooks_useWelcomeTour__WEBPACK_IMPORTED_MODULE_12__.useWelcomeTour)();
  const handleStartFeatureTour = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useCallback)(() => {
    triggerOnDemandTour(welcomeTour);
  }, [triggerOnDemandTour, welcomeTour]);
  const menuItems = [{
    gaEventLabel: 'fix_common_issues',
    href: fixCommonIssuesURL,
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Fix common issues', 'google-site-kit')
  }, {
    gaEventLabel: 'documentation',
    href: 'https://sitekit.withgoogle.com/documentation/',
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Read help docs', 'google-site-kit')
  }, {
    gaEventLabel: 'support_forum',
    href: 'https://wordpress.org/support/plugin/google-site-kit/',
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get support', 'google-site-kit')
  }, ...(adSenseModuleActive ? [{
    gaEventLabel: 'adsense_help',
    href: 'https://support.google.com/adsense/',
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get help with AdSense', 'google-site-kit')
  }] : [])];
  const setupFlowRefreshMenuItems = [{
    gaEventLabel: 'browse_documentation',
    href: 'https://sitekit.withgoogle.com/documentation/',
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_svg_icons_documentation_svg__WEBPACK_IMPORTED_MODULE_17__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Browse documentation', 'google-site-kit')
  }, {
    gaEventLabel: 'get_support',
    href: 'https://wordpress.org/support/plugin/google-site-kit/',
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_svg_icons_support_svg__WEBPACK_IMPORTED_MODULE_16__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get free support', 'google-site-kit')
  }, {
    gaEventLabel: 'start_tour',
    onClick: handleStartFeatureTour,
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_svg_icons_compass_svg__WEBPACK_IMPORTED_MODULE_15__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Start a feature tour', 'google-site-kit')
  }, {
    gaEventLabel: 'send_feedback',
    href: 'https://wordpress.org/support/plugin/google-site-kit/reviews/',
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_svg_icons_feedback_svg__WEBPACK_IMPORTED_MODULE_14__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Send feedback', 'google-site-kit')
  }, ...(adSenseModuleActive ? [{
    gaEventLabel: 'get_adsense_help',
    href: 'https://support.google.com/adsense/',
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_svg_icons_adsense_help_svg__WEBPACK_IMPORTED_MODULE_19__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get help with AdSense', 'google-site-kit')
  }] : [])];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)("div", {
    ref: menuWrapperRef,
    className: "googlesitekit-dropdown-menu googlesitekit-dropdown-menu__icon-menu mdc-menu-surface--anchor",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
      "aria-controls": "googlesitekit-help-menu",
      "aria-expanded": menuOpen,
      "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Help', 'google-site-kit'),
      "aria-haspopup": "menu",
      className: "googlesitekit-header__dropdown googlesitekit-border-radius-round googlesitekit-button-icon googlesitekit-help-menu__button mdc-button--dropdown",
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_svg_icons_help_svg__WEBPACK_IMPORTED_MODULE_18__["default"], {
        width: "20",
        height: "20"
      }),
      onClick: handleMenu,
      tooltipEnterDelayInMS: 500,
      text: true
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Menu, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-width-auto', {
        'googlesitekit-help-menu': setupFlowRefreshEnabled
      }),
      menuOpen: menuOpen,
      id: "googlesitekit-help-menu",
      onSelected: handleMenuSelected,
      children: [children, (setupFlowRefreshEnabled ? setupFlowRefreshMenuItems : menuItems).map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_HelpMenuLink__WEBPACK_IMPORTED_MODULE_5__["default"], {
        ...item
      }, index))]
    })]
  });
}
HelpMenu.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_24___default().node)
};

/***/ }),

/***/ "./js/components/help/HelpMenuLink.js":
/*!********************************************!*\
  !*** ./js/components/help/HelpMenuLink.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * HelpMenuLink component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





function HelpMenuLink({
  children,
  href,
  gaEventLabel,
  onClick,
  icon
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_2__["default"])();
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_3__.useFeature)('setupFlowRefresh');
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)(async () => {
    onClick?.();
    if (gaEventLabel) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.trackEvent)(`${viewContext}_headerbar_helpmenu`, setupFlowRefreshEnabled ? 'click_menu_item' : 'click_outgoing_link', gaEventLabel);
    }
  }, [onClick, gaEventLabel, viewContext, setupFlowRefreshEnabled]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("li", {
    className: "googlesitekit-help-menu-link mdc-list-item",
    role: "none",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_0__["default"], {
      className: "mdc-list-item__text",
      href: href,
      role: "menuitem",
      onClick: handleClick,
      leadingIcon: icon,
      external: true,
      hideExternalIndicator: true,
      children: children
    })
  });
}
HelpMenuLink.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().node).isRequired,
  href: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  gaEventLabel: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().func)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HelpMenuLink);

/***/ }),

/***/ "./js/components/layout/Layout.js":
/*!****************************************!*\
  !*** ./js/components/layout/Layout.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _LayoutHeader__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LayoutHeader */ "./js/components/layout/LayoutHeader.js");
/* harmony import */ var _LayoutFooter__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LayoutFooter */ "./js/components/layout/LayoutFooter.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Layout component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



class Layout extends _wordpress_element__WEBPACK_IMPORTED_MODULE_4__.Component {
  render() {
    const {
      header,
      footer,
      children,
      title,
      badge,
      headerCTALabel,
      headerCTALink,
      footerCTALabel,
      footerCTALink,
      footerContent,
      className,
      fill,
      relative,
      rounded = false,
      transparent = false,
      ...otherProps
    } = this.props;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-layout', className, {
        'googlesitekit-layout--fill': fill,
        'googlesitekit-layout--relative': relative,
        'googlesitekit-layout--rounded': rounded,
        'googlesitekit-layout--transparent': transparent
      }),
      ...otherProps,
      children: [header && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_LayoutHeader__WEBPACK_IMPORTED_MODULE_1__["default"], {
        title: title,
        badge: badge,
        ctaLabel: headerCTALabel,
        ctaLink: headerCTALink
      }), children, footer && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_LayoutFooter__WEBPACK_IMPORTED_MODULE_2__["default"], {
        ctaLabel: footerCTALabel,
        ctaLink: footerCTALink,
        footerContent: footerContent
      })]
    });
  }
}
Layout.propTypes = {
  header: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  footer: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  badge: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node),
  headerCTALabel: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  headerCTALink: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  footerCTALabel: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  footerCTALink: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  footerContent: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  fill: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  relative: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  rounded: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  transparent: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool)
};
Layout.defaultProps = {
  header: false,
  footer: false,
  title: '',
  badge: null,
  headerCTALabel: '',
  headerCTALink: '',
  footerCTALabel: '',
  footerCTALink: '',
  footerContent: null,
  className: '',
  fill: false,
  relative: false
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Layout);

/***/ }),

/***/ "./js/components/layout/LayoutFooter.js":
/*!**********************************************!*\
  !*** ./js/components/layout/LayoutFooter.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_components_SourceLink__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * LayoutFooter component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



class LayoutFooter extends _wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Component {
  render() {
    const {
      ctaLabel,
      ctaLink,
      footerContent
    } = this.props;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("footer", {
      className: "googlesitekit-layout__footer",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Grid, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Row, {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
            size: 12,
            children: [ctaLink && ctaLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_1__["default"], {
              className: "googlesitekit-data-block__source",
              name: ctaLabel,
              href: ctaLink,
              external: true
            }), footerContent]
          })
        })
      })
    });
  }
}
LayoutFooter.propTypes = {
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string),
  ctaLink: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LayoutFooter);

/***/ }),

/***/ "./js/components/layout/LayoutHeader.js":
/*!**********************************************!*\
  !*** ./js/components/layout/LayoutHeader.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * LayoutHeader component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




class LayoutHeader extends _wordpress_element__WEBPACK_IMPORTED_MODULE_4__.Component {
  render() {
    const {
      title,
      badge,
      ctaLabel,
      ctaLink
    } = this.props;
    const titleCellProps = ctaLink ? {
      alignMiddle: true,
      smSize: 4,
      lgSize: 6
    } : {
      alignMiddle: true,
      smSize: 4,
      mdSize: 8,
      lgSize: 12
    };
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("header", {
      className: "googlesitekit-layout__header",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Grid, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Row, {
          children: [title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
            ...titleCellProps,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
              as: "h3",
              size: "small",
              type: "title",
              className: "googlesitekit-subheading-1 googlesitekit-layout__header-title",
              children: [title, badge]
            })
          }), ctaLink && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
            smSize: 4,
            lgSize: 6,
            alignMiddle: true,
            mdAlignRight: true,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_1__["default"], {
              href: ctaLink,
              external: true,
              children: ctaLabel
            })
          })]
        })
      })
    });
  }
}
LayoutHeader.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  badge: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node),
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  ctaLink: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string)
};
LayoutHeader.defaultProps = {
  title: '',
  badge: null,
  ctaLabel: '',
  ctaLink: ''
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LayoutHeader);

/***/ }),

/***/ "./js/components/notifications/AdBlockerWarning.js":
/*!*********************************************************!*\
  !*** ./js/components/notifications/AdBlockerWarning.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdBlockerWarning)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _AdBlockerWarningMessage__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AdBlockerWarningMessage */ "./js/components/notifications/AdBlockerWarningMessage.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense AdBlockerWarning component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */





function AdBlockerWarning({
  moduleSlug,
  className
}) {
  const storeName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).getModuleStoreName(moduleSlug));
  const adBlockerWarningMessage = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(storeName)?.getAdBlockerWarningMessage());
  const getHelpLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getDocumentationLinkURL(`${moduleSlug}-ad-blocker-detected`));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_AdBlockerWarningMessage__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: className,
    getHelpLink: getHelpLink,
    warningMessage: adBlockerWarningMessage
  });
}
AdBlockerWarning.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string).isRequired
};

/***/ }),

/***/ "./js/components/notifications/AdBlockerWarningMessage.js":
/*!****************************************************************!*\
  !*** ./js/components/notifications/AdBlockerWarningMessage.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdBlockerWarningMessage)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _svg_icons_external_rounded_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/external-rounded.svg */ "./svg/icons/external-rounded.svg");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockerWarningMessage component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




function AdBlockerWarningMessage({
  className,
  getHelpLink = '',
  warningMessage = null
}) {
  if (!warningMessage) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"], {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice--small', className),
    type: _js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"].TYPES.WARNING,
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: The warning message. 2: "Get help" text. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%1$s. <Link><Strong>%2$s</Strong></Link>', 'google-site-kit'), warningMessage, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get help', 'google-site-kit')), {
      Link: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
        href: getHelpLink,
        trailingIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_svg_icons_external_rounded_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
          width: 15,
          height: 15
        }),
        external: true,
        hideExternalIndicator: true
      }),
      Strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("strong", {})
    }),
    hideIcon: true
  });
}
AdBlockerWarningMessage.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  getHelpLink: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  warningMessage: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string)
};

/***/ }),

/***/ "./js/components/notifications/CTA.js":
/*!********************************************!*\
  !*** ./js/components/notifications/CTA.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * CTA component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */




function CTA({
  title,
  headerText,
  headerContent,
  description,
  ctaLink,
  ctaLabel,
  ctaLinkExternal,
  ctaType,
  error,
  onClick,
  'aria-label': ariaLabel,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-cta', {
      'googlesitekit-cta--error': error
    }),
    children: [(headerText || headerContent) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "googlesitekit-cta__header",
      children: [headerText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_3__["default"], {
        as: "h2",
        size: "small",
        type: "label",
        className: "googlesitekit-cta__header_text",
        children: headerText
      }), headerContent]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "googlesitekit-cta__body",
      children: [title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_3__["default"], {
        as: "h3",
        size: "small",
        type: "title",
        className: "googlesitekit-cta__title",
        children: title
      }), description && typeof description === 'string' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
        className: "googlesitekit-cta__description",
        children: description
      }), description && typeof description !== 'string' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "googlesitekit-cta__description",
        children: description
      }), ctaLabel && ctaType === 'button' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        "aria-label": ariaLabel,
        href: ctaLink,
        onClick: onClick,
        children: ctaLabel
      }), ctaLabel && ctaType === 'link' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
        href: ctaLink,
        onClick: onClick,
        "aria-label": ariaLabel,
        external: ctaLinkExternal,
        hideExternalIndicator: ctaLinkExternal,
        arrow: true,
        children: ctaLabel
      }), children]
    })]
  });
}
CTA.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string).isRequired,
  headerText: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node)]),
  ctaLink: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  ctaLinkExternal: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  ctaType: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  'aria-label': (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  error: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().func),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node),
  headerContent: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().node)
};
CTA.defaultProps = {
  title: '',
  headerText: '',
  headerContent: '',
  description: '',
  ctaLink: '',
  ctaLabel: '',
  ctaType: 'link',
  error: false,
  onClick: () => {}
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CTA);

/***/ }),

/***/ "./js/components/notifications/CoreSiteBannerNotification.js":
/*!*******************************************************************!*\
  !*** ./js/components/notifications/CoreSiteBannerNotification.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_components_NotificationFromServer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/NotificationFromServer */ "./js/components/NotificationFromServer.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * CoreSiteBannerNotification component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




function CoreSiteBannerNotification({
  id,
  ...props
}) {
  const {
    dismissNotification,
    acceptNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE);
  const onCTAClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => {
    acceptNotification(id);
  }, [id, acceptNotification]);
  const onDismissClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => {
    dismissNotification(id);
  }, [id, dismissNotification]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_NotificationFromServer__WEBPACK_IMPORTED_MODULE_3__["default"], {
    onCTAClick: onCTAClick,
    onDismissClick: onDismissClick,
    ...props,
    id: id
  });
}
CoreSiteBannerNotification.propTypes = {
  content: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  ctaTarget: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  ctaURL: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  dismissLabel: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  dismissible: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool),
  gaTrackingEventArgs: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string).isRequired,
  learnMoreLabel: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  learnMoreURL: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string).isRequired
};
CoreSiteBannerNotification.defaultProps = {
  content: '',
  ctaLabel: '',
  ctaTarget: '',
  ctaURL: '',
  dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('OK, Got it!', 'google-site-kit'),
  dismissible: true,
  learnMoreLabel: '',
  learnMoreURL: ''
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CoreSiteBannerNotification);

/***/ }),

/***/ "./js/components/notifications/CoreSiteBannerNotifications.js":
/*!********************************************************************!*\
  !*** ./js/components/notifications/CoreSiteBannerNotifications.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _CoreSiteBannerNotification__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./CoreSiteBannerNotification */ "./js/components/notifications/CoreSiteBannerNotification.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * CoreSiteBannerNotifications component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */








const MAX_SECONDS_FOR_SURVEY = 5;

/**
 * Registers notifications from the server, if any exist in the data store.
 *
 * This is a side-effect component that does not render anything directly.
 *
 * @since 1.157.0
 *
 * @return {null} Returns null as this component does not render anything directly.
 */
function CoreSiteBannerNotifications() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__["default"])();
  const [surveysHaveLoaded, setSurveysHaveLoaded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
  const [hasSurveys, setHasSurveys] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useState)(false);

  // This check doesn't rely on an actual date; we only need to track the
  // elapsed number of seconds since this component was rendered to see when
  // to cause a survey to appear after page load.
  const startTime = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useRef)(Date.now()); // eslint-disable-line sitekit/no-direct-date

  const surveys = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).isUsingProxy() && select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).areSurveysOnCooldown() === false ? select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getCurrentSurvey() : null);
  const [registeredNotifications, setRegisteredNotifications] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useState)([]);
  const {
    registerNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_NOTIFICATIONS);
  const notifications = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getNotifications());
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
    const timer = setTimeout(() => {
      if (!hasSurveys) {
        setSurveysHaveLoaded(true);
      }
    }, MAX_SECONDS_FOR_SURVEY * 1000);
    return () => {
      clearTimeout(timer);
    };
  }, [hasSurveys]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
    const secondsElapsed = Math.floor(
    // See comment above; this is just about tracking elapsed
    // seconds since this component first rendered, so we
    // shouldn't use the reference date.
    (Date.now() - startTime.current) / 1000 // eslint-disable-line sitekit/no-direct-date
    );
    // Surveys that were received in time prevent the render, surveys loaded
    // after a set amount of time do not prevent notifications from rendering.
    if (secondsElapsed < MAX_SECONDS_FOR_SURVEY && surveys) {
      setHasSurveys(true);
    }
  }, [startTime, surveys, setHasSurveys]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useEffect)(() => {
    // If surveys haven't loaded yet or there are surveys on-screen, we don't
    // register any server notifications.
    if (!surveysHaveLoaded || hasSurveys) {
      return;
    }

    // Register any notifications from the server that haven't yet been
    // registered.
    //
    // (Usually there will be one, if any, notification from the server.)
    notifications?.forEach(notification => {
      if (registeredNotifications.includes(notification.id)) {
        return;
      }

      // Before refactoring our Banner Notifications, `CoreSiteBannerNotification` added the
      // constant GA event category (initalised below) but the notification ID from the server
      // was passed as the event label to differentiate multiple notifications from
      // the server. So we continue to do that here for consistency with historical events.
      const gaTrackingEventArgs = {
        category: `${viewContext}_remote-site-notification`,
        label: notification.id
      };
      registerNotification(notification.id, {
        Component({
          Notification
        }) {
          return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Notification, {
            gaTrackingEventArgs: gaTrackingEventArgs,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_CoreSiteBannerNotification__WEBPACK_IMPORTED_MODULE_6__["default"], {
              ...notification,
              gaTrackingEventArgs: gaTrackingEventArgs
            })
          });
        },
        priority: notification.priority,
        areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.HEADER,
        isDismissible: notification.dismissible
      });
      setRegisteredNotifications(previousRegisteredNotifications => {
        previousRegisteredNotifications.push(notification.id);
        return previousRegisteredNotifications;
      });
    });
  }, [viewContext, hasSurveys, notifications, registerNotification, registeredNotifications, surveysHaveLoaded]);
  return null;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CoreSiteBannerNotifications);

/***/ }),

/***/ "./js/components/notifications/InternalServerError.js":
/*!************************************************************!*\
  !*** ./js/components/notifications/InternalServerError.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ InternalServerError)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/BannerNotification */ "./js/googlesitekit/notifications/components/layout/BannerNotification.js");
/* harmony import */ var _js_googlesitekit_notifications_components_Notification__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/Notification */ "./js/googlesitekit/notifications/components/Notification/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * InternalServerError component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */





function InternalServerError() {
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getInternalServerError());
  if (!error) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_googlesitekit_notifications_components_Notification__WEBPACK_IMPORTED_MODULE_3__["default"], {
    id: "internal-server-error",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_2__["default"], {
      notificationID: "internal-server-error",
      type: _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_2__.TYPES.ERROR,
      title: error.title,
      description: error.description
    })
  });
}

/***/ }),

/***/ "./js/components/notifications/LegacyNotifications.js":
/*!************************************************************!*\
  !*** ./js/components/notifications/LegacyNotifications.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ LegacyNotifications)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _CoreSiteBannerNotifications__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./CoreSiteBannerNotifications */ "./js/components/notifications/CoreSiteBannerNotifications.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.js");
/* harmony import */ var _InternalServerError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./InternalServerError */ "./js/components/notifications/InternalServerError.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * BannerNotifications component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







function LegacyNotifications() {
  const viewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_3__["default"])();
  const dashboardType = (0,_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const isAuthenticated = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).isAuthenticated());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_InternalServerError__WEBPACK_IMPORTED_MODULE_5__["default"], {}), !viewOnly && dashboardType === _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_4__.DASHBOARD_TYPE_MAIN && isAuthenticated && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_CoreSiteBannerNotifications__WEBPACK_IMPORTED_MODULE_2__["default"], {})]
  });
}

/***/ }),

/***/ "./js/components/notifications/ModuleSettingsWarning.js":
/*!**************************************************************!*\
  !*** ./js/components/notifications/ModuleSettingsWarning.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ModuleSettingsWarning)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _AdBlockerWarning__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AdBlockerWarning */ "./js/components/notifications/AdBlockerWarning.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModuleSettingsWarning component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */






function ModuleSettingsWarning({
  slug
}) {
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_MODULES)?.getCheckRequirementsError(slug));
  if (!error) {
    return null;
  }

  // The AdBlockerWarning component also renders the "Get help"
  // documentation URL in addition to the error message.
  if (_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.ERROR_CODE_ADBLOCKER_ACTIVE === error.code) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_AdBlockerWarning__WEBPACK_IMPORTED_MODULE_3__["default"], {
      moduleSlug: slug
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"], {
    className: "googlesitekit-notice--small",
    type: _js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"].TYPES.WARNING,
    description: error.message,
    hideIcon: true
  });
}

/***/ }),

/***/ "./js/components/notifications/Notifications.js":
/*!******************************************************!*\
  !*** ./js/components/notifications/Notifications.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Notifications)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_util_component_props__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/util/component-props */ "./js/googlesitekit/notifications/util/component-props.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Notifications component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */






function Notifications({
  areaSlug,
  groupID = _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_3__.NOTIFICATION_GROUPS.DEFAULT
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__["default"])();
  const queuedNotifications = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_NOTIFICATIONS).getQueuedNotifications(viewContext, groupID));
  if (queuedNotifications?.[0] === undefined || queuedNotifications?.[0]?.areaSlug !== areaSlug) {
    return null;
  }
  const {
    id,
    Component: ActiveNotification
  } = queuedNotifications[0];
  const props = {
    ...(0,_js_googlesitekit_notifications_util_component_props__WEBPACK_IMPORTED_MODULE_4__.getNotificationComponentProps)(id)
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(ActiveNotification, {
    ...props
  });
}
Notifications.propTypes = {
  viewContext: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  areaSlug: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string)
};

/***/ }),

/***/ "./js/components/setup/StepHint/index.js":
/*!***********************************************!*\
  !*** ./js/components/setup/StepHint/index.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ StepHint)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupUsingProxyWithSignIn StepHint component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


function StepHint({
  leadingText,
  tooltipText
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
    className: "googlesitekit-setup__step-hint",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("p", {
      children: leadingText
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_0__["default"], {
      tooltipClassName: "googlesitekit-setup__step-hint-tooltip",
      title: tooltipText
    })]
  });
}
StepHint.propTypes = {
  leadingText: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element)]).isRequired,
  tooltipText: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element)]).isRequired
};

/***/ }),

/***/ "./js/components/surveys/SurveyViewTrigger.js":
/*!****************************************************!*\
  !*** ./js/components/surveys/SurveyViewTrigger.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SurveyViewTrigger)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/**
 * SurveyViewTrigger component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


function SurveyViewTrigger({
  triggerID,
  ttl = 0
}) {
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    triggerSurvey(triggerID, {
      ttl
    });
  }, [triggerID, ttl, triggerSurvey]);
  return null;
}
SurveyViewTrigger.propTypes = {
  triggerID: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string).isRequired,
  ttl: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number)
};

/***/ }),

/***/ "./js/feature-tours/hooks/useWelcomeTour.ts":
/*!**************************************************!*\
  !*** ./js/feature-tours/hooks/useWelcomeTour.ts ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useWelcomeTour: () => (/* binding */ useWelcomeTour)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_feature_tours_welcome__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/feature-tours/welcome */ "./js/feature-tours/welcome.ts");
/* harmony import */ var _js_hooks_useWindowSize__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useWindowSize */ "./js/hooks/useWindowSize.ts");
/**
 * `useWelcomeTour` hook.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */












/**
 * Returns the welcome tour configuration based on the current user context.
 *
 * @since 1.175.0
 *
 * @return The welcome tour configuration object.
 */
function useWelcomeTour() {
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const windowHeight = (0,_js_hooks_useWindowSize__WEBPACK_IMPORTED_MODULE_10__.useWindowHeight)();
  const canAuthenticate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.PERMISSION_AUTHENTICATE));
  const isAnalyticsConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4));
  const isActivateAnalyticsNotificationPresent = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (viewContext !== _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_6__.VIEW_CONTEXT_MAIN_DASHBOARD) {
      return false;
    }
    const queuedNotifications = select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_NOTIFICATIONS).getQueuedNotifications(_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_6__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.NOTIFICATION_GROUPS.DEFAULT);
    return queuedNotifications?.[0]?.id === 'activate-analytics-notification';
  });
  return (0,_js_feature_tours_welcome__WEBPACK_IMPORTED_MODULE_9__.getWelcomeTour)({
    isViewOnly,
    canAuthenticate,
    isAnalyticsConnected: !!isAnalyticsConnected,
    isActivateAnalyticsNotificationPresent,
    windowHeight
  });
}

/***/ }),

/***/ "./js/feature-tours/shared-key-metrics.js":
/*!************************************************!*\
  !*** ./js/feature-tours/shared-key-metrics.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/*
 * Internal dependencies
 */

const sharedKeyMetrics = {
  slug: 'sharedKeyMetrics',
  contexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_ENTITY_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY],
  gaEventCategory: viewContext => `${viewContext}_shared_key-metrics`,
  steps: [{
    target: '.googlesitekit-km-change-metrics-cta',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Personalize your key metrics', 'google-site-kit'),
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Another admin has set up these tailored metrics for your site. Click here to personalize them.', 'google-site-kit'),
    placement: 'bottom-start'
  }]
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (sharedKeyMetrics);

/***/ }),

/***/ "./js/feature-tours/welcome.ts":
/*!*************************************!*\
  !*** ./js/feature-tours/welcome.ts ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getWelcomeTour: () => (/* binding */ getWelcomeTour)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/**
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/*
 * Internal dependencies
 */


/**
 * Gets the dashboard sharing step configuration based on user context.
 *
 * @since 1.173.0
 *
 * @param isViewOnly           Whether the user is in view-only mode.
 * @param canAuthenticate      Whether the user can authenticate.
 * @param isAnalyticsConnected Whether Analytics is connected.
 * @return The dashboard sharing step configuration object.
 */
function getDashboardSharingStep(isViewOnly, canAuthenticate, isAnalyticsConnected) {
  if (isViewOnly) {
    return {
      // This slug is used to target the step in the CSS and remove the border radius from the spotlight.
      slug: 'dashboard-sharing',
      target: '.googlesitekit-header',
      floaterProps: {
        target: '.googlesitekit-view-only-menu'
      },
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get instant access to insights, no setup', 'google-site-kit'),
      content: canAuthenticate ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('See what’s been shared with you here, or sign in with Google to configure services and sharing access', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site admins have shared the dashboard with you, so you can keep track of how your site is doing. See what’s been shared with you here.', 'google-site-kit'),
      offset: 0,
      spotlightPadding: 0,
      placement: 'bottom'
    };
  }
  return {
    // This slug is used to target the step in the CSS and remove the border radius from the spotlight.
    slug: 'dashboard-sharing',
    target: '.googlesitekit-header',
    floaterProps: {
      // The Analytics-connected tour targets the SVG inside the button,
      // while the SC-only tour targets the button itself.
      target: isAnalyticsConnected ? '.googlesitekit-sharing-settings__button svg' : '.googlesitekit-sharing-settings__button'
    },
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Share insights with your team', 'google-site-kit'),
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Give access to your teammates or clients to view the dashboard instantly, no setup required. You control who sees what.', 'google-site-kit'),
    offset: 0,
    spotlightPadding: 0,
    placement: 'bottom'
  };
}

/**
 * Gets the activate Analytics step configuration.
 *
 * @since 1.173.0
 *
 * @return {Object} The activate Analytics step configuration object.
 */
function getActivateAnalyticsStep() {
  return {
    // This slug is used to target the step in the CSS and remove the border radius from the spotlight.
    slug: 'activate-analytics',
    target: '#activate-analytics-notification',
    floaterProps: {
      target: '#activate-analytics-notification .googlesitekit-banner__cta'
    },
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Want to know what people do once they land on your site?', 'google-site-kit'),
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get insights on how visitors navigate your site and help you achieve your goals by connecting Analytics', 'google-site-kit'),
    offset: 0,
    spotlightPadding: 0,
    placement: 'bottom'
  };
}

/**
 * Gets the welcome tour configuration based on the current user context.
 *
 * @since 1.173.0
 *
 * @param {Object}  params                                        Tour parameters.
 * @param {boolean} params.isViewOnly                             Whether the user is in view-only mode.
 * @param {boolean} params.canAuthenticate                        Whether the user can authenticate.
 * @param {boolean} params.isAnalyticsConnected                   Whether Analytics is connected.
 * @param {boolean} params.isActivateAnalyticsNotificationPresent Whether the Activate Analytics notification is present.
 * @param {number}  params.windowHeight                           The height of the window.
 * @return {Object} The welcome tour configuration object.
 */
function getWelcomeTour({
  isViewOnly,
  canAuthenticate,
  isAnalyticsConnected,
  isActivateAnalyticsNotificationPresent,
  windowHeight
}) {
  if (!isAnalyticsConnected) {
    const steps = [{
      target: '.googlesitekit-widget--searchFunnelGA4',
      floaterProps: {
        target: typeof windowHeight === 'number' && windowHeight < 930 ? '.googlesitekit-widget--searchFunnelGA4 .googlesitekit-chart' : '.googlesitekit-widget--searchFunnelGA4 .googlesitekit-widget__body'
      },
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Track Search traffic trends, identify baselines', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Know what’s normal for your site. This is how you spot trends and measure real growth.', 'google-site-kit'),
      offset: 0,
      spotlightPadding: 0,
      placement: 'top'
    }, {
      target: '.googlesitekit-widget--searchConsolePopularKeywords',
      floaterProps: {
        target: '.googlesitekit-widget--searchConsolePopularKeywords .googlesitekit-table__wrapper'
      },
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Track how your site is doing on Search', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Know what’s driving growth and bringing your site more visitors', 'google-site-kit'),
      offset: 0,
      spotlightPadding: 0,
      placement: 'top'
    }, getDashboardSharingStep(isViewOnly, canAuthenticate, false)];

    // Add the Activate Analytics step for authenticated users only.
    if (!isViewOnly && isActivateAnalyticsNotificationPresent) {
      steps.push(getActivateAnalyticsStep());
    }
    return {
      slug: 'welcome-without-analytics',
      isRepeatable: true,
      contexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY],
      gaEventCategory: viewContext => `${viewContext}_dashboard-tour-sc`,
      steps
    };
  }
  return {
    slug: 'welcome-with-analytics',
    isRepeatable: true,
    contexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY],
    gaEventCategory: viewContext => `${viewContext}_dashboard-tour-ga4`,
    steps: [{
      target: '.googlesitekit-widget-area--mainDashboardKeyMetricsPrimary',
      floaterProps: {
        target: '.googlesitekit-km-change-metrics-cta'
      },
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your goals, measured and clear', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('These Key Metrics show you exactly how your site is performing against the goals you set. Watch these numbers to see what’s working and what’s not.', 'google-site-kit'),
      offset: -3,
      spotlightPadding: 4,
      placement: 'top-end'
    }, {
      target: '.googlesitekit-widget--analyticsAllTrafficGA4',
      floaterProps: {
        target: '.googlesitekit-widget--analyticsAllTraffic__user-count-chart'
      },
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Track traffic trends, identify baselines', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Know what’s normal for your site. This is how you spot trends and measure real growth.', 'google-site-kit'),
      offset: 35,
      spotlightPadding: 0,
      placement: 'top'
    }, {
      target: '.googlesitekit-widget-area--mainDashboardTrafficAudienceSegmentation',
      floaterProps: {
        target: '.googlesitekit-widget-audience-tiles__body .googlesitekit-widget--analyticsAudienceTiles:last-child .googlesitekit-audience-segmentation-tile__header-title'
      },
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get to know your site visitors', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Not all visitors are the same, tailor your strategy based on who you want to attract', 'google-site-kit'),
      offset: 14,
      spotlightPadding: 4,
      placement: 'top'
    }, {
      target: '.googlesitekit-widget--analyticsModulePopularPagesGA4',
      floaterProps: {
        target: '.googlesitekit-table__head-item--pageviews .googlesitekit-table__head-item-title'
      },
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Discover your most popular and engaging content', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Find out what your audience loves and double down on what resonates most', 'google-site-kit'),
      offset: 25,
      spotlightPadding: 0,
      placement: 'top'
    }, getDashboardSharingStep(isViewOnly, canAuthenticate, true)]
  };
}

/***/ }),

/***/ "./js/features/index.js":
/*!******************************!*\
  !*** ./js/features/index.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   enabledFeatures: () => (/* binding */ enabledFeatures),
/* harmony export */   isFeatureEnabled: () => (/* binding */ isFeatureEnabled)
/* harmony export */ });
/**
 * Feature flags.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const enabledFeatures = new Set(__webpack_require__.g?._googlesitekitBaseData?.enabledFeatures || []);

/**
 * Returns true if a feature is enabled; false otherwise.
 *
 * @since 1.25.0
 * @since 1.33.0 Changed _enabledFeatures argument to be a `Set` instead of `Array`.
 *
 * @param {string} feature            The name of the feature to check.
 * @param {Set}    [_enabledFeatures] Optional. The set of enabled features. Uses `enabledFeatures` set by the server in a global JS variable, by default.
 * @return {boolean} `true` if a feature is enabled; `false` otherwise.
 */
function isFeatureEnabled(feature, _enabledFeatures = enabledFeatures) {
  if (!(_enabledFeatures instanceof Set)) {
    return false;
  }
  return _enabledFeatures.has(feature);
}

/***/ }),

/***/ "./js/googlesitekit-data.js":
/*!**********************************!*\
  !*** ./js/googlesitekit-data.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RegistryProvider: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.RegistryProvider),
/* harmony export */   combineStores: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.combineStores),
/* harmony export */   commonActions: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.commonActions),
/* harmony export */   commonControls: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.commonControls),
/* harmony export */   commonStore: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.commonStore),
/* harmony export */   controls: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.controls),
/* harmony export */   createReducer: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createReducer),
/* harmony export */   createRegistryControl: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistryControl),
/* harmony export */   createRegistrySelector: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   useDispatch: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch),
/* harmony export */   useInViewSelect: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect),
/* harmony export */   useRegistry: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useRegistry),
/* harmony export */   useSelect: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect),
/* harmony export */   withDispatch: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.withDispatch),
/* harmony export */   withSelect: () => (/* reexport safe */ _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.withSelect)
/* harmony export */ });
/* harmony import */ var _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./googlesitekit/data */ "./js/googlesitekit/data/index.js");
/**
 * Public Data store entrypoint.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */

if (typeof __webpack_require__.g.googlesitekit === 'undefined') {
  __webpack_require__.g.googlesitekit = {};
}
__webpack_require__.g.googlesitekit.data = _googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__["default"];

// This is only exported for Jest and is not used in production.
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__["default"]);


/***/ }),

/***/ "./js/googlesitekit-modules-adsense.js":
/*!*********************************************!*\
  !*** ./js/googlesitekit-modules-adsense.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_modules__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-modules */ "googlesitekit-modules");
/* harmony import */ var googlesitekit_modules__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_modules__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-widgets */ "googlesitekit-widgets");
/* harmony import */ var googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_notifications__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-notifications */ "googlesitekit-notifications");
/* harmony import */ var googlesitekit_notifications__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_notifications__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _modules_adsense__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/adsense */ "./js/modules/adsense/index.js");
/**
 * AdSense module entrypoint.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */





(0,_modules_adsense__WEBPACK_IMPORTED_MODULE_4__.registerStore)((googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default()));
(0,_modules_adsense__WEBPACK_IMPORTED_MODULE_4__.registerModule)((googlesitekit_modules__WEBPACK_IMPORTED_MODULE_1___default()));
(0,_modules_adsense__WEBPACK_IMPORTED_MODULE_4__.registerWidgets)((googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_2___default()));
(0,_modules_adsense__WEBPACK_IMPORTED_MODULE_4__.registerNotifications)((googlesitekit_notifications__WEBPACK_IMPORTED_MODULE_3___default()));

/***/ }),

/***/ "./js/googlesitekit/api/cache.js":
/*!***************************************!*\
  !*** ./js/googlesitekit/api/cache.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   STORAGE_KEY_PREFIX: () => (/* binding */ STORAGE_KEY_PREFIX),
/* harmony export */   STORAGE_KEY_PREFIX_ROOT: () => (/* binding */ STORAGE_KEY_PREFIX_ROOT),
/* harmony export */   clearCache: () => (/* binding */ clearCache),
/* harmony export */   deleteItem: () => (/* binding */ deleteItem),
/* harmony export */   getItem: () => (/* binding */ getItem),
/* harmony export */   getKeys: () => (/* binding */ getKeys),
/* harmony export */   getStorage: () => (/* binding */ getStorage),
/* harmony export */   isStorageAvailable: () => (/* binding */ isStorageAvailable),
/* harmony export */   resetDefaultStorageOrder: () => (/* binding */ resetDefaultStorageOrder),
/* harmony export */   setItem: () => (/* binding */ setItem),
/* harmony export */   setSelectedStorageBackend: () => (/* binding */ setSelectedStorageBackend),
/* harmony export */   setStorageOrder: () => (/* binding */ setStorageOrder)
/* harmony export */ });
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * Caching functions and cache management for API requests.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */


/**
 * Prefix used for all Site Kit keys.
 *
 * Anything not using this prefix should not be touched by this library.
 *
 * @since 1.96.0
 * @private
 */
const STORAGE_KEY_PREFIX_ROOT = 'googlesitekit_';

/**
 * Prefix used for all Site Kit keys for the current Site Kit version.
 *
 * Anything not using this key should not be touched by this library.
 *
 * @since 1.5.0
 * @since 1.92.0 Updated to include a user, session, and blog-specific hash.
 * @since 1.96.0 Updated to make use of the new STORAGE_KEY_PREFIX_ROOT constant.
 * @private
 */
const STORAGE_KEY_PREFIX = `${STORAGE_KEY_PREFIX_ROOT}${"1.175.0"}_${__webpack_require__.g._googlesitekitBaseData.storagePrefix}_`;
const defaultOrder = ['sessionStorage', 'localStorage'];
let storageBackend;
let storageOrder = [...defaultOrder];

/**
 * Overrides the storage backend.
 *
 * Largely used for tests. Should not be used directly.
 *
 * @since 1.5.0
 * @private
 *
 * @param {*} backend Backend to set for the cache.
 */
function setSelectedStorageBackend(backend) {
  storageBackend = backend;
}

/**
 * Overrides the priority of storage mechanisms.
 *
 * Largely used for tests. Implicitly resets the selected storage backend,
 * causing `_getStorage` to re-run its checks for the best available
 * storage backend.
 *
 * @since 1.5.0
 * @private
 *
 * @param {Array} order Ordered array of storage backends to use.
 */
function setStorageOrder(order) {
  storageOrder = [...order];
  setSelectedStorageBackend(undefined);
}

/**
 * Resets the storage mechanism order.
 *
 * Largely used for tests. Implicitly resets the selected storage backend,
 * causing `_getStorage` to re-run its checks for the best available
 * storage backend.
 *
 * @since 1.5.0
 * @private
 */
function resetDefaultStorageOrder() {
  storageOrder = [...defaultOrder];
  setSelectedStorageBackend(undefined);
}

/**
 * Detects whether browser storage is both supported and available.
 *
 * @since 1.5.0
 * @private
 *
 * @param {string} type Browser storage to test. Should be one of `localStorage` or `sessionStorage`.
 * @return {boolean} True if the given storage is available, false otherwise.
 */
// eslint-disable-next-line require-await
async function isStorageAvailable(type) {
  const storage = __webpack_require__.g[type];
  if (!storage) {
    return false;
  }
  try {
    const x = '__storage_test__';
    storage.setItem(x, x);
    storage.removeItem(x);
    return true;
  } catch (error) {
    return error instanceof DOMException && (
    // everything except Firefox
    22 === error.code ||
    // Firefox
    1014 === error.code ||
    // test name field too, because code might not be present
    // everything except Firefox
    'QuotaExceededError' === error.name ||
    // Firefox
    'NS_ERROR_DOM_QUOTA_REACHED' === error.name) &&
    // acknowledge QuotaExceededError only if there's something already stored
    0 !== storage.length;
  }
}

/**
 * Gets the storage object to use.
 *
 * @since 1.5.0
 * @private
 *
 * @return {Storage|null} A storage mechanism (`localStorage` or `sessionStorage`) if available; otherwise returns `null`.
 */
async function getStorage() {
  if (storageBackend !== undefined) {
    return storageBackend;
  }

  // Only run the logic to determine the storage object once.
  for (const backend of storageOrder) {
    if (storageBackend) {
      continue;
    }
    if (await isStorageAvailable(backend)) {
      storageBackend = __webpack_require__.g[backend];
    }
  }
  if (storageBackend === undefined) {
    storageBackend = null;
  }
  return storageBackend;
}

/**
 * Gets cached data.
 *
 * Get cached data from the persistent storage cache.
 *
 * @since 1.5.0
 *
 * @param {string} key Name of cache key.
 * @return {Promise} A promise returned, containing an object with the cached value (if found) and whether or not there was a cache hit.
 */
async function getItem(key) {
  const storage = await getStorage();
  if (storage) {
    const cachedData = storage.getItem(`${STORAGE_KEY_PREFIX}${key}`);
    if (cachedData) {
      const parsedData = JSON.parse(cachedData);
      const {
        timestamp,
        ttl,
        value,
        isError
      } = parsedData;

      // Ensure a timestamp is found, otherwise this isn't a valid cache hit.
      // (We don't check for a truthy `value`, because it could be legitimately
      // false-y if `0`, `null`, etc.)
      if (timestamp && (!ttl ||
      // Ensure the cached data isn't too old.
      // The cache dates shouldn't rely on reference
      // dates for cache expiration. This is a case
      // where we actually want to rely on
      // the _actual_ date/time the data was set.
      Math.round(Date.now() / 1000) - timestamp < ttl) // eslint-disable-line sitekit/no-direct-date
      ) {
        return {
          cacheHit: true,
          value,
          isError
        };
      }
    }
  }
  return {
    cacheHit: false,
    value: undefined
  };
}

/**
 * Sets cached data using a key.
 *
 * Save data to the relevant local storage mechanism, if available.
 * By default, data is saved with a one hour (60 minute) TTL.
 *
 * @since 1.5.0
 *
 * @param {string}  key              Name of cache key.
 * @param {*}       value            Value to store in the cache.
 * @param {Object}  args             Optional object containing ttl, timestamp and isError keys.
 * @param {number}  [args.ttl]       Optional. Validity of the cached item in seconds.
 * @param {number}  [args.timestamp] Optional. Timestamp when the cached item was created.
 * @param {boolean} [args.isError]   Optional. Whether the cached item is an error.
 * @return {Promise} A promise: resolves to `true` if the value was saved; `false` if not (usually because no storage method was available).
 */
async function setItem(key, value, {
  ttl = _js_util__WEBPACK_IMPORTED_MODULE_0__.HOUR_IN_SECONDS,
  // Cached times should rely on real times, not the reference date,
  // so the cache timeouts are consistent even when changing
  // the reference dates when developing/testing.
  timestamp = Math.round(Date.now() / 1000),
  // eslint-disable-line sitekit/no-direct-date
  isError = false
} = {}) {
  const storage = await getStorage();
  if (storage) {
    try {
      storage.setItem(`${STORAGE_KEY_PREFIX}${key}`, JSON.stringify({
        timestamp,
        ttl,
        value,
        isError
      }));
      return true;
    } catch (error) {
      __webpack_require__.g.console.warn('Encountered an unexpected storage error:', error);
      return false;
    }
  }
  return false;
}

/**
 * Removes cached data by key.
 *
 * Remove one piece of cached data from the persistent storage cache, by key.
 *
 * @since 1.5.0
 *
 * @param {string} key Name of cache key.
 * @return {Promise} A promise: resolves to `true` if the value was deleted; `false` if not (usually because no storage method was available).
 */
async function deleteItem(key) {
  const storage = await getStorage();
  if (storage) {
    try {
      const fullKey = key.startsWith(STORAGE_KEY_PREFIX_ROOT) ? key : `${STORAGE_KEY_PREFIX}${key}`;
      storage.removeItem(fullKey);
      return true;
    } catch (error) {
      __webpack_require__.g.console.warn('Encountered an unexpected storage error:', error);
      return false;
    }
  }
  return false;
}

/**
 * Gets all cache keys created by Site Kit.
 *
 * @since 1.5.0
 *
 * @return {Promise} A promise: resolves to an array of all keys.
 */
async function getKeys() {
  const storage = await getStorage();
  if (storage) {
    try {
      const keys = [];
      for (let index = 0; index < storage.length; index++) {
        const itemKey = storage.key(index);
        if (itemKey.indexOf(STORAGE_KEY_PREFIX_ROOT) === 0) {
          keys.push(itemKey);
        }
      }
      return keys;
    } catch (error) {
      __webpack_require__.g.console.warn('Encountered an unexpected storage error:', error);
      return [];
    }
  }
  return [];
}

/**
 * Removes the entire cache created by Site Kit.
 *
 * @since 1.5.0
 *
 * @return {Promise} A promise: resolves to `true` if the cache was cleared; `false` if there was an error.
 */
async function clearCache() {
  const storage = await getStorage();
  if (storage) {
    const keys = await getKeys();
    for (const key of keys) {
      await deleteItem(key);
    }
    return true;
  }
  return false;
}

/***/ }),

/***/ "./js/googlesitekit/api/middleware/deduplication.ts":
/*!**********************************************************!*\
  !*** ./js/googlesitekit/api/middleware/deduplication.ts ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   logDuplicate: () => (/* binding */ logDuplicate)
/* harmony export */ });
/* harmony import */ var equivalent_key_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! equivalent-key-map */ "../node_modules/equivalent-key-map/equivalent-key-map.js");
/* harmony import */ var equivalent_key_map__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(equivalent_key_map__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */

/**
 * Logs a console warning for the given request options.
 *
 * @since 1.170.0
 *
 * @param  options API fetch options of the duplicate request.
 * @return {void}
 */
function logDuplicate(options) {
  __webpack_require__.g.console.warn('Google Site Kit API: duplicate request', options);
}
/**
 * Creates a new request deduplication middleware instance.
 *
 * @since 1.170.0
 *
 * @param middlewareOptions Options for configuring the behavior of the middleware.
 * @return Middleware handler function.
 */
function createDedupeMiddleware(middlewareOptions = {}) {
  const {
    onDuplicate
  } = middlewareOptions;
  const concurrentRequests = new (equivalent_key_map__WEBPACK_IMPORTED_MODULE_0___default())();
  return function (options, next) {
    // If we already have a request for these options
    // call the handler, if any, and return the shared response.
    const existingRequest = concurrentRequests.get(options);
    // EquivalentKeyMap doesn't implement `has` as expected, so we need to check the value.
    // When deleting, the value is set to `undefined` so `has(key)` remains true.
    if (existingRequest instanceof Promise) {
      onDuplicate?.(options);
      return existingRequest;
    }
    const promise = next(options);
    concurrentRequests.set(options, promise);

    // Ensure the request entry is removed once the request
    // is completed regardless of any error.
    promise.catch(() => {
      // avoid an uncaught error here
    }).finally(() => {
      concurrentRequests.delete(options);
    });
    return promise;
  };
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createDedupeMiddleware);

/***/ }),

/***/ "./js/googlesitekit/api/middleware/preloading.js":
/*!*******************************************************!*\
  !*** ./js/googlesitekit/api/middleware/preloading.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/normalize-path.js");
/**
 * Custom preloading middleware.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies.
 */


/**
 * Creates a preloading middleware.
 *
 * Based on preloadMiddleware from from @wordpress/api-fetch, this middle is a single-use per-endpoint and provides cached
 * data for the first request only and any subsequent requests reach the server.
 *
 * @since 1.13.0
 *
 * @param {Object} preloadedData Preloaded data paths.
 * @return {Function} Function.
 */
function createPreloadingMiddleware(preloadedData) {
  const cache = Object.keys(preloadedData).reduce((result, path) => {
    result[(0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.normalizePath)(path)] = preloadedData[path];
    return result;
  }, {});
  let cacheHasExpired = false;
  return (options, next) => {
    if (cacheHasExpired) {
      return next(options);
    }
    setTimeout(() => {
      cacheHasExpired = true;
    }, 3000);
    const {
      parse = true
    } = options;
    const uri = options.path;
    if (typeof options.path === 'string') {
      const method = options.method?.toUpperCase() || 'GET';
      const path = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.normalizePath)(uri);
      if (parse && 'GET' === method && cache[path]) {
        const result = Promise.resolve(cache[path].body);
        delete cache[path];
        return result;
      } else if ('OPTIONS' === method && cache[method] && cache[method][path]) {
        const result = Promise.resolve(cache[method][path]);
        delete cache[method][path];
        return result;
      }
    }
    return next(options);
  };
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createPreloadingMiddleware);

/***/ }),

/***/ "./js/googlesitekit/constants.js":
/*!***************************************!*\
  !*** ./js/googlesitekit/constants.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ANCHOR_ID_CONTENT: () => (/* binding */ ANCHOR_ID_CONTENT),
/* harmony export */   ANCHOR_ID_KEY_METRICS: () => (/* binding */ ANCHOR_ID_KEY_METRICS),
/* harmony export */   ANCHOR_ID_MONETIZATION: () => (/* binding */ ANCHOR_ID_MONETIZATION),
/* harmony export */   ANCHOR_ID_SPEED: () => (/* binding */ ANCHOR_ID_SPEED),
/* harmony export */   ANCHOR_ID_TRAFFIC: () => (/* binding */ ANCHOR_ID_TRAFFIC),
/* harmony export */   SITE_KIT_VIEW_CONTEXTS: () => (/* binding */ SITE_KIT_VIEW_CONTEXTS),
/* harmony export */   SITE_KIT_VIEW_ONLY_CONTEXTS: () => (/* binding */ SITE_KIT_VIEW_ONLY_CONTEXTS),
/* harmony export */   VIEW_CONTEXT_ACTIVATION: () => (/* binding */ VIEW_CONTEXT_ACTIVATION),
/* harmony export */   VIEW_CONTEXT_ADMIN_BAR: () => (/* binding */ VIEW_CONTEXT_ADMIN_BAR),
/* harmony export */   VIEW_CONTEXT_ADMIN_BAR_VIEW_ONLY: () => (/* binding */ VIEW_CONTEXT_ADMIN_BAR_VIEW_ONLY),
/* harmony export */   VIEW_CONTEXT_AD_BLOCKING_RECOVERY: () => (/* binding */ VIEW_CONTEXT_AD_BLOCKING_RECOVERY),
/* harmony export */   VIEW_CONTEXT_ENTITY_DASHBOARD: () => (/* binding */ VIEW_CONTEXT_ENTITY_DASHBOARD),
/* harmony export */   VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY: () => (/* binding */ VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY),
/* harmony export */   VIEW_CONTEXT_KEY_METRICS_SETUP: () => (/* binding */ VIEW_CONTEXT_KEY_METRICS_SETUP),
/* harmony export */   VIEW_CONTEXT_MAIN_DASHBOARD: () => (/* binding */ VIEW_CONTEXT_MAIN_DASHBOARD),
/* harmony export */   VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY: () => (/* binding */ VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY),
/* harmony export */   VIEW_CONTEXT_METRIC_SELECTION: () => (/* binding */ VIEW_CONTEXT_METRIC_SELECTION),
/* harmony export */   VIEW_CONTEXT_MODULE: () => (/* binding */ VIEW_CONTEXT_MODULE),
/* harmony export */   VIEW_CONTEXT_MODULE_SETUP: () => (/* binding */ VIEW_CONTEXT_MODULE_SETUP),
/* harmony export */   VIEW_CONTEXT_POSTS_LIST: () => (/* binding */ VIEW_CONTEXT_POSTS_LIST),
/* harmony export */   VIEW_CONTEXT_SETTINGS: () => (/* binding */ VIEW_CONTEXT_SETTINGS),
/* harmony export */   VIEW_CONTEXT_SPLASH: () => (/* binding */ VIEW_CONTEXT_SPLASH),
/* harmony export */   VIEW_CONTEXT_USER_INPUT: () => (/* binding */ VIEW_CONTEXT_USER_INPUT),
/* harmony export */   VIEW_CONTEXT_WP_BLOCK_EDITOR: () => (/* binding */ VIEW_CONTEXT_WP_BLOCK_EDITOR),
/* harmony export */   VIEW_CONTEXT_WP_DASHBOARD: () => (/* binding */ VIEW_CONTEXT_WP_DASHBOARD),
/* harmony export */   VIEW_CONTEXT_WP_DASHBOARD_VIEW_ONLY: () => (/* binding */ VIEW_CONTEXT_WP_DASHBOARD_VIEW_ONLY)
/* harmony export */ });
/**
 * Core constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const VIEW_CONTEXT_MAIN_DASHBOARD = 'mainDashboard';
const VIEW_CONTEXT_ENTITY_DASHBOARD = 'entityDashboard';
const VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY = 'mainDashboardViewOnly';
const VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY = 'entityDashboardViewOnly';
const VIEW_CONTEXT_POSTS_LIST = 'postsList';
const VIEW_CONTEXT_USER_INPUT = 'userInput';
const VIEW_CONTEXT_ACTIVATION = 'activation';
const VIEW_CONTEXT_SPLASH = 'splash';
const VIEW_CONTEXT_ADMIN_BAR = 'adminBar';
const VIEW_CONTEXT_ADMIN_BAR_VIEW_ONLY = 'adminBarViewOnly';
const VIEW_CONTEXT_SETTINGS = 'settings';
const VIEW_CONTEXT_AD_BLOCKING_RECOVERY = 'adBlockingRecovery';
const VIEW_CONTEXT_MODULE = 'module';
const VIEW_CONTEXT_WP_DASHBOARD = 'wpDashboard';
const VIEW_CONTEXT_WP_DASHBOARD_VIEW_ONLY = 'wpDashboardViewOnly';
const VIEW_CONTEXT_MODULE_SETUP = 'moduleSetup';
const VIEW_CONTEXT_METRIC_SELECTION = 'metricSelection';
const VIEW_CONTEXT_WP_BLOCK_EDITOR = 'wpBlockEditor';
const VIEW_CONTEXT_KEY_METRICS_SETUP = 'keyMetricsSetup';

// Anchor ID Constants
const ANCHOR_ID_KEY_METRICS = 'key-metrics';
const ANCHOR_ID_TRAFFIC = 'traffic';
const ANCHOR_ID_CONTENT = 'content';
const ANCHOR_ID_SPEED = 'speed';
const ANCHOR_ID_MONETIZATION = 'monetization';

// Site Kit only view contexts
const SITE_KIT_VIEW_CONTEXTS = [VIEW_CONTEXT_MAIN_DASHBOARD, VIEW_CONTEXT_ENTITY_DASHBOARD, VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY, VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY, VIEW_CONTEXT_USER_INPUT, VIEW_CONTEXT_SPLASH, VIEW_CONTEXT_SETTINGS, VIEW_CONTEXT_MODULE_SETUP, VIEW_CONTEXT_METRIC_SELECTION];

// Site Kit view-only contexts
const SITE_KIT_VIEW_ONLY_CONTEXTS = [VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY, VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY, VIEW_CONTEXT_ADMIN_BAR_VIEW_ONLY, VIEW_CONTEXT_WP_DASHBOARD_VIEW_ONLY];

/***/ }),

/***/ "./js/googlesitekit/data/create-error-store.js":
/*!*****************************************************!*\
  !*** ./js/googlesitekit/data/create-error-store.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   createErrorStore: () => (/* binding */ createErrorStore),
/* harmony export */   generateErrorKey: () => (/* binding */ generateErrorKey)
/* harmony export */ });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/factory.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! md5 */ "../node_modules/md5/md5.js");
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/**
 * API function to create fetch store.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * External dependencies
 */


const RECEIVE_ERROR = 'RECEIVE_ERROR';
const CLEAR_ERROR = 'CLEAR_ERROR';
const CLEAR_ERRORS = 'CLEAR_ERRORS';

/**
 * Internal dependencies
 */


function generateErrorKey(baseName, args) {
  if (args && Array.isArray(args)) {
    const stringifiedArgs = args.map(item => {
      return 'object' === typeof item ? (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.stringifyObject)(item) : item;
    });
    return `${baseName}::${md5__WEBPACK_IMPORTED_MODULE_1___default()(JSON.stringify(stringifiedArgs))}`;
  }
  return baseName;
}
const actions = {
  receiveError(error, baseName, args = []) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(error, 'error is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(baseName, 'baseName is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(args && Array.isArray(args), 'args must be an array.');
    return {
      type: RECEIVE_ERROR,
      payload: {
        error,
        baseName,
        args
      }
    };
  },
  clearError(baseName, args = []) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(baseName, 'baseName is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(args && Array.isArray(args), 'args must be an array.');
    return {
      type: CLEAR_ERROR,
      payload: {
        baseName,
        args
      }
    };
  },
  clearErrors(baseName) {
    return {
      type: CLEAR_ERRORS,
      payload: {
        baseName
      }
    };
  }
};
function createErrorStore(storeName) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(storeName, 'storeName must be defined.');
  const initialState = {
    errors: {},
    errorArgs: {}
  };
  const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, {
    type,
    payload
  }) => {
    switch (type) {
      case RECEIVE_ERROR:
        {
          const {
            baseName,
            args,
            error
          } = payload;
          const key = generateErrorKey(baseName, args);
          state.errors = state.errors || {};
          state.errorArgs = state.errorArgs || {};
          state.errors[key] = error;
          state.errorArgs[key] = args;
          break;
        }
      case CLEAR_ERROR:
        {
          const {
            baseName,
            args
          } = payload;
          const key = generateErrorKey(baseName, args);
          state.errors = state.errors || {};
          state.errorArgs = state.errorArgs || {};
          delete state.errors[key];
          delete state.errorArgs[key];
          break;
        }
      case CLEAR_ERRORS:
        {
          const {
            baseName
          } = payload;
          if (baseName) {
            state.errors = state.errors || {};
            state.errorArgs = state.errorArgs || {};
            for (const key in state.errors) {
              if (key === baseName || key.startsWith(`${baseName}::`)) {
                delete state.errors[key];
                delete state.errorArgs[key];
              }
            }
          } else {
            state.errors = {};
            state.errorArgs = {};
          }
          break;
        }
    }
  });
  const controls = {};
  const resolvers = {};
  const selectors = {
    /**
     * Retrieves the error object from state.
     *
     * Error object has the format:
     *
     * ```
     * {
     *   code: <String>,
     *   message: <String>,
     *   data: <Object>
     * }
     * ```
     *
     * @since 1.15.0
     *
     * @param {Object}      state        Data store's state.
     * @param {string}      selectorName Selector name.
     * @param {Array.<any>} [args]       Arguments passed to selector (default `[]`).
     * @return {(Object|undefined)} Error object if exists, otherwise undefined.
     */
    getErrorForSelector(state, selectorName, args = []) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(selectorName, 'selectorName is required.');
      return selectors.getError(state, selectorName, args);
    },
    /**
     * Retrieves the error object from state.
     *
     *```
     * {
     *   code: <String>,
     *   message: <String>,
     *   data: <Object>
     * }
     * ```
     *
     * @since 1.15.0
     *
     * @param {Object}      state      Data store's state.
     * @param {string}      actionName Action name.
     * @param {Array.<any>} [args]     Arguments passed to action (default `[]`).
     * @return {(Object|undefined)} Error object if exists, otherwise undefined.
     */
    getErrorForAction(state, actionName, args = []) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(actionName, 'actionName is required.');
      return selectors.getError(state, actionName, args);
    },
    /**
     * Retrieves the error object from state.
     *
     *```
     * {
     *   code: <String>,
     *   message: <String>,
     *   data: <Object>
     * }
     * ```
     *
     * @since 1.15.0
     * @private
     *
     * @param {Object}      state      Data store's state.
     * @param {string}      [baseName] Selector or action name.
     * @param {Array.<any>} [args]     Arguments array.
     * @return {(Object|undefined)} Error object if exists, otherwise undefined.
     */
    getError(state, baseName, args) {
      const {
        errors
      } = state;
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(baseName, 'baseName is required.');
      return errors[generateErrorKey(baseName, args)];
    },
    /**
     * Gets a list of all unique errors.
     *
     * @since 1.19.0
     *
     * @param {Object} state Data store's state.
     * @return {Object[]} Unique set of errors.
     */
    getErrors(state) {
      const errorsSet = new Set(Object.values(state.errors));
      return Array.from(errorsSet);
    },
    /**
     * Gets the meta-data for a given error object, or null if the error is not found.
     *
     * Returns meta-data in the format:
     *
     * ```
     *	{
     *		baseName: <string>,
     *		args: <Array>
     *	}
     * ```
     *
     * @since 1.84.0
     *
     * @param {Object} state Data store's state.
     * @param {Object} error Error object.
     * @return {Object|null} Meta-data for the given error object, or null if the error is not found.
     */
    getMetaDataForError(state, error) {
      const key = Object.keys(state.errors).find(errorKey => state.errors[errorKey] === error);
      if (key) {
        const baseName = key.substring(0, key.indexOf('::'));
        return {
          baseName,
          args: state.errorArgs[key]
        };
      }
      return null;
    },
    /**
     * Gets the selector data for a given error object, or null if no selector data is available.
     *
     * Returns selector data in the format:
     *
     * ```
     *	{
     *		storeName: <string>,
     *		name: <string>,
     *		args: <Array>
     *	}
     * ```
     *
     * @since 1.87.0
     *
     * @param {Object} state Data store's state.
     * @param {Object} error Error object.
     * @return {Object|null} Selector data for the given error object, or null if no selector data is available.
     */
    getSelectorDataForError: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_4__.createRegistrySelector)(select => function (state, error) {
      const metaData = select(storeName).getMetaDataForError(error);
      if (metaData) {
        const {
          baseName: name,
          args
        } = metaData;
        const isSelector = !!select(storeName)[name];
        if (isSelector) {
          return {
            storeName,
            name,
            args
          };
        }
      }
      return null;
    }),
    /**
     * Determines whether the datastore has errors or not.
     *
     * @since 1.15.0
     *
     * @param {Object} state Data store's state.
     * @return {boolean} TRUE if the datastore has errors, otherwise FALSE.
     */
    hasErrors(state) {
      return selectors.getErrors(state).length > 0;
    }
  };
  return {
    initialState,
    actions,
    controls,
    reducer,
    resolvers,
    selectors
  };
}

/***/ }),

/***/ "./js/googlesitekit/data/create-existing-tag-store.js":
/*!************************************************************!*\
  !*** ./js/googlesitekit/data/create-existing-tag-store.js ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createExistingTagStore: () => (/* binding */ createExistingTagStore)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_util_tag__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util/tag */ "./js/util/tag.js");
/**
 * Provides a datastore for getting existing tags
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




// Actions
const FETCH_GET_EXISTING_TAG = 'FETCH_GET_EXISTING_TAG';
const RECEIVE_GET_EXISTING_TAG = 'RECEIVE_GET_EXISTING_TAG';

/**
 * Creates a store object that includes actions and selectors for getting existing tags.
 *
 * @since 1.13.0
 * @private
 *
 * @param {Object}   args             Arguments for the store generation.
 * @param {string}   args.storeName   Store name to use.
 * @param {Array}    args.tagMatchers The tag matchers used to extract tags from HTML.
 * @param {Function} args.isValidTag  Function to test whether a tag is valid or not.
 * @return {Object} The existing tag store object, with additional `STORE_NAME` and
 * initialState` properties.
 */
function createExistingTagStore({
  storeName: STORE_NAME,
  isValidTag,
  tagMatchers
} = {}) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof STORE_NAME && STORE_NAME, 'storeName is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('function' === typeof isValidTag, 'isValidTag must be a function.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(tagMatchers), 'tagMatchers must be an Array.');
  const initialState = {
    existingTag: undefined
  };
  const actions = {
    fetchGetExistingTag() {
      return {
        payload: {},
        type: FETCH_GET_EXISTING_TAG
      };
    },
    receiveGetExistingTag(existingTag) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(existingTag === null || 'string' === typeof existingTag, 'existingTag must be a tag string or null.');
      return {
        payload: {
          existingTag: isValidTag(existingTag) ? existingTag : null
        },
        type: RECEIVE_GET_EXISTING_TAG
      };
    }
  };
  const controls = {
    [FETCH_GET_EXISTING_TAG]: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistryControl)(registry => async () => {
      const homeURL = registry.select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getHomeURL();
      const ampMode = registry.select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getAMPMode();
      const existingTagURLs = await (0,_js_util_tag__WEBPACK_IMPORTED_MODULE_3__.getExistingTagURLs)({
        homeURL,
        ampMode
      });
      const {
        getHTMLForURL
      } = registry.resolveSelect(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE);
      for (const url of existingTagURLs) {
        const html = await getHTMLForURL(url);
        const tagFound = (0,_js_util_tag__WEBPACK_IMPORTED_MODULE_3__.extractExistingTag)(html, tagMatchers);
        if (tagFound) {
          return tagFound;
        }
      }
      return null;
    })
  };
  const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createReducer)((state, {
    type,
    payload
  }) => {
    switch (type) {
      case RECEIVE_GET_EXISTING_TAG:
        {
          const {
            existingTag
          } = payload;
          state.existingTag = existingTag;
          break;
        }
    }
  });
  const resolvers = {
    *getExistingTag() {
      const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
      if (registry.select(STORE_NAME).getExistingTag() === undefined) {
        const existingTag = yield actions.fetchGetExistingTag();
        registry.dispatch(STORE_NAME).receiveGetExistingTag(existingTag);
      }
    }
  };
  const selectors = {
    /**
     * Gets the existing tag, if any.
     *
     * @since 1.13.0
     *
     * @param {Object} state Data store's state.
     * @return {(string|null|undefined)} The existing tag `string` if present, `null` if not present, or `undefined` if not loaded yet.
     */
    getExistingTag(state) {
      return state.existingTag;
    },
    /**
     * Checks whether or not an existing tag is present.
     *
     * @since 1.13.0
     *
     * @return {(boolean|undefined)} Boolean if tag is present, `undefined` if tag presence has not been resolved yet.
     */
    hasExistingTag: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
      const existingTag = select(STORE_NAME).getExistingTag();
      if (existingTag === undefined) {
        return undefined;
      }
      return !!existingTag;
    })
  };
  const store = {
    initialState,
    actions,
    controls,
    reducer,
    resolvers,
    selectors
  };
  return {
    ...store,
    STORE_NAME
  };
}

/***/ }),

/***/ "./js/googlesitekit/data/create-fetch-store.js":
/*!*****************************************************!*\
  !*** ./js/googlesitekit/data/create-fetch-store.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createFetchStore: () => (/* binding */ createFetchStore)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _create_error_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/* harmony import */ var _transform_case__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./transform-case */ "./js/googlesitekit/data/transform-case.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__);
/**
 * API function to create fetch store.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */




function defaultReducerCallback(state) {
  return state;
}
function defaultArgsToParams() {
  return {};
}
function defaultValidateParams() {}

// Get access to error store action creators.
// If the parent store doesn't include the error store,
// yielded error actions will be a no-op.
const {
  clearError,
  receiveError
} = _create_error_store__WEBPACK_IMPORTED_MODULE_2__.actions;

/**
 * Creates a store object implementing the necessary infrastructure for a
 * single fetch action.
 *
 * This function returns a partial store object with the following:
 * - action creators to fetch and to receive the data
 * - control to issue the API request
 * - reducer to set API request flag and receive the response
 * - selector to check whether the API request is in progress via a flag
 *
 * The names of the pieces are based on the baseName provided.
 * For example, if baseName is 'saveSettings':
 * - The fetch action creator is called 'fetchSaveSettings'.
 * - The receive action creator is called 'receiveSaveSettings'.
 * - The fetching selector is called 'isFetchingSaveSettings'.
 *
 * All parts of the returned store objects should be considered internal. A
 * public action or selector should be implemented to actually call the
 * fetch action included in the returned store object.
 *
 * For example, if the fetch store is intended for an API-based
 * action 'storeMySetting':
 * - The basename passed should be 'storeMySetting'.
 * - The action 'storeMySetting' should call 'fetchStoreMySetting'.
 *
 * Or, if the fetch store is intended for an API-based selector
 * 'getSomeData':
 * - The baseName passed should be 'getSomeData'.
 * - The resolver for 'getSomeData' should call 'fetchGetSomeData'.
 *
 * @since 1.10.0
 * @private
 *
 * @param {Object}   args                   Arguments for creating the fetch store.
 * @param {string}   args.baseName          The base name to use for all the created infrastructure.
 * @param {Function} args.controlCallback   Callback function to issue the API request. Will be used inside the
 *                                          control. The function receives a params object based on argsToParams,
 *                                          i.e. the respective values passed to the action.
 * @param {Function} [args.reducerCallback] Optional. Callback function to modify state based on the API response.
 *                                          Will be used inside the reducer. The function receives the store's state
 *                                          object as first parameter, the API response as second parameter, and the
 *                                          params object for the request (see above) as third parameter. If not
 *                                          provided, the default will return the unmodified state.
 * @param {Function} [args.argsToParams]    Optional. Function that reduces the given list of arguments
 *                                          into a object of key/value parameters, with the argument names used as keys.
 *                                          If not provided, the default function will return an empty object,
 *                                          essentially indicating that no arguments are supported/required.
 * @param {Function} [args.validateParams]  Optional. Function that validates the given parameters object created by `argsToParams`.
 *                                          Any invalid parameters should cause a respective error to be thrown.
 * @return {Object} Partial store object with properties 'actions', 'controls', 'reducer', 'resolvers', and 'selectors'.
 */
function createFetchStore({
  baseName,
  controlCallback,
  reducerCallback = defaultReducerCallback,
  argsToParams = defaultArgsToParams,
  validateParams = defaultValidateParams
}) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(baseName, 'baseName is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('function' === typeof controlCallback, 'controlCallback is required and must be a function.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('function' === typeof reducerCallback, 'reducerCallback must be a function.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('function' === typeof argsToParams, 'argsToParams must be a function.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('function' === typeof validateParams, 'validateParams must be a function.');

  // If validating the result of argsToParams without any arguments does not result in an error, we
  // know params is okay to be empty.
  let requiresParams;
  try {
    validateParams(argsToParams());
    requiresParams = false;
  } catch (error) {
    requiresParams = true;
  }
  const pascalCaseBaseName = (0,_transform_case__WEBPACK_IMPORTED_MODULE_3__.camelCaseToPascalCase)(baseName);
  const constantBaseName = (0,_transform_case__WEBPACK_IMPORTED_MODULE_3__.camelCaseToConstantCase)(baseName);
  const FETCH = `FETCH_${constantBaseName}`;
  const START_FETCH = `START_${FETCH}`;
  const FINISH_FETCH = `FINISH_${FETCH}`;
  const CATCH_FETCH = `CATCH_${FETCH}`;
  const RECEIVE = `RECEIVE_${constantBaseName}`;
  const fetchCreator = `fetch${pascalCaseBaseName}`;
  const receiveCreator = `receive${pascalCaseBaseName}`;
  const isFetching = `isFetching${pascalCaseBaseName}`;
  const initialState = {
    [isFetching]: {}
  };
  function* fetchGenerator(params, args) {
    let response;
    let error;
    yield {
      payload: {
        params
      },
      type: START_FETCH
    };
    yield clearError(baseName, args);
    try {
      response = yield {
        payload: {
          params
        },
        type: FETCH
      };
      yield actions[receiveCreator](response, params);
      yield {
        payload: {
          params
        },
        type: FINISH_FETCH
      };
    } catch (fetchError) {
      error = fetchError;
      yield receiveError(error, baseName, args);
      yield {
        payload: {
          params
        },
        type: CATCH_FETCH
      };
    }
    return {
      response,
      error
    };
  }
  const actions = {
    [fetchCreator](...args) {
      const params = argsToParams(...args);
      // In order for params validation to throw an error as expected,
      // this function cannot be a generator.
      validateParams(params);

      // The normal fetch action generator is invoked as the return here
      // to preserve asynchronous behavior without registering another action creator.
      return fetchGenerator(params, args);
    },
    [receiveCreator](response, params) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(response !== undefined, 'response is required.');
      if (requiresParams) {
        invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(params), 'params is required.');
        validateParams(params);
      } else {
        params = {};
      }
      return {
        payload: {
          response,
          params
        },
        type: RECEIVE
      };
    }
  };
  const controls = {
    [FETCH]: ({
      payload
    }) => {
      return controlCallback(payload.params);
    }
  };
  const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.createReducer)((state, {
    type,
    payload
  }) => {
    switch (type) {
      case START_FETCH:
        {
          const {
            params
          } = payload;
          state[isFetching] = state[isFetching] || {};
          state[isFetching][(0,_js_util__WEBPACK_IMPORTED_MODULE_4__.stringifyObject)(params)] = true;
          return state;
        }
      case RECEIVE:
        {
          const {
            response,
            params
          } = payload;
          return reducerCallback(state, response, params);
        }
      case FINISH_FETCH:
        {
          const {
            params
          } = payload;
          state[isFetching] = state[isFetching] || {};
          state[isFetching][(0,_js_util__WEBPACK_IMPORTED_MODULE_4__.stringifyObject)(params)] = false;
          return state;
        }
      case CATCH_FETCH:
        {
          const {
            params
          } = payload;
          state[isFetching] = state[isFetching] || {};
          state[isFetching][(0,_js_util__WEBPACK_IMPORTED_MODULE_4__.stringifyObject)(params)] = false;
          return state;
        }
      default:
        return state;
    }
  });
  const selectors = {
    [isFetching]: (state, ...args) => {
      if (state[isFetching] === undefined) {
        return false;
      }
      let params;
      try {
        params = argsToParams(...args);
        validateParams(params);
      } catch (err) {
        // If parameters are invalid, fail silently here. It likely is
        // because some dependency selector is still resolving.
        return false;
      }
      return !!state[isFetching][(0,_js_util__WEBPACK_IMPORTED_MODULE_4__.stringifyObject)(params)];
    }
  };
  return {
    initialState,
    actions,
    controls,
    reducer,
    resolvers: {},
    selectors
  };
}

/***/ }),

/***/ "./js/googlesitekit/data/create-reducer.js":
/*!*************************************************!*\
  !*** ./js/googlesitekit/data/create-reducer.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createReducer: () => (/* binding */ createReducer)
/* harmony export */ });
/* harmony import */ var immer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! immer */ "../node_modules/immer/dist/immer.esm.mjs");
/**
 * Create Immer reducer utility function.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Creates an Immer-enabled reducer.
 *
 * @since 1.84.0
 *
 * @param {Function} reducerFunction A reducer function that follows the curried Immer recipe pattern.
 * @return {Function} An Immer-enabled reducer.
 */
function createReducer(reducerFunction) {
  return (0,immer__WEBPACK_IMPORTED_MODULE_0__["default"])(reducerFunction);
}

/***/ }),

/***/ "./js/googlesitekit/data/create-settings-store.js":
/*!********************************************************!*\
  !*** ./js/googlesitekit/data/create-settings-store.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   INVARIANT_DOING_SUBMIT_CHANGES: () => (/* binding */ INVARIANT_DOING_SUBMIT_CHANGES),
/* harmony export */   INVARIANT_SETTINGS_NOT_CHANGED: () => (/* binding */ INVARIANT_SETTINGS_NOT_CHANGED),
/* harmony export */   createSettingsStore: () => (/* binding */ createSettingsStore),
/* harmony export */   makeDefaultCanSubmitChanges: () => (/* binding */ makeDefaultCanSubmitChanges),
/* harmony export */   makeDefaultHaveSettingsChanged: () => (/* binding */ makeDefaultHaveSettingsChanged),
/* harmony export */   makeDefaultRollbackChanges: () => (/* binding */ makeDefaultRollbackChanges),
/* harmony export */   makeDefaultSubmitChanges: () => (/* binding */ makeDefaultSubmitChanges)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ "./js/googlesitekit/data/utils.js");
/* harmony import */ var _transform_case__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./transform-case */ "./js/googlesitekit/data/transform-case.js");
/* harmony import */ var _create_fetch_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/* harmony import */ var _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/**
 * Provides API functions to create a datastore for settings.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */







// Get access to error store action creators.
// If the parent store doesn't include the error store,
// yielded error actions will be a no-op.
const {
  clearError,
  receiveError
} = _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_7__.actions;

// Invariant error messages.
const INVARIANT_DOING_SUBMIT_CHANGES = 'cannot submit changes while submitting changes';
const INVARIANT_SETTINGS_NOT_CHANGED = 'cannot submit changes if settings have not changed';

// Actions
const SET_SETTINGS = 'SET_SETTINGS';
const ROLLBACK_SETTINGS = 'ROLLBACK_SETTINGS';
const ROLLBACK_SETTING = 'ROLLBACK_SETTING';

/**
 * Creates a store object that includes actions and selectors for managing settings.
 *
 * The first three parameters hook up the store to the respective REST API endpoint,
 * while the fourth defines the names of the sub-settings to support.
 *
 * @since 1.6.0
 * @since 1.129.0 Added haveSettingsChanged optional paramter.
 * @private
 *
 * @param {string}        type                                  The data to access. One of 'core' or 'modules'.
 * @param {string}        identifier                            The data identifier, eg. a module slug like `search-console`.
 * @param {string}        datapoint                             The endpoint to request data from, e.g. 'settings'.
 * @param {Object}        options                               Optional. Options to consider for the store.
 * @param {Array}         [options.ownedSettingsSlugs]          Optional. List of "owned settings" for this module, if they exist.
 * @param {number}        [options.storeName]                   Store name to use. Default is '{type}/{identifier}'.
 * @param {Array}         [options.settingSlugs]                List of the slugs that are part of the settings object handled by the respective API endpoint.
 * @param {Object}        [options.initialSettings]             Optional. An initial set of settings as key-value pairs.
 * @param {Function|null} [options.validateHaveSettingsChanged] Optional. Custom callback to determine if settings have changed.
 * @return {Object} The settings store object, with additional `STORE_NAME` and
 *                  `initialState` properties.
 */
function createSettingsStore(type, identifier, datapoint, {
  ownedSettingsSlugs = undefined,
  storeName = undefined,
  settingSlugs = [],
  initialSettings = undefined,
  validateHaveSettingsChanged = makeDefaultHaveSettingsChanged()
} = {}) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(type, 'type is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(identifier, 'identifier is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(datapoint, 'datapoint is required.');
  const STORE_NAME = storeName || `${type}/${identifier}`;
  const initialState = {
    ownedSettingsSlugs,
    settings: initialSettings,
    savedSettings: undefined
  };
  const fetchGetSettingsStore = (0,_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
    baseName: 'getSettings',
    controlCallback: () => {
      return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)(type, identifier, datapoint, {}, {
        useCache: false
      });
    },
    reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, values) => {
      state.savedSettings = {
        ...values
      };
      state.settings = {
        ...values,
        // In case settings were already changed, they should take precedence.
        ...(state.settings || {})
      };
    })
  });
  const fetchSaveSettingsStore = (0,_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
    baseName: 'saveSettings',
    controlCallback: params => {
      const {
        values
      } = params;
      return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)(type, identifier, datapoint, values);
    },
    reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, values) => {
      state.savedSettings = {
        ...values
      };
      // Ensure client settings are refreshed from server.
      state.settings = {
        ...values
      };
    }),
    argsToParams: values => {
      return {
        values
      };
    },
    validateParams: ({
      values
    } = {}) => {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(values), 'values is required.');
    }
  });

  // This will be populated further down with reducer functions for individual settings.
  const settingReducers = {};
  const actions = {
    /**
     * Sets settings for the given values.
     *
     * @since 1.6.0
     *
     * @param {Object} values Settings with their values to set.
     * @return {Object} Redux-style action.
     */
    setSettings(values) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(values), 'values is required.');
      return {
        payload: {
          values
        },
        type: SET_SETTINGS
      };
    },
    /**
     * Returns the current settings back to the current saved values.
     *
     * @since 1.7.1
     * @private
     *
     * @return {Object} Redux-style action.
     */
    rollbackSettings() {
      return {
        payload: {},
        type: ROLLBACK_SETTINGS
      };
    },
    /**
     * Returns a specific setting back to the current saved value.
     *
     * @since 1.147.0
     *
     * @param {string} setting The setting to rollback.
     * @return {Object} Redux-style action.
     */
    rollbackSetting(setting) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(setting, 'setting is required.');
      return {
        payload: {
          setting
        },
        type: ROLLBACK_SETTING
      };
    },
    /**
     * Saves all current settings to the server.
     *
     * @since 1.6.0
     *
     * @return {Object} Response and error, if any.
     */
    *saveSettings() {
      const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
      yield clearError('saveSettings', []);
      const values = registry.select(STORE_NAME).getSettings();
      const {
        response,
        error
      } = yield fetchSaveSettingsStore.actions.fetchSaveSettings(values);
      if (error) {
        // Store error manually since saveSettings signature differs from fetchSaveSettings.
        yield receiveError(error, 'saveSettings', []);
      }
      return {
        response,
        error
      };
    }
  };
  const controls = {};

  // eslint-disable-next-line no-shadow
  const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, {
    type,
    payload
  }) => {
    switch (type) {
      case SET_SETTINGS:
        {
          const {
            values
          } = payload;
          state.settings = {
            ...(state.settings || {}),
            ...values
          };
          break;
        }
      case ROLLBACK_SETTINGS:
        {
          state.settings = state.savedSettings;
          break;
        }
      case ROLLBACK_SETTING:
        {
          const {
            setting
          } = payload;
          if (state.savedSettings[setting]) {
            state.settings = {
              ...(state.settings || {}),
              [setting]: state.savedSettings[setting]
            };
          }
          break;
        }
      default:
        {
          // Check if this action is for a reducer for an individual setting.
          if ('undefined' !== typeof settingReducers[type]) {
            settingReducers[type](state, {
              type,
              payload
            });
          }
          break;
        }
    }
  });
  const resolvers = {
    *getSettings() {
      const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
      const existingSettings = registry.select(STORE_NAME).getSettings();
      // If settings are already present, don't fetch them.
      if (!existingSettings) {
        yield fetchGetSettingsStore.actions.fetchGetSettings();
      }
    }
  };
  const {
    safeSelector: haveSettingsChanged,
    dangerousSelector: __dangerousHaveSettingsChanged
  } = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.createValidationSelector)(validateHaveSettingsChanged);
  const selectors = {
    /**
     * Indicates whether the current settings have changed from what is saved.
     *
     * @since 1.6.0
     * @since 1.77.0 Added ability to filter settings using `keys` argument.
     * @since 1.129.0 Changed the approach to use validateHaveSettingsChanged callback.
     * @since 1.131.0 Updated implementation to use safeSelector and dangerousSelector returned from createValidationSelector.
     *
     * @param {Object}     state Data store's state.
     * @param {Array|null} keys  Settings keys to check; if not provided, all settings are checked.
     * @return {boolean} True if the settings have changed, false otherwise.
     */
    haveSettingsChanged,
    __dangerousHaveSettingsChanged,
    /**
     * Gets the current settings.
     *
     * Returns `undefined` if notifications are not available/loaded.
     *
     * @since 1.6.0
     *
     * @param {Object} state Data store's state.
     * @return {(Object|undefined)} Settings with their values, or undefined.
     */
    getSettings(state) {
      return state.settings;
    },
    /**
     * Indicates whether the provided setting has changed from what is saved.
     *
     * @since 1.72.0
     *
     * @param {Object} state   Data store's state.
     * @param {string} setting The setting we want to check for saved changes.
     * @return {boolean} True if the settings have changed, false otherwise.
     */
    hasSettingChanged(state, setting) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(setting, 'setting is required.');
      const {
        settings,
        savedSettings
      } = state;
      if (!settings || !savedSettings) {
        return false;
      }
      return !(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isEqual)(settings[setting], savedSettings[setting]);
    },
    /**
     * Indicates whether saving the settings is currently in progress.
     *
     * @since 1.6.0
     *
     * @param {Object} state Data store's state.
     * @return {boolean} True if the settings are being saved, false otherwise.
     */
    isDoingSaveSettings(state) {
      // Since isFetchingSaveSettings (via createFetchStore)
      // holds information based on specific values but we only need
      // generic information here, we need to check whether ANY such
      // request is in progress.
      return Object.values(state.isFetchingSaveSettings).some(Boolean);
    },
    /**
     * Gets the owned settings slugs for this module.
     *
     * @since 1.77.0
     *
     * @param {Object} state Data store's state.
     * @return {Array|null} The array of owned settings slugs for this module if they exist. Returns `null` if no owned settings slugs exist.
     */
    getOwnedSettingsSlugs: state => {
      return state.ownedSettingsSlugs;
    },
    /**
     * Returns `true` if a module's "own settings" have changed; `false` if not.
     *
     * @since 1.77.0
     *
     * @param {Object} state Data store's state.
     * @return {boolean} `true` if the module's "own settings" have changed; `false` if not.
     */
    haveOwnedSettingsChanged: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
      const ownedSettingsSlugsToCheck = select(STORE_NAME).getOwnedSettingsSlugs();
      return select(STORE_NAME).haveSettingsChanged(ownedSettingsSlugsToCheck);
    })
  };

  // Define individual actions, selectors and related for sub-settings.
  settingSlugs.forEach(slug => {
    const pascalCaseSlug = (0,_transform_case__WEBPACK_IMPORTED_MODULE_5__.camelCaseToPascalCase)(slug);
    const constantSlug = (0,_transform_case__WEBPACK_IMPORTED_MODULE_5__.camelCaseToConstantCase)(slug);

    /**
     * Sets the setting indicated by the action name to the given value.
     *
     * @since 1.6.0
     *
     * @param {*} value Value for the setting.
     * @return {Object} Redux-style action.
     */
    actions[`set${pascalCaseSlug}`] = value => {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(typeof value !== 'undefined', `value is required for calls to set${pascalCaseSlug}().`);
      return {
        payload: {
          value
        },
        type: `SET_${constantSlug}`
      };
    };
    settingReducers[`SET_${constantSlug}`] = (state, {
      payload
    }) => {
      const {
        value
      } = payload;
      state.settings = {
        ...(state.settings || {}),
        [slug]: value
      };
    };

    /**
     * Gets the current value for the setting indicated by the selector name.
     *
     * @since 1.6.0
     *
     * @return {*} Setting value, or undefined.
     */
    selectors[`get${pascalCaseSlug}`] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
      const settings = select(STORE_NAME).getSettings() || {};
      return settings[slug];
    });
  });
  const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.combineStores)(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonStore, fetchGetSettingsStore, fetchSaveSettingsStore, {
    initialState,
    actions,
    controls,
    reducer,
    resolvers,
    selectors
  });
  return {
    ...store,
    STORE_NAME
  };
}

/**
 * Creates a default submitChanges control function.
 *
 * @since 1.21.0
 *
 * @param {string} slug      Module slug.
 * @param {string} storeName Datastore slug.
 * @return {Function} Control function to submit changes.
 */
function makeDefaultSubmitChanges(slug, storeName) {
  return async ({
    select,
    dispatch
  }) => {
    if (select(storeName).haveSettingsChanged()) {
      const {
        error
      } = await dispatch(storeName).saveSettings();
      if (error) {
        return {
          error
        };
      }
    }
    await (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.invalidateCache)('modules', slug);
    return {};
  };
}

/**
 * Creates a default rollbackChanges control function.
 *
 * @since 1.45.0
 *
 * @param {string} storeName Datastore slug.
 * @return {Function} Control function to rollback settings changes.
 */
function makeDefaultRollbackChanges(storeName) {
  return ({
    select,
    dispatch
  }) => {
    if (select(storeName).haveSettingsChanged()) {
      return dispatch(storeName).rollbackSettings();
    }
    return {};
  };
}

/**
 * Creates a default canSubmitChanges function.
 *
 * @since 1.21.0
 *
 * @param {string} storeName Datastore slug.
 * @return {Function} A function to check if settings can be submitted.
 */
function makeDefaultCanSubmitChanges(storeName) {
  return select => {
    const strictSelect = (0,_utils__WEBPACK_IMPORTED_MODULE_4__.createStrictSelect)(select);
    const {
      haveSettingsChanged,
      isDoingSubmitChanges
    } = strictSelect(storeName);
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(!isDoingSubmitChanges(), INVARIANT_DOING_SUBMIT_CHANGES);
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(haveSettingsChanged(), INVARIANT_SETTINGS_NOT_CHANGED);
  };
}

/**
 * Creates Default haveSettingsChanged.
 *
 * @since 1.129.0
 *
 * @return {boolean} True if the settings have changed, false otherwise.
 */
function makeDefaultHaveSettingsChanged() {
  return (select, state, keys) => {
    const {
      settings,
      savedSettings
    } = state;
    if (keys) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(!(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isEqual)((0,lodash__WEBPACK_IMPORTED_MODULE_1__.pick)(settings, keys), (0,lodash__WEBPACK_IMPORTED_MODULE_1__.pick)(savedSettings, keys)), INVARIANT_SETTINGS_NOT_CHANGED);
    }
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(!(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isEqual)(settings, savedSettings), INVARIANT_SETTINGS_NOT_CHANGED);
  };
}

/***/ }),

/***/ "./js/googlesitekit/data/index.js":
/*!****************************************!*\
  !*** ./js/googlesitekit/data/index.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   RegistryProvider: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_11__["default"]),
/* harmony export */   combineStores: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_1__.combineStores),
/* harmony export */   commonActions: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_1__.commonActions),
/* harmony export */   commonControls: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_1__.commonControls),
/* harmony export */   commonStore: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_1__.commonStore),
/* harmony export */   controls: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_4__.controls),
/* harmony export */   createReducer: () => (/* reexport safe */ _create_reducer__WEBPACK_IMPORTED_MODULE_2__.createReducer),
/* harmony export */   createRegistryControl: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_5__.createRegistryControl),
/* harmony export */   createRegistrySelector: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_5__.createRegistrySelector),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   useDispatch: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   useInViewSelect: () => (/* reexport safe */ _js_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect),
/* harmony export */   useRegistry: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   useSelect: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   withDispatch: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_10__["default"]),
/* harmony export */   withSelect: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_9__["default"])
/* harmony export */ });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/registry.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/controls.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/factory.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-select/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/with-select/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/with-dispatch/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/registry-provider/context.js");
/* harmony import */ var _js_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useInViewSelect */ "./js/hooks/useInViewSelect.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ "./js/googlesitekit/data/utils.js");
/* harmony import */ var _create_reducer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./create-reducer */ "./js/googlesitekit/data/create-reducer.js");
/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./types */ "./js/googlesitekit/data/types.ts");
/**
 * Site Kit @wordpress/data (eg Redux-style) data store.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




/**
 * @since 1.166.0
 *
 * @typedef {Object} WPDataRegistry
 * @property {Function} registerStore Given a namespace key and settings
 *                                    object, registers a new namespace
 *                                    store.
 * @property {Function} subscribe     Given a function callback, invokes
 *                                    the callback on any change to state
 *                                    within any registered store.
 * @property {Function} select        Given a namespace key, returns an
 *                                    object of the store's registered
 *                                    selectors.
 * @property {Function} dispatch      Given a namespace key, returns an
 *                                    object of the store's registered
 *                                    action dispatchers.
 * @property {Function} resolveSelect Given a namespace key, returns an
 *                                    object containing the store's
 *                                    selectors modified so that they return
 *                                    promises that resolve to their eventual
 *                                    values, after any resolvers have run.
 */

/**
 * The Site Kit data registry.
 *
 * This should not be imported directly outside of `googlesitekit-*` files
 * that need access to the registry to register datastores/widgets/etc.
 *
 * Instead, use the exported functions (eg `useSelect`,
 * `createRegistrySelector`, etc.) from the `googlesitekit-data` package to
 * access parts of the registry.
 *
 * @since 1.3.0 Data registry introduced.
 * @since 1.130.0 Deprecated for general use in favor of named exports from `googlesitekit-data` package.
 * @deprecated
 */
const Data = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.createRegistry)({}, __webpack_require__.g.wp?.data);

// Attach some of our utility functions to the registry so third-party
// developers can use them.
Data.combineStores = _utils__WEBPACK_IMPORTED_MODULE_1__.combineStores;
Data.commonActions = _utils__WEBPACK_IMPORTED_MODULE_1__.commonActions;
Data.commonControls = _utils__WEBPACK_IMPORTED_MODULE_1__.commonControls;
Data.commonStore = _utils__WEBPACK_IMPORTED_MODULE_1__.commonStore;
Data.createReducer = _create_reducer__WEBPACK_IMPORTED_MODULE_2__.createReducer;

// Attach our custom, useInViewSelect hook to the registry so third-party
// developers can use it.
Data.useInViewSelect = _js_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect;

// Attach some WordPress data functions to the registry so third-party
// developers can use them without importing '@wordpress/data'.
Data.controls = _wordpress_data__WEBPACK_IMPORTED_MODULE_4__.controls;
Data.createRegistryControl = _wordpress_data__WEBPACK_IMPORTED_MODULE_5__.createRegistryControl;
Data.createRegistrySelector = _wordpress_data__WEBPACK_IMPORTED_MODULE_5__.createRegistrySelector;
Data.useSelect = _wordpress_data__WEBPACK_IMPORTED_MODULE_6__["default"];
Data.useDispatch = _wordpress_data__WEBPACK_IMPORTED_MODULE_7__["default"];
Data.useRegistry = _wordpress_data__WEBPACK_IMPORTED_MODULE_8__["default"];
Data.withSelect = _wordpress_data__WEBPACK_IMPORTED_MODULE_9__["default"];
Data.withDispatch = _wordpress_data__WEBPACK_IMPORTED_MODULE_10__["default"];
Data.RegistryProvider = _wordpress_data__WEBPACK_IMPORTED_MODULE_11__["default"];


/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Data);

/***/ }),

/***/ "./js/googlesitekit/data/transform-case.js":
/*!*************************************************!*\
  !*** ./js/googlesitekit/data/transform-case.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   camelCaseToConstantCase: () => (/* binding */ camelCaseToConstantCase),
/* harmony export */   camelCaseToPascalCase: () => (/* binding */ camelCaseToPascalCase),
/* harmony export */   hyphenCaseToPascalCase: () => (/* binding */ hyphenCaseToPascalCase)
/* harmony export */ });
/**
 * Data store utilities for transforming names to a certain case.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Transforms a camelCase name into its PascalCase name.
 *
 * @since 1.10.0
 * @private
 *
 * @param {string} name "camelCase" name to transform.
 * @return {string} PascalCase name.
 */
function camelCaseToPascalCase(name) {
  return name.charAt(0).toUpperCase() + name.slice(1);
}

/**
 * Transforms a camelCase name into its CONSTANT_CASE name.
 *
 * @since 1.10.0
 * @private
 *
 * @param {string} name "camelCase" name to transform.
 * @return {string} CONSTANT_CASE name.
 */
function camelCaseToConstantCase(name) {
  return name.replace(/([a-z0-9]{1})([A-Z]{1})/g, '$1_$2').toUpperCase();
}

/**
 * Transforms a hyphen-case name into its PascalCase name.
 *
 * @since 1.30.0
 * @private
 *
 * @param {string} name "hyphen-case" name to transform.
 * @return {string} PascalCase name.
 */
function hyphenCaseToPascalCase(name) {
  return name.split('-').map(part => part.charAt(0).toUpperCase() + part.slice(1)).join('');
}

/***/ }),

/***/ "./js/googlesitekit/data/types.ts":
/*!****************************************!*\
  !*** ./js/googlesitekit/data/types.ts ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);



/***/ }),

/***/ "./js/googlesitekit/data/utils.js":
/*!****************************************!*\
  !*** ./js/googlesitekit/data/utils.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   collect: () => (/* binding */ collect),
/* harmony export */   collectActions: () => (/* binding */ collectActions),
/* harmony export */   collectControls: () => (/* binding */ collectControls),
/* harmony export */   collectName: () => (/* binding */ collectName),
/* harmony export */   collectReducers: () => (/* binding */ collectReducers),
/* harmony export */   collectResolvers: () => (/* binding */ collectResolvers),
/* harmony export */   collectSelectors: () => (/* binding */ collectSelectors),
/* harmony export */   collectState: () => (/* binding */ collectState),
/* harmony export */   combineStores: () => (/* binding */ combineStores),
/* harmony export */   commonActions: () => (/* binding */ commonActions),
/* harmony export */   commonControls: () => (/* binding */ commonControls),
/* harmony export */   commonStore: () => (/* binding */ commonStore),
/* harmony export */   createStrictSelect: () => (/* binding */ createStrictSelect),
/* harmony export */   createValidatedAction: () => (/* binding */ createValidatedAction),
/* harmony export */   createValidationSelector: () => (/* binding */ createValidationSelector)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! memize */ "../node_modules/memize/index.js");
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/factory.js");
/**
 * Data store utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */

const GET_REGISTRY = 'GET_REGISTRY';
const AWAIT = 'AWAIT';

/**
 * Collects and combines multiple objects of similar shape.
 *
 * Used to combine objects like actions, selectors, etc. for a data
 * store while ensuring no keys/action names/selector names are duplicated.
 *
 * Effectively this is an object spread, but throws an error if keys are
 * duplicated.
 *
 * @since 1.5.0
 * @private
 *
 * @param {...Object} items A list of arguments, each one should be an object to combine into one.
 * @return {Object} The combined object.
 */
function collect(...items) {
  const collectedObject = items.reduce((acc, item) => {
    return {
      ...acc,
      ...item
    };
  }, {});
  const functionNames = items.reduce((acc, itemSet) => {
    return [...acc, ...Object.keys(itemSet)];
  }, []);
  const duplicates = findDuplicates(functionNames);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(duplicates.length === 0, `collect() cannot accept collections with duplicate keys. Your call to collect() contains the following duplicated functions: ${duplicates.join(', ')}. Check your data stores for duplicates.`);
  return collectedObject;
}

/**
 * Collects all actions.
 *
 * @since 1.5.0
 *
 * @param {...Object} args A list of objects, each containing their own actions.
 * @return {Object} The combined object.
 */
const collectActions = collect;

/**
 * Collects all controls.
 *
 * @since 1.5.0
 *
 * @param {...Object} args A list of objects, each containing their own controls.
 * @return {Object} The combined object.
 */
const collectControls = collect;

/**
 * Collects all reducers and (optionally) provides initial state.
 *
 * If the first argument passed is not a function, it will be used as the
 * combined reducer's `initialState`.
 *
 * @since 1.5.0
 *
 * @param {...(Object|Function)} args A list of reducers, each containing their own controls. If the first argument is not a function, it will be used as the combined reducer's `initialState`.
 * @return {Function} A Redux-style reducer.
 */
function collectReducers(...args) {
  const reducers = [...args];
  let initialState;
  if (typeof reducers[0] !== 'function') {
    initialState = reducers.shift();
  }
  return (state = initialState, action = {}) => {
    return reducers.reduce((newState, reducer) => {
      return reducer(newState, action);
    }, state);
  };
}

/**
 * Collects all resolvers.
 *
 * @since 1.5.0
 *
 * @param {...Object} args A list of objects, each containing their own resolvers.
 * @return {Object} The combined object.
 */
const collectResolvers = collect;

/**
 * Collects all selectors.
 *
 * @since 1.5.0
 *
 * @param {...Object} args A list of objects, each containing their own selectors.
 * @return {Object} The combined object.
 */
const collectSelectors = collect;

/**
 * Collects all state values.
 *
 * @since 1.5.0
 *
 * @param {...Object} args A list of objects, each containing their own state values.
 * @return {Object} The combined object.
 */
const collectState = collect;

/**
 * Collects all store names.
 *
 * This function's main purpose is to ensure generated store names for a single store match.
 *
 * @since 1.6.0
 *
 * @param {...string} args A list of store names, all of which must be equal.
 * @return {string} The single store name.
 */
function collectName(...args) {
  const names = [...args];
  const duplicates = findDuplicates(names);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(duplicates.length === names.length - 1, 'collectName() must not receive different names.');
  return names.shift();
}

/**
 * Passes through state unmodified; eg. an empty reducer.
 *
 * @since 1.8.0
 * @private
 *
 * @param {Object} state A store's state.
 * @return {Object} The same state data as passed in `state`.
 */
function passthroughReducer(state) {
  return state;
}

/**
 * Combines multiple stores.
 *
 * @since 1.8.0
 *
 * @param {...Object} stores A list of objects, each a store containing one or more of the following keys: initialState, actions, controls, reducer, resolvers, selectors.
 * @return {Object} The combined store.
 */
function combineStores(...stores) {
  const combinedInitialState = collectState(...stores.map(store => store.initialState || {}));
  return {
    initialState: combinedInitialState,
    controls: collectControls(...stores.map(store => store.controls || {})),
    actions: collectActions(...stores.map(store => store.actions || {})),
    reducer: collectReducers(combinedInitialState, ...stores.map(store => store.reducer || passthroughReducer)),
    resolvers: collectResolvers(...stores.map(store => store.resolvers || {})),
    selectors: collectSelectors(...stores.map(store => store.selectors || {}))
  };
}

/**
 * An object of common actions most stores will use.
 *
 * @since 1.7.0
 *
 * @return {Object} Key/value list of common actions most stores will want.
 */
const commonActions = {
  /**
   * Dispatches an action and calls a control to get the current data registry.
   *
   * Useful for controls and resolvers that wish to dispatch actions/use selectors
   * on the current data registry.
   *
   * @since 1.7.0
   *
   * @return {Object} FSA-compatible action.
   */
  getRegistry() {
    return {
      payload: {},
      type: GET_REGISTRY
    };
  },
  /**
   * Dispatches an action and calls a control to return the promise resolution.
   *
   * Useful for controls and resolvers that wish to call an asynchronous function or other promise.
   *
   * @since 1.22.0
   *
   * @param {Promise} value A promise to resolve.
   * @return {Object} Object with resolved promise.
   */
  *await(value) {
    return {
      payload: {
        value
      },
      type: AWAIT
    };
  }
};

/**
 * An object of common controls most stores will use.
 *
 * @since 1.7.0
 *
 * @return {Object} Key/value list of common controls most stores will want.
 */
const commonControls = {
  /**
   * Returns the current registry.
   *
   * Useful for controls and resolvers that wish to dispatch actions/use selectors
   * on the current data registry.
   *
   * @since 1.7.0
   *
   * @return {Object} FSA-compatible action.
   */
  [GET_REGISTRY]: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.createRegistryControl)(registry => () => registry),
  /**
   * Returns a resolved promise.
   *
   * @since 1.22.0
   *
   * @param {Object} payload         Object containing a promise.
   * @param {Object} payload.payload Object containing a promise.
   * @return {*} Resolved promise.
   */
  [AWAIT]: ({
    payload
  }) => payload.value
};

/**
 * Finds all duplicate items in an array and return them.
 *
 * @since 1.5.0
 * @private
 *
 * @param {Array} array Any array.
 * @return {Array} All values in the input array that were duplicated.
 */
function findDuplicates(array) {
  const duplicates = [];
  const counts = {};
  for (let index = 0; index < array.length; index++) {
    const item = array[index];
    counts[item] = counts[item] >= 1 ? counts[item] + 1 : 1;
    if (counts[item] > 1) {
      duplicates.push(item);
    }
  }
  return duplicates;
}

/**
 * A store containing the common actions, controls and reducer that all stores will use.
 *
 * @since 1.8.0
 *
 * @return {Object} Object with common actions, controls and reducer.
 */
const commonStore = {
  actions: commonActions,
  controls: commonControls,
  reducer: passthroughReducer
};

/**
 * Creates a strict version of registry.select for ensuring that a selector is resolved at the time of calling.
 *
 * Not intended to be used directly. This is useful in the context of validation functions
 * to save checking for undefined on every result.
 *
 * Given the registry.select function instance, a new function is returned
 * with the same API as `select()` but will throw an error if the result
 * of the selector function is `undefined`.
 *
 * Ideally this would use something like `hasFinishedResolution` instead,
 * but there is no way to traverse the selectors used internally to identify
 * dependent selectors that have resolvers as many selectors are composed of
 * higher-level selectors internally which is where a resolver is normally implemented.
 *
 * @since 1.18.0
 * @private
 *
 * @param {Function} select The registry.select function.
 * @return {Function} The strict version of registry.select.
 */
function createStrictSelect(select) {
  return storeName => {
    return getStrictSelectors(select(storeName));
  };
}

// Based on {@link https://github.com/WordPress/gutenberg/blob/b1c8026087dfb026eff0a023a5f7febe28c876de/packages/data/src/registry.js#L91}
const getStrictSelectors = memize__WEBPACK_IMPORTED_MODULE_1___default()(selectors => (0,lodash__WEBPACK_IMPORTED_MODULE_2__.mapValues)(selectors, (selector, selectorName) => (...args) => {
  const returnValue = selector(...args);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(returnValue !== undefined, `${selectorName}(...) is not resolved`);
  return returnValue;
}));

/**
 * Creates two registry selectors that call the incoming function to validate the current state.
 *
 * @since 1.19.0
 *
 * @param {Function} validate         Validation function callback.
 * @param {Object}   [options]        Options to modify the behavior of the generated selectors.
 * @param {boolean}  [options.negate] Whether to negate the boolean result or not. Default: false.
 * @return {Object} Safe and dangerous selectors.
 */
function createValidationSelector(validate, {
  negate = false
} = {}) {
  const safeSelector = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, ...args) => {
    const pass = negate ? false : true;
    const fail = negate ? true : false;
    try {
      validate(select, state, ...args);
      return pass;
    } catch {
      return fail;
    }
  });
  const dangerousSelector = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, ...args) => {
    validate(select, state, ...args);
  });
  return {
    safeSelector,
    dangerousSelector
  };
}

/**
 * Creates a validated action creator.
 *
 * @since 1.32.0
 *
 * @param {Function} validate      A function for validating action arguments.
 * @param {Function} actionCreator A function for returning or yielding redux-style actions.
 * @return {Function} An enhanced action creator.
 */
function createValidatedAction(validate, actionCreator) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(typeof validate === 'function', 'a validator function is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(typeof actionCreator === 'function', 'an action creator function is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(validate[Symbol.toStringTag] !== 'Generator' && validate[Symbol.toStringTag] !== 'GeneratorFunction', 'an action’s validator function must not be a generator.');
  return (...args) => {
    validate(...args);
    return actionCreator(...args);
  };
}

/***/ }),

/***/ "./js/googlesitekit/datastore/forms/constants.js":
/*!*******************************************************!*\
  !*** ./js/googlesitekit/datastore/forms/constants.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_FORMS: () => (/* binding */ CORE_FORMS)
/* harmony export */ });
/**
 * `core/forms` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_FORMS = 'core/forms';

/***/ }),

/***/ "./js/googlesitekit/datastore/location/constants.js":
/*!**********************************************************!*\
  !*** ./js/googlesitekit/datastore/location/constants.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_LOCATION: () => (/* binding */ CORE_LOCATION)
/* harmony export */ });
/**
 * `core/location` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_LOCATION = 'core/location';

/***/ }),

/***/ "./js/googlesitekit/datastore/site/constants.js":
/*!******************************************************!*\
  !*** ./js/googlesitekit/datastore/site/constants.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AMP_MODE_PRIMARY: () => (/* binding */ AMP_MODE_PRIMARY),
/* harmony export */   AMP_MODE_SECONDARY: () => (/* binding */ AMP_MODE_SECONDARY),
/* harmony export */   CORE_SITE: () => (/* binding */ CORE_SITE)
/* harmony export */ });
/**
 * `core/site` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_SITE = 'core/site';
const AMP_MODE_PRIMARY = 'primary';
const AMP_MODE_SECONDARY = 'secondary';

/***/ }),

/***/ "./js/googlesitekit/datastore/ui/constants.js":
/*!****************************************************!*\
  !*** ./js/googlesitekit/datastore/ui/constants.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ACTIVE_CONTEXT_ID: () => (/* binding */ ACTIVE_CONTEXT_ID),
/* harmony export */   CORE_UI: () => (/* binding */ CORE_UI)
/* harmony export */ });
/**
 * `core/ui` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_UI = 'core/ui';
const ACTIVE_CONTEXT_ID = 'activeContextID';

/***/ }),

/***/ "./js/googlesitekit/datastore/user/constants.js":
/*!******************************************************!*\
  !*** ./js/googlesitekit/datastore/user/constants.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_USER: () => (/* binding */ CORE_USER),
/* harmony export */   DISCONNECTED_REASON_CONNECTED_URL_MISMATCH: () => (/* binding */ DISCONNECTED_REASON_CONNECTED_URL_MISMATCH),
/* harmony export */   EMAIL_REPORT_FREQUENCIES: () => (/* binding */ EMAIL_REPORT_FREQUENCIES),
/* harmony export */   ERROR_CODE_ADBLOCKER_ACTIVE: () => (/* binding */ ERROR_CODE_ADBLOCKER_ACTIVE),
/* harmony export */   FORM_TEMPORARY_PERSIST_PERMISSION_ERROR: () => (/* binding */ FORM_TEMPORARY_PERSIST_PERMISSION_ERROR),
/* harmony export */   GLOBAL_SURVEYS_TIMEOUT_SLUG: () => (/* binding */ GLOBAL_SURVEYS_TIMEOUT_SLUG),
/* harmony export */   KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT: () => (/* binding */ KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT),
/* harmony export */   KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE: () => (/* binding */ KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE),
/* harmony export */   KM_ANALYTICS_LEAST_ENGAGING_PAGES: () => (/* binding */ KM_ANALYTICS_LEAST_ENGAGING_PAGES),
/* harmony export */   KM_ANALYTICS_MOST_ENGAGING_PAGES: () => (/* binding */ KM_ANALYTICS_MOST_ENGAGING_PAGES),
/* harmony export */   KM_ANALYTICS_NEW_VISITORS: () => (/* binding */ KM_ANALYTICS_NEW_VISITORS),
/* harmony export */   KM_ANALYTICS_PAGES_PER_VISIT: () => (/* binding */ KM_ANALYTICS_PAGES_PER_VISIT),
/* harmony export */   KM_ANALYTICS_POPULAR_AUTHORS: () => (/* binding */ KM_ANALYTICS_POPULAR_AUTHORS),
/* harmony export */   KM_ANALYTICS_POPULAR_CONTENT: () => (/* binding */ KM_ANALYTICS_POPULAR_CONTENT),
/* harmony export */   KM_ANALYTICS_POPULAR_PRODUCTS: () => (/* binding */ KM_ANALYTICS_POPULAR_PRODUCTS),
/* harmony export */   KM_ANALYTICS_RETURNING_VISITORS: () => (/* binding */ KM_ANALYTICS_RETURNING_VISITORS),
/* harmony export */   KM_ANALYTICS_TOP_CATEGORIES: () => (/* binding */ KM_ANALYTICS_TOP_CATEGORIES),
/* harmony export */   KM_ANALYTICS_TOP_CITIES: () => (/* binding */ KM_ANALYTICS_TOP_CITIES),
/* harmony export */   KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART: () => (/* binding */ KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART),
/* harmony export */   KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS: () => (/* binding */ KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS),
/* harmony export */   KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES: () => (/* binding */ KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES),
/* harmony export */   KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE: () => (/* binding */ KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE),
/* harmony export */   KM_ANALYTICS_TOP_COUNTRIES: () => (/* binding */ KM_ANALYTICS_TOP_COUNTRIES),
/* harmony export */   KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES: () => (/* binding */ KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES),
/* harmony export */   KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS: () => (/* binding */ KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS),
/* harmony export */   KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES: () => (/* binding */ KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES),
/* harmony export */   KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES: () => (/* binding */ KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS),
/* harmony export */   KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES: () => (/* binding */ KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES),
/* harmony export */   KM_ANALYTICS_VISITS_PER_VISITOR: () => (/* binding */ KM_ANALYTICS_VISITS_PER_VISITOR),
/* harmony export */   KM_ANALYTICS_VISIT_LENGTH: () => (/* binding */ KM_ANALYTICS_VISIT_LENGTH),
/* harmony export */   KM_SEARCH_CONSOLE_POPULAR_KEYWORDS: () => (/* binding */ KM_SEARCH_CONSOLE_POPULAR_KEYWORDS),
/* harmony export */   PERMISSION_AUTHENTICATE: () => (/* binding */ PERMISSION_AUTHENTICATE),
/* harmony export */   PERMISSION_DELEGATE_MODULE_SHARING_MANAGEMENT: () => (/* binding */ PERMISSION_DELEGATE_MODULE_SHARING_MANAGEMENT),
/* harmony export */   PERMISSION_MANAGE_MODULE_SHARING_OPTIONS: () => (/* binding */ PERMISSION_MANAGE_MODULE_SHARING_OPTIONS),
/* harmony export */   PERMISSION_MANAGE_OPTIONS: () => (/* binding */ PERMISSION_MANAGE_OPTIONS),
/* harmony export */   PERMISSION_READ_SHARED_MODULE_DATA: () => (/* binding */ PERMISSION_READ_SHARED_MODULE_DATA),
/* harmony export */   PERMISSION_SETUP: () => (/* binding */ PERMISSION_SETUP),
/* harmony export */   PERMISSION_UPDATE_PLUGINS: () => (/* binding */ PERMISSION_UPDATE_PLUGINS),
/* harmony export */   PERMISSION_VIEW_DASHBOARD: () => (/* binding */ PERMISSION_VIEW_DASHBOARD),
/* harmony export */   PERMISSION_VIEW_MODULE_DETAILS: () => (/* binding */ PERMISSION_VIEW_MODULE_DETAILS),
/* harmony export */   PERMISSION_VIEW_POSTS_INSIGHTS: () => (/* binding */ PERMISSION_VIEW_POSTS_INSIGHTS),
/* harmony export */   PERMISSION_VIEW_SHARED_DASHBOARD: () => (/* binding */ PERMISSION_VIEW_SHARED_DASHBOARD),
/* harmony export */   WELCOME_GATHERING_DATA_DISMISSED_ITEM_SLUG: () => (/* binding */ WELCOME_GATHERING_DATA_DISMISSED_ITEM_SLUG),
/* harmony export */   WELCOME_WITH_TOUR_DISMISSED_ITEM_SLUG: () => (/* binding */ WELCOME_WITH_TOUR_DISMISSED_ITEM_SLUG),
/* harmony export */   allKeyMetricsTileWidgets: () => (/* binding */ allKeyMetricsTileWidgets),
/* harmony export */   keyMetricsGA4Widgets: () => (/* binding */ keyMetricsGA4Widgets)
/* harmony export */ });
/**
 * `core/user` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_USER = 'core/user';
const DISCONNECTED_REASON_CONNECTED_URL_MISMATCH = 'connected_url_mismatch';
const GLOBAL_SURVEYS_TIMEOUT_SLUG = '__global';
const FORM_TEMPORARY_PERSIST_PERMISSION_ERROR = 'temporary_persist_permission_error';
const ERROR_CODE_ADBLOCKER_ACTIVE = 'adblocker_active';

// Email Report Frequency options.
const EMAIL_REPORT_FREQUENCIES = ['weekly', 'monthly', 'quarterly'];

// Permissions list.
const PERMISSION_AUTHENTICATE = 'googlesitekit_authenticate';
const PERMISSION_SETUP = 'googlesitekit_setup';
const PERMISSION_VIEW_POSTS_INSIGHTS = 'googlesitekit_view_posts_insights';
const PERMISSION_VIEW_DASHBOARD = 'googlesitekit_view_dashboard';
const PERMISSION_VIEW_SHARED_DASHBOARD = 'googlesitekit_view_shared_dashboard';
const PERMISSION_VIEW_MODULE_DETAILS = 'googlesitekit_view_module_details';
const PERMISSION_MANAGE_OPTIONS = 'googlesitekit_manage_options';
const PERMISSION_READ_SHARED_MODULE_DATA = 'googlesitekit_read_shared_module_data';
const PERMISSION_MANAGE_MODULE_SHARING_OPTIONS = 'googlesitekit_manage_module_sharing_options';
const PERMISSION_DELEGATE_MODULE_SHARING_MANAGEMENT = 'googlesitekit_delegate_module_sharing_management';
const PERMISSION_UPDATE_PLUGINS = 'googlesitekit_update_plugins';

// Key Metrics Widgets
const KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT = 'kmAnalyticsAdSenseTopEarningContent';
const KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE = 'kmAnalyticsEngagedTrafficSource';
const KM_ANALYTICS_LEAST_ENGAGING_PAGES = 'kmAnalyticsLeastEngagingPages';
const KM_ANALYTICS_NEW_VISITORS = 'kmAnalyticsNewVisitors';
const KM_ANALYTICS_POPULAR_AUTHORS = 'kmAnalyticsPopularAuthors';
const KM_ANALYTICS_POPULAR_CONTENT = 'kmAnalyticsPopularContent';
const KM_ANALYTICS_POPULAR_PRODUCTS = 'kmAnalyticsPopularProducts';
const KM_ANALYTICS_RETURNING_VISITORS = 'kmAnalyticsReturningVisitors';
const KM_ANALYTICS_TOP_CITIES = 'kmAnalyticsTopCities';
const KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS = 'kmAnalyticsTopCitiesDrivingLeads';
const KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART = 'kmAnalyticsTopCitiesDrivingAddToCart';
const KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES = 'kmAnalyticsTopCitiesDrivingPurchases';
const KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES = 'kmAnalyticsTopDeviceDrivingPurchases';
const KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE = 'kmAnalyticsTopConvertingTrafficSource';
const KM_ANALYTICS_TOP_COUNTRIES = 'kmAnalyticsTopCountries';
const KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS = 'kmAnalyticsTopPagesDrivingLeads';
const KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES = 'kmAnalyticsTopRecentTrendingPages';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE = 'kmAnalyticsTopTrafficSource';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART = 'kmAnalyticsTopTrafficSourceDrivingAddToCart';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS = 'kmAnalyticsTopTrafficSourceDrivingLeads';
const KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES = 'kmAnalyticsTopTrafficSourceDrivingPurchases';
const KM_ANALYTICS_PAGES_PER_VISIT = 'kmAnalyticsPagesPerVisit';
const KM_ANALYTICS_VISIT_LENGTH = 'kmAnalyticsVisitLength';
const KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES = 'kmAnalyticsTopReturningVisitorPages';
const KM_SEARCH_CONSOLE_POPULAR_KEYWORDS = 'kmSearchConsolePopularKeywords';
const KM_ANALYTICS_VISITS_PER_VISITOR = 'kmAnalyticsVisitsPerVisitor';
const KM_ANALYTICS_MOST_ENGAGING_PAGES = 'kmAnalyticsMostEngagingPages';
const KM_ANALYTICS_TOP_CATEGORIES = 'kmAnalyticsTopCategories';
const keyMetricsGA4Widgets = [KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT, KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE, KM_ANALYTICS_LEAST_ENGAGING_PAGES, KM_ANALYTICS_NEW_VISITORS, KM_ANALYTICS_POPULAR_AUTHORS, KM_ANALYTICS_POPULAR_CONTENT, KM_ANALYTICS_POPULAR_PRODUCTS, KM_ANALYTICS_RETURNING_VISITORS, KM_ANALYTICS_TOP_CATEGORIES, KM_ANALYTICS_TOP_CITIES, KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS, KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART, KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES, KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES, KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE, KM_ANALYTICS_TOP_COUNTRIES, KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES, KM_ANALYTICS_TOP_TRAFFIC_SOURCE, KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART, KM_ANALYTICS_PAGES_PER_VISIT, KM_ANALYTICS_VISIT_LENGTH, KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES, KM_ANALYTICS_VISITS_PER_VISITOR, KM_ANALYTICS_MOST_ENGAGING_PAGES, KM_ANALYTICS_TOP_CATEGORIES];
const allKeyMetricsTileWidgets = [...keyMetricsGA4Widgets, KM_SEARCH_CONSOLE_POPULAR_KEYWORDS];
const WELCOME_WITH_TOUR_DISMISSED_ITEM_SLUG = 'welcome-modal-with-tour';
const WELCOME_GATHERING_DATA_DISMISSED_ITEM_SLUG = 'welcome-modal-gathering-data';

/***/ }),

/***/ "./js/googlesitekit/modules/datastore/constants.js":
/*!*********************************************************!*\
  !*** ./js/googlesitekit/modules/datastore/constants.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_MODULES: () => (/* binding */ CORE_MODULES),
/* harmony export */   ERROR_CODE_INSUFFICIENT_MODULE_DEPENDENCIES: () => (/* binding */ ERROR_CODE_INSUFFICIENT_MODULE_DEPENDENCIES)
/* harmony export */ });
/**
 * `core/modules` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const CORE_MODULES = 'core/modules';
const ERROR_CODE_INSUFFICIENT_MODULE_DEPENDENCIES = 'insufficient_module_dependencies';

/***/ }),

/***/ "./js/googlesitekit/notifications/components/Notification/ViewedStateObserver.js":
/*!***************************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/Notification/ViewedStateObserver.js ***!
  \***************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ViewedStateObserver)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_hooks_useLatestIntersection__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useLatestIntersection */ "./js/hooks/useLatestIntersection.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useHasBeenViewed */ "./js/googlesitekit/notifications/hooks/useHasBeenViewed.js");
/**
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





function ViewedStateObserver({
  id,
  observeRef,
  threshold
}) {
  const intersectionEntry = (0,_js_hooks_useLatestIntersection__WEBPACK_IMPORTED_MODULE_3__["default"])(observeRef, {
    threshold
  });
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_UI);
  const {
    markNotificationSeen
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_NOTIFICATIONS);
  const isInView = !!intersectionEntry?.isIntersecting;
  const viewed = (0,_js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_4__.useHasBeenViewed)(id);
  const timeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useRef)();
  function clearExistingTimeout() {
    if (timeoutRef.current) {
      clearTimeout(timeoutRef.current);
    }
  }
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useEffect)(() => {
    // If notification is not viewed yet and is in view, start the timer.
    if (!viewed && isInView) {
      clearExistingTimeout();

      // Set a new timeout for 3 seconds.
      timeoutRef.current = setTimeout(() => {
        // Only mark as viewed if still in view after 3 seconds.
        if (intersectionEntry?.isIntersecting) {
          setValue(_js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_4__.useHasBeenViewed.getKey(id), true);
          markNotificationSeen(id);
        }
      }, 3000);
    } else if (!isInView && timeoutRef.current) {
      clearExistingTimeout();
    }

    // Cleanup function to clear timeout on unmount or when dependencies change.
    return () => {
      clearExistingTimeout();
    };
  }, [viewed, isInView, setValue, markNotificationSeen, id, intersectionEntry]);
  return null;
}
ViewedStateObserver.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string),
  observeRef: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object),
  threshold: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().number)
};

/***/ }),

/***/ "./js/googlesitekit/notifications/components/Notification/index.js":
/*!*************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/Notification/index.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Notification)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _ViewedStateObserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ViewedStateObserver */ "./js/googlesitekit/notifications/components/Notification/ViewedStateObserver.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useHasBeenViewed */ "./js/googlesitekit/notifications/hooks/useHasBeenViewed.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */






function Notification({
  id,
  className,
  gaTrackingEventArgs,
  children,
  onView
}) {
  const ref = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useRef)();
  const viewed = (0,_js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_2__.useHasBeenViewed)(id);
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_3__["default"])(id, gaTrackingEventArgs?.category, {
    viewAction: gaTrackingEventArgs?.viewAction
  });
  const [isViewedOnce, setIsViewedOnce] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useState)(false);
  const viewedDates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_NOTIFICATIONS).getNotificationSeenDates(id));
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_NOTIFICATIONS);

  // Track view once and check if notification should be dismissed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
    if (!isViewedOnce && viewed) {
      trackEvents.view(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
      onView?.();
      setIsViewedOnce(true);
    }

    // If the notification has been viewed on 3 distinct days, dismiss it permanently for the next view.
    if (viewedDates?.length >= 3) {
      dismissNotification(id, {
        skipHidingFromQueue: true
      });
    }
  }, [viewed, trackEvents, isViewedOnce, gaTrackingEventArgs, onView, viewedDates, dismissNotification, id]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("section", {
    id: id,
    ref: ref,
    className: className,
    children: [children, !viewed && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ViewedStateObserver__WEBPACK_IMPORTED_MODULE_1__["default"], {
      id: id,
      observeRef: ref,
      threshold: 0.5
    })]
  });
}
Notification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
  gaTrackingEventArgs: prop_types__WEBPACK_IMPORTED_MODULE_7___default().shape({
    category: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
    viewAction: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
    label: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string),
    value: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string)
  }),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().node),
  onView: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().func)
};

/***/ }),

/***/ "./js/googlesitekit/notifications/components/layout/BannerNotification.js":
/*!********************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/layout/BannerNotification.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   TYPES: () => (/* binding */ TYPES),
/* harmony export */   "default": () => (/* binding */ BannerNotification)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_components_Banner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Banner */ "./js/components/Banner/index.js");
/* harmony import */ var _js_components_Banner_LearnMoreLink__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Banner/LearnMoreLink */ "./js/components/Banner/LearnMoreLink.tsx");
/* harmony import */ var _js_components_Banner_CTAButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Banner/CTAButton */ "./js/components/Banner/CTAButton.js");
/* harmony import */ var _js_components_Banner_DismissButton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Banner/DismissButton */ "./js/components/Banner/DismissButton.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _svg_graphics_banner_warning_svg_url__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/graphics/banner-warning.svg?url */ "./svg/graphics/banner-warning.svg?url");
/* harmony import */ var _svg_graphics_banner_error_svg_url__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/svg/graphics/banner-error.svg?url */ "./svg/graphics/banner-error.svg?url");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * BannerNotification layout component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */











const TYPES = {
  INFO: 'info',
  ERROR: 'error',
  WARNING: 'warning'
};
function BannerNotification({
  notificationID,
  type = TYPES.INFO,
  learnMoreLink,
  dismissButton,
  ctaButton,
  gaTrackingEventArgs,
  ...props
}) {
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_3__["default"])(notificationID, gaTrackingEventArgs?.category);
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_NOTIFICATIONS);
  async function handleDismissWithTrackEvent(event) {
    await dismissButton?.onClick?.(event);
    trackEvents.dismiss(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    dismissNotification(notificationID, {
      ...dismissButton?.dismissOptions
    });
  }
  async function handleCTAClickWithTrackEvent(event) {
    trackEvents.confirm(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    await ctaButton?.onClick?.(event);
    if (ctaButton?.dismissOnClick) {
      dismissNotification(notificationID, {
        ...ctaButton?.dismissOptions
      });
    }
  }
  async function handleLearnMoreClickWithTrackEvent(event) {
    trackEvents.clickLearnMore(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    await learnMoreLink?.onClick?.(event);
  }
  let SVGData = props?.svg;
  if (!SVGData && type !== TYPES.INFO) {
    SVGData = {
      desktop: undefined,
      mobile: undefined,
      verticalPosition: 'center'
    };
    if (type === TYPES.WARNING) {
      SVGData.desktop = _svg_graphics_banner_warning_svg_url__WEBPACK_IMPORTED_MODULE_9__["default"];
    }
    if (type === TYPES.ERROR) {
      SVGData.desktop = _svg_graphics_banner_error_svg_url__WEBPACK_IMPORTED_MODULE_10__["default"];
    }
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner-notification', `googlesitekit-banner-notification--${type}`),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_8__.Grid, {
      className: "googlesitekit-page-content",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_8__.Row, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_8__.Cell, {
          size: 12,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Banner__WEBPACK_IMPORTED_MODULE_4__["default"], {
            learnMoreLink: learnMoreLink && {
              ...learnMoreLink,
              onClick: handleLearnMoreClickWithTrackEvent
            },
            dismissButton: dismissButton && {
              ...dismissButton,
              onClick: handleDismissWithTrackEvent
            },
            ctaButton: ctaButton && {
              ...ctaButton,
              onClick: handleCTAClickWithTrackEvent
            },
            svg: SVGData,
            ...props
          })
        })
      })
    })
  });
}
BannerNotification.propTypes = {
  notificationID: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string).isRequired,
  type: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOf(Object.values(TYPES)),
  titleIcon: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_12___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_12___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_12___default().node)]),
  learnMoreLink: prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape(_js_components_Banner_LearnMoreLink__WEBPACK_IMPORTED_MODULE_5__["default"].propTypes),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape(_js_components_Banner_DismissButton__WEBPACK_IMPORTED_MODULE_7__["default"].propTypes),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape(_js_components_Banner_CTAButton__WEBPACK_IMPORTED_MODULE_6__["default"].propTypes),
  gaTrackingEventArgs: prop_types__WEBPACK_IMPORTED_MODULE_12___default().shape({
    category: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string),
    label: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string),
    value: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().number)
  })
};

/***/ }),

/***/ "./js/googlesitekit/notifications/components/layout/NoticeNotification.js":
/*!********************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/layout/NoticeNotification.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ NoticeNotification)
/* harmony export */ });
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */







function NoticeNotification({
  notificationID,
  children,
  dismissButton,
  ctaButton,
  gaTrackingEventArgs,
  ...props
}) {
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_1__["default"])(notificationID, gaTrackingEventArgs?.category);
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_NOTIFICATIONS);
  async function handleDismissWithTrackEvent(event) {
    await dismissButton?.onClick?.(event);
    trackEvents.dismiss(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    dismissNotification(notificationID, {
      ...(dismissButton?.dismissOptions || {})
    });
  }
  async function handleCTAClickWithTrackEvent(event) {
    trackEvents.confirm(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    await ctaButton?.onClick?.(event);
    if (ctaButton?.dismissOnClick) {
      dismissNotification(notificationID, {
        ...ctaButton?.dismissOptions
      });
    }
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Grid, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Row, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Cell, {
        size: 12,
        alignMiddle: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_0__["default"], {
          dismissButton: {
            ...dismissButton,
            onClick: handleDismissWithTrackEvent
          },
          ctaButton: {
            ...ctaButton,
            onClick: handleCTAClickWithTrackEvent
          },
          ...props,
          children: children
        })
      })
    })
  });
}
NoticeNotification.propTypes = {
  notificationID: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().string).isRequired,
  children: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().node),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_6___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_6___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object)]),
  ctaButton: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object),
  gaTrackingEventArgs: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().object)
};

/***/ }),

/***/ "./js/googlesitekit/notifications/components/layout/OverlayNotification.js":
/*!*********************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/layout/OverlayNotification.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ OverlayNotification)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_components_OverlayCard__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/OverlayCard */ "./js/components/OverlayCard/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * OverlayNotification layout component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */





function OverlayNotification({
  notificationID,
  ctaButton,
  dismissButton,
  gaTrackingEventArgs,
  ...props
}) {
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_2__["default"])(notificationID, gaTrackingEventArgs?.category, {
    confirmAction: gaTrackingEventArgs?.confirmAction,
    dismissAction: gaTrackingEventArgs?.dismissAction
  });
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_NOTIFICATIONS);
  async function handleDismissWithTrackEvent(event) {
    await dismissButton?.onClick?.(event);
    trackEvents.dismiss(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    dismissNotification(notificationID, {
      ...dismissButton.dismissOptions
    });
  }
  const {
    dismissOnClick,
    dismissOptions,
    ...otherCTAProps
  } = ctaButton || {};
  async function handleCTAClickWithTrackEvent(event) {
    trackEvents.confirm(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    await ctaButton?.onClick?.(event);
    if (dismissOnClick) {
      dismissNotification(notificationID, {
        ...dismissOptions
      });
    }
  }
  const overlayCTAButton = ctaButton ? {
    ...otherCTAProps,
    onClick: handleCTAClickWithTrackEvent
  } : undefined;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_OverlayCard__WEBPACK_IMPORTED_MODULE_3__["default"], {
    ctaButton: overlayCTAButton,
    dismissButton: {
      ...dismissButton,
      onClick: handleDismissWithTrackEvent
    },
    ...props,
    visible: true
  });
}
OverlayNotification.propTypes = {
  notificationID: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().string),
  ctaButton: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_5___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_5___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_5___default().bool)])
};

/***/ }),

/***/ "./js/googlesitekit/notifications/constants.js":
/*!*****************************************************!*\
  !*** ./js/googlesitekit/notifications/constants.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   GTG_HEALTH_CHECK_WARNING_NOTIFICATION_ID: () => (/* binding */ GTG_HEALTH_CHECK_WARNING_NOTIFICATION_ID),
/* harmony export */   GTG_SETUP_CTA_BANNER_NOTIFICATION: () => (/* binding */ GTG_SETUP_CTA_BANNER_NOTIFICATION),
/* harmony export */   NOTIFICATION_AREAS: () => (/* binding */ NOTIFICATION_AREAS),
/* harmony export */   NOTIFICATION_GROUPS: () => (/* binding */ NOTIFICATION_GROUPS),
/* harmony export */   PRIORITY: () => (/* binding */ PRIORITY),
/* harmony export */   SITE_KIT_SETUP_SUCCESS_NOTIFICATION: () => (/* binding */ SITE_KIT_SETUP_SUCCESS_NOTIFICATION)
/* harmony export */ });
/**
 * Notifications API constants.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const GTG_HEALTH_CHECK_WARNING_NOTIFICATION_ID = 'warning-notification-gtg';
const GTG_SETUP_CTA_BANNER_NOTIFICATION = 'gtg-setup-cta';
const SITE_KIT_SETUP_SUCCESS_NOTIFICATION = 'setup-success-notification-site-kit';
const PRIORITY = {
  ERROR_HIGH: 30,
  ERROR_LOW: 60,
  WARNING: 100,
  INFO: 150,
  SETUP_CTA_HIGH: 150,
  SETUP_CTA_LOW: 200
};
const NOTIFICATION_AREAS = {
  HEADER: 'notification-area-header',
  DASHBOARD_TOP: 'notification-area-dashboard-top',
  OVERLAYS: 'notification-area-overlays'
};
const NOTIFICATION_GROUPS = {
  DEFAULT: 'default',
  SETUP_CTAS: 'setup-ctas'
};

/***/ }),

/***/ "./js/googlesitekit/notifications/datastore/constants.js":
/*!***************************************************************!*\
  !*** ./js/googlesitekit/notifications/datastore/constants.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_NOTIFICATIONS: () => (/* binding */ CORE_NOTIFICATIONS),
/* harmony export */   NOTIFICATION_VIEW_CONTEXTS: () => (/* binding */ NOTIFICATION_VIEW_CONTEXTS)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/**
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */


const CORE_NOTIFICATIONS = 'core/notifications';
const NOTIFICATION_VIEW_CONTEXTS = [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_SPLASH, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_ENTITY_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY];

/***/ }),

/***/ "./js/googlesitekit/notifications/hooks/useHasBeenViewed.js":
/*!******************************************************************!*\
  !*** ./js/googlesitekit/notifications/hooks/useHasBeenViewed.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useHasBeenViewed: () => (/* binding */ useHasBeenViewed)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/**
 * `useHasBeenViewed` hook.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */


function getKey(id) {
  return `notification/${id}/viewed`;
}
function useHasBeenViewed(id) {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => !!select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_UI).getValue(getKey(id)), [id]);
}
useHasBeenViewed.getKey = getKey;

/***/ }),

/***/ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js":
/*!***********************************************************************!*\
  !*** ./js/googlesitekit/notifications/hooks/useNotificationEvents.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useNotificationEvents)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * `useNotificationEvents` hook.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function useNotificationEvents(id, category, {
  viewAction = 'view_notification',
  confirmAction = 'confirm_notification',
  dismissAction = 'dismiss_notification',
  clickLearnMoreAction = 'click_learn_more_link'
} = {}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_0__["default"])();
  const eventCategory = category !== null && category !== void 0 ? category : `${viewContext}_${id}`;
  const view = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.trackEvent)(eventCategory, viewAction, ...args);
  }, [eventCategory, viewAction]);
  const confirm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.trackEvent)(eventCategory, confirmAction, ...args);
  }, [eventCategory, confirmAction]);
  const dismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.trackEvent)(eventCategory, dismissAction, ...args);
  }, [eventCategory, dismissAction]);
  const clickLearnMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.trackEvent)(eventCategory, clickLearnMoreAction, ...args);
  }, [eventCategory, clickLearnMoreAction]);
  return {
    view,
    confirm,
    dismiss,
    clickLearnMore
  };
}

/***/ }),

/***/ "./js/googlesitekit/notifications/util/component-props.js":
/*!****************************************************************!*\
  !*** ./js/googlesitekit/notifications/util/component-props.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getNotificationComponentProps: () => (/* binding */ getNotificationComponentProps),
/* harmony export */   withNotificationComponentProps: () => (/* binding */ withNotificationComponentProps)
/* harmony export */ });
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! memize */ "../node_modules/memize/index.js");
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_notifications_components_Notification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/Notification */ "./js/googlesitekit/notifications/components/Notification/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Gets the props to pass to a Notification's component.
 *
 * @since 1.134.0
 *
 * @param {string} id The Notification's ID.
 * @return {Object} Props to pass to the Notification component.
 */

const getNotificationComponentProps = memize__WEBPACK_IMPORTED_MODULE_0___default()(id => {
  return {
    id,
    Notification: withNotificationID(id)(_js_googlesitekit_notifications_components_Notification__WEBPACK_IMPORTED_MODULE_1__["default"])
  };
});
function withNotificationID(id) {
  return WrappedComponent => {
    function WithNotificationID(props) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(WrappedComponent, {
        ...props,
        id: id
      });
    }
    WithNotificationID.displayName = 'WithNotificationID';
    if (WrappedComponent.displayName || WrappedComponent.name) {
      WithNotificationID.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return WithNotificationID;
  };
}

/**
 * Gets the props and passes them to the notification's component through a HOC.
 *
 * @since 1.134.0
 *
 * @param {string} id The id of the notification.
 * @return {Function} Enhancing function that adds the getNotificationComponentProps to the passed component.
 */
function withNotificationComponentProps(id) {
  const notificationComponentProps = getNotificationComponentProps(id);
  return WrappedComponent => {
    function DecoratedComponent(props) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(WrappedComponent, {
        ...props,
        ...notificationComponentProps
      });
    }
    DecoratedComponent.displayName = 'WithWidgetComponentProps';
    if (WrappedComponent.displayName || WrappedComponent.name) {
      DecoratedComponent.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return DecoratedComponent;
  };
}

/***/ }),

/***/ "./js/googlesitekit/notifications/util/create-register-notifications.js":
/*!******************************************************************************!*\
  !*** ./js/googlesitekit/notifications/util/create-register-notifications.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createRegisterNotifications: () => (/* binding */ createRegisterNotifications)
/* harmony export */ });
/**
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Registers module notifications using the notifications API.
 *
 * @since 1.173.0
 *
 * @param {Object} notificationsAPI    Notifications API.
 * @param {Object} moduleNotifications Notification definitions keyed by notification ID.
 */
function createRegisterNotifications(notificationsAPI, moduleNotifications) {
  for (const [notificationID, notificationSettings] of Object.entries(moduleNotifications)) {
    notificationsAPI.registerNotification(notificationID, notificationSettings);
  }
}

/***/ }),

/***/ "./js/googlesitekit/widgets/components/WidgetContext.tsx":
/*!***************************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WidgetContext.tsx ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Consumer: () => (/* binding */ Consumer),
/* harmony export */   Provider: () => (/* binding */ Provider),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * Context for widgets.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */

/**
 * Widget context value interface.
 *
 * @since 1.170.0
 */

const WidgetContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.createContext)({});
const {
  Consumer,
  Provider
} = WidgetContext;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WidgetContext);

/***/ }),

/***/ "./js/googlesitekit/widgets/components/WidgetHeaderTitle.js":
/*!******************************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WidgetHeaderTitle.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WidgetHeaderTitle component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function WidgetHeaderTitle({
  title
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_0__["default"], {
    className: "googlesitekit-widget__header-title",
    as: "h3",
    type: "title",
    size: "small",
    children: title
  });
}
WidgetHeaderTitle.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WidgetHeaderTitle);

/***/ }),

/***/ "./js/googlesitekit/widgets/datastore/constants.js":
/*!*********************************************************!*\
  !*** ./js/googlesitekit/widgets/datastore/constants.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CORE_WIDGETS: () => (/* binding */ CORE_WIDGETS),
/* harmony export */   WIDGET_AREA_STYLES: () => (/* binding */ WIDGET_AREA_STYLES),
/* harmony export */   WIDGET_WIDTHS: () => (/* binding */ WIDGET_WIDTHS)
/* harmony export */ });
/**
 * `core/widgets` data store: constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const WIDGET_AREA_STYLES = {
  BOXES: 'boxes',
  COMPOSITE: 'composite'
};
const WIDGET_WIDTHS = {
  QUARTER: 'quarter',
  HALF: 'half',
  FULL: 'full'
};
const CORE_WIDGETS = 'core/widgets';

/***/ }),

/***/ "./js/googlesitekit/widgets/default-areas.js":
/*!***************************************************!*\
  !*** ./js/googlesitekit/widgets/default-areas.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AREA_ENTITY_DASHBOARD_CONTENT_PRIMARY: () => (/* binding */ AREA_ENTITY_DASHBOARD_CONTENT_PRIMARY),
/* harmony export */   AREA_ENTITY_DASHBOARD_MONETIZATION_PRIMARY: () => (/* binding */ AREA_ENTITY_DASHBOARD_MONETIZATION_PRIMARY),
/* harmony export */   AREA_ENTITY_DASHBOARD_SPEED_PRIMARY: () => (/* binding */ AREA_ENTITY_DASHBOARD_SPEED_PRIMARY),
/* harmony export */   AREA_ENTITY_DASHBOARD_TRAFFIC_PRIMARY: () => (/* binding */ AREA_ENTITY_DASHBOARD_TRAFFIC_PRIMARY),
/* harmony export */   AREA_MAIN_DASHBOARD_CONTENT_PRIMARY: () => (/* binding */ AREA_MAIN_DASHBOARD_CONTENT_PRIMARY),
/* harmony export */   AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY: () => (/* binding */ AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY),
/* harmony export */   AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY: () => (/* binding */ AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY),
/* harmony export */   AREA_MAIN_DASHBOARD_SPEED_PRIMARY: () => (/* binding */ AREA_MAIN_DASHBOARD_SPEED_PRIMARY),
/* harmony export */   AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION: () => (/* binding */ AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION),
/* harmony export */   AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY: () => (/* binding */ AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Widgets API default areas
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Main dashboard
const AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY = 'mainDashboardKeyMetricsPrimary';
const AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY = 'mainDashboardTrafficPrimary';
const AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION = 'mainDashboardTrafficAudienceSegmentation';
const AREA_MAIN_DASHBOARD_CONTENT_PRIMARY = 'mainDashboardContentPrimary';
const AREA_MAIN_DASHBOARD_SPEED_PRIMARY = 'mainDashboardSpeedPrimary';
const AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY = 'mainDashboardMonetizationPrimary';
// Entity dashboard
const AREA_ENTITY_DASHBOARD_TRAFFIC_PRIMARY = 'entityDashboardTrafficPrimary';
const AREA_ENTITY_DASHBOARD_CONTENT_PRIMARY = 'entityDashboardContentPrimary';
const AREA_ENTITY_DASHBOARD_SPEED_PRIMARY = 'entityDashboardSpeedPrimary';
const AREA_ENTITY_DASHBOARD_MONETIZATION_PRIMARY = 'entityDashboardMonetizationPrimary';
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  // Main dashboard
  AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY,
  AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY,
  AREA_MAIN_DASHBOARD_CONTENT_PRIMARY,
  AREA_MAIN_DASHBOARD_SPEED_PRIMARY,
  AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY,
  // Entity dashboard
  AREA_ENTITY_DASHBOARD_TRAFFIC_PRIMARY,
  AREA_ENTITY_DASHBOARD_CONTENT_PRIMARY,
  AREA_ENTITY_DASHBOARD_SPEED_PRIMARY,
  AREA_ENTITY_DASHBOARD_MONETIZATION_PRIMARY
});

/***/ }),

/***/ "./js/googlesitekit/widgets/default-contexts.js":
/*!******************************************************!*\
  !*** ./js/googlesitekit/widgets/default-contexts.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_CONTENT: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_CONTENT),
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_MONETIZATION: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_MONETIZATION),
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_SPEED: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_SPEED),
/* harmony export */   CONTEXT_ENTITY_DASHBOARD_TRAFFIC: () => (/* binding */ CONTEXT_ENTITY_DASHBOARD_TRAFFIC),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_CONTENT: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_CONTENT),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_KEY_METRICS: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_KEY_METRICS),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_MONETIZATION: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_MONETIZATION),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_SPEED: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_SPEED),
/* harmony export */   CONTEXT_MAIN_DASHBOARD_TRAFFIC: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_TRAFFIC),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Widgets API default contexts
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Main dashboard
const CONTEXT_MAIN_DASHBOARD_KEY_METRICS = 'mainDashboardKeyMetrics';
const CONTEXT_MAIN_DASHBOARD_TRAFFIC = 'mainDashboardTraffic';
const CONTEXT_MAIN_DASHBOARD_CONTENT = 'mainDashboardContent';
const CONTEXT_MAIN_DASHBOARD_SPEED = 'mainDashboardSpeed';
const CONTEXT_MAIN_DASHBOARD_MONETIZATION = 'mainDashboardMonetization';
// Entity dashboard
const CONTEXT_ENTITY_DASHBOARD_TRAFFIC = 'entityDashboardTraffic';
const CONTEXT_ENTITY_DASHBOARD_CONTENT = 'entityDashboardContent';
const CONTEXT_ENTITY_DASHBOARD_SPEED = 'entityDashboardSpeed';
const CONTEXT_ENTITY_DASHBOARD_MONETIZATION = 'entityDashboardMonetization';
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  // Main dashboard
  CONTEXT_MAIN_DASHBOARD_KEY_METRICS,
  CONTEXT_MAIN_DASHBOARD_TRAFFIC,
  CONTEXT_MAIN_DASHBOARD_CONTENT,
  CONTEXT_MAIN_DASHBOARD_SPEED,
  CONTEXT_MAIN_DASHBOARD_MONETIZATION,
  // Entity dashboard
  CONTEXT_ENTITY_DASHBOARD_TRAFFIC,
  CONTEXT_ENTITY_DASHBOARD_CONTENT,
  CONTEXT_ENTITY_DASHBOARD_SPEED,
  CONTEXT_ENTITY_DASHBOARD_MONETIZATION
});

/***/ }),

/***/ "./js/googlesitekit/widgets/hooks/useWidget.ts":
/*!*****************************************************!*\
  !*** ./js/googlesitekit/widgets/hooks/useWidget.ts ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useWidget)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_googlesitekit_widgets_components_WidgetContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetContext */ "./js/googlesitekit/widgets/components/WidgetContext.tsx");
/**
 * `useWidget` hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Returns the current widget context.
 *
 * @since 1.170.0
 *
 * @return {WidgetContextValue} The current widget context.
 */
function useWidget() {
  const widgetContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_js_googlesitekit_widgets_components_WidgetContext__WEBPACK_IMPORTED_MODULE_0__["default"]);
  return widgetContext;
}

/***/ }),

/***/ "./js/googlesitekit/widgets/hooks/useWidgetStateEffect.js":
/*!****************************************************************!*\
  !*** ./js/googlesitekit/widgets/hooks/useWidgetStateEffect.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useWidgetStateEffect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/**
 * `useWidgetStateEffect` hook.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function useWidgetStateEffect(widgetSlug, Component, metadata) {
  const {
    setWidgetState,
    unsetWidgetState
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_WIDGETS);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    setWidgetState(widgetSlug, Component, metadata);
    return () => {
      unsetWidgetState(widgetSlug, Component, metadata);
    };
  }, [widgetSlug, Component, metadata, setWidgetState, unsetWidgetState]);
}

/***/ }),

/***/ "./js/hooks/useActivateModuleCallback.js":
/*!***********************************************!*\
  !*** ./js/hooks/useActivateModuleCallback.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useActivateModuleCallback)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.js");
/* harmony import */ var _js_util_tracking__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/tracking */ "./js/util/tracking/index.js");
/* harmony import */ var _useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./useViewContext */ "./js/hooks/useViewContext.js");
/**
 * `useActivateModuleCallback` hook.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */









/**
 * Returns a callback to activate a module. If the call to activate the module is successful, navigate to the reauthentication URL.
 * Returns null if the module doesn't exist or the user can't manage options.
 *
 * @since 1.70.0
 *
 * @param {string} moduleSlug Module slug.
 * @return {Function|null} Callback to activate module, null if the module doesn't exist or the user can't manage options.
 */
function useActivateModuleCallback(moduleSlug) {
  const viewContext = (0,_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).getModule(moduleSlug));
  const canManageOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.PERMISSION_MANAGE_OPTIONS));
  const {
    activateModule
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_LOCATION);
  const {
    setInternalServerError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE);
  const activateModuleCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(async () => {
    const {
      error,
      response
    } = await activateModule(moduleSlug);
    if (!error) {
      await (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_widget-activation-cta`, 'activate_module', moduleSlug);
      await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_5__.setItem)('module_setup', moduleSlug, {
        ttl: 300
      });
      navigateTo(response.moduleReauthURL);
    } else {
      setInternalServerError({
        id: `${moduleSlug}-setup-error`,
        description: error.message
      });
    }
  }, [activateModule, moduleSlug, navigateTo, setInternalServerError, viewContext]);
  if (!module?.name || !canManageOptions) {
    return null;
  }
  return activateModuleCallback;
}

/***/ }),

/***/ "./js/hooks/useAdSenseNotifications.js":
/*!*********************************************!*\
  !*** ./js/hooks/useAdSenseNotifications.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useAdSenseNotifications)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _useViewContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_components_NotificationFromServer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/NotificationFromServer */ "./js/components/NotificationFromServer.js");
/* harmony import */ var _svg_graphics_adsense_circular_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/graphics/adsense-circular.svg */ "./svg/graphics/adsense-circular.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense notifications side-effect hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */










function useAdSenseNotifications() {
  const viewContext = (0,_useViewContext__WEBPACK_IMPORTED_MODULE_2__["default"])();
  const adSenseModuleConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).isModuleConnected(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ADSENSE));
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getAccountID());
  const [registeredNotifications, setRegisteredNotifications] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useState)([]);
  const {
    registerNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_NOTIFICATIONS);
  const notifications = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getNotifications());
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useEffect)(() => {
    // If AdSense is not connected, or the account ID is not set,
    // there's nothing to do here.
    if (!adSenseModuleConnected || !accountID) {
      return;
    }

    // Register any notifications from the server that haven't yet been
    // registered.
    //
    // (Usually there will be one, if any, notification from the server.)
    notifications?.forEach(notification => {
      if (registeredNotifications.includes(notification.id)) {
        return;
      }

      /**
       * Adjust the notification props to match the expected
       * `NotificationFromServer` component props, which vary
       * slightly from the attributes returned from the REST API.
       */
      const notificationProps = {
        ...notification
      };

      // Some notifications do not include a `title` property, so supply
      // a default.
      if (!notificationProps.title) {
        notificationProps.title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Notice about your AdSense account', 'google-site-kit');
      }
      if (!notificationProps.content?.length && !!notificationProps.description?.length) {
        notificationProps.content = notificationProps.description;
        delete notificationProps.description;
      }

      // This always shows the `dismissButton` in the `<NotificationFromServer>`
      // layout component. AdSense alerts are always dismissible, but these
      // will persist only for an hour in `<NotificationFromServer>`, allowing
      // the alerts to resurface if the issue still persists.
      if (notificationProps.dismissible === undefined && notificationProps.isDismissible !== undefined) {
        notificationProps.dismissible = notificationProps.isDismissible;
        delete notificationProps.isDismissible;
      }

      // Before refactoring Banner Notifications, `CoreSiteBannerNotification`
      // added a constant GA event category but the notification ID from the
      // server was passed as the event label to differentiate multiple notifications
      // from the server. So we follow the same pattern here.
      const gaTrackingEventArgs = {
        category: `${viewContext}_adsense-alerts-banner-notification`,
        label: notification.id
      };
      registerNotification(notification.id, {
        Component({
          Notification
        }) {
          return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Notification, {
            gaTrackingEventArgs: gaTrackingEventArgs,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_NotificationFromServer__WEBPACK_IMPORTED_MODULE_8__["default"], {
              ...notificationProps,
              titleIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_svg_graphics_adsense_circular_svg__WEBPACK_IMPORTED_MODULE_9__["default"], {}),
              gaTrackingEventArgs: gaTrackingEventArgs
            })
          });
        },
        priority: notification.priority,
        areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_6__.NOTIFICATION_AREAS.HEADER,
        isDismissible: true // AdSense alerts are always dismissible, but these will persist only for an hour in `<NotificationFromServer>`.
      });
      setRegisteredNotifications(previousRegisteredNotifications => {
        return [...previousRegisteredNotifications, notification.id];
      });
    });
  }, [viewContext, accountID, adSenseModuleConnected, notifications, registerNotification, registeredNotifications]);
}

/***/ }),

/***/ "./js/hooks/useBreakpoint.ts":
/*!***********************************!*\
  !*** ./js/hooks/useBreakpoint.ts ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BREAKPOINT_DESKTOP: () => (/* binding */ BREAKPOINT_DESKTOP),
/* harmony export */   BREAKPOINT_SMALL: () => (/* binding */ BREAKPOINT_SMALL),
/* harmony export */   BREAKPOINT_TABLET: () => (/* binding */ BREAKPOINT_TABLET),
/* harmony export */   BREAKPOINT_XLARGE: () => (/* binding */ BREAKPOINT_XLARGE),
/* harmony export */   useBreakpoint: () => (/* binding */ useBreakpoint)
/* harmony export */ });
/* harmony import */ var _useWindowSize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useWindowSize */ "./js/hooks/useWindowSize.ts");
/**
 * `useBreakpoint` hook.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */



/**
 * Breakpoint for an extra large screen (over `1280px` wide).
 */
const BREAKPOINT_XLARGE = 'xlarge';
/**
 * Breakpoint for a desktop screen (over `960px` wide).
 */
const BREAKPOINT_DESKTOP = 'desktop';
/**
 * Breakpoint for a tablet screen (over `600px` wide).
 */
const BREAKPOINT_TABLET = 'tablet';
/**
 * Breakpoint for a mobile phone screen (any screen `600px` wide or less).
 */
const BREAKPOINT_SMALL = 'small';

/**
 * Retrieves the current breakpoint.
 *
 * @since 1.29.0
 *
 * @return {string} The current breakpoint according to the window size.
 */
function useBreakpoint() {
  const windowWidth = (0,_useWindowSize__WEBPACK_IMPORTED_MODULE_0__.useWindowWidth)();
  if (windowWidth > 1280) {
    return BREAKPOINT_XLARGE;
  }
  if (windowWidth > 960) {
    return BREAKPOINT_DESKTOP;
  }
  if (windowWidth > 600) {
    return BREAKPOINT_TABLET;
  }
  return BREAKPOINT_SMALL;
}

/***/ }),

/***/ "./js/hooks/useDashboardType.js":
/*!**************************************!*\
  !*** ./js/hooks/useDashboardType.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DASHBOARD_TYPE_ENTITY: () => (/* binding */ DASHBOARD_TYPE_ENTITY),
/* harmony export */   DASHBOARD_TYPE_MAIN: () => (/* binding */ DASHBOARD_TYPE_MAIN),
/* harmony export */   "default": () => (/* binding */ useDashboardType)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useViewContext */ "./js/hooks/useViewContext.js");
/**
 * `useDashboardType` hook.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */


const DASHBOARD_TYPE_MAIN = _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_MAIN_DASHBOARD;
const DASHBOARD_TYPE_ENTITY = _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_ENTITY_DASHBOARD;

/**
 * Determines dashboard type from the view context.
 *
 * @since 1.45.0
 *
 * @return {string|null} The type of dashboard (either `DASHBOARD_TYPE_MAIN` or `DASHBOARD_TYPE_ENTITY`; `null` if not a Unified Dashboard page).
 */
function useDashboardType() {
  const viewContext = (0,_useViewContext__WEBPACK_IMPORTED_MODULE_1__["default"])();
  if (viewContext === _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_MAIN_DASHBOARD || viewContext === _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY) {
    return DASHBOARD_TYPE_MAIN;
  }
  if (viewContext === _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_ENTITY_DASHBOARD || viewContext === _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.VIEW_CONTEXT_ENTITY_DASHBOARD_VIEW_ONLY) {
    return DASHBOARD_TYPE_ENTITY;
  }
  return null;
}

/***/ }),

/***/ "./js/hooks/useDebounce.js":
/*!*********************************!*\
  !*** ./js/hooks/useDebounce.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useDebounce: () => (/* binding */ useDebounce)
/* harmony export */ });
/* harmony import */ var use_memo_one__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! use-memo-one */ "../node_modules/use-memo-one/dist/use-memo-one.esm.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * `useDebounce` hook, from @wordpress/compose.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// @TODO When we upgrade React to 16.4, we can also upgrade @wordpress/compose, and then this file can be removed.

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Debounces a function with Lodash's `debounce`.
 *
 * A new debounced function will be returned and any scheduled calls
 * cancelled if any of the arguments change, including the function to debounce,
 * so please wrap functions created on render in components in `useCallback`.
 *
 * @since 1.26.0
 *
 * @param {...any} args Arguments passed to Lodash's `debounce`.
 * @return {Function} Debounced function.
 */
function useDebounce(...args) {
  const debounced = (0,use_memo_one__WEBPACK_IMPORTED_MODULE_1__.useMemoOne)(() => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.debounce)(...args), args);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => () => debounced.cancel(), [debounced]);
  return debounced;
}

/***/ }),

/***/ "./js/hooks/useFeature.js":
/*!********************************!*\
  !*** ./js/hooks/useFeature.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useFeature: () => (/* binding */ useFeature)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_FeaturesProvider_FeaturesContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/FeaturesProvider/FeaturesContext */ "./js/components/FeaturesProvider/FeaturesContext.js");
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/features */ "./js/features/index.js");
/**
 * Feature Flags hook.
 *
 * Site Kit by Google, Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Returns the enabled state of a feature flag.
 *
 * @since 1.25.0
 *
 * @param {string} feature The feature flag name to check enabled state for.
 * @return {boolean} `true` if the feature is enabled, `false` otherwise.
 */
function useFeature(feature) {
  const enabledFeatures = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_js_components_FeaturesProvider_FeaturesContext__WEBPACK_IMPORTED_MODULE_0__["default"]);
  return (0,_js_features__WEBPACK_IMPORTED_MODULE_1__.isFeatureEnabled)(feature, enabledFeatures);
}

/***/ }),

/***/ "./js/hooks/useFormValue.js":
/*!**********************************!*\
  !*** ./js/hooks/useFormValue.js ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useFormValue)
/* harmony export */ });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-select/index.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/**
 * Form value hook.
 *
 * Site Kit by Google, Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Returns the value of a form field.
 *
 * @since 1.160.0
 *
 * @param {string} formName The name of the form.
 * @param {string} key      The key of the form field.
 * @return {string|number|boolean|Array|Object|undefined} The value of the form field, or the default value if provided.
 */
function useFormValue(formName, key) {
  return (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["default"])(select => {
    const {
      getValue
    } = select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_0__.CORE_FORMS);
    return getValue(formName, key);
  }, [formName, key]);
}

/***/ }),

/***/ "./js/hooks/useGlobalTrackingEffect.js":
/*!*********************************************!*\
  !*** ./js/hooks/useGlobalTrackingEffect.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useGlobalTrackingEffect: () => (/* binding */ useGlobalTrackingEffect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _useViewContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _useFeature__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./useFeature */ "./js/hooks/useFeature.js");
/**
 * `useGlobalTrackingEffect` hook.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







/**
 * Tracks the successful user and site setup.
 *
 * @since 1.132.0
 */
function useGlobalTrackingEffect() {
  const viewContext = (0,_useViewContext__WEBPACK_IMPORTED_MODULE_2__["default"])();
  const isUsingProxy = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).isUsingProxy());
  const setupErrorMessage = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getSetupErrorMessage());
  const setupFlowRefreshEnabled = (0,_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefresh');
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
    if (setupFlowRefreshEnabled) {
      return;
    }
    async function trackEvents() {
      const startUserSetup = await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.getItem)('start_user_setup');
      const startSiteSetup = await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.getItem)('start_site_setup');
      if (startUserSetup.cacheHit) {
        await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.deleteItem)('start_user_setup');
        (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_setup`, 'complete_user_setup', isUsingProxy ? 'proxy' : 'custom-oauth');
      }
      if (startSiteSetup.cacheHit) {
        await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.deleteItem)('start_site_setup');
        (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_setup`, 'complete_site_setup', isUsingProxy ? 'proxy' : 'custom-oauth');
      }
    }
    if (!setupErrorMessage && isUsingProxy !== undefined) {
      trackEvents();
    }
  }, [setupFlowRefreshEnabled, viewContext, isUsingProxy, setupErrorMessage]);
}

/***/ }),

/***/ "./js/hooks/useInView.js":
/*!*******************************!*\
  !*** ./js/hooks/useInView.js ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useInView: () => (/* binding */ useInView)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useUpdateEffect.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-select/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_InViewProvider_InViewContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/InViewProvider/InViewContext */ "./js/components/InViewProvider/InViewContext.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/**
 * In viewport hook.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */
// Imported directly from `@wordpress/data` to avoid circular
// dependency/imports.



/**
 * Internal dependencies
 */



/**
 * Returns whether the nearest parent component tracking viewport detection is in-view.
 *
 * @since 1.46.0
 *
 * @param {Object}  options        Optional. Options to pass to the request.
 * @param {boolean} options.sticky Set to `true` to always return `true` after the nearest viewport-detecting component has been in-view once. Defaults to `false`.
 * @return {boolean} `true` if the nearest parent component is in-view (or if `sticky` is `true`, if the component has ever been in-view); `false` if not..
 */
function useInView({
  sticky = false
} = {}) {
  const inView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useContext)(_js_components_InViewProvider_InViewContext__WEBPACK_IMPORTED_MODULE_0__["default"]);
  const [hasBeenInViewOnce, setHasBeenInViewOnce] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const resetCount = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["default"])(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_UI).getInViewResetCount());
  const forceInView = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_3__["default"])(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_UI).getValue('forceInView'));
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (inView.value && !hasBeenInViewOnce) {
      setHasBeenInViewOnce(true);
    }
  }, [hasBeenInViewOnce, inView, setHasBeenInViewOnce]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (forceInView) {
      setHasBeenInViewOnce(true);
    }
  }, [forceInView]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_4__["default"])(() => {
    setHasBeenInViewOnce(false);
  }, [resetCount]);
  if (sticky && hasBeenInViewOnce) {
    return true;
  }
  return !!inView.value;
}

/***/ }),

/***/ "./js/hooks/useInViewSelect.js":
/*!*************************************!*\
  !*** ./js/hooks/useInViewSelect.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useInViewSelect: () => (/* binding */ useInViewSelect)
/* harmony export */ });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-select/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _useInView__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useInView */ "./js/hooks/useInView.js");
/**
 * Select when in-view hook.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */


/**
 * Returns undefined when the component is not in view.
 *
 * @since 1.131.0 Moved this inline function outside the hook and assigned it a stable function name.
 *
 * @return {undefined} Always returns undefined.
 */
function notInViewCallback() {
  return undefined;
}

/**
 * Returns whether the nearest parent component tracking viewport detection is in-view.
 *
 * @since 1.49.0
 * @private
 *
 * @param {Function} mapSelect Selector to call when this selector's component is considered in-view.
 * @param {Array}    deps      Deps passed to `useInViewSelect`'s `deps` argument.
 * @return {*} The result of the selector if in-view; `undefined` if not in-view.
 */
function useInViewSelect(mapSelect, deps) {
  const isInView = (0,_useInView__WEBPACK_IMPORTED_MODULE_0__.useInView)({
    sticky: true
  });
  const latestSelectorResult = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)();

  // These are "pass-through" dependencies from the parent hook,
  // and the parent should catch any hook rule violations.
  // eslint-disable-next-line react-hooks/exhaustive-deps
  const mapSelectCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(mapSelect, deps);
  const selectorResult = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__["default"])(isInView ? mapSelectCallback : notInViewCallback);
  if (isInView) {
    latestSelectorResult.current = selectorResult;
  }
  return latestSelectorResult.current;
}

/***/ }),

/***/ "./js/hooks/useKeyCodesInside.js":
/*!***************************************!*\
  !*** ./js/hooks/useKeyCodesInside.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useKeyCodesInside: () => (/* binding */ useKeyCodesInside)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useKey.js");
/**
 * `useKeyCodesInside` hook.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Calls handler when event happens with a given keyCode inside a target ref.
 *
 * @since 1.32.0
 *
 * @param {Array}    keyCodes Array of keyCodes.
 * @param {Object}   ref      React ref to element containing target.
 * @param {Function} handler  Callback function.
 */
function useKeyCodesInside(keyCodes, ref, handler) {
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])(event => {
    return keyCodes.includes(event.keyCode) && ref.current.contains(event.target);
  }, handler);
}

/***/ }),

/***/ "./js/hooks/useLatestIntersection.js":
/*!*******************************************!*\
  !*** ./js/hooks/useLatestIntersection.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * `useLatestIntersection` hook.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Returns latest intersaction observer entry for a given element.
 *
 * This hook is based on the `useIntersection` hook from the `react-use` package. The difference
 * is that this hook returns the last intersection observer entry instead of the first one.
 * See https://github.com/streamich/react-use/blob/325f5bd69904346788ea981ec18bfc7397c611df/src/useIntersection.ts.
 *
 * @since 1.95.0
 *
 * @param {Object} ref     A ref object that points to the HTML element to observe.
 * @param {Object} options Options for the Intersection Observer.
 * @return {IntersectionObserverEntry | null} The latest Intersection Observer entry.
 */
function useLatestIntersection(ref, options) {
  const [intersectionObserverEntry, setIntersectionObserverEntry] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (ref.current && typeof __webpack_require__.g.IntersectionObserver === 'function') {
      function handler(entries) {
        setIntersectionObserverEntry(entries[entries.length - 1]);
      }
      const observer = new __webpack_require__.g.IntersectionObserver(handler, options);
      observer.observe(ref.current);
      return () => {
        setIntersectionObserverEntry(null);
        observer.disconnect();
      };
    }
    return () => {};
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [ref.current, options.threshold, options.root, options.rootMargin]);
  return intersectionObserverEntry;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useLatestIntersection);

/***/ }),

/***/ "./js/hooks/useQueryArg.js":
/*!*********************************!*\
  !*** ./js/hooks/useQueryArg.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/**
 * `useQueryArg` hook.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Uses a location query param as a variable in a component.
 *
 * @since 1.24.0
 *
 * @param {string} key            The query param key to be used.
 * @param {string} [initialValue] Optional. The initial value for the query param to be used.
 * @param {Object} [_global]      The global window object.
 * @return {Array} The getter and setter for the query param state.
 */
function useQueryArg(key, initialValue, _global = __webpack_require__.g) {
  const [value, setValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.getQueryArg)(_global.location.href, key) || initialValue);
  function onSetValue(newValue) {
    setValue(newValue);
    const newURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.addQueryArgs)(_global.location.href, {
      [key]: newValue
    });
    _global.history.replaceState(null, '', newURL);
  }
  return [value, onSetValue];
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useQueryArg);

/***/ }),

/***/ "./js/hooks/useRefocus.js":
/*!********************************!*\
  !*** ./js/hooks/useRefocus.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useRefocus: () => (/* binding */ useRefocus)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * `useRefocus` hook.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Invokes a function when the window is blurred and then refocused after the specified delay.
 *
 * @since 1.80.0
 *
 * @param {Function} callback     Function to invoke when the window is blurred and then refocused after the specified delay.
 * @param {number}   milliseconds Amount of time (in milliseconds) required to elapse with the tab unfocused before the callback should be run when refocused. Default is `0`, eg. run the `callback` after returning to this tab/window as soon as the user is unfocused for any length of time.
 */
function useRefocus(callback, milliseconds = 0) {
  // Run the supplied callback whenever a user re-focuses window, as
  // long as it happens after the specified delay.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    let timeout;
    let runCallback = false;

    // Count `milliseconds` once user focuses elsewhere.
    function countIdleTime() {
      timeout = __webpack_require__.g.setTimeout(() => {
        runCallback = true;
      }, milliseconds);
    }

    // Run the callback when user re-focuses after `milliseconds` or more.
    function onFocus() {
      __webpack_require__.g.clearTimeout(timeout);

      // Do not run the callback if user has been away for less
      // than `milliseconds`.
      if (!runCallback) {
        return;
      }
      runCallback = false;
      callback();
    }
    __webpack_require__.g.addEventListener('focus', onFocus);
    __webpack_require__.g.addEventListener('blur', countIdleTime);
    return () => {
      __webpack_require__.g.removeEventListener('focus', onFocus);
      __webpack_require__.g.removeEventListener('blur', countIdleTime);
      __webpack_require__.g.clearTimeout(timeout);
    };
  }, [milliseconds, callback]);
}

/***/ }),

/***/ "./js/hooks/useViewContext.js":
/*!************************************!*\
  !*** ./js/hooks/useViewContext.js ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Root/ViewContextContext */ "./js/components/Root/ViewContextContext.js");
/**
 * `useViewContext` hook.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Returns the current Site Kit viewing context, eg. "dashboard",
 * "entity dashboard", "view-only dashboard", etc.
 *
 * @since 1.74.0
 *
 * @return {string} The current "viewing context" value for the plugin.
 */
function useViewContext() {
  const viewContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useContext)(_js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_0__["default"]);
  return viewContext;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useViewContext);

/***/ }),

/***/ "./js/hooks/useViewOnly.js":
/*!*********************************!*\
  !*** ./js/hooks/useViewOnly.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ useViewOnly)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useViewContext */ "./js/hooks/useViewContext.js");
/**
 * `useViewOnly` hook.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */



/**
 * Determines if the current view context is a "view only" dashboard context.
 *
 * @since 1.72.0
 *
 * @return {boolean} True if current context is a view-only dashboard context, false otherwise.
 */
function useViewOnly() {
  const viewContext = (0,_useViewContext__WEBPACK_IMPORTED_MODULE_1__["default"])();
  return _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.SITE_KIT_VIEW_ONLY_CONTEXTS.includes(viewContext);
}

/***/ }),

/***/ "./js/hooks/useWindowSize.ts":
/*!***********************************!*\
  !*** ./js/hooks/useWindowSize.ts ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useWindowHeight: () => (/* binding */ useWindowHeight),
/* harmony export */   useWindowSize: () => (/* binding */ useWindowSize),
/* harmony export */   useWindowWidth: () => (/* binding */ useWindowWidth)
/* harmony export */ });
/* harmony import */ var _react_hook_throttle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hook/throttle */ "../node_modules/@react-hook/throttle/dist/module/index.js");
/* harmony import */ var _react_hook_event__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hook/event */ "../node_modules/@react-hook/event/dist/module/index.js");
/**
 * `useWindowSize` hook.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// Copied from https://github.com/jaredLunde/react-hook/blob/b8ac9515e26937e838a36a27001dc46c7f46a390/packages/window-size/throttled/src/index.tsx
// Modified to use global.innerWidth and global.innerHeight instead of document.documentElement.clientWidth and document.documentElement.clientHeight.

/**
 * External dependencies
 */


function getSize() {
  return [__webpack_require__.g.innerWidth, __webpack_require__.g.innerHeight];
}
function useWindowSize({
  fps = 60,
  leading = false,
  initialWidth = 0,
  initialHeight = 0
} = {}) {
  const [size, setThrottledSize] = (0,_react_hook_throttle__WEBPACK_IMPORTED_MODULE_0__.useThrottle)(/* istanbul ignore next */
  typeof document === 'undefined' ? [initialWidth, initialHeight] : getSize, fps, leading);
  function setSize() {
    return setThrottledSize(getSize);
  }
  (0,_react_hook_event__WEBPACK_IMPORTED_MODULE_1__["default"])(window, 'resize', setSize);
  (0,_react_hook_event__WEBPACK_IMPORTED_MODULE_1__["default"])(window, 'orientationchange', setSize);
  return size;
}
function useWindowHeight(options = {}) {
  return useWindowSize(options)[1];
}
function useWindowWidth(options = {}) {
  return useWindowSize(options)[0];
}

/***/ }),

/***/ "./js/material-components/index.js":
/*!*****************************************!*\
  !*** ./js/material-components/index.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Cell: () => (/* reexport safe */ _layout__WEBPACK_IMPORTED_MODULE_1__.Cell),
/* harmony export */   Dialog: () => (/* reexport default from dynamic */ _material_react_dialog__WEBPACK_IMPORTED_MODULE_0___default.a),
/* harmony export */   DialogContent: () => (/* reexport safe */ _material_react_dialog__WEBPACK_IMPORTED_MODULE_0__.DialogContent),
/* harmony export */   DialogFooter: () => (/* reexport safe */ _material_react_dialog__WEBPACK_IMPORTED_MODULE_0__.DialogFooter),
/* harmony export */   Grid: () => (/* reexport safe */ _layout__WEBPACK_IMPORTED_MODULE_1__.Grid),
/* harmony export */   MDCCheckbox: () => (/* reexport safe */ _material_checkbox__WEBPACK_IMPORTED_MODULE_7__.MDCCheckbox),
/* harmony export */   MDCDialog: () => (/* reexport safe */ _material_dialog__WEBPACK_IMPORTED_MODULE_6__.MDCDialog),
/* harmony export */   MDCFormField: () => (/* reexport safe */ _material_form_field__WEBPACK_IMPORTED_MODULE_3__.MDCFormField),
/* harmony export */   MDCMenu: () => (/* reexport safe */ _material_menu__WEBPACK_IMPORTED_MODULE_8__.MDCMenu),
/* harmony export */   MDCRadio: () => (/* reexport safe */ _material_radio__WEBPACK_IMPORTED_MODULE_4__.MDCRadio),
/* harmony export */   MDCRipple: () => (/* reexport safe */ _material_ripple__WEBPACK_IMPORTED_MODULE_2__.MDCRipple),
/* harmony export */   MDCSwitch: () => (/* reexport safe */ _material_switch__WEBPACK_IMPORTED_MODULE_5__.MDCSwitch),
/* harmony export */   Row: () => (/* reexport safe */ _layout__WEBPACK_IMPORTED_MODULE_1__.Row)
/* harmony export */ });
/* harmony import */ var _material_ripple__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material/ripple */ "../node_modules/@material/ripple/component.js");
/* harmony import */ var _material_form_field__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @material/form-field */ "../node_modules/@material/form-field/component.js");
/* harmony import */ var _material_radio__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @material/radio */ "../node_modules/@material/radio/component.js");
/* harmony import */ var _material_switch__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material/switch */ "../node_modules/@material/switch/component.js");
/* harmony import */ var _material_dialog__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material/dialog */ "../node_modules/@material/dialog/component.js");
/* harmony import */ var _material_checkbox__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material/checkbox */ "../node_modules/@material/checkbox/component.js");
/* harmony import */ var _material_menu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @material/menu */ "../node_modules/@material/menu/component.js");
/* harmony import */ var _material_react_dialog__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material/react-dialog */ "../node_modules/@material/react-dialog/dist/index.js");
/* harmony import */ var _material_react_dialog__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_material_react_dialog__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./layout */ "./js/material-components/layout/index.js");
/**
 * Material components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */











/***/ }),

/***/ "./js/material-components/layout/Cell.js":
/*!***********************************************!*\
  !*** ./js/material-components/layout/Cell.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Cell)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Material UI > Layout > Cell component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



function Cell(props) {
  const {
    className,
    alignTop,
    alignMiddle,
    alignBottom,
    alignRight,
    alignLeft,
    smAlignRight,
    mdAlignRight,
    lgAlignRight,
    smSize,
    smStart,
    smOrder,
    mdSize,
    mdStart,
    mdOrder,
    lgSize,
    lgStart,
    lgOrder,
    size,
    children,
    ...otherProps
  } = props;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    ...otherProps,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, 'mdc-layout-grid__cell', {
      'mdc-layout-grid__cell--align-top': alignTop,
      'mdc-layout-grid__cell--align-middle': alignMiddle,
      'mdc-layout-grid__cell--align-bottom': alignBottom,
      'mdc-layout-grid__cell--align-right': alignRight,
      'mdc-layout-grid__cell--align-left': alignLeft,
      'mdc-layout-grid__cell--align-right-phone': smAlignRight,
      'mdc-layout-grid__cell--align-right-tablet': mdAlignRight,
      'mdc-layout-grid__cell--align-right-desktop': lgAlignRight,
      [`mdc-layout-grid__cell--span-${size}`]: 12 >= size && size > 0,
      [`mdc-layout-grid__cell--span-${lgSize}-desktop`]: 12 >= lgSize && lgSize > 0,
      [`mdc-layout-grid__cell--start-${lgStart}-desktop`]: 12 >= lgStart && lgStart > 0,
      [`mdc-layout-grid__cell--order-${lgOrder}-desktop`]: 12 >= lgOrder && lgOrder > 0,
      [`mdc-layout-grid__cell--span-${mdSize}-tablet`]: 8 >= mdSize && mdSize > 0,
      [`mdc-layout-grid__cell--start-${mdStart}-tablet`]: 8 >= mdStart && mdStart > 0,
      [`mdc-layout-grid__cell--order-${mdOrder}-tablet`]: 8 >= mdOrder && mdOrder > 0,
      [`mdc-layout-grid__cell--span-${smSize}-phone`]: 4 >= smSize && smSize > 0,
      [`mdc-layout-grid__cell--start-${smStart}-phone`]: 4 >= smStart && smStart > 0,
      [`mdc-layout-grid__cell--order-${smOrder}-phone`]: 4 >= smOrder && smOrder > 0
    }),
    children: children
  });
}
Cell.propTypes = {
  smSize: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  smStart: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  smOrder: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  mdSize: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  mdStart: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  mdOrder: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  lgSize: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  lgStart: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  lgOrder: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  size: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number),
  alignTop: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  alignMiddle: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  alignBottom: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  alignRight: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  alignLeft: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  smAlignRight: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  mdAlignRight: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  lgAlignRight: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node)
};
Cell.defaultProps = {
  className: '',
  size: 0,
  smSize: 0,
  smStart: 0,
  smOrder: 0,
  mdSize: 0,
  mdStart: 0,
  mdOrder: 0,
  lgSize: 0,
  lgStart: 0,
  lgOrder: 0
};

/***/ }),

/***/ "./js/material-components/layout/Grid.js":
/*!***********************************************!*\
  !*** ./js/material-components/layout/Grid.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Material UI > Layout > Grid component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


const Grid = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(({
  alignLeft,
  fill,
  className,
  children,
  collapsed,
  ...otherProps
}, ref) => {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-layout-grid', className, {
      'mdc-layout-grid--align-left': alignLeft,
      'mdc-layout-grid--collapsed': collapsed,
      'mdc-layout-grid--fill': fill
    }),
    ...otherProps,
    ref: ref,
    children: children
  });
});
Grid.displayName = 'Grid';
Grid.propTypes = {
  alignLeft: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  fill: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  collapsed: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)
};
Grid.defaultProps = {
  className: ''
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Grid);

/***/ }),

/***/ "./js/material-components/layout/Row.js":
/*!**********************************************!*\
  !*** ./js/material-components/layout/Row.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Material UI > Layout > Row component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


const Row = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(({
  className,
  children,
  ...otherProps
}, ref) => {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    ref: ref,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-layout-grid__inner', className),
    ...otherProps,
    children: children
  });
});
Row.displayName = 'Row';
Row.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)
};
Row.defaultProps = {
  className: ''
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Row);

/***/ }),

/***/ "./js/material-components/layout/index.js":
/*!************************************************!*\
  !*** ./js/material-components/layout/index.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Cell: () => (/* reexport safe */ _Cell__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   Grid: () => (/* reexport safe */ _Grid__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   Row: () => (/* reexport safe */ _Row__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _Cell__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Cell */ "./js/material-components/layout/Cell.js");
/* harmony import */ var _Row__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Row */ "./js/material-components/layout/Row.js");
/* harmony import */ var _Grid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Grid */ "./js/material-components/layout/Grid.js");
/**
 * Material UI > Layout components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */





/***/ }),

/***/ "./js/modules/adsense/components/DashboardMainEffectComponent.js":
/*!***********************************************************************!*\
  !*** ./js/modules/adsense/components/DashboardMainEffectComponent.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ DashboardMainEffectComponent)
/* harmony export */ });
/* harmony import */ var _js_hooks_useAdSenseNotifications__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useAdSenseNotifications */ "./js/hooks/useAdSenseNotifications.js");
/**
 * AdSense DashboardMainEffectComponent component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */

function DashboardMainEffectComponent() {
  (0,_js_hooks_useAdSenseNotifications__WEBPACK_IMPORTED_MODULE_0__["default"])();
  return null;
}

/***/ }),

/***/ "./js/modules/adsense/components/common/AccountSelect.js":
/*!***************************************************************!*\
  !*** ./js/modules/adsense/components/common/AccountSelect.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AccountSelect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Account Select component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function AccountSelect() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const eventCategory = `${viewContext}_adsense`;
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getAccountID());
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getAccounts());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).hasFinishedResolution('getAccounts'));
  const {
    setAccountID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE);
  const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)((index, item) => {
    const newAccountID = item.dataset.value;
    if (accountID !== newAccountID) {
      setAccountID(newAccountID);
      (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(eventCategory, 'change_account');
    }
  }, [accountID, eventCategory, setAccountID]);
  if (!hasResolvedAccounts) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {
      small: true
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Select, {
    className: "googlesitekit-adsense__select-account",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Account', 'google-site-kit'),
    value: accountID,
    onEnhancedChange: onChange,
    enhanced: true,
    outlined: true,
    children: (accounts || []).map(({
      _id,
      displayName
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Option, {
      value: _id,
      children: displayName
    }, index))
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/common/AdSenseConnectCTA/Content.js":
/*!***************************************************************************!*\
  !*** ./js/modules/adsense/components/common/AdSenseConnectCTA/Content.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _ContentSVG__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ContentSVG */ "./js/modules/adsense/components/common/AdSenseConnectCTA/ContentSVG.js");
/* harmony import */ var _svg_graphics_adsense_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/graphics/adsense.svg */ "./svg/graphics/adsense.svg");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSenseConnectCTA > Content component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






const Content = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.forwardRef)(({
  stage,
  mode,
  onAnimationEnd
}, ref) => {
  const stageContent = [{
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Earn money from your site', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Focus on writing good content and let AdSense help you make it profitable', 'google-site-kit')
  }, {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Save time with automated ads', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Auto ads automatically place and optimize your ads for you so you don't have to spend time doing it yourself", 'google-site-kit')
  }, {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('You’re in control', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Block ads you don't like, customize where ads appear, and choose which types fit your site best", 'google-site-kit')
  }];
  const cellProps = {
    smSize: 4,
    mdSize: 4,
    lgSize: 6
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Row, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Cell, {
        size: 12,
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("p", {
          className: "googlesitekit-setup__intro-title",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Connect Service', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
          className: "googlesitekit-setup-module",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
            className: "googlesitekit-setup-module__logo",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_svg_graphics_adsense_svg__WEBPACK_IMPORTED_MODULE_4__["default"], {
              width: "33",
              height: "33"
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_5__["default"], {
            as: "h3",
            className: "googlesitekit-setup-module__title",
            size: "small",
            type: "headline",
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('AdSense', 'Service name', 'google-site-kit')
          })]
        })]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Row, {
      ref: ref,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Cell, {
        ...cellProps,
        smOrder: 2,
        mdOrder: 1,
        className: "googlesitekit-setup-module--adsense__stage-captions",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("ul", {
          className: "googlesitekit-setup-module--adsense__stage-caption-container",
          children: stageContent.map(({
            title,
            description
          }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("li", {
            className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-setup-module--adsense__stage-caption', {
              [`googlesitekit-setup-module--adsense__stage-caption--current--${mode}`]: stage === index
            }),
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
              className: "googlesitekit-setup-module--adsense__stage-caption-indicator"
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
              children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_5__["default"], {
                as: "h4",
                size: "large",
                type: "title",
                children: title
              }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
                children: description
              })]
            })]
          }, index))
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("ul", {
          className: "googlesitekit-setup-module--adsense__stage-indicator",
          children: stageContent.map((_, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("li", {
            className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
              [`googlesitekit-setup-module--adsense__stage-indicator--current--${mode}`]: stage === index
            })
          }, index))
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Cell, {
        ...cellProps,
        smOrder: 1,
        mdOrder: 2,
        className: "googlesitekit-setup-module--adsense__stage-images",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
          className: "googlesitekit-setup-module--adsense__stage-image-container",
          children: stageContent.map((_, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
            className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-setup-module--adsense__stage-image', {
              [`googlesitekit-setup-module--adsense__stage-image--current--${mode}`]: stage === index
            }),
            onAnimationEnd: stage === index ? onAnimationEnd : undefined,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ContentSVG__WEBPACK_IMPORTED_MODULE_3__["default"], {
              stage: index
            })
          }, index))
        })
      })]
    })]
  });
});
Content.propTypes = {
  stage: prop_types__WEBPACK_IMPORTED_MODULE_9___default().oneOf([0, 1, 2]),
  mode: prop_types__WEBPACK_IMPORTED_MODULE_9___default().oneOf(['static', 'enter', 'leave']),
  onAnimationEnd: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().func)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Content);

/***/ }),

/***/ "./js/modules/adsense/components/common/AdSenseConnectCTA/ContentAutoUpdate.js":
/*!*************************************************************************************!*\
  !*** ./js/modules/adsense/components/common/AdSenseConnectCTA/ContentAutoUpdate.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ContentAutoUpdate)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _Content__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Content */ "./js/modules/adsense/components/common/AdSenseConnectCTA/Content.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSenseConnectCTA > ContentAutoUpdate component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


const minStage = 0;
const maxStage = 2;
function ContentAutoUpdate({
  hasBeenInView
}) {
  const [{
    stage,
    mode
  }, setContentState] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)({
    stage: 0,
    mode: 'static'
  });
  function onAnimationEnd() {
    if (mode === 'enter') {
      setContentState({
        stage,
        mode: 'leave'
      });
    } else if (mode === 'leave') {
      setContentState({
        stage: stage === maxStage ? minStage : stage + 1,
        mode: 'enter'
      });
    }
  }
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (!hasBeenInView) {
      // Return noop cleanup function to satisfy consistent-return rule.
      return () => {};
    }
    const timeoutID = setTimeout(() => {
      setContentState({
        stage: 0,
        mode: 'leave'
      });
    }, 7000);
    return () => {
      clearTimeout(timeoutID);
    };
  }, [hasBeenInView]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_Content__WEBPACK_IMPORTED_MODULE_0__["default"], {
    stage: stage,
    mode: mode,
    onAnimationEnd: onAnimationEnd
  });
}
ContentAutoUpdate.propTypes = {
  hasBeenInView: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool).isRequired
};

/***/ }),

/***/ "./js/modules/adsense/components/common/AdSenseConnectCTA/ContentSVG.js":
/*!******************************************************************************!*\
  !*** ./js/modules/adsense/components/common/AdSenseConnectCTA/ContentSVG.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ContentSVG)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/MediaErrorHandler */ "./js/components/MediaErrorHandler/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSenseConnectCTA > ContentSVG component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */



const LazyContentSVG0 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.lazy)(() => __webpack_require__.e(/*! import() */ "svg_graphics_adsense-connect-0_svg").then(__webpack_require__.bind(__webpack_require__, /*! ../../../../../../svg/graphics/adsense-connect-0.svg */ "./svg/graphics/adsense-connect-0.svg")));
const LazyContentSVG1 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.lazy)(() => __webpack_require__.e(/*! import() */ "svg_graphics_adsense-connect-1_svg").then(__webpack_require__.bind(__webpack_require__, /*! ../../../../../../svg/graphics/adsense-connect-1.svg */ "./svg/graphics/adsense-connect-1.svg")));
const LazyContentSVG2 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.lazy)(() => __webpack_require__.e(/*! import() */ "svg_graphics_adsense-connect-2_svg").then(__webpack_require__.bind(__webpack_require__, /*! ../../../../../../svg/graphics/adsense-connect-2.svg */ "./svg/graphics/adsense-connect-2.svg")));
function LazyContentSVG({
  stage
}) {
  const graphics = {
    0: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(LazyContentSVG0, {}),
    1: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(LazyContentSVG1, {}),
    2: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(LazyContentSVG2, {})
  };
  if (!graphics[stage]) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__["default"], {
    errorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to load graphic', 'google-site-kit'),
    children: graphics[stage]
  });
}
function ContentSVG({
  stage
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.Suspense, {
    fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
      width: "100%",
      height: "100%"
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(LazyContentSVG, {
      stage: stage
    })
  });
}
ContentSVG.propTypes = {
  stage: prop_types__WEBPACK_IMPORTED_MODULE_5__.PropTypes.oneOf([0, 1, 2]).isRequired
};

/***/ }),

/***/ "./js/modules/adsense/components/common/AdSenseConnectCTA/index.js":
/*!*************************************************************************!*\
  !*** ./js/modules/adsense/components/common/AdSenseConnectCTA/index.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdSenseConnectCTA)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useIntersection.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_19___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_19__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _ContentAutoUpdate__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ContentAutoUpdate */ "./js/modules/adsense/components/common/AdSenseConnectCTA/ContentAutoUpdate.js");
/* harmony import */ var _js_components_SupportLink__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/components/SupportLink */ "./js/components/SupportLink.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSenseConnectCTA component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */















function AdSenseConnectCTA({
  onDismissModule
}) {
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_LOCATION);
  const {
    activateModule
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES);
  const {
    setInternalServerError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__["default"])();
  const trackingRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_16__.useRef)();
  const [hasBeenInView, setHasBeenInView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_16__.useState)(false);
  const intersectionEntry = (0,react_use__WEBPACK_IMPORTED_MODULE_17__["default"])(trackingRef, {
    threshold: 0.25
  });
  const inView = !!intersectionEntry?.intersectionRatio;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_16__.useEffect)(() => {
    if (inView && !hasBeenInView) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-cta-widget`, 'widget_view');
      setHasBeenInView(true);
    }
  }, [inView, viewContext, hasBeenInView]);
  const adminReauthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getAdminReauthURL());
  const adSenseModuleActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isModuleActive(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE));
  const adSenseModuleConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isModuleConnected(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE));
  const isConnectingAdSense = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const isFetching = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isFetchingSetModuleActivation(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE, true);
    if (isFetching) {
      return true;
    }
    if (!adminReauthURL) {
      return false;
    }
    return select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_LOCATION).isNavigatingTo(adminReauthURL);
  });
  const handleConnect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_16__.useCallback)(async () => {
    const {
      response,
      error
    } = await activateModule(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE);
    if (error) {
      setInternalServerError({
        id: 'setup-module-error',
        description: error.message
      });
      return null;
    }
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-cta-widget`, 'activate_module', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE);
    await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_9__.setItem)('module_setup', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE, {
      ttl: 300
    });
    navigateTo(response.moduleReauthURL);
    return null;
  }, [activateModule, navigateTo, setInternalServerError, viewContext]);
  const handleCompleteSetup = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_16__.useCallback)(() => navigateTo(adminReauthURL), [adminReauthURL, navigateTo]);
  const handleDismissModule = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_16__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-cta-widget`, 'dismiss_widget');
    onDismissModule();
  }, [onDismissModule, viewContext]);
  const cellProps = {
    smSize: 4,
    mdSize: 4,
    lgSize: 6
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("section", {
    ref: trackingRef,
    className: "googlesitekit-setup__wrapper googlesitekit-setup__wrapper--adsense-connect",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Grid, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_ContentAutoUpdate__WEBPACK_IMPORTED_MODULE_11__["default"], {
        hasBeenInView: hasBeenInView
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Row, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          ...cellProps,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("div", {
            className: "googlesitekit-setup-module__action",
            children: [!adSenseModuleActive && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.SpinnerButton, {
              onClick: handleConnect,
              isSaving: isConnectingAdSense,
              disabled: isConnectingAdSense,
              children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Connect now', 'google-site-kit')
            }), adSenseModuleActive && !adSenseModuleConnected && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.SpinnerButton, {
              onClick: handleCompleteSetup,
              isSaving: isConnectingAdSense,
              children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Complete setup', 'google-site-kit')
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
              onClick: handleDismissModule,
              tertiary: true,
              children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maybe later', 'google-site-kit')
            })]
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          ...cellProps,
          className: "googlesitekit-setup-module__footer-text",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_13__["default"], {
            children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_18__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('AdSense accounts are <a>subject to review and approval</a> by the Google AdSense team', 'google-site-kit'), {
              a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_SupportLink__WEBPACK_IMPORTED_MODULE_12__["default"], {
                path: "/adsense/answer/9724",
                external: true,
                hideExternalIndicator: true
              })
            })
          })
        })]
      })]
    })
  });
}
AdSenseConnectCTA.propTypes = {
  onDismissModule: (prop_types__WEBPACK_IMPORTED_MODULE_19___default().func).isRequired
};

/***/ }),

/***/ "./js/modules/adsense/components/common/AdSenseLinkCTA.js":
/*!****************************************************************!*\
  !*** ./js/modules/adsense/components/common/AdSenseLinkCTA.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdSenseLinkCTA)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/notifications/CTA */ "./js/components/notifications/CTA.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics AdSense Link CTA component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




function AdSenseLinkCTA({
  onClick = () => {}
}) {
  const supportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getGoogleSupportURL({
    path: '/adsense/answer/6084409'
  }));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_2__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Link Analytics and AdSense', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get reports for your top earning pages by linking your Analytics and AdSense accounts', 'google-site-kit'),
    ctaLink: supportURL,
    ctaLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more', 'google-site-kit'),
    onClick: onClick,
    ctaLinkExternal: true
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/common/AutoAdExclusionSwitches.js":
/*!*************************************************************************!*\
  !*** ./js/modules/adsense/components/common/AutoAdExclusionSwitches.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AUTO_ADS_CONTENT_CREATORS: () => (/* binding */ AUTO_ADS_CONTENT_CREATORS),
/* harmony export */   AUTO_ADS_LOGGED_IN_USERS: () => (/* binding */ AUTO_ADS_LOGGED_IN_USERS),
/* harmony export */   "default": () => (/* binding */ AutoAdExclusionSwitches),
/* harmony export */   trackingExclusionLabels: () => (/* binding */ trackingExclusionLabels)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Ad Exclusion Switches component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





const AUTO_ADS_LOGGED_IN_USERS = 'loggedinUsers';
const AUTO_ADS_CONTENT_CREATORS = 'contentCreators';
const trackingExclusionLabels = {
  [AUTO_ADS_LOGGED_IN_USERS]: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All logged-in users', 'google-site-kit'),
  [AUTO_ADS_CONTENT_CREATORS]: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Users who can write posts', 'google-site-kit')
};
function AutoAdExclusionSwitches() {
  const autoAdsDisabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getAutoAdsDisabled());
  const {
    setAutoAdsDisabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE);
  let message;
  if (autoAdsDisabled && autoAdsDisabled.includes(AUTO_ADS_LOGGED_IN_USERS)) {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ads will not be displayed for all logged-in users', 'google-site-kit');
  } else if (autoAdsDisabled && autoAdsDisabled.includes(AUTO_ADS_CONTENT_CREATORS)) {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ads will not be displayed for users that can write posts', 'google-site-kit');
  } else {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ads will be displayed for all users', 'google-site-kit');
  }
  const updateAutoAdsDisabled = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useCallback)((users, exclude) => {
    const trackingDisabledArray = exclude ? autoAdsDisabled.concat(users) : autoAdsDisabled.filter(item => item !== users);
    setAutoAdsDisabled(trackingDisabledArray);
  }, [autoAdsDisabled, setAutoAdsDisabled]);
  const onChangeTrackContentCreators = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useCallback)(event => {
    const {
      checked: exclude
    } = event.target;
    updateAutoAdsDisabled(AUTO_ADS_CONTENT_CREATORS, exclude);
  }, [updateAutoAdsDisabled]);
  const onChangeTrackLoggedInUsers = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useCallback)(event => {
    const {
      checked: exclude
    } = event.target;
    updateAutoAdsDisabled(AUTO_ADS_LOGGED_IN_USERS, exclude);
  }, [updateAutoAdsDisabled]);
  if (!Array.isArray(autoAdsDisabled)) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("fieldset", {
    className: "googlesitekit-analytics-auto-ads-disabled",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("legend", {
      className: "googlesitekit-setup-module__text",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Exclude from Ads', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      className: "googlesitekit-settings-module__inline-items",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
        className: "googlesitekit-settings-module__inline-item",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Switch, {
          label: trackingExclusionLabels[AUTO_ADS_LOGGED_IN_USERS],
          checked: autoAdsDisabled.includes(AUTO_ADS_LOGGED_IN_USERS),
          onClick: onChangeTrackLoggedInUsers,
          hideLabel: false
        })
      }), !autoAdsDisabled.includes(AUTO_ADS_LOGGED_IN_USERS) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
        className: "googlesitekit-settings-module__inline-item",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Switch, {
          label: trackingExclusionLabels[AUTO_ADS_CONTENT_CREATORS],
          checked: autoAdsDisabled.includes(AUTO_ADS_CONTENT_CREATORS),
          onClick: onChangeTrackContentCreators,
          hideLabel: false
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: message
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/common/ErrorNotices.js":
/*!**************************************************************!*\
  !*** ./js/modules/adsense/components/common/ErrorNotices.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ErrorNotices)
/* harmony export */ });
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Error Notices component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */




function ErrorNotices({
  hasButton = false
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_1__["default"], {
    hasButton: hasButton,
    moduleSlug: "adsense",
    storeName: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ADSENSE
  });
}
ErrorNotices.propTypes = {
  hasButton: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
};

/***/ }),

/***/ "./js/modules/adsense/components/common/UseSnippetSwitch.js":
/*!******************************************************************!*\
  !*** ./js/modules/adsense/components/common/UseSnippetSwitch.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ UseSnippetSwitch)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useUpdateEffect.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_components_Badge__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Badge */ "./js/components/Badge.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Use Snippet Switch component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








function UseSnippetSwitch(props) {
  const {
    label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Let Site Kit place AdSense code on your site', 'google-site-kit'),
    checkedMessage,
    uncheckedMessage,
    saveOnChange
  } = props;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const eventCategory = `${viewContext}_adsense`;
  const useSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getUseSnippet());
  const isDoingSaveUseSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).isDoingSubmitChanges());
  const {
    setUseSnippet,
    saveSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE);
  const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(async () => {
    setUseSnippet(!useSnippet);
    if (saveOnChange) {
      await saveSettings();
    }
  }, [useSnippet, saveOnChange, setUseSnippet, saveSettings]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_10__["default"])(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(eventCategory, useSnippet ? 'enable_tag' : 'disable_tag');
  }, [eventCategory, useSnippet]);
  if (undefined === useSnippet) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "googlesitekit-setup-module__switch",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Switch, {
        label: label,
        onClick: onChange,
        checked: useSnippet,
        disabled: isDoingSaveUseSnippet,
        hideLabel: false
      }), ' ', /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Badge__WEBPACK_IMPORTED_MODULE_6__["default"], {
        className: "googlesitekit-badge--primary",
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Recommended', 'google-site-kit')
      })]
    }), useSnippet && checkedMessage && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_7__["default"], {
      className: "googlesitekit-notice--bottom-margin",
      type: _js_components_Notice__WEBPACK_IMPORTED_MODULE_7__["default"].TYPES.INFO,
      description: checkedMessage
    }), !useSnippet && uncheckedMessage && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_7__["default"], {
      className: "googlesitekit-notice--bottom-margin",
      type: _js_components_Notice__WEBPACK_IMPORTED_MODULE_7__["default"].TYPES.INFO,
      description: uncheckedMessage
    })]
  });
}
UseSnippetSwitch.propTypes = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
  checkedMessage: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
  uncheckedMessage: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string),
  saveOnChange: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().bool)
};
UseSnippetSwitch.defaultProps = {
  saveOnChange: false
};

/***/ }),

/***/ "./js/modules/adsense/components/common/UserProfile.js":
/*!*************************************************************!*\
  !*** ./js/modules/adsense/components/common/UserProfile.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ UserProfile)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense User Profile component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */




function UserProfile() {
  const userEmail = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getEmail());
  const userPicture = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getPicture());
  const hasResolvedGetUser = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).hasFinishedResolution('getUser'));
  if (!hasResolvedGetUser) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {
      small: true
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("p", {
    className: "googlesitekit-setup-module__user",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("img", {
      className: "googlesitekit-setup-module__user-image",
      src: userPicture,
      alt: ""
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      className: "googlesitekit-setup-module__user-email",
      children: userEmail
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/common/WebStoriesAdUnitSelect.js":
/*!************************************************************************!*\
  !*** ./js/modules/adsense/components/common/WebStoriesAdUnitSelect.js ***!
  \************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ WebStoriesAdUnitSelect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Web Stories Ad Unit Select component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




function WebStoriesAdUnitSelect() {
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getAccountID());
  const clientID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getClientID());
  const webStoriesAdUnit = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getWebStoriesAdUnit());
  const adunits = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getAdUnits(accountID, clientID));
  const hasResolvedAdUnits = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).hasFinishedResolution('getAdUnits', [accountID, clientID]));
  const {
    setWebStoriesAdUnit
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE);
  const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)((index, item) => {
    const newWebStoriesAdUnit = item.dataset.value;
    if (webStoriesAdUnit !== newWebStoriesAdUnit) {
      setWebStoriesAdUnit(newWebStoriesAdUnit);
    }
  }, [webStoriesAdUnit, setWebStoriesAdUnit]);
  if (!hasResolvedAdUnits) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {
      small: true
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Select, {
    className: "googlesitekit-adsense__select-field",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Web Stories Ad Unit', 'google-site-kit'),
    value: webStoriesAdUnit,
    onEnhancedChange: onChange,
    enhanced: true,
    outlined: true,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Option, {
      value: "",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select ad unit', 'google-site-kit')
    }), (adunits || []).map(({
      _id,
      displayName
    }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Option, {
      value: _id,
      children: displayName
    }, _id))]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/common/index.js":
/*!*******************************************************!*\
  !*** ./js/modules/adsense/components/common/index.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AccountSelect: () => (/* reexport safe */ _AccountSelect__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   AdSenseConnectCTA: () => (/* reexport safe */ _AdSenseConnectCTA__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   AdSenseLinkCTA: () => (/* reexport safe */ _AdSenseLinkCTA__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   AutoAdExclusionSwitches: () => (/* reexport safe */ _AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   ErrorNotices: () => (/* reexport safe */ _ErrorNotices__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   UseSnippetSwitch: () => (/* reexport safe */ _UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   UserProfile: () => (/* reexport safe */ _UserProfile__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   WebStoriesAdUnitSelect: () => (/* reexport safe */ _WebStoriesAdUnitSelect__WEBPACK_IMPORTED_MODULE_5__["default"])
/* harmony export */ });
/* harmony import */ var _AccountSelect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AccountSelect */ "./js/modules/adsense/components/common/AccountSelect.js");
/* harmony import */ var _AdSenseLinkCTA__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AdSenseLinkCTA */ "./js/modules/adsense/components/common/AdSenseLinkCTA.js");
/* harmony import */ var _ErrorNotices__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ErrorNotices */ "./js/modules/adsense/components/common/ErrorNotices.js");
/* harmony import */ var _UserProfile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./UserProfile */ "./js/modules/adsense/components/common/UserProfile.js");
/* harmony import */ var _UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./UseSnippetSwitch */ "./js/modules/adsense/components/common/UseSnippetSwitch.js");
/* harmony import */ var _WebStoriesAdUnitSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./WebStoriesAdUnitSelect */ "./js/modules/adsense/components/common/WebStoriesAdUnitSelect.js");
/* harmony import */ var _AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AutoAdExclusionSwitches */ "./js/modules/adsense/components/common/AutoAdExclusionSwitches.js");
/* harmony import */ var _AdSenseConnectCTA__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AdSenseConnectCTA */ "./js/modules/adsense/components/common/AdSenseConnectCTA/index.js");
/**
 * AdSense common components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */










/***/ }),

/***/ "./js/modules/adsense/components/dashboard/AdBlockerWarningWidget.js":
/*!***************************************************************************!*\
  !*** ./js/modules/adsense/components/dashboard/AdBlockerWarningWidget.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_notifications_AdBlockerWarning__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/notifications/AdBlockerWarning */ "./js/components/notifications/AdBlockerWarning.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockerWarningWidget component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */






function AdBlockerWarningWidget({
  Widget,
  WidgetNull
}) {
  const isAdBlockerActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAdBlockerActive());
  if (!isAdBlockerActive) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(WidgetNull, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_notifications_AdBlockerWarning__WEBPACK_IMPORTED_MODULE_1__["default"], {
      moduleSlug: "adsense"
    })
  });
}
AdBlockerWarningWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_6___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_2__["default"])({
  moduleName: _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE
})(AdBlockerWarningWidget));

/***/ }),

/***/ "./js/modules/adsense/components/dashboard/AdBlockingRecoverySetupCTAWidget.js":
/*!*************************************************************************************!*\
  !*** ./js/modules/adsense/components/dashboard/AdBlockingRecoverySetupCTAWidget.js ***!
  \*************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_22___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_22__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/AdminScreenTooltip */ "./js/components/AdminScreenTooltip/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useInView__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useInView */ "./js/hooks/useInView.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/components/surveys/SurveyViewTrigger */ "./js/components/surveys/SurveyViewTrigger.js");
/* harmony import */ var _js_components_Banner__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/components/Banner */ "./js/components/Banner/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _svg_graphics_banner_ad_blocking_recovery_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/svg/graphics/banner-ad-blocking-recovery-setup-cta-mobile.svg?url */ "./svg/graphics/banner-ad-blocking-recovery-setup-cta-mobile.svg?url");
/* harmony import */ var _svg_graphics_banner_ad_blocking_recovery_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/svg/graphics/banner-ad-blocking-recovery-setup-cta.svg?url */ "./svg/graphics/banner-ad-blocking-recovery-setup-cta.svg?url");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockingRecoverySetupCTAWidget component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




















function AdBlockingRecoverySetupCTAWidget({
  Widget,
  WidgetNull
}) {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const inView = (0,_js_hooks_useInView__WEBPACK_IMPORTED_MODULE_7__.useInView)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const tooltipSettings = {
    tooltipSlug: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can always set up ad blocking recovery in Settings later', 'google-site-kit'),
    dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Got it', 'google-site-kit')
  };
  const showTooltip = (0,_js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_2__.useShowTooltip)(tooltipSettings);
  const isDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).isPromptDismissed(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY));
  const dismissCount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getPromptDismissCount(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY));
  const isDismissingPrompt = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).isDismissingPrompt(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY));
  const adBlockingRecoverySetupStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ADSENSE).getAdBlockingRecoverySetupStatus();
  });
  const accountStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ADSENSE).getAccountStatus();
  });
  const setupCompletedTimestamp = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ADSENSE).getSetupCompletedTimestamp();
  });
  const siteStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ADSENSE).getSiteStatus();
  });
  const hasExistingAdBlockingRecoveryTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ADSENSE).hasExistingAdBlockingRecoveryTag());
  const learnMoreURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getGoogleSupportURL({
    path: '/adsense/answer/11576589'
  }));
  const recoveryPageURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getAdminURL('googlesitekit-ad-blocking-recovery'));
  const referenceDate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate());
  const {
    dismissPrompt
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_LOCATION);
  const isNavigatingToRecoveryPageURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => recoveryPageURL && select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_LOCATION).isNavigatingTo(recoveryPageURL));
  const referenceDateInMilliseconds = (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.stringToDate)(referenceDate).getTime();
  const setupCompletedTimestampInMilliseconds = setupCompletedTimestamp * 1000;
  const threeWeeksInMilliseconds = _js_util__WEBPACK_IMPORTED_MODULE_10__.WEEK_IN_SECONDS * 3 * 1000;
  const isThreeWeeksAfterSetupCompleted = referenceDateInMilliseconds - setupCompletedTimestampInMilliseconds >= threeWeeksInMilliseconds;
  const shouldShowWidget = !viewOnlyDashboard && hasExistingAdBlockingRecoveryTag === false && isDismissed === false && isDismissingPrompt === false && adBlockingRecoverySetupStatus === '' && accountStatus === _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_14__.ACCOUNT_STATUS_READY && siteStatus === _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_14__.SITE_STATUS_READY && (!setupCompletedTimestamp || isThreeWeeksAfterSetupCompleted);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useEffect)(() => {
    if (inView && shouldShowWidget) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr-cta-widget`, 'view_notification');
    }
  }, [inView, shouldShowWidget, viewContext]);
  async function handleCTAClick() {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr-cta-widget`, 'confirm_notification');
    navigateTo(recoveryPageURL);
    return new Promise(() => {
      // We are intentionally letting this promise unresolved.
    });
  }
  async function handleDismissClick() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr-cta-widget`, 'dismiss_notification');
    showTooltip();

    // For the first two dismissals, we show the notification again in two weeks.
    if (dismissCount < 2) {
      const twoWeeksInSeconds = _js_util__WEBPACK_IMPORTED_MODULE_10__.WEEK_IN_SECONDS * 2;
      await dismissPrompt(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY, {
        expiresInSeconds: twoWeeksInSeconds
      });
    } else {
      // For the third dismissal, dismiss permanently.
      await dismissPrompt(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY);
    }
  }
  function handleLearnMoreClick() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr-cta-widget`, 'click_learn_more_link');
  }
  if (!shouldShowWidget) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(WidgetNull, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)(Widget, {
    noPadding: true,
    children: [inView && shouldShowWidget && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_15__["default"], {
      triggerID: "view_abr_setup_cta",
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_10__.DAY_IN_SECONDS
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Banner__WEBPACK_IMPORTED_MODULE_16__["default"], {
      className: "googlesitekit-banner--setup-cta",
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Recover revenue lost to ad blockers', 'google-site-kit'),
      description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.Fragment, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_17__["default"], {
          children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Display a message to give site visitors with an ad blocker the option to allow ads on your site.', 'google-site-kit'), ' ', /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
            onClick: handleLearnMoreClick,
            href: learnMoreURL,
            external: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more', 'google-site-kit')
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_17__["default"], {
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Publishers see up to 1 in 5 users choose to allow ads once they encounter an ad blocking recovery message*', 'google-site-kit')
        })]
      }),
      dismissButton: {
        label: dismissCount < 2 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maybe later', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Don’t show again', 'google-site-kit'),
        onClick: handleDismissClick
      },
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Set up now', 'google-site-kit'),
        onClick: handleCTAClick,
        disabled: isNavigatingToRecoveryPageURL
      },
      svg: {
        desktop: _svg_graphics_banner_ad_blocking_recovery_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_18__["default"],
        mobile: _svg_graphics_banner_ad_blocking_recovery_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_19__["default"],
        verticalPosition: 'bottom'
      },
      helpText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('*Average for publishers showing non-dismissible ad blocking recovery messages placed at the center of the page on desktop', 'google-site-kit')
    })]
  });
}
AdBlockingRecoverySetupCTAWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_22___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_22___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_13__.MODULE_SLUG_ADSENSE
})(AdBlockingRecoverySetupCTAWidget));

/***/ }),

/***/ "./js/modules/adsense/components/dashboard/AdBlockingRecoverySetupSuccessNotification.js":
/*!***********************************************************************************************!*\
  !*** ./js/modules/adsense/components/dashboard/AdBlockingRecoverySetupSuccessNotification.js ***!
  \***********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdBlockingRecoverySetupSuccessNotification)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_12__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/NoticeNotification */ "./js/googlesitekit/notifications/components/layout/NoticeNotification.js");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockingRecoverySetupSuccessNotification component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */









function AdBlockingRecoverySetupSuccessNotification({
  id,
  Notification
}) {
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
  const adsenseAccountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getAccountID());
  const privacyMessagingURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getServiceURL({
    path: `/${adsenseAccountID}/privacymessaging/ad_blocking`
  }));
  const handleView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useCallback)(() => {
    triggerSurvey('abr_setup_completed', {
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_3__.DAY_IN_SECONDS
    });
  }, [triggerSurvey]);
  const [, setNotification] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_8__["default"])('notification');
  const dismissNotice = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useCallback)(() => {
    setNotification(undefined);
  }, [setNotification]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Notification, {
    onView: handleView,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_googlesitekit_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_5__["default"], {
      notificationID: id,
      type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.TYPES.SUCCESS,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You successfully enabled the ad blocking recovery message', 'google-site-kit'),
      description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Make sure to also create the message in <a>AdSense</a>, otherwise this feature won’t work', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_7__["default"], {
          href: privacyMessagingURL,
          external: true,
          hideExternalIndicator: true
        })
      }),
      dismissButton: {
        onClick: dismissNotice
      }
    })
  });
}
AdBlockingRecoverySetupSuccessNotification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_12___default().elementType).isRequired
};

/***/ }),

/***/ "./js/modules/adsense/components/dashboard/AdSenseConnectCTAWidget.js":
/*!****************************************************************************!*\
  !*** ./js/modules/adsense/components/dashboard/AdSenseConnectCTAWidget.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_adsense_components_common_AdSenseConnectCTA__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/components/common/AdSenseConnectCTA */ "./js/modules/adsense/components/common/AdSenseConnectCTA/index.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/AdminScreenTooltip */ "./js/components/AdminScreenTooltip/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSenseConnectCTAWidget component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * External dependencies
 */


/**
 * Internal dependencies
 */







function AdSenseConnectCTAWidget({
  Widget,
  WidgetNull
}) {
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
  const tooltipSettings = {
    tooltipSlug: _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.ADSENSE_CTA_WIDGET_TOOLTIP_STATE_KEY,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You can always connect AdSense from here later', 'google-site-kit'),
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The Monetization section will be added back to your dashboard if you connect AdSense in Settings later', 'google-site-kit'),
    dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Got it', 'google-site-kit')
  };
  const showTooltip = (0,_js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_6__.useShowTooltip)(tooltipSettings);
  const adSenseModuleConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).isModuleConnected(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE));
  const hasDismissedWidget = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isItemDismissed(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.ADSENSE_CTA_WIDGET_DISMISSED_ITEM_KEY));
  const isDismissingItem = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isDismissingItem(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.ADSENSE_CTA_WIDGET_DISMISSED_ITEM_KEY));
  const handleDismissModule = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(async () => {
    showTooltip();
    await dismissItem(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.ADSENSE_CTA_WIDGET_DISMISSED_ITEM_KEY);
  }, [dismissItem, showTooltip]);

  // Check for `false` explicitly, as these variables will be `undefined`
  // while loading.
  if (adSenseModuleConnected === false && hasDismissedWidget === false && isDismissingItem === false) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Widget, {
      noPadding: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_modules_adsense_components_common_AdSenseConnectCTA__WEBPACK_IMPORTED_MODULE_2__["default"], {
        onDismissModule: handleDismissModule
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(WidgetNull, {});
}
AdSenseConnectCTAWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_9___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AdSenseConnectCTAWidget);

/***/ }),

/***/ "./js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidgetGA4.js":
/*!**************************************************************************************!*\
  !*** ./js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidgetGA4.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_23__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useIntersection.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils_report_date_range_args__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/report-date-range-args */ "./js/modules/analytics-4/utils/report-date-range-args.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _js_components_SourceLink__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_PreviewTable__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/components/PreviewTable */ "./js/components/PreviewTable.js");
/* harmony import */ var _js_components_ReportTable__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/components/ReportTable */ "./js/components/ReportTable.js");
/* harmony import */ var _js_components_TableOverflowContainer__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/components/TableOverflowContainer */ "./js/components/TableOverflowContainer.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_components_notifications_AdBlockerWarning__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/components/notifications/AdBlockerWarning */ "./js/components/notifications/AdBlockerWarning.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockerWarningWidget component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */




















function DashboardTopEarningPagesWidgetGA4({
  WidgetNull,
  WidgetReportError,
  Widget
}) {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const isGatheringData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).isGatheringData());
  const {
    startDate,
    endDate
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates({
    offsetDays: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.DATE_RANGE_OFFSET
  }));
  const adSenseAccountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getAccountID());
  const args = {
    startDate,
    endDate,
    dimensions: ['pagePath', 'adSourceName'],
    metrics: [{
      name: 'totalAdRevenue'
    }],
    dimensionFilters: {
      adSourceName: `Google AdSense account (${adSenseAccountID})`
    },
    orderby: [{
      metric: {
        metricName: 'totalAdRevenue'
      },
      desc: true
    }],
    limit: 5,
    reportID: 'adsense_top-earning-pages-widget-ga4_widget_args'
  };
  const data = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getReport(args), [args]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [args]));
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => !error ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getPageTitles(data, args) : undefined, [data, args]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [args]) || !error && titles === undefined);
  const isDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isItemDismissed(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__.ADSENSE_GA4_TOP_EARNING_PAGES_NOTICE_DISMISSED_ITEM_KEY));
  const analyticsMainURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getServiceReportURL('content-publisher-overview', (0,_js_modules_analytics_4_utils_report_date_range_args__WEBPACK_IMPORTED_MODULE_7__.generateDateRangeArgs)({
      startDate,
      endDate
    }));
  });
  const isAdSenseLinked = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getAdSenseLinked());
  const isAdblockerActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAdBlockerActive());
  const trackingRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useRef)();

  // This function works around the fact that useRef does not trigger a re-render when its value changes.
  // This meant that if you scrolled slowly, the trackingRef would be null when the intersection observer
  // was created, and the observer would never detect the component as in view.
  // Full discussion: https://github.com/google/site-kit-wp/issues/8212#issuecomment-1954275748
  const [trackingRefReady, setTrackingRefReady] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useState)(false);
  function updateTrackingRef(element) {
    trackingRef.current = element;
    if (element && !trackingRefReady) {
      setTrackingRefReady(true);
    }
  }
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const intersectionEntry = (0,react_use__WEBPACK_IMPORTED_MODULE_22__["default"])(trackingRef, {
    threshold: 0.25
  });
  const [hasBeenInView, setHasBeenInView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useState)(false);
  const inView = !!intersectionEntry?.intersectionRatio;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_21__.useEffect)(() => {
    if (inView && !hasBeenInView) {
      if (isAdSenseLinked) {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_top-earning-pages-widget`, 'view_widget');
      }
      if (!isAdSenseLinked) {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_top-earning-pages-widget`, 'view_notification');
      }
      setHasBeenInView(true);
    }
  }, [inView, viewContext, isAdSenseLinked, hasBeenInView]);
  function onClickAdSenseLinkedCTA() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_top-earning-pages-widget`, 'click_learn_more_link');
  }
  if (isDismissed) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(WidgetNull, {});
  }
  if (!isAdSenseLinked && viewOnlyDashboard) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(WidgetNull, {});
  }
  if (isAdblockerActive) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
      Footer: Footer,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_notifications_AdBlockerWarning__WEBPACK_IMPORTED_MODULE_19__["default"], {
        moduleSlug: "adsense"
      })
    });
  }
  if (loading || isGatheringData === undefined) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
      Footer: Footer,
      noPadding: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_PreviewTable__WEBPACK_IMPORTED_MODULE_14__["default"], {
        rows: 5,
        padding: true
      })
    });
  }
  if (!isAdSenseLinked && !viewOnlyDashboard) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
      Footer: Footer,
      ref: updateTrackingRef,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_18__.AdSenseLinkCTA, {
        onClick: onClickAdSenseLinkedCTA
      })
    });
  }
  if (error) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
      Footer: Footer,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(WidgetReportError, {
        moduleSlug: "analytics-4",
        error: error
      })
    });
  }
  function Footer() {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_12__["default"], {
      className: "googlesitekit-data-block__source",
      name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Analytics', 'Service name', 'google-site-kit'),
      href: analyticsMainURL,
      external: true
    });
  }
  const columnClassName = 'googlesitekit-typography googlesitekit-typography--title googlesitekit-typography--medium';
  const tableColumns = [{
    columnHeaderClassName: columnClassName,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Earning Pages', 'google-site-kit'),
    tooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top Earning Pages', 'google-site-kit'),
    primary: true,
    Component({
      row
    }) {
      const [{
        value: url
      }] = row.dimensionValues;
      const title = titles[url];
      const serviceURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates: {
            startDate,
            endDate
          }
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
          children: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_13__["default"], {
        href: serviceURL,
        title: title,
        external: true,
        hideExternalIndicator: true,
        children: title
      });
    }
  }, {
    columnHeaderClassName: columnClassName,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Earnings', 'google-site-kit'),
    tooltip: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Earnings', 'google-site-kit'),
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(fieldValue, {
          style: 'currency',
          currency: data?.metadata?.currencyCode
        })
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
    Footer: Footer,
    ref: updateTrackingRef,
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_TableOverflowContainer__WEBPACK_IMPORTED_MODULE_16__["default"], {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_ReportTable__WEBPACK_IMPORTED_MODULE_15__["default"], {
        rows: data?.rows || [],
        columns: tableColumns,
        zeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_17__.ZeroDataMessage,
        gatheringData: isGatheringData
      })
    })
  });
}
DashboardTopEarningPagesWidgetGA4.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_23___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_23___default().elementType).isRequired,
  WidgetReportError: (prop_types__WEBPACK_IMPORTED_MODULE_23___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_24__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__.MODULE_SLUG_ADSENSE
}), (0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4
}))(DashboardTopEarningPagesWidgetGA4));

/***/ }),

/***/ "./js/modules/adsense/components/dashboard/index.js":
/*!**********************************************************!*\
  !*** ./js/modules/adsense/components/dashboard/index.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AdBlockerWarningWidget: () => (/* reexport safe */ _AdBlockerWarningWidget__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   AdBlockingRecoverySetupCTAWidget: () => (/* reexport safe */ _AdBlockingRecoverySetupCTAWidget__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   AdBlockingRecoverySetupSuccessNotification: () => (/* reexport safe */ _AdBlockingRecoverySetupSuccessNotification__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   AdSenseConnectCTAWidget: () => (/* reexport safe */ _AdSenseConnectCTAWidget__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   DashboardTopEarningPagesWidgetGA4: () => (/* reexport safe */ _DashboardTopEarningPagesWidgetGA4__WEBPACK_IMPORTED_MODULE_4__["default"])
/* harmony export */ });
/* harmony import */ var _AdBlockerWarningWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AdBlockerWarningWidget */ "./js/modules/adsense/components/dashboard/AdBlockerWarningWidget.js");
/* harmony import */ var _AdBlockingRecoverySetupCTAWidget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AdBlockingRecoverySetupCTAWidget */ "./js/modules/adsense/components/dashboard/AdBlockingRecoverySetupCTAWidget.js");
/* harmony import */ var _AdBlockingRecoverySetupSuccessNotification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AdBlockingRecoverySetupSuccessNotification */ "./js/modules/adsense/components/dashboard/AdBlockingRecoverySetupSuccessNotification.js");
/* harmony import */ var _AdSenseConnectCTAWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AdSenseConnectCTAWidget */ "./js/modules/adsense/components/dashboard/AdSenseConnectCTAWidget.js");
/* harmony import */ var _DashboardTopEarningPagesWidgetGA4__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./DashboardTopEarningPagesWidgetGA4 */ "./js/modules/adsense/components/dashboard/DashboardTopEarningPagesWidgetGA4.js");
/**
 * AdSense Dashboard components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */







/***/ }),

/***/ "./js/modules/adsense/components/module/ModuleOverviewWidget/Footer.js":
/*!*****************************************************************************!*\
  !*** ./js/modules/adsense/components/module/ModuleOverviewWidget/Footer.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_adsense_util_report_date_range_args__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/util/report-date-range-args */ "./js/modules/adsense/util/report-date-range-args.js");
/* harmony import */ var _js_components_SourceLink__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Footer component for ModuleOverviewWidget.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







function Footer() {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const dateRangeDates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getDateRangeDates({
    offsetDays: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.DATE_RANGE_OFFSET
  }));
  const accountSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getServiceReportURL((0,_js_modules_adsense_util_report_date_range_args__WEBPACK_IMPORTED_MODULE_3__.generateDateRangeArgs)(dateRangeDates));
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_4__["default"], {
    href: accountSiteURL,
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('AdSense', 'Service name', 'google-site-kit'),
    external: true
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Footer);

/***/ }),

/***/ "./js/modules/adsense/components/module/ModuleOverviewWidget/Header.js":
/*!*****************************************************************************!*\
  !*** ./js/modules/adsense/components/module/ModuleOverviewWidget/Header.js ***!
  \*****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetHeaderTitle */ "./js/googlesitekit/widgets/components/WidgetHeaderTitle.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Header component for ModuleOverviewWidget.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




function Header() {
  const currentDayCount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getDateRangeNumberOfDays());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_2__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: number of days */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._n)('Performance over the last %s day', 'Performance over the last %s days', currentDayCount, 'google-site-kit'), currentDayCount)
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Header);

/***/ }),

/***/ "./js/modules/adsense/components/module/ModuleOverviewWidget/Overview.js":
/*!*******************************************************************************!*\
  !*** ./js/modules/adsense/components/module/ModuleOverviewWidget/Overview.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_components_DataBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/DataBlock */ "./js/components/DataBlock/index.js");
/* harmony import */ var _js_components_DataBlockGroup__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/DataBlockGroup */ "./js/components/DataBlockGroup.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModuleOverviewWidget component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */





function Overview({
  metrics,
  currentRangeData,
  previousRangeData,
  selectedStats,
  handleStatsSelection
}) {
  const {
    totals,
    headers
  } = currentRangeData;
  const {
    totals: previousTotals
  } = previousRangeData;
  const cellProps = {
    smSize: 2,
    mdSize: 2,
    lgSize: 3
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Grid, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_js_components_DataBlockGroup__WEBPACK_IMPORTED_MODULE_3__["default"], {
      className: "mdc-layout-grid__inner",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
        ...cellProps,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_DataBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {
          stat: 0,
          className: "googlesitekit-data-block--page-rpm googlesitekit-data-block--button-1",
          title: metrics[headers[0].name],
          datapoint: totals?.cells[0].value || 0,
          datapointUnit: headers[0]?.currencyCode,
          change: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.calculateChange)(previousTotals?.cells[0].value || 0, totals?.cells[0].value || 0),
          changeDataUnit: "%",
          context: "button",
          selected: selectedStats === 0,
          handleStatSelection: handleStatsSelection
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
        ...cellProps,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_DataBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {
          stat: 1,
          className: "googlesitekit-data-block--page-rpm googlesitekit-data-block--button-2",
          title: metrics[headers[1].name],
          datapoint: totals?.cells[1].value || 0,
          datapointUnit: headers[1]?.currencyCode,
          change: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.calculateChange)(previousTotals?.cells[1].value || 0, totals?.cells[1].value || 0),
          changeDataUnit: "%",
          context: "button",
          selected: selectedStats === 1,
          handleStatSelection: handleStatsSelection
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
        ...cellProps,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_DataBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {
          stat: 2,
          className: "googlesitekit-data-block--page-rpm googlesitekit-data-block--button-3",
          title: metrics[headers[2].name],
          datapoint: totals?.cells[2].value || 0,
          change: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.calculateChange)(previousTotals?.cells[2].value || 0, totals?.cells[2].value || 0),
          changeDataUnit: "%",
          context: "button",
          selected: selectedStats === 2,
          handleStatSelection: handleStatsSelection
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
        ...cellProps,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_DataBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {
          stat: 3,
          className: "googlesitekit-data-block--impression googlesitekit-data-block--button-4",
          title: metrics[headers[3].name],
          datapoint: totals?.cells[3].value || 0,
          datapointUnit: "%",
          change: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.calculateChange)(previousTotals?.cells[3].value || 0, totals?.cells[3].value || 0),
          changeDataUnit: "%",
          context: "button",
          selected: selectedStats === 3,
          handleStatSelection: handleStatsSelection
        })
      })]
    })
  });
}
Overview.propTypes = {
  metrics: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  currentRangeData: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  previousRangeData: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  selectedStats: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number).isRequired,
  handleStatsSelection: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().func).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Overview);

/***/ }),

/***/ "./js/modules/adsense/components/module/ModuleOverviewWidget/Stats.js":
/*!****************************************************************************!*\
  !*** ./js/modules/adsense/components/module/ModuleOverviewWidget/Stats.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Stats)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _js_components_GoogleChart_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/GoogleChart/utils */ "./js/components/GoogleChart/utils.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_components_GoogleChart__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/GoogleChart */ "./js/components/GoogleChart/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModuleOverviewWidget component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */





function Stats(props) {
  const {
    metrics,
    currentRangeData,
    previousRangeData,
    selectedStats
  } = props;
  const dataMap = (0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_1__.getSiteStatsDataForGoogleChart)(currentRangeData, previousRangeData, Object.values(metrics)[selectedStats], selectedStats + 1,
  // Since we have the dimension in first position, then the metrics, we need the +1 offset.
  currentRangeData.headers[selectedStats + 1]);
  const colors = ['#6380b8', '#4bbbbb', '#3c7251', '#8e68cb'];
  function getFormat({
    type,
    currencyCode
  } = {}) {
    if (type === 'METRIC_CURRENCY') {
      return (0,_js_components_GoogleChart_utils__WEBPACK_IMPORTED_MODULE_0__.getCurrencyPattern)(currencyCode);
    }
    const formats = {
      METRIC_TALLY: undefined,
      METRIC_RATIO: 'percent',
      METRIC_DECIMAL: 'decimal',
      METRIC_MILLISECONDS: undefined
    };
    return formats[type];
  }
  const [, ...ticks] = dataMap.slice(1).map(([date]) => date);
  const options = {
    curveType: 'function',
    height: 270,
    width: '100%',
    chartArea: {
      height: '80%',
      width: '100%',
      left: 60
    },
    legend: {
      position: 'top',
      textStyle: {
        color: '#616161',
        fontSize: 12
      }
    },
    hAxis: {
      format: 'MMM d',
      gridlines: {
        color: '#fff'
      },
      textStyle: {
        color: '#616161',
        fontSize: 12
      },
      ticks
    },
    vAxis: {
      format: getFormat(currentRangeData.headers[selectedStats + 1]),
      gridlines: {
        color: '#eee'
      },
      minorGridlines: {
        color: '#eee'
      },
      textStyle: {
        color: '#616161',
        fontSize: 12
      },
      titleTextStyle: {
        color: '#616161',
        fontSize: 12,
        italic: false
      },
      viewWindow: {
        min: 0
      }
    },
    focusTarget: 'category',
    crosshair: {
      color: 'gray',
      opacity: 0.1,
      orientation: 'vertical',
      trigger: 'both'
    },
    tooltip: {
      isHtml: true,
      // eslint-disable-line sitekit/acronym-case
      trigger: 'both'
    },
    series: {
      0: {
        color: colors[selectedStats],
        targetAxisIndex: 0
      },
      1: {
        color: colors[selectedStats],
        targetAxisIndex: 0,
        lineDashStyle: [3, 3],
        lineWidth: 1
      }
    }
  };
  if ((0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_1__.isZeroReport)(currentRangeData, selectedStats + 1) && (0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_1__.isZeroReport)(previousRangeData, selectedStats + 1)) {
    options.vAxis.viewWindow.max = 100;
  } else {
    options.vAxis.viewWindow.max = undefined;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Grid, {
    className: "googlesitekit-adsense-site-stats",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Row, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Cell, {
        size: 12,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_GoogleChart__WEBPACK_IMPORTED_MODULE_3__["default"], {
          chartType: "LineChart",
          data: dataMap,
          loadingHeight: "270px",
          loadingWidth: "100%",
          options: options
        })
      })
    })
  });
}
Stats.propTypes = {
  metrics: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  currentRangeData: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  previousRangeData: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().object),
  selectedStats: (prop_types__WEBPACK_IMPORTED_MODULE_5___default().number).isRequired
};

/***/ }),

/***/ "./js/modules/adsense/components/module/ModuleOverviewWidget/StatusMigration.js":
/*!**************************************************************************************!*\
  !*** ./js/modules/adsense/components/module/ModuleOverviewWidget/StatusMigration.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ StatusMigration)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_material_components_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/material-components/layout */ "./js/material-components/layout/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/adsense/util/status */ "./js/modules/adsense/util/status.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModuleOverviewWidget - StatusMigration component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








function StatusMigration() {
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ADSENSE).getAccountID());
  const afcClient = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ADSENSE).getAFCClient(accountID));
  const site = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ADSENSE).getCurrentSite(accountID));
  const adminReauthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ADSENSE).getAdminReauthURL());
  const isNavigating = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_LOCATION).isNavigating());
  const {
    setAccountStatus,
    setSiteStatus,
    setAccountSetupComplete,
    setSiteSetupComplete,
    saveSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ADSENSE);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_LOCATION);
  let isReady;
  if (afcClient && site) {
    if (afcClient.state !== _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.API_STATE_READY || site.state !== _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.API_STATE_READY || !site.autoAdsEnabled) {
      isReady = false;
    } else {
      isReady = true;
    }
  }
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
    if (isReady) {
      (async () => {
        await setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_6__.ACCOUNT_STATUS_READY);
        await setSiteStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_6__.SITE_STATUS_READY);
        await saveSettings();
      })();
    }
  }, [isReady, saveSettings, setAccountStatus, setSiteStatus]);
  async function handleRedoSetup() {
    await setAccountSetupComplete(false);
    await setSiteSetupComplete(false);
    await saveSettings();
    navigateTo(adminReauthURL);
  }
  if (isReady === true) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_4__.Grid, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_4__.Row, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_4__.Cell, {
        size: 12,
        children: [isReady === undefined && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {}), isReady === false && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_7__["default"], {
          type: _js_components_Notice__WEBPACK_IMPORTED_MODULE_7__["default"].TYPES.WARNING,
          description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You need to redo setup to complete AdSense configuration', 'google-site-kit'),
          ctaButton: {
            label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Redo setup', 'google-site-kit'),
            onClick: handleRedoSetup,
            disabled: isNavigating,
            inProgress: isNavigating
          }
        })]
      })
    })
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/module/ModuleOverviewWidget/index.js":
/*!****************************************************************************!*\
  !*** ./js/modules/adsense/components/module/ModuleOverviewWidget/index.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _Header__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Header */ "./js/modules/adsense/components/module/ModuleOverviewWidget/Header.js");
/* harmony import */ var _Footer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Footer */ "./js/modules/adsense/components/module/ModuleOverviewWidget/Footer.js");
/* harmony import */ var _Overview__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Overview */ "./js/modules/adsense/components/module/ModuleOverviewWidget/Overview.js");
/* harmony import */ var _Stats__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Stats */ "./js/modules/adsense/components/module/ModuleOverviewWidget/Stats.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _StatusMigration__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./StatusMigration */ "./js/modules/adsense/components/module/ModuleOverviewWidget/StatusMigration.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModuleOverviewWidget component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */














function ModuleOverviewWidget({
  Widget,
  WidgetReportError
}) {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_13__["default"])();
  const [selectedStats, setSelectedStats] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_15__.useState)(0);
  const accountStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getAccountStatus();
  });
  const siteStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getSiteStatus();
  });
  const legacyStatus = _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_4__.legacyAccountStatuses.includes(accountStatus) || siteStatus === _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_4__.SITE_STATUS_ADDED;
  const {
    startDate,
    endDate,
    compareStartDate,
    compareEndDate
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates({
    compare: true,
    offsetDays: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.DATE_RANGE_OFFSET
  }));
  const currentRangeArgs = {
    metrics: Object.keys(ModuleOverviewWidget.metrics),
    startDate,
    endDate,
    reportID: 'adsense_module-overview-widget_widget_currentRangeArgs'
  };
  const previousRangeArgs = {
    metrics: Object.keys(ModuleOverviewWidget.metrics),
    startDate: compareStartDate,
    endDate: compareEndDate,
    reportID: 'adsense_module-overview-widget_widget_previousRangeArgs'
  };
  const currentRangeChartArgs = {
    ...currentRangeArgs,
    dimensions: ['DATE'],
    reportID: 'adsense_module-overview-widget_widget_currentRangeChartArgs'
  };
  const previousRangeChartArgs = {
    ...previousRangeArgs,
    dimensions: ['DATE'],
    reportID: 'adsense_module-overview-widget_widget_previousRangeChartArgs'
  };
  const currentRangeData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useInViewSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getReport(currentRangeArgs), [currentRangeArgs]);
  const previousRangeData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useInViewSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getReport(previousRangeArgs), [previousRangeArgs]);
  const currentRangeChartData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useInViewSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getReport(currentRangeChartArgs), [currentRangeChartArgs]);
  const previousRangeChartData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useInViewSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getReport(previousRangeChartArgs), [previousRangeChartArgs]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useSelect)(select => !select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).hasFinishedResolution('getReport', [currentRangeArgs]) || !select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).hasFinishedResolution('getReport', [previousRangeArgs]) || !select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).hasFinishedResolution('getReport', [currentRangeChartArgs]) || !select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).hasFinishedResolution('getReport', [previousRangeChartArgs]));
  const errors = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useSelect)(select => [...[select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getErrorForSelector('getReport', [currentRangeArgs])], ...[select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getErrorForSelector('getReport', [previousRangeArgs])], ...[select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getErrorForSelector('getReport', [currentRangeChartArgs])], ...[select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getErrorForSelector('getReport', [previousRangeChartArgs])]]).filter(Boolean);
  if (loading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(Widget, {
      Header: _Header__WEBPACK_IMPORTED_MODULE_7__["default"],
      Footer: _Footer__WEBPACK_IMPORTED_MODULE_8__["default"],
      noPadding: true,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
        width: "100%",
        height: "190px",
        padding: true
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
        width: "100%",
        height: "270px",
        padding: true
      })]
    });
  }
  if (!!errors.length) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(Widget, {
      Header: _Header__WEBPACK_IMPORTED_MODULE_7__["default"],
      Footer: _Footer__WEBPACK_IMPORTED_MODULE_8__["default"],
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(WidgetReportError, {
        moduleSlug: "adsense",
        error: errors
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(Widget, {
    Header: _Header__WEBPACK_IMPORTED_MODULE_7__["default"],
    Footer: _Footer__WEBPACK_IMPORTED_MODULE_8__["default"],
    noPadding: true,
    children: [!viewOnlyDashboard && legacyStatus && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_StatusMigration__WEBPACK_IMPORTED_MODULE_12__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_Overview__WEBPACK_IMPORTED_MODULE_9__["default"], {
      metrics: ModuleOverviewWidget.metrics,
      currentRangeData: currentRangeData,
      previousRangeData: previousRangeData,
      selectedStats: selectedStats,
      handleStatsSelection: setSelectedStats
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_Stats__WEBPACK_IMPORTED_MODULE_10__["default"], {
      metrics: ModuleOverviewWidget.metrics,
      currentRangeData: currentRangeChartData,
      previousRangeData: previousRangeChartData,
      selectedStats: selectedStats
    })]
  });
}
ModuleOverviewWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_16___default().elementType).isRequired,
  WidgetReportZero: (prop_types__WEBPACK_IMPORTED_MODULE_16___default().elementType).isRequired,
  WidgetReportError: (prop_types__WEBPACK_IMPORTED_MODULE_16___default().elementType).isRequired
};
ModuleOverviewWidget.metrics = {
  ESTIMATED_EARNINGS: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Earnings', 'google-site-kit'),
  PAGE_VIEWS_RPM: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Page RPM', 'google-site-kit'),
  IMPRESSIONS: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Impressions', 'google-site-kit'),
  PAGE_VIEWS_CTR: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Page CTR', 'google-site-kit')
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_6__["default"])({
  moduleName: _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__.MODULE_SLUG_ADSENSE
})(ModuleOverviewWidget));

/***/ }),

/***/ "./js/modules/adsense/components/module/index.js":
/*!*******************************************************!*\
  !*** ./js/modules/adsense/components/module/index.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ModuleOverviewWidget: () => (/* reexport safe */ _ModuleOverviewWidget__WEBPACK_IMPORTED_MODULE_0__["default"])
/* harmony export */ });
/* harmony import */ var _ModuleOverviewWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ModuleOverviewWidget */ "./js/modules/adsense/components/module/ModuleOverviewWidget/index.js");
/**
 * AdSense Module components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */



/***/ }),

/***/ "./js/modules/adsense/components/settings/AdBlockingRecoverySetupCTANotice.js":
/*!************************************************************************************!*\
  !*** ./js/modules/adsense/components/settings/AdBlockingRecoverySetupCTANotice.js ***!
  \************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdBlockingRecoverySetupCTANotice)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_SupportLink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/SupportLink */ "./js/components/SupportLink.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_hooks_useInView__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useInView */ "./js/hooks/useInView.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/surveys/SurveyViewTrigger */ "./js/components/surveys/SurveyViewTrigger.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockingRecoverySetupCTANotice component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */












function AdBlockingRecoverySetupCTANotice() {
  const inView = (0,_js_hooks_useInView__WEBPACK_IMPORTED_MODULE_5__.useInView)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const adBlockingRecoverySetupStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ADSENSE).getAdBlockingRecoverySetupStatus());
  const accountStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ADSENSE).getAccountStatus());
  const siteStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ADSENSE).getSiteStatus());
  const hasExistingAdBlockingRecoveryTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ADSENSE).hasExistingAdBlockingRecoveryTag());
  const recoveryPageURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getAdminURL('googlesitekit-ad-blocking-recovery'));
  const isNavigatingToRecoveryPageURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_LOCATION).isNavigatingTo(recoveryPageURL));
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_LOCATION);
  const isCTAHidden = hasExistingAdBlockingRecoveryTag === undefined || hasExistingAdBlockingRecoveryTag || adBlockingRecoverySetupStatus !== '' || accountStatus !== _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_9__.ACCOUNT_STATUS_READY || siteStatus !== _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_9__.SITE_STATUS_READY;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useEffect)(() => {
    if (inView && !isCTAHidden) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_adsense-abr-cta-widget`, 'view_notification');
    }
  }, [inView, isCTAHidden, viewContext]);
  async function handleCTAClick() {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_adsense-abr-cta-widget`, 'confirm_notification');
    return navigateTo(recoveryPageURL);
  }
  function handleLearnMoreClick() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_adsense-abr-cta-widget`, 'click_learn_more_link');
  }
  if (isCTAHidden) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_11__["default"], {
    type: _js_components_Notice__WEBPACK_IMPORTED_MODULE_11__["default"].TYPES.INFO,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad blocking recovery', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_14__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Start recovering revenue lost from ad blockers by deploying an ad blocking recovery message through Site Kit. <a>Learn more</a>', 'google-site-kit'), {
      a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_SupportLink__WEBPACK_IMPORTED_MODULE_2__["default"], {
        path: "/adsense/answer/11576589",
        onClick: handleLearnMoreClick,
        external: true
      })
    }),
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Set up now', 'google-site-kit'),
      onClick: handleCTAClick,
      isSaving: isNavigatingToRecoveryPageURL,
      disabled: isNavigatingToRecoveryPageURL
    },
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_10__["default"], {
      triggerID: "view_abr_setup_cta",
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_7__.DAY_IN_SECONDS
    })
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/settings/AdBlockingRecoveryToggle.js":
/*!****************************************************************************!*\
  !*** ./js/modules/adsense/components/settings/AdBlockingRecoveryToggle.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdBlockingRecoveryToggle)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockingRecoveryToggle component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */













function AdBlockingRecoveryToggle() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const adBlockingRecoverySnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getUseAdBlockingRecoverySnippet());
  const adBlockingRecoveryErrorSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getUseAdBlockingRecoveryErrorSnippet());
  const adBlockingRecoverySetupStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getAdBlockingRecoverySetupStatus());
  const existingAdBlockingRecoveryTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getExistingAdBlockingRecoveryTag());
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getAccountID());
  const privacyMessagingURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getServiceURL({
    path: `/${accountID}/privacymessaging/ad_blocking`
  }));
  const learnMoreURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getDocumentationLinkURL('ad-blocking-recovery'));
  const adBlockingRecoveryToggle = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_12__["default"])(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AD_BLOCKING_FORM_SETTINGS, 'adBlockingRecoveryToggle');
  const adBlockingRecoveryErrorToggle = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_12__["default"])(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AD_BLOCKING_FORM_SETTINGS, 'adBlockingRecoveryErrorToggle');
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_FORMS);
  const {
    setUseAdBlockingRecoverySnippet,
    setUseAdBlockingRecoveryErrorSnippet
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE);
  function handleAdBlockingRecoveryToggleClick() {
    const toggleValue = !adBlockingRecoveryToggle;
    setValues(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AD_BLOCKING_FORM_SETTINGS, {
      adBlockingRecoveryToggle: toggleValue
    });
    setUseAdBlockingRecoverySnippet(toggleValue);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_adsense-abr`, toggleValue ? 'enable_tag' : 'disable_tag', 'abr_tag');
  }
  function handleErrorProtectionToggleClick() {
    const toggleValue = !adBlockingRecoveryErrorToggle;
    setValues(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AD_BLOCKING_FORM_SETTINGS, {
      adBlockingRecoveryErrorToggle: toggleValue
    });
    setUseAdBlockingRecoveryErrorSnippet(toggleValue);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_adsense-abr`, toggleValue ? 'enable_tag' : 'disable_tag', 'error_protection_tag');
  }
  (0,react_use__WEBPACK_IMPORTED_MODULE_14__["default"])(() => {
    const initialToggleValues = {
      adBlockingRecoveryToggle: adBlockingRecoverySnippet,
      adBlockingRecoveryErrorToggle: adBlockingRecoveryErrorSnippet
    };
    setValues(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AD_BLOCKING_FORM_SETTINGS, initialToggleValues);
  });
  let existingAdBlockingRecoveryTagMessage;
  if (existingAdBlockingRecoveryTag && existingAdBlockingRecoveryTag === accountID) {
    existingAdBlockingRecoveryTagMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You’ve already enabled an ad blocking recovery message on your site. We recommend using Site Kit to manage this to get the most out of AdSense.', 'google-site-kit');
  } else if (existingAdBlockingRecoveryTag) {
    existingAdBlockingRecoveryTagMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: account ID */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit detected Ad Blocking Recovery code for a different account %s on your site. For a better ad blocking recovery experience, you should remove Ad Blocking Recovery code that’s not linked to this AdSense account.', 'google-site-kit'), (0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_10__.parseAccountIDFromExistingTag)(existingAdBlockingRecoveryTag));
  }
  if (!adBlockingRecoverySetupStatus) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("fieldset", {
    className: "googlesitekit-settings-module__ad-blocking-recovery-toggles",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("legend", {
      className: "googlesitekit-setup-module__text",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad blocking recovery', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Switch, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enable ad blocking recovery message', 'google-site-kit'),
          checked: adBlockingRecoveryToggle,
          onClick: handleAdBlockingRecoveryToggleClick,
          hideLabel: false
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_4__["default"], {
          children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_15__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Identify site visitors that have an ad blocker browser extension installed. These site visitors will see the ad blocking recovery message created in AdSense. <a>Configure your message</a>', 'google-site-kit'), {
            a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
              href: privacyMessagingURL,
              external: true
            })
          })
        })]
      }), (adBlockingRecoveryToggle || adBlockingRecoverySnippet) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Switch, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Place error protection code', 'google-site-kit'),
          checked: adBlockingRecoveryErrorToggle,
          onClick: handleErrorProtectionToggleClick,
          hideLabel: false
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_4__["default"], {
          children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_15__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('If a site visitor’s ad blocker browser extension blocks the message you create in AdSense, a default, non-customizable ad blocking recovery message will display instead. <a>Learn more</a>', 'google-site-kit'), {
            a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
              href: learnMoreURL,
              external: true
            })
          })
        })]
      })]
    }), existingAdBlockingRecoveryTag && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_11__["default"], {
      type: _js_components_Notice__WEBPACK_IMPORTED_MODULE_11__["default"].TYPES.INFO,
      description: existingAdBlockingRecoveryTagMessage
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/settings/SettingsEdit.js":
/*!****************************************************************!*\
  !*** ./js/modules/adsense/components/settings/SettingsEdit.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SettingsEdit)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _SettingsForm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SettingsForm */ "./js/modules/adsense/components/settings/SettingsForm.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Settings Edit component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */





function SettingsEdit() {
  const isDoingSubmitChanges = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).isDoingSubmitChanges());
  let viewComponent;
  if (isDoingSubmitChanges) {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {});
  } else {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_SettingsForm__WEBPACK_IMPORTED_MODULE_3__["default"], {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
    className: "googlesitekit-setup-module googlesitekit-setup-module--adsense",
    children: viewComponent
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/settings/SettingsForm.js":
/*!****************************************************************!*\
  !*** ./js/modules/adsense/components/settings/SettingsForm.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SettingsForm)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util_parsing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/util/parsing */ "./js/modules/adsense/util/parsing.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_modules_adsense_components_common_WebStoriesAdUnitSelect__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/adsense/components/common/WebStoriesAdUnitSelect */ "./js/modules/adsense/components/common/WebStoriesAdUnitSelect.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _AdBlockingRecoverySetupCTANotice__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./AdBlockingRecoverySetupCTANotice */ "./js/modules/adsense/components/settings/AdBlockingRecoverySetupCTANotice.js");
/* harmony import */ var _AdBlockingRecoveryToggle__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AdBlockingRecoveryToggle */ "./js/modules/adsense/components/settings/AdBlockingRecoveryToggle.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Settings form.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */












function SettingsForm() {
  const webStoriesActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).isWebStoriesActive());
  const clientID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getClientID());
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getExistingTag());
  const hasResolvedGetExistingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).hasFinishedResolution('getExistingTag'));

  // This is called here to ensure that the progress bar is displayed while
  // the Ad Blocking Recovery existing tag is being resolved to prevent a
  // layout shift.
  (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getExistingAdBlockingRecoveryTag());
  const hasResolvedGetExistingAdBlockingRecoveryTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).hasFinishedResolution('getExistingAdBlockingRecoveryTag'));
  if (!hasResolvedGetExistingTag || !hasResolvedGetExistingAdBlockingRecoveryTag) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {});
  }
  let checkedMessage, uncheckedMessage;
  if (existingTag && existingTag === clientID) {
    // Existing tag with permission.
    checkedMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You’ve already got an AdSense code on your site for this account, we recommend you use Site Kit to place code to get the most out of AdSense', 'google-site-kit');
    uncheckedMessage = checkedMessage;
  } else if (existingTag) {
    // Existing tag without permission.
    checkedMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: account ID */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit detected AdSense code for a different account %s on your site. For a better ads experience, you should remove AdSense code that’s not linked to this AdSense account.', 'google-site-kit'), (0,_js_modules_adsense_util_parsing__WEBPACK_IMPORTED_MODULE_4__.parseAccountID)(existingTag));
    uncheckedMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please note that AdSense will not show ads on your website unless you’ve already placed the code', 'google-site-kit');
  } else {
    // No existing tag.
    uncheckedMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Please note that AdSense will not show ads on your website unless you’ve already placed the code', 'google-site-kit');
  }
  const supportURL = 'https://support.google.com/adsense/answer/10175505#create-an-ad-unit-for-web-stories';
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
    className: "googlesitekit-adsense-settings-fields",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_5__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_5__.UseSnippetSwitch, {
      checkedMessage: checkedMessage,
      uncheckedMessage: uncheckedMessage
    }), webStoriesActive && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_adsense_components_common_WebStoriesAdUnitSelect__WEBPACK_IMPORTED_MODULE_6__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_8__["default"], {
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_14__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This ad unit will be used for your Web Stories. <LearnMoreLink />', 'google-site-kit'), {
          LearnMoreLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_7__["default"], {
            href: supportURL,
            "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more about Ad Sense Web Stories.', 'google-site-kit'),
            external: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more', 'google-site-kit')
          })
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_5__.AutoAdExclusionSwitches, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_AdBlockingRecoverySetupCTANotice__WEBPACK_IMPORTED_MODULE_10__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_AdBlockingRecoveryToggle__WEBPACK_IMPORTED_MODULE_11__["default"], {})]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/settings/SettingsSetupIncomplete.js":
/*!***************************************************************************!*\
  !*** ./js/modules/adsense/components/settings/SettingsSetupIncomplete.js ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SettingsSetupIncomplete)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/adsense/util/status */ "./js/modules/adsense/util/status.js");
/* harmony import */ var _js_components_notifications_ModuleSettingsWarning__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/notifications/ModuleSettingsWarning */ "./js/components/notifications/ModuleSettingsWarning.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Settings Setup Incomplete component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








function SettingsSetupIncomplete() {
  const accountStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getAccountStatus());
  const isPendingStatus = (0,_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_6__.isPendingAccountStatus)(accountStatus);
  const adminReauthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getAdminReauthURL());
  const requirementsError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES)?.getCheckRequirementsError(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ADSENSE));
  let statusText, actionText;
  if (isPendingStatus) {
    /* translators: %s: link with next step */
    statusText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit has placed AdSense code on your site: %s', 'google-site-kit');
    actionText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('check module page', 'google-site-kit');
  } else {
    /* translators: %s: link with next step */
    statusText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Setup incomplete: %s', 'google-site-kit');
    actionText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('continue module setup', 'google-site-kit');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
      className: "googlesitekit-settings-module__fields-group googlesitekit-settings-module__fields-group--no-border",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_notifications_ModuleSettingsWarning__WEBPACK_IMPORTED_MODULE_7__["default"], {
        slug: "adsense"
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
      className: "googlesitekit-settings-module__fields-group-title",
      children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(statusText, `<a>${actionText}</a>`), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
          className: "googlesitekit-settings-module__edit-button",
          href: adminReauthURL,
          disabled: requirementsError ? true : false
        })
      })
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/settings/SettingsView.js":
/*!****************************************************************!*\
  !*** ./js/modules/adsense/components/settings/SettingsView.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SettingsView)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/DisplaySetting */ "./js/components/DisplaySetting.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils */ "./js/modules/adsense/components/settings/utils.js");
/* harmony import */ var _AdBlockingRecoverySetupCTANotice__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./AdBlockingRecoverySetupCTANotice */ "./js/modules/adsense/components/settings/AdBlockingRecoverySetupCTANotice.js");
/* harmony import */ var _js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/VisuallyHidden */ "./js/components/VisuallyHidden.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Settings View component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */












function SettingsView() {
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getAccountID());
  const siteStatusURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getServiceAccountManageSitesURL());
  const webStoriesActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).isWebStoriesActive());
  const webStoriesAdUnit = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getWebStoriesAdUnit());
  const accountStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getAccountStatus());
  const useAdBlockingRecoverySnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getUseAdBlockingRecoverySnippet());
  const useAdBlockingRecoveryErrorSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getUseAdBlockingRecoveryErrorSnippet());
  const siteStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getSiteStatus());
  const useSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getUseSnippet());
  const adBlockingRecoverySetupStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getAdBlockingRecoverySetupStatus());
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getExistingTag());
  const clientID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getClientID());
  const autoAdsDisabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getAutoAdsDisabled() || []);
  const privacyMessagingURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getServiceURL({
    path: `/${accountID}/privacymessaging/ad_blocking`
  }));
  const accountStatusLabel = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getAccountStatusLabel)(accountStatus);
  const siteStatusLabel = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getSiteStatusLabel)(siteStatus);
  const siteStatusLinkLabel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('View <VisuallyHidden>site </VisuallyHidden>in AdSense', 'google-site-kit'), {
    VisuallyHidden: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_10__["default"], {})
  });
  const snippetLabel = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getSnippetLabel)(useSnippet, existingTag, clientID);
  const autoAdsDisabledMessage = (0,_utils__WEBPACK_IMPORTED_MODULE_8__.getAutoAdsDisabledMessage)(autoAdsDisabled);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    return select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getSettings() === undefined || select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).hasExistingAdBlockingRecoveryTag() === undefined;
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
    className: "googlesitekit-setup-module googlesitekit-setup-module--adsense",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_7__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_11__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Publisher ID', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_2__["default"], {
            value: accountID
          })
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_11__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Status', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: [siteStatusLabel + ' ', /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
            href: siteStatusURL,
            className: "googlesitekit-settings-module__cta-button",
            disabled: siteStatusURL === undefined,
            hideExternalIndicator: siteStatusURL === undefined,
            external: true,
            children: siteStatusLinkLabel
          })]
        })]
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_11__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Account Status', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: accountStatusLabel
        })]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_11__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('AdSense Code', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: snippetLabel
        })]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_11__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excluded from ads', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: autoAdsDisabledMessage
        })]
      })
    }), webStoriesActive && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_11__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Web Stories Ad Unit', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: [!webStoriesAdUnit && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('None', 'google-site-kit')
          }), webStoriesAdUnit && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_2__["default"], {
            value: webStoriesAdUnit
          })]
        })]
      })
    }), adBlockingRecoverySetupStatus?.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: [loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.ProgressBar, {
        verticalSpacing: 86,
        small: true
      }), !loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_11__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad blocking recovery', 'google-site-kit')
        }), !useAdBlockingRecoverySnippet && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad blocking recovery message is not placed', 'google-site-kit')
        }), useAdBlockingRecoverySnippet && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
            className: "googlesitekit-settings-module__meta-item-data",
            children: useAdBlockingRecoveryErrorSnippet ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad blocking recovery message enabled with error protection code', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad blocking recovery message enabled without error protection code', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
            className: "googlesitekit-settings-module__meta-item-data",
            children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Identify site visitors that have an ad blocker browser extension installed. These site visitors will see the ad blocking recovery message created in AdSense. <a>Configure your message</a>', 'google-site-kit'), {
              a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
                href: privacyMessagingURL,
                external: true
              })
            })
          })]
        })]
      })]
    }), !adBlockingRecoverySetupStatus?.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
      children: [loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.ProgressBar, {
        verticalSpacing: 131,
        small: true
      }), !loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_AdBlockingRecoverySetupCTANotice__WEBPACK_IMPORTED_MODULE_9__["default"], {})]
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/settings/index.js":
/*!*********************************************************!*\
  !*** ./js/modules/adsense/components/settings/index.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AdBlockingRecoverySetupCTANotice: () => (/* reexport safe */ _AdBlockingRecoverySetupCTANotice__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   AdBlockingRecoveryToggle: () => (/* reexport safe */ _AdBlockingRecoveryToggle__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   SettingsEdit: () => (/* reexport safe */ _SettingsEdit__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   SettingsForm: () => (/* reexport safe */ _SettingsForm__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   SettingsSetupIncomplete: () => (/* reexport safe */ _SettingsSetupIncomplete__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   SettingsView: () => (/* reexport safe */ _SettingsView__WEBPACK_IMPORTED_MODULE_5__["default"])
/* harmony export */ });
/* harmony import */ var _AdBlockingRecoverySetupCTANotice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AdBlockingRecoverySetupCTANotice */ "./js/modules/adsense/components/settings/AdBlockingRecoverySetupCTANotice.js");
/* harmony import */ var _AdBlockingRecoveryToggle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AdBlockingRecoveryToggle */ "./js/modules/adsense/components/settings/AdBlockingRecoveryToggle.js");
/* harmony import */ var _SettingsEdit__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SettingsEdit */ "./js/modules/adsense/components/settings/SettingsEdit.js");
/* harmony import */ var _SettingsForm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SettingsForm */ "./js/modules/adsense/components/settings/SettingsForm.js");
/* harmony import */ var _SettingsSetupIncomplete__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SettingsSetupIncomplete */ "./js/modules/adsense/components/settings/SettingsSetupIncomplete.js");
/* harmony import */ var _SettingsView__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SettingsView */ "./js/modules/adsense/components/settings/SettingsView.js");
/**
 * AdSense Settings components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */








/***/ }),

/***/ "./js/modules/adsense/components/settings/utils.js":
/*!*********************************************************!*\
  !*** ./js/modules/adsense/components/settings/utils.js ***!
  \*********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAccountStatusLabel: () => (/* binding */ getAccountStatusLabel),
/* harmony export */   getAutoAdsDisabledMessage: () => (/* binding */ getAutoAdsDisabledMessage),
/* harmony export */   getSiteStatusLabel: () => (/* binding */ getSiteStatusLabel),
/* harmony export */   getSnippetLabel: () => (/* binding */ getSnippetLabel)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/components/common/AutoAdExclusionSwitches */ "./js/modules/adsense/components/common/AutoAdExclusionSwitches.js");
/* harmony import */ var _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/util/status */ "./js/modules/adsense/util/status.js");
/**
 * Adsense Settings utilities.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* eslint-disable sitekit/jsdoc-no-unnamed-boolean-params */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Returns translatable account status label.
 *
 * @since 1.93.0
 *
 * @param {string} accountStatus The active account status.
 * @return {string} The account status label.
 */
function getAccountStatusLabel(accountStatus) {
  let accountStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site isn’t ready to show ads yet', 'google-site-kit');
  switch (accountStatus) {
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_APPROVED:
      accountStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your account has been approved', 'google-site-kit');
      break;
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_READY:
      accountStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site is ready for ads', 'google-site-kit');
      break;
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_PENDING:
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_GRAYLISTED:
      accountStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('We’re getting your site ready for ads. This usually takes less than a day, but it can sometimes take a bit longer', 'google-site-kit');
      break;
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_NO_CLIENT:
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_DISAPPROVED:
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_NEEDS_ATTENTION:
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_CLIENT_REQUIRES_REVIEW:
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_STATUS_CLIENT_GETTING_READY:
      accountStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You need to fix some issues before your account is approved. Go to AdSense to find out how to fix it', 'google-site-kit');
      break;
  }
  return accountStatusLabel;
}

/**
 * Returns translatable site status label.
 *
 * @since 1.93.0
 *
 * @param {string} siteStatus The site status.
 * @return {string} The site status label.
 */
function getSiteStatusLabel(siteStatus) {
  let siteStatusLabel = '';
  switch (siteStatus) {
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.SITE_STATUS_NEEDS_ATTENTION:
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.SITE_STATUS_REQUIRES_REVIEW:
      siteStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You need to fix some things before your site is ready.', 'google-site-kit');
      break;
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.SITE_STATUS_GETTING_READY:
      siteStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site is getting ready.', 'google-site-kit');
      break;
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.SITE_STATUS_READY:
      siteStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site is ready for ads.', 'google-site-kit');
      break;
    case _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_2__.SITE_STATUS_READY_NO_AUTO_ADS:
      siteStatusLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site is ready, with auto-ads disabled.', 'google-site-kit');
      break;
  }
  return siteStatusLabel;
}

/**
 * Returns translatable site snippet label.
 *
 * @since 1.93.0
 *
 * @param {boolean} useSnippet  The adsense site snippet flag.
 * @param {string}  existingTag The adsense existing tag.
 * @param {string}  clientID    The client ID.
 * @return {string} The site snippet label.
 */
function getSnippetLabel(useSnippet, existingTag, clientID) {
  let snippetLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The AdSense code has not been placed on your site', 'google-site-kit');
  if (useSnippet) {
    snippetLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The AdSense code has been placed on your site', 'google-site-kit');
  } else if (existingTag && existingTag === clientID) {
    snippetLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The AdSense code has been placed by another plugin or theme', 'google-site-kit');
  }
  return snippetLabel;
}

/**
 * Returns translatable auto ads disabled message.
 *
 * @since 1.93.0
 *
 * @param {Array} autoAdsDisabled The array of user types strings.
 * @return {string} The auto ads disabled message.
 */
function getAutoAdsDisabledMessage(autoAdsDisabled) {
  let autoAdsDisabledMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ads are currently displayed for all visitors', 'google-site-kit');
  if (autoAdsDisabled.includes(_js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.AUTO_ADS_LOGGED_IN_USERS) && autoAdsDisabled.includes(_js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.AUTO_ADS_CONTENT_CREATORS)) {
    autoAdsDisabledMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All logged-in users and users who can write posts', 'google-site-kit');
  } else if (autoAdsDisabled.includes(_js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.AUTO_ADS_LOGGED_IN_USERS)) {
    autoAdsDisabledMessage = _js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.trackingExclusionLabels[_js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.AUTO_ADS_LOGGED_IN_USERS];
  } else if (autoAdsDisabled.includes(_js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.AUTO_ADS_CONTENT_CREATORS)) {
    autoAdsDisabledMessage = _js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.trackingExclusionLabels[_js_modules_adsense_components_common_AutoAdExclusionSwitches__WEBPACK_IMPORTED_MODULE_1__.AUTO_ADS_CONTENT_CREATORS];
  }
  return autoAdsDisabledMessage;
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/Content.js":
/*!******************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/AdBlockingRecoveryApp/Content.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Content)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _svg_graphics_ad_blocking_recovery_setup_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/svg/graphics/ad-blocking-recovery-setup.svg */ "./svg/graphics/ad-blocking-recovery-setup.svg");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




function Content({
  children
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.useBreakpoint)();
  const isDesktopWidthOrLarger = ![_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_TABLET, _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_SMALL].includes(breakpoint);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Grid, {
    className: "googlesitekit-ad-blocking-recovery__content",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Row, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
        mdSize: 8,
        lgSize: 8,
        children: children
      }), isDesktopWidthOrLarger && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_0__.Cell, {
        className: "googlesitekit-ad-blocking-recovery__hero-graphic",
        lgSize: 4,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_svg_graphics_ad_blocking_recovery_setup_svg__WEBPACK_IMPORTED_MODULE_1__["default"], {})
      })]
    })
  });
}
Content.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().node)
};

/***/ }),

/***/ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/SetupMain.js":
/*!********************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/AdBlockingRecoveryApp/SetupMain.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupMain)
/* harmony export */ });
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_PageHeader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/PageHeader */ "./js/components/PageHeader.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_components_Stepper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Stepper */ "./js/components/Stepper/index.js");
/* harmony import */ var _js_components_Stepper_Step__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Stepper/Step */ "./js/components/Stepper/Step.js");
/* harmony import */ var _js_components_layout_Layout__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/layout/Layout */ "./js/components/layout/Layout.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _Content__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Content */ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/Content.js");
/* harmony import */ var _steps_CreateMessageStep__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./steps/CreateMessageStep */ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/steps/CreateMessageStep.js");
/* harmony import */ var _steps_PlaceTagsStep__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./steps/PlaceTagsStep */ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/steps/PlaceTagsStep.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */




















function SetupMain() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__["default"])();
  const settingsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_SITE).getAdminURL('googlesitekit-settings'));
  const adSenseSettingsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_SITE).getModuleSettingsURL(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_19__.MODULE_SLUG_ADSENSE));
  const createMessageCTAClicked = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !!select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_UI).getValue(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.AD_BLOCKING_RECOVERY_SETUP_CREATE_MESSAGE_CTA_CLICKED));
  const dashboardURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_SITE).getAdminURL('googlesitekit-dashboard'));
  const initialActiveStep = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const statusStepMap = {
      [_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS.TAG_PLACED]: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP.CREATE_MESSAGE,
      [_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS.SETUP_CONFIRMED]: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP.COMPLETE
    };
    const adBlockingRecoverySetupStatus = select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ADSENSE).getAdBlockingRecoverySetupStatus();
    if (adBlockingRecoverySetupStatus === undefined) {
      return undefined;
    }
    return statusStepMap[adBlockingRecoverySetupStatus] || _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP.PLACE_TAGS;
  });
  const setupSuccessURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_21__.addQueryArgs)(dashboardURL, {
    notification: 'ad_blocking_recovery_setup_success'
  });
  const adsenseAccountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ADSENSE).getAccountID());
  const privacyMessagingURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ADSENSE).getServiceURL({
    path: `/${adsenseAccountID}/privacymessaging/ad_blocking`
  }));
  const {
    saveSettings,
    setAdBlockingRecoverySetupStatus,
    setUseAdBlockingRecoverySnippet,
    setUseAdBlockingRecoveryErrorSnippet
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ADSENSE);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_LOCATION);
  const [activeStep, setActiveStep] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_22__.useState)(initialActiveStep);
  const onCancel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_22__.useCallback)(async () => {
    if (activeStep === 0) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.trackEvent)(`${viewContext}_adsense-abr`, 'cancel_setup', 'on_place_tag_step');
      if (document.referrer.includes(settingsURL)) {
        return navigateTo(adSenseSettingsURL);
      }
      return navigateTo(dashboardURL);
    }
    if (createMessageCTAClicked) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.trackEvent)(`${viewContext}_adsense-abr`, 'cancel_setup', 'on_final_step');
      return navigateTo(adSenseSettingsURL);
    }
    setAdBlockingRecoverySetupStatus('');
    setUseAdBlockingRecoverySnippet(false);
    setUseAdBlockingRecoveryErrorSnippet(false);
    const {
      error
    } = await saveSettings();
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.trackEvent)(`${viewContext}_adsense-abr`, 'cancel_setup', 'on_create_message_step');
    if (!error) {
      if (document.referrer.includes(settingsURL)) {
        navigateTo(adSenseSettingsURL);
      } else {
        navigateTo(dashboardURL);
      }
    }
    return null;
  }, [activeStep, adSenseSettingsURL, createMessageCTAClicked, dashboardURL, navigateTo, saveSettings, setAdBlockingRecoverySetupStatus, setUseAdBlockingRecoveryErrorSnippet, setUseAdBlockingRecoverySnippet, settingsURL, viewContext]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_22__.useEffect)(() => {
    if (undefined === activeStep && undefined !== initialActiveStep) {
      setActiveStep(initialActiveStep);
    }
  }, [activeStep, initialActiveStep]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)(_js_components_layout_Layout__WEBPACK_IMPORTED_MODULE_8__["default"], {
    rounded: true,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_13__.Grid, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_13__.Row, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_13__.Cell, {
          lgSize: 6,
          mdSize: 8,
          smSize: 4,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_PageHeader__WEBPACK_IMPORTED_MODULE_4__["default"], {
            className: "googlesitekit-heading-3 googlesitekit-ad-blocking-recovery__heading",
            title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad Blocking Recovery', 'google-site-kit'),
            fullWidth: true
          })
        })
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)(_Content__WEBPACK_IMPORTED_MODULE_16__["default"], {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)(_js_components_Stepper__WEBPACK_IMPORTED_MODULE_6__["default"], {
        activeStep: activeStep,
        className: "googlesitekit-ad-blocking-recovery__steps",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Stepper_Step__WEBPACK_IMPORTED_MODULE_7__["default"], {
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enable ad blocking recovery message (required)', 'google-site-kit'),
          className: "googlesitekit-ad-blocking-recovery__step googlesitekit-ad-blocking-recovery__step-place-tags",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_steps_PlaceTagsStep__WEBPACK_IMPORTED_MODULE_18__["default"], {
            setActiveStep: setActiveStep
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Stepper_Step__WEBPACK_IMPORTED_MODULE_7__["default"], {
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create your site’s ad blocking recovery message (required)', 'google-site-kit'),
          className: "googlesitekit-ad-blocking-recovery__step googlesitekit-ad-blocking-recovery__step-create-message",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_steps_CreateMessageStep__WEBPACK_IMPORTED_MODULE_17__["default"], {})
        })]
      }), _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP.COMPLETE === activeStep && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)("div", {
        className: "googlesitekit-ad-blocking-recovery__complete-content",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__["default"], {
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create and publish an ad blocking recovery message in AdSense', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__["default"], {
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site visitors will be given the option to allow ads on your site. You can also present them with other options to fund your site (optional)', 'google-site-kit')
        })]
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("div", {
      className: "googlesitekit-ad-blocking-recovery__footer googlesitekit-ad-blocking-recovery__buttons",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("div", {
        className: "googlesitekit-ad-blocking-recovery__footer-cancel",
        children: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP.COMPLETE === activeStep ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsxs)("div", {
          className: "googlesitekit-ad-blocking-recovery__complete-actions",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.SpinnerButton, {
            href: setupSuccessURL,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('My message is ready', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
            href: privacyMessagingURL,
            external: true,
            hideExternalIndicator: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create message', 'google-site-kit')
          })]
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
          onClick: onCancel,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Cancel', 'google-site-kit')
        })
      })
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/index.js":
/*!****************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/AdBlockingRecoveryApp/index.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AdBlockingRecoveryApp)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Header__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Header */ "./js/components/Header.js");
/* harmony import */ var _js_components_help_HelpMenu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/help/HelpMenu */ "./js/components/help/HelpMenu.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _SetupMain__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SetupMain */ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/SetupMain.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdBlockingRecoveryApp component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





function AdBlockingRecoveryApp() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Header__WEBPACK_IMPORTED_MODULE_0__["default"], {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_help_HelpMenu__WEBPACK_IMPORTED_MODULE_1__["default"], {})
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      className: "googlesitekit-ad-blocking-recovery googlesitekit-module-page",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Grid, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Row, {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_2__.Cell, {
            size: 12,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_SetupMain__WEBPACK_IMPORTED_MODULE_3__["default"], {})
          })
        })
      })
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/steps/CreateMessageStep.js":
/*!**********************************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/AdBlockingRecoveryApp/steps/CreateMessageStep.js ***!
  \**********************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CreateMessageStep)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */












function CreateMessageStep() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const adsenseAccountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ADSENSE).getAccountID());
  const privacyMessagingURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ADSENSE).getServiceURL({
    path: `/${adsenseAccountID}/privacymessaging/ad_blocking`
  }));
  const dashboardURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getAdminURL('googlesitekit-dashboard'));
  const setupSuccessURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_13__.addQueryArgs)(dashboardURL, {
    notification: 'ad_blocking_recovery_setup_success'
  });
  const isSaving = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ADSENSE).isDoingSaveSettings() || select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_LOCATION).isNavigatingTo(setupSuccessURL));
  const createMessageCTAClicked = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => !!select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_UI).getValue(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.AD_BLOCKING_RECOVERY_SETUP_CREATE_MESSAGE_CTA_CLICKED));
  const saveSettingsError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ADSENSE).getErrorForAction('saveSettings'));
  const {
    saveSettings,
    setAdBlockingRecoverySetupStatus
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ADSENSE);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_LOCATION);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_UI);
  const onCTAClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.useCallback)(async () => {
    if (!createMessageCTAClicked) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr`, 'create_message', 'primary_cta');
      setValue(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.AD_BLOCKING_RECOVERY_SETUP_CREATE_MESSAGE_CTA_CLICKED, true);
      return;
    }
    setAdBlockingRecoverySetupStatus(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS.SETUP_CONFIRMED);
    const {
      error
    } = await saveSettings();
    if (!error) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr`, 'confirm_message_ready');
      navigateTo(setupSuccessURL);
    }
  }, [createMessageCTAClicked, navigateTo, saveSettings, setAdBlockingRecoverySetupStatus, setValue, setupSuccessURL, viewContext]);
  const onSecondaryCTAClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.useCallback)(async () => {
    setAdBlockingRecoverySetupStatus(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS.SETUP_CONFIRMED);
    const {
      error
    } = await saveSettings();
    if (!error) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr`, 'confirm_message_ready_secondary_cta');
      navigateTo(setupSuccessURL);
    }
  }, [setAdBlockingRecoverySetupStatus, saveSettings, navigateTo, setupSuccessURL, viewContext]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_15__["default"])(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr`, 'setup_create_message');
  });
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.useEffect)(() => {
    if (createMessageCTAClicked) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr`, 'setup_final_step');
    }
  }, [createMessageCTAClicked, viewContext]);
  function handleSecondaryCTAClick() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_adsense-abr`, 'create_message', 'secondary_cta');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create and publish an ad blocking recovery message in AdSense', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site visitors will be given the option to allow ads on your site. You can also present them with other options to fund your site (optional)', 'google-site-kit')
    }), saveSettingsError && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__["default"], {
      error: saveSettingsError
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      className: "googlesitekit-ad-blocking-recovery__create-message-footer",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
        className: "googlesitekit-ad-blocking-recovery__create-message-footer-actions",
        children: createMessageCTAClicked ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.SpinnerButton, {
            onClick: onCTAClick,
            isSaving: isSaving,
            disabled: isSaving,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('My message is ready', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
            onClick: handleSecondaryCTAClick,
            href: privacyMessagingURL,
            external: true,
            hideExternalIndicator: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create message', 'google-site-kit')
          })]
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_14__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
            href: privacyMessagingURL,
            target: "_blank",
            onClick: onCTAClick,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create message', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
            onClick: onSecondaryCTAClick,
            disabled: isSaving,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('I published my message', 'google-site-kit')
          })]
        })
      }), createMessageCTAClicked && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
        className: "googlesitekit-ad-blocking-recovery__create-message-footer-note",
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Ad blocking recovery only works if you’ve created and published your message in AdSense', 'google-site-kit')
      })]
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/steps/PlaceTagsStep.js":
/*!******************************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/AdBlockingRecoveryApp/steps/PlaceTagsStep.js ***!
  \******************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PlaceTagsStep)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_14___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_14__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */










function PlaceTagsStep({
  setActiveStep
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const useAdBlockingRecoveryErrorSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getUseAdBlockingRecoveryErrorSnippet());
  const isSaving = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).isDoingSaveSettings() || select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).isFetchingSyncAdBlockingRecoveryTags());
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getErrorForAction('syncAdBlockingRecoveryTags') || select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE).getErrorForAction('saveSettings'));
  const learnMoreURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getDocumentationLinkURL('ad-blocking-recovery'));
  const {
    saveSettings,
    setAdBlockingRecoverySetupStatus,
    setUseAdBlockingRecoverySnippet,
    setUseAdBlockingRecoveryErrorSnippet,
    syncAdBlockingRecoveryTags
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ADSENSE);
  const onErrorProtectionTagOptionChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(({
    target
  }) => {
    const isChecked = !!target.checked;
    setUseAdBlockingRecoveryErrorSnippet(isChecked);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_adsense-abr`, isChecked ? 'check_box' : 'uncheck_box');
  }, [setUseAdBlockingRecoveryErrorSnippet, viewContext]);
  const onCTAClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(async () => {
    const {
      error: syncError
    } = await syncAdBlockingRecoveryTags();
    if (syncError) {
      return;
    }
    setAdBlockingRecoverySetupStatus(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS.TAG_PLACED);
    setUseAdBlockingRecoverySnippet(true);
    const {
      error: saveError
    } = await saveSettings();
    if (saveError) {
      return;
    }
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_adsense-abr`, 'setup_enable_tag');
    setActiveStep(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP.CREATE_MESSAGE);
  }, [saveSettings, setActiveStep, setAdBlockingRecoverySetupStatus, setUseAdBlockingRecoverySnippet, syncAdBlockingRecoveryTags, viewContext]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_12__["default"])(() => {
    // Error snippet option is enabled by default.
    if (!useAdBlockingRecoveryErrorSnippet) {
      setUseAdBlockingRecoveryErrorSnippet(true);
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_adsense-abr`, 'setup_place_tag');
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Identify site visitors that have an ad blocker browser extension installed. These site visitors will see the ad blocking recovery message created in AdSense.', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Checkbox, {
      checked: useAdBlockingRecoveryErrorSnippet,
      id: "ad-blocking-recovery-error-protection-tag-checkbox",
      name: "ad-blocking-recovery-error-protection-tag-checkbox",
      value: "1",
      onChange: onErrorProtectionTagOptionChange,
      alignLeft: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enable error protection code (optional)', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
      className: "googlesitekit-ad-blocking-recovery__error-protection-tag-info",
      children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('If a site visitor’s ad blocker browser extension blocks the message you create in AdSense, a default, non-customizable ad blocking recovery message will display instead. <a>Learn more</a>', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
          href: learnMoreURL,
          external: true
        })
      })
    }), error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__["default"], {
      error: error
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.SpinnerButton, {
      onClick: onCTAClick,
      isSaving: isSaving,
      disabled: isSaving,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enable message', 'google-site-kit')
    })]
  });
}
PlaceTagsStep.propTypes = {
  setActiveStep: (prop_types__WEBPACK_IMPORTED_MODULE_14___default().func)
};

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccount.js":
/*!*************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccount.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupAccount)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/util/status */ "./js/modules/adsense/util/status.js");
/* harmony import */ var _SetupAccountSite__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SetupAccountSite */ "./js/modules/adsense/components/setup/SetupAccountSite/index.js");
/* harmony import */ var _SetupAccountNoClient__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupAccountNoClient */ "./js/modules/adsense/components/setup/SetupAccountNoClient.js");
/* harmony import */ var _SetupAccountCreateSite__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SetupAccountCreateSite */ "./js/modules/adsense/components/setup/SetupAccountCreateSite.js");
/* harmony import */ var _SetupAccountPendingTasks__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SetupAccountPendingTasks */ "./js/modules/adsense/components/setup/SetupAccountPendingTasks.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense SetupAccount component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */









function SetupAccount({
  account,
  finishSetup
}) {
  const {
    _id: accountID,
    state: accountState
  } = account;
  const clientID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getClientID());
  const site = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getCurrentSite(accountID));
  const afcClient = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getAFCClient(accountID));
  const {
    setClientID,
    setAccountStatus,
    setSiteStatus
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
    if (afcClient?._id && clientID !== afcClient._id) {
      setClientID(afcClient._id);
    } else if (afcClient === null && !!clientID) {
      setClientID('');
    }
  }, [afcClient, clientID, setClientID]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
    if (site === null) {
      setSiteStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.SITE_STATUS_NONE);
    }
  }, [setSiteStatus, site]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useEffect)(() => {
    // Do nothing if site isn't loaded yet.
    if (site === undefined) {
      return;
    }
    if (!clientID) {
      setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.ACCOUNT_STATUS_NO_CLIENT);
    } else if (accountState === _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_NEEDS_ATTENTION) {
      setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.ACCOUNT_STATUS_NEEDS_ATTENTION);
    } else if (afcClient?.state === _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_REQUIRES_REVIEW) {
      setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.ACCOUNT_STATUS_CLIENT_REQUIRES_REVIEW);
    } else if (afcClient?.state === _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_GETTING_READY) {
      setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.ACCOUNT_STATUS_CLIENT_GETTING_READY);
    } else {
      setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.ACCOUNT_STATUS_READY);
    }
  }, [accountState, afcClient, clientID, setAccountStatus, site]);

  // Show the progress bar if site isn't loaded yet.
  if (site === undefined) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {});
  }
  if (!clientID) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SetupAccountNoClient__WEBPACK_IMPORTED_MODULE_5__["default"], {});
  }
  if (site === null) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SetupAccountCreateSite__WEBPACK_IMPORTED_MODULE_6__["default"], {});
  }
  if (accountState === _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_NEEDS_ATTENTION || afcClient?.state === _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_REQUIRES_REVIEW || afcClient?.state === _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_GETTING_READY) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SetupAccountPendingTasks__WEBPACK_IMPORTED_MODULE_7__["default"], {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_SetupAccountSite__WEBPACK_IMPORTED_MODULE_4__["default"], {
    site: site,
    finishSetup: finishSetup
  });
}
SetupAccount.propTypes = {
  account: prop_types__WEBPACK_IMPORTED_MODULE_10___default().shape({
    _id: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
    state: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string)
  }),
  finishSetup: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func)
};

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountCreateSite.js":
/*!***********************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountCreateSite.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupAccountCreateSite)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupAccountCreateSite component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */









function SetupAccountCreateSite() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const addSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getServiceAccountManageSiteURL());
  const addSiteHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useCallback)(event => {
    event.preventDefault();
    (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(`${viewContext}_adsense`, 'create_site');
    __webpack_require__.g.open(addSiteURL, '_blank');
  }, [addSiteURL, viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
      as: "h3",
      type: "title",
      size: "large",
      className: "googlesitekit-setup-module__title",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add this site to your AdSense account', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_4__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_8__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('We’ve detected that you haven’t added this site to your AdSense account yet', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "googlesitekit-setup-module__action",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        onClick: addSiteHandler,
        href: addSiteURL,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Add site to AdSense', 'google-site-kit')
      })
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountNoClient.js":
/*!*********************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountNoClient.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupAccountNoClient)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_SupportLink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/SupportLink */ "./js/components/SupportLink.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupAccountNoClient component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */








function SetupAccountNoClient() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const onButtonClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_adsense`, 'apply_afc');
  }, [viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_6__["default"], {
      as: "h3",
      type: "title",
      size: "large",
      className: "googlesitekit-setup-module__title",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Looks like you need to upgrade your AdSense account', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_3__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__["default"], {
      children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('To start using AdSense on your website, you need to upgrade your account to add “AdSense for content”. <a>Learn more</a>', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_SupportLink__WEBPACK_IMPORTED_MODULE_2__["default"], {
          path: "/adsense/answer/6023158",
          "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more about updating your AdSense account', 'google-site-kit'),
          external: true
        })
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
      className: "googlesitekit-setup-module__action",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
        href: "https://www.google.com/adsense",
        target: "_blank",
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more about updating your AdSense account', 'google-site-kit'),
        onClick: onButtonClick,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Apply now', 'google-site-kit')
      })
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountPendingTasks.js":
/*!*************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountPendingTasks.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupAccountPendingTasks)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SetupUseSnippetSwitch */ "./js/modules/adsense/components/setup/SetupUseSnippetSwitch.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupAccountPendingTasks component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */










function SetupAccountPendingTasks() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const onButtonClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_adsense`, 'review_tasks');
  }, [viewContext]);
  const serviceAccountURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getServiceAccountURL());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_8__["default"], {
      as: "h3",
      type: "title",
      size: "large",
      className: "googlesitekit-setup-module__title",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your account isn’t ready to show ads yet', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_5__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_9__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You need to fix some things before we can connect Site Kit to your AdSense account', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_3__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "googlesitekit-setup-module__action",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        onClick: onButtonClick,
        href: serviceAccountURL,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Review AdSense account', 'google-site-kit')
      })
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountSite/GettingReady.js":
/*!******************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountSite/GettingReady.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ GettingReady)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Root/ViewContextContext */ "./js/components/Root/ViewContextContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupAccountSiteUI */ "./js/modules/adsense/components/setup/SetupAccountSite/SetupAccountSiteUI.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Setup Account Site Getting Ready component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function GettingReady() {
  const viewContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useContext)(_js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__["default"]);
  const reviewSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getServiceAccountManageSitesURL());
  const reviewSiteHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(event => {
    event.preventDefault();
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_adsense`, 'review_site_state', 'getting_ready');
    __webpack_require__.g.open(reviewSiteURL, '_blank');
  }, [reviewSiteURL, viewContext]);
  const heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site is getting ready', 'google-site-kit');
  const description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This usually takes a few days, but in some cases can take a few weeks. You’ll get an email from AdSense as soon as they have run some checks on your site.', 'google-site-kit');
  const primaryButton = {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Review site in AdSense', 'google-site-kit'),
    href: reviewSiteURL,
    onClick: reviewSiteHandler
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_5__["default"], {
    heading: heading,
    description: description,
    primaryButton: primaryButton
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountSite/NeedsAttention.js":
/*!********************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountSite/NeedsAttention.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ NeedsAttention)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Root/ViewContextContext */ "./js/components/Root/ViewContextContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupAccountSiteUI */ "./js/modules/adsense/components/setup/SetupAccountSite/SetupAccountSiteUI.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Setup Account Site Needs Attention component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function NeedsAttention() {
  const viewContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useContext)(_js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__["default"]);
  const reviewSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getServiceAccountManageSitesURL());
  const reviewSiteHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(event => {
    event.preventDefault();
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_adsense`, 'review_site_state', 'needs_attention');
    __webpack_require__.g.open(reviewSiteURL, '_blank');
  }, [reviewSiteURL, viewContext]);
  const heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site isn’t ready to show ads yet', 'google-site-kit');
  const description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You need to fix some things with this site before we can connect Site Kit to your AdSense account', 'google-site-kit');
  const primaryButton = {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Review site in AdSense', 'google-site-kit'),
    href: reviewSiteURL,
    onClick: reviewSiteHandler
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_5__["default"], {
    heading: heading,
    description: description,
    primaryButton: primaryButton
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountSite/Ready.js":
/*!***********************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountSite/Ready.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ Ready)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Root/ViewContextContext */ "./js/components/Root/ViewContextContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SetupAccountSiteUI */ "./js/modules/adsense/components/setup/SetupAccountSite/SetupAccountSiteUI.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Setup Account Site Ready component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







function Ready({
  site,
  finishSetup
}) {
  const [acknowledgedDisabledAutoAds, setAcknowledgedDisabledAutoAds] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useState)(false);
  const viewContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useContext)(_js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__["default"]);
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getExistingTag());
  const enableAutoAdsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getServiceAccountSiteAdsPreviewURL());
  const isDoingSubmitChanges = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).isDoingSubmitChanges());
  const {
    completeSiteSetup,
    completeAccountSetup
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI);
  const enableAutoAdsHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(event => {
    event.preventDefault();
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_adsense`, 'enable_auto_ads');
    __webpack_require__.g.open(enableAutoAdsURL, '_blank');
  }, [enableAutoAdsURL, viewContext]);
  const acknowledgeDisabledAutoAdsHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(event => {
    event.preventDefault();
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_adsense`, 'disable_auto_ads');
    setAcknowledgedDisabledAutoAds(true);
  }, [viewContext]);
  const continueSetupHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)(async () => {
    if (isDoingSubmitChanges) {
      return;
    }

    // Temporarily suspend ability to perform background submission(s)
    // pending completion of the below async tasks. This prevents a
    // rare race condition from occurring.
    // @see https://github.com/google/site-kit-wp/issues/5614.
    setValue(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.BACKGROUND_SUBMIT_SUSPENDED, true);
    const successSiteSetupCompletion = await completeSiteSetup();
    const successAccountSetupCompletion = await completeAccountSetup();

    // Re-enable ability to perform background submission(s).
    setValue(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.BACKGROUND_SUBMIT_SUSPENDED, false);
    if (successSiteSetupCompletion && successAccountSetupCompletion && typeof finishSetup === 'function') {
      finishSetup();
    }
  }, [isDoingSubmitChanges, setValue, completeSiteSetup, completeAccountSetup, finishSetup]);
  const uiProps = {};
  if (!site.autoAdsEnabled && !acknowledgedDisabledAutoAds) {
    uiProps.heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enable auto ads for your site', 'google-site-kit');
    uiProps.description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('To start serving ads via Site Kit, you need to activate auto ads first. Go to AdSense and enable auto ads for your site.', 'google-site-kit');
    uiProps.primaryButton = {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Enable auto ads', 'google-site-kit'),
      href: enableAutoAdsURL,
      onClick: enableAutoAdsHandler
    };
    if (existingTag) {
      uiProps.description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit recommends enabling auto ads. If your existing AdSense setup relies on individual ad units, you can proceed without enabling auto ads.', 'google-site-kit');
      uiProps.secondaryButton = {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Proceed without enabling auto ads', 'google-site-kit'),
        onClick: acknowledgeDisabledAutoAdsHandler
      };
    }
  } else {
    uiProps.heading = existingTag ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your AdSense account is ready to connect to Site Kit', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site is ready to use AdSense', 'google-site-kit');
    uiProps.description = existingTag ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Connect your AdSense account to see stats on your overall earnings, page CTR, and top earning pages', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit has placed AdSense code on your site to connect your site to AdSense and help you get the most out of ads', 'google-site-kit');
    uiProps.primaryButton = {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Complete setup', 'google-site-kit'),
      onClick: continueSetupHandler
    };
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_6__["default"], {
    ...uiProps
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountSite/RequiresReview.js":
/*!********************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountSite/RequiresReview.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ RequiresReview)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Root/ViewContextContext */ "./js/components/Root/ViewContextContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupAccountSiteUI */ "./js/modules/adsense/components/setup/SetupAccountSite/SetupAccountSiteUI.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Setup Account Site Requires Review component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function RequiresReview() {
  const viewContext = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useContext)(_js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_2__["default"]);
  const reviewSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getServiceAccountManageSitesURL());
  const reviewSiteHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(event => {
    event.preventDefault();
    (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_adsense`, 'review_site_state', 'requires_review');
    __webpack_require__.g.open(reviewSiteURL, '_blank');
  }, [reviewSiteURL, viewContext]);
  const heading = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site requires review', 'google-site-kit');
  const description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('To start serving ads, your site needs to be approved first. Go to AdSense to request the review.', 'google-site-kit');
  const primaryButton = {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Request review in AdSense', 'google-site-kit'),
    href: reviewSiteURL,
    onClick: reviewSiteHandler
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_SetupAccountSiteUI__WEBPACK_IMPORTED_MODULE_5__["default"], {
    heading: heading,
    description: description,
    primaryButton: primaryButton
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountSite/SetupAccountSiteUI.js":
/*!************************************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountSite/SetupAccountSiteUI.js ***!
  \************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupAccountSiteUI)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_modules_adsense_components_setup_SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/components/setup/SetupUseSnippetSwitch */ "./js/modules/adsense/components/setup/SetupUseSnippetSwitch.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Setup Account Site UI component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */









function SetupAccountSiteUI({
  heading,
  description,
  primaryButton,
  secondaryButton
}) {
  const isSaving = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ADSENSE).isDoingSubmitChanges() || select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_LOCATION).isNavigating());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_6__["default"], {
      as: "h3",
      type: "title",
      size: "large",
      className: "googlesitekit-setup-module__title",
      children: heading
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_3__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__["default"], {
      children: description
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_modules_adsense_components_setup_SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "googlesitekit-setup-module__action",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.SpinnerButton, {
        onClick: primaryButton.onClick,
        href: primaryButton.href,
        disabled: isSaving,
        isSaving: isSaving,
        children: primaryButton.label
      }), secondaryButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
        className: "googlesitekit-setup-module__sub-action",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
          onClick: secondaryButton.onClick,
          tertiary: true,
          children: secondaryButton.label
        })
      })]
    })]
  });
}
SetupAccountSiteUI.propTypes = {
  heading: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string).isRequired,
  description: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string).isRequired,
  primaryButton: prop_types__WEBPACK_IMPORTED_MODULE_10___default().shape({
    label: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
    href: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
    onClick: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func)
  }).isRequired,
  secondaryButton: prop_types__WEBPACK_IMPORTED_MODULE_10___default().shape({
    label: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
    onClick: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func)
  })
};

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupAccountSite/index.js":
/*!***********************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupAccountSite/index.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupAccountSite)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_11__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/util/status */ "./js/modules/adsense/util/status.js");
/* harmony import */ var _NeedsAttention__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./NeedsAttention */ "./js/modules/adsense/components/setup/SetupAccountSite/NeedsAttention.js");
/* harmony import */ var _GettingReady__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./GettingReady */ "./js/modules/adsense/components/setup/SetupAccountSite/GettingReady.js");
/* harmony import */ var _RequiresReview__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./RequiresReview */ "./js/modules/adsense/components/setup/SetupAccountSite/RequiresReview.js");
/* harmony import */ var _Ready__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Ready */ "./js/modules/adsense/components/setup/SetupAccountSite/Ready.js");
/* harmony import */ var _js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupAccountSite component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */









function SetupAccountSite({
  site,
  finishSetup
}) {
  const {
    autoAdsEnabled,
    state
  } = site;
  const {
    setSiteStatus
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useEffect)(() => {
    let siteStatus;
    switch (state) {
      case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_NEEDS_ATTENTION:
        siteStatus = _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.SITE_STATUS_NEEDS_ATTENTION;
        break;
      case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_REQUIRES_REVIEW:
        siteStatus = _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.SITE_STATUS_REQUIRES_REVIEW;
        break;
      case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_GETTING_READY:
        siteStatus = _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.SITE_STATUS_GETTING_READY;
        break;
      case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_READY:
        siteStatus = autoAdsEnabled ? _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.SITE_STATUS_READY : _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_3__.SITE_STATUS_READY_NO_AUTO_ADS;
        break;
    }
    if (siteStatus) {
      setSiteStatus(siteStatus);
    }
  }, [autoAdsEnabled, setSiteStatus, state]);
  switch (state) {
    case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_NEEDS_ATTENTION:
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_NeedsAttention__WEBPACK_IMPORTED_MODULE_4__["default"], {});
    case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_REQUIRES_REVIEW:
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_RequiresReview__WEBPACK_IMPORTED_MODULE_6__["default"], {});
    case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_GETTING_READY:
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_GettingReady__WEBPACK_IMPORTED_MODULE_5__["default"], {});
    case _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.API_STATE_READY:
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_Ready__WEBPACK_IMPORTED_MODULE_7__["default"], {
        site: site,
        finishSetup: finishSetup
      });
    default:
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_8__["default"], {
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: invalid site state identifier */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Invalid site state %s', 'google-site-kit'), state),
        skipRetryMessage: true
      });
  }
}
SetupAccountSite.propTypes = {
  site: prop_types__WEBPACK_IMPORTED_MODULE_11___default().shape({
    autoAdsEnabled: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().bool),
    state: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().string)
  }).isRequired,
  finishSetup: (prop_types__WEBPACK_IMPORTED_MODULE_11___default().func)
};

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupCreateAccount.js":
/*!*******************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupCreateAccount.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupCreateAccount)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_components_SupportLink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/SupportLink */ "./js/components/SupportLink.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_util_parsing__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/util/parsing */ "./js/modules/adsense/util/parsing.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense SetupCreateAccount component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */












function SetupCreateAccount() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const eventCategory = `${viewContext}_adsense`;
  const userEmail = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getEmail());
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getExistingTag());
  const signUpURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ADSENSE).getServiceCreateAccountURL());
  const createAccountHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.useCallback)(async event => {
    event.preventDefault();
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(eventCategory, 'create_account');
    __webpack_require__.g.open(signUpURL, '_blank');
  }, [signUpURL, eventCategory]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_13__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_10__["default"], {
      as: "h3",
      type: "title",
      size: "large",
      className: "googlesitekit-setup-module__title",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create your AdSense account', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_8__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_11__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Once you create your account, Site Kit will place AdSense code on every page across your site. This means your site will be automatically optimized to help you earn money from your content.', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_8__.UserProfile, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
      className: "googlesitekit-setup-module__action",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        onClick: createAccountHandler,
        href: signUpURL,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create AdSense account', 'google-site-kit')
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("p", {
      className: "googlesitekit-setup-module__footer-text",
      children: [existingTag && (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: 1: client ID, 2: user email address, 3: account ID */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit detected AdSense code %1$s on your page. We recommend you remove that code or add %2$s as a user to the AdSense account %3$s.', 'google-site-kit'), existingTag, userEmail, (0,_js_modules_adsense_util_parsing__WEBPACK_IMPORTED_MODULE_5__.parseAccountID)(existingTag)), !existingTag && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_14__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: user email address */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Already use AdSense? Add %s as a user to an existing AdSense account. <a>Learn more</a>', 'google-site-kit'), userEmail), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_SupportLink__WEBPACK_IMPORTED_MODULE_3__["default"], {
          path: "/adsense/answer/2659101",
          "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Learn more about adding a user to an existing AdSense account', 'google-site-kit'),
          external: true
        })
      })]
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupMain.js":
/*!**********************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupMain.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupMain)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useUpdateEffect.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_21___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_21__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _svg_graphics_adsense_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/graphics/adsense.svg */ "./svg/graphics/adsense.svg");
/* harmony import */ var _SetupAccount__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SetupAccount */ "./js/modules/adsense/components/setup/SetupAccount.js");
/* harmony import */ var _SetupCreateAccount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupCreateAccount */ "./js/modules/adsense/components/setup/SetupCreateAccount.js");
/* harmony import */ var _SetupSelectAccount__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SetupSelectAccount */ "./js/modules/adsense/components/setup/SetupSelectAccount.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_components_notifications_AdBlockerWarning__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/notifications/AdBlockerWarning */ "./js/components/notifications/AdBlockerWarning.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/adsense/util/status */ "./js/modules/adsense/util/status.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useRefocus__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/hooks/useRefocus */ "./js/hooks/useRefocus.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Main setup component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */


















function SetupMain({
  finishSetup
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__["default"])();
  const eventCategory = `${viewContext}_adsense`;
  const {
    resetAccounts,
    resetClients,
    resetSites,
    setAccountID,
    setAccountStatus,
    submitChanges
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE);
  const [isAwaitingBackgroundSubmit, setIsAwaitingBackgroundSubmit] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useState)(false);
  // Submit changes for determined parameters in the background when they are valid.
  const [isSubmittingInBackground, setIsSubmittingInBackground] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useState)(false);
  const backgroundSubmissionSuspended = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !!select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_16__.CORE_UI).getValue(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.BACKGROUND_SUBMIT_SUSPENDED));
  const isAdBlockerActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).isAdBlockerActive());
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).getAccounts());
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).getAccountID());
  const hasAccountIDChanged = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).hasSettingChanged('accountID'));
  const hasClientIDChanged = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).hasSettingChanged('clientID'));
  // Check whether settings differ from server and are valid.
  const canSubmitChanges = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).canSubmitChanges());
  const clientID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).getClientID());
  const accountStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).getAccountStatus());
  const hasAccountStatusChanged = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).hasSettingChanged('accountStatus'));
  const siteStatus = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).getSiteStatus());
  const hasSiteStatusChanged = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).hasSettingChanged('siteStatus'));
  const hasErrors = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).hasErrors());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).hasFinishedResolution('getAccounts'));
  const userEmail = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).getEmail());
  const referenceSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__.CORE_SITE).getReferenceSiteURL());
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ADSENSE).getExistingTag());
  const account = accounts?.find(({
    _id
  }) => _id === accountID);
  (0,react_use__WEBPACK_IMPORTED_MODULE_20__["default"])(() => {
    if (hasAccountIDChanged && accountID !== undefined || hasClientIDChanged && clientID !== undefined || hasAccountStatusChanged && accountStatus !== undefined || hasSiteStatusChanged && siteStatus !== undefined) {
      setIsAwaitingBackgroundSubmit(true);
    }
  }, [accountID, hasAccountIDChanged, clientID, hasClientIDChanged, accountStatus, hasAccountStatusChanged, siteStatus, hasSiteStatusChanged]);

  // Update current account ID setting on-the-fly.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useEffect)(() => {
    if (!Array.isArray(accounts)) {
      return;
    }
    let newAccountID;
    if (accounts.length === 1 && (!accountID || accounts[0]._id !== accountID)) {
      newAccountID = accounts[0]._id;
    } else if (accounts.length === 0 && !!accountID) {
      newAccountID = '';
    }
    if (newAccountID !== undefined) {
      setAccountID(newAccountID);
      // Set flag to await background submission.
      setIsAwaitingBackgroundSubmit(true);
    }
  }, [accounts, accountID, setAccountID]);

  // Update account status on-the-fly.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useEffect)(() => {
    if (accounts?.length === 0) {
      setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_13__.ACCOUNT_STATUS_NONE);
    } else if (accounts?.length > 1 && !accountID) {
      setAccountStatus(_js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_13__.ACCOUNT_STATUS_MULTIPLE);
    }
  }, [setAccountStatus, accountID, accounts]);

  // If a background submission should happen and changes are valid to be
  // submitted, do that here. This is wrapped in a separate useEffect hook
  // and relies on isAwaitingBackgroundSubmit since the above useEffect hook
  // must not depend on canSubmitChanges, since that is also updated when
  // other than the above four settings are updated.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useEffect)(() => {
    if (!isAwaitingBackgroundSubmit || isSubmittingInBackground || !canSubmitChanges || backgroundSubmissionSuspended) {
      return;
    }

    // Set flag to false since we are going to run the background submission
    // right now.
    setIsAwaitingBackgroundSubmit(false);

    // Set internal state for submitting in background to avoid sudden
    // rendering of a progress bar.
    (async () => {
      setIsSubmittingInBackground(true);
      await submitChanges();
      setIsSubmittingInBackground(false);
    })();
  }, [isAwaitingBackgroundSubmit, isSubmittingInBackground, canSubmitChanges, submitChanges, backgroundSubmissionSuspended]);
  const reset = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useCallback)(() => {
    // Do not reset if account status has not been determined yet, or
    // if the account is approved.
    if (undefined === accountStatus || _js_modules_adsense_util_status__WEBPACK_IMPORTED_MODULE_13__.ACCOUNT_STATUS_READY === accountStatus) {
      return;
    }

    // Reset all data to force re-fetch.
    resetAccounts();
    resetClients();
    resetSites();
  }, [accountStatus, resetAccounts, resetClients, resetSites]);

  // Reset all fetched data when user re-focuses window.
  (0,_js_hooks_useRefocus__WEBPACK_IMPORTED_MODULE_15__.useRefocus)(reset, 15000);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useEffect)(() => {
    if (accountStatus !== undefined) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(eventCategory, 'receive_account_state', accountStatus);
    }
  }, [eventCategory, accountStatus]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_19__.useEffect)(() => {
    if (siteStatus !== undefined) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(eventCategory, 'receive_site_state', siteStatus);
    }
  }, [eventCategory, siteStatus]);
  let viewComponent;
  if (!hasResolvedAccounts || accountID === undefined || userEmail === undefined || referenceSiteURL === undefined || existingTag === undefined) {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {});
  } else if (hasErrors) {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_8__.ErrorNotices, {
      hasButton: true
    });
  } else if (!accounts?.length) {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_SetupCreateAccount__WEBPACK_IMPORTED_MODULE_5__["default"], {});
  } else if (!accountID) {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_SetupSelectAccount__WEBPACK_IMPORTED_MODULE_6__["default"], {});
  } else {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_SetupAccount__WEBPACK_IMPORTED_MODULE_4__["default"], {
      account: account,
      finishSetup: finishSetup
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div", {
    className: "googlesitekit-setup-module googlesitekit-setup-module--adsense",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div", {
      className: "googlesitekit-setup-module__step",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)("div", {
        className: "googlesitekit-setup-module__logo",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_svg_graphics_adsense_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
          width: "40",
          height: "40"
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_17__["default"], {
        as: "h3",
        className: "googlesitekit-setup-module__title",
        size: "small",
        type: "headline",
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('AdSense', 'Service name', 'google-site-kit')
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div", {
      className: "googlesitekit-setup-module__step",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_notifications_AdBlockerWarning__WEBPACK_IMPORTED_MODULE_9__["default"], {
        moduleSlug: "adsense"
      }), !isAdBlockerActive && viewComponent]
    })]
  });
}
SetupMain.propTypes = {
  finishSetup: (prop_types__WEBPACK_IMPORTED_MODULE_21___default().func)
};

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupSelectAccount.js":
/*!*******************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupSelectAccount.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupSelectAccount)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense SetupSelectAccount component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */




function SetupSelectAccount() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
      as: "h3",
      type: "title",
      size: "large",
      className: "googlesitekit-setup-module__title",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select your AdSense account', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_1__.ErrorNotices, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Looks like you have multiple AdSense accounts associated with your Google account. Select the account to use with Site Kit below.', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      className: "googlesitekit-setup-module__inputs",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_1__.AccountSelect, {})
    })]
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/SetupUseSnippetSwitch.js":
/*!**********************************************************************!*\
  !*** ./js/modules/adsense/components/setup/SetupUseSnippetSwitch.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ SetupUseSnippetSwitch)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util_parsing__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/util/parsing */ "./js/modules/adsense/util/parsing.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AdSense Setup UseSnippet Switch Component.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





function SetupUseSnippetSwitch() {
  const originalUseSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getOriginalUseSnippet());
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getExistingTag());
  const clientID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getClientID());
  const {
    setUseSnippet,
    saveSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE);
  const hasExistingTag = Boolean(existingTag);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__.useEffect)(() => {
    if (hasExistingTag) {
      setUseSnippet(false);
      saveSettings();
    }
  }, [hasExistingTag, saveSettings, setUseSnippet]);
  if (originalUseSnippet && !existingTag || undefined === existingTag || undefined === originalUseSnippet) {
    return null;
  }
  let checkedMessage, uncheckedMessage;
  const checkedMessageExtra = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Make sure to remove the existing AdSense code to avoid conflicts with the code placed by Site Kit', 'google-site-kit');
  if (existingTag === clientID) {
    // Existing tag with permission.
    uncheckedMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You’ve already got an AdSense code on your site for this account. We recommend you use Site Kit to place the code to get the most out of AdSense.', 'google-site-kit');
    checkedMessage = `${uncheckedMessage} ${checkedMessageExtra}`;
  } else if (existingTag) {
    // Existing tag without permission.
    uncheckedMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: 1: existing account ID, 2: current account ID */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site Kit detected AdSense code for a different account %1$s on your site. In order to configure AdSense for your current account %2$s, we recommend you use Site Kit to place the code instead.', 'google-site-kit'), (0,_js_modules_adsense_util_parsing__WEBPACK_IMPORTED_MODULE_3__.parseAccountID)(existingTag), (0,_js_modules_adsense_util_parsing__WEBPACK_IMPORTED_MODULE_3__.parseAccountID)(clientID));
    checkedMessage = `${uncheckedMessage} ${checkedMessageExtra}`;
  } else {
    // No existing tag.
    checkedMessage = checkedMessageExtra;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_4__.UseSnippetSwitch, {
    checkedMessage: checkedMessage,
    uncheckedMessage: uncheckedMessage,
    saveOnChange: true
  });
}

/***/ }),

/***/ "./js/modules/adsense/components/setup/index.js":
/*!******************************************************!*\
  !*** ./js/modules/adsense/components/setup/index.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AdBlockingRecoveryApp: () => (/* reexport safe */ _AdBlockingRecoveryApp__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   SetupAccount: () => (/* reexport safe */ _SetupAccount__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   SetupAccountCreateSite: () => (/* reexport safe */ _SetupAccountCreateSite__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   SetupAccountNoClient: () => (/* reexport safe */ _SetupAccountNoClient__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   SetupAccountPendingTasks: () => (/* reexport safe */ _SetupAccountPendingTasks__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   SetupAccountSite: () => (/* reexport safe */ _SetupAccountSite__WEBPACK_IMPORTED_MODULE_9__["default"]),
/* harmony export */   SetupCreateAccount: () => (/* reexport safe */ _SetupCreateAccount__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   SetupMain: () => (/* reexport safe */ _SetupMain__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   SetupSelectAccount: () => (/* reexport safe */ _SetupSelectAccount__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   SetupUseSnippetSwitch: () => (/* reexport safe */ _SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _AdBlockingRecoveryApp__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AdBlockingRecoveryApp */ "./js/modules/adsense/components/setup/AdBlockingRecoveryApp/index.js");
/* harmony import */ var _SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SetupUseSnippetSwitch */ "./js/modules/adsense/components/setup/SetupUseSnippetSwitch.js");
/* harmony import */ var _SetupMain__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SetupMain */ "./js/modules/adsense/components/setup/SetupMain.js");
/* harmony import */ var _SetupAccount__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SetupAccount */ "./js/modules/adsense/components/setup/SetupAccount.js");
/* harmony import */ var _SetupCreateAccount__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SetupCreateAccount */ "./js/modules/adsense/components/setup/SetupCreateAccount.js");
/* harmony import */ var _SetupSelectAccount__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupSelectAccount */ "./js/modules/adsense/components/setup/SetupSelectAccount.js");
/* harmony import */ var _SetupAccountNoClient__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SetupAccountNoClient */ "./js/modules/adsense/components/setup/SetupAccountNoClient.js");
/* harmony import */ var _SetupAccountCreateSite__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SetupAccountCreateSite */ "./js/modules/adsense/components/setup/SetupAccountCreateSite.js");
/* harmony import */ var _SetupAccountPendingTasks__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SetupAccountPendingTasks */ "./js/modules/adsense/components/setup/SetupAccountPendingTasks.js");
/* harmony import */ var _SetupAccountSite__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./SetupAccountSite */ "./js/modules/adsense/components/setup/SetupAccountSite/index.js");
/**
 * AdSense Setup components.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */












/***/ }),

/***/ "./js/modules/adsense/components/widgets/ConnectAdSenseCTATileWidget.js":
/*!******************************************************************************!*\
  !*** ./js/modules/adsense/components/widgets/ConnectAdSenseCTATileWidget.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ConnectAdSenseCTATileWidget)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/KeyMetrics/ConnectModuleCTATile */ "./js/components/KeyMetrics/ConnectModuleCTATile.js");
/* harmony import */ var _js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/widgets/hooks/useWidgetStateEffect */ "./js/googlesitekit/widgets/hooks/useWidgetStateEffect.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ConnectAdSenseCTATileWidget component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




// Ensure the metadata instance is static when rerendering.

const metadata = {
  moduleSlug: _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__.MODULE_SLUG_ADSENSE
};
function ConnectAdSenseCTATileWidget({
  Widget,
  widgetSlug
}) {
  (0,_js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_1__["default"])(widgetSlug, _js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_0__["default"], metadata);

  // Note that we need to render the `Widget` component as a wrapper here so this component will display
  // correctly when used as a `FallbackComponent` for the `whenActive` HOC. Conversely, when `ConnectModuleCTATile`
  // is rendered as an `OverrideComponent` in `WidgetRenderer` (as a result of multiple adjacent widgets rendering
  // this component and thus sharing the same state), it is wrapped with a `Widget` component - the net
  // result being the ConnectModuleCTATile is correctly wrapped in a `Widget` in both cases.
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Widget, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_0__["default"], {
      ...metadata
    })
  });
}
ConnectAdSenseCTATileWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().elementType).isRequired,
  widgetSlug: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().string).isRequired
};

/***/ }),

/***/ "./js/modules/adsense/components/widgets/TopEarningContentWidget.js":
/*!**************************************************************************!*\
  !*** ./js/modules/adsense/components/widgets/TopEarningContentWidget.js ***!
  \**************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_16___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_16__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _js_modules_analytics_4_components_widgets_ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/adsense/components/common */ "./js/modules/adsense/components/common/index.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _ConnectAdSenseCTATileWidget__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ConnectAdSenseCTATileWidget */ "./js/modules/adsense/components/widgets/ConnectAdSenseCTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopEarningContentWidget component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */
















function TopEarningContentWidget({
  Widget
}) {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getDateRangeDates({
    offsetDays: _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.DATE_RANGE_OFFSET
  }));
  const adSenseAccountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getAccountID());
  const reportOptions = {
    ...dates,
    dimensions: ['pagePath', 'adSourceName'],
    metrics: [{
      name: 'totalAdRevenue'
    }],
    dimensionFilters: {
      adSourceName: `Google AdSense account (${adSenseAccountID})`
    },
    orderby: [{
      metric: {
        metricName: 'totalAdRevenue'
      },
      desc: true
    }],
    limit: 3,
    reportID: 'adsense_top-earning-content-widget_widget_reportOptions'
  };
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => {
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getReport(reportOptions);
  }, [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => !error ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || titles === undefined);
  const isAdSenseLinked = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (viewOnlyDashboard && loading) {
      return undefined;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getAdSenseLinked();
  });
  if (!isAdSenseLinked && !viewOnlyDashboard) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(Widget, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_modules_adsense_components_common__WEBPACK_IMPORTED_MODULE_11__.AdSenseLinkCTA, {})
    });
  }
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = titles[url];
      // Utilizing `useSelect` inside the component rather than
      // returning its direct value to the `columns` array.
      // This pattern ensures that the component re-renders correctly based on changes in state,
      // preventing potential issues with stale or out-of-sync data.
      // Note: This pattern is replicated in a few other spots within our codebase.
      const serviceURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileTablePlainText, {
          content: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
        href: serviceURL,
        title: title,
        external: true,
        hideExternalIndicator: true,
        children: title
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(fieldValue, {
          style: 'currency',
          currency: report?.metadata?.currencyCode
        })
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_6__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopEarningContentWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_16___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_17__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_8__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_13__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _js_modules_analytics_4_components_widgets_ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__["default"]
}), (0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_8__["default"])({
  moduleName: _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE,
  FallbackComponent: _ConnectAdSenseCTATileWidget__WEBPACK_IMPORTED_MODULE_14__["default"]
}))(TopEarningContentWidget));

/***/ }),

/***/ "./js/modules/adsense/components/widgets/index.js":
/*!********************************************************!*\
  !*** ./js/modules/adsense/components/widgets/index.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ConnectAdSenseCTATileWidget: () => (/* reexport safe */ _ConnectAdSenseCTATileWidget__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   TopEarningContentWidget: () => (/* reexport safe */ _TopEarningContentWidget__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _ConnectAdSenseCTATileWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConnectAdSenseCTATileWidget */ "./js/modules/adsense/components/widgets/ConnectAdSenseCTATileWidget.js");
/* harmony import */ var _TopEarningContentWidget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TopEarningContentWidget */ "./js/modules/adsense/components/widgets/TopEarningContentWidget.js");
/**
 * GA4 Key Metrics widget components.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */




/***/ }),

/***/ "./js/modules/adsense/constants.js":
/*!*****************************************!*\
  !*** ./js/modules/adsense/constants.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ADSENSE_CTA_WIDGET_DISMISSED_ITEM_KEY: () => (/* binding */ ADSENSE_CTA_WIDGET_DISMISSED_ITEM_KEY),
/* harmony export */   ADSENSE_CTA_WIDGET_TOOLTIP_STATE_KEY: () => (/* binding */ ADSENSE_CTA_WIDGET_TOOLTIP_STATE_KEY),
/* harmony export */   ADSENSE_GA4_TOP_EARNING_PAGES_NOTICE_DISMISSED_ITEM_KEY: () => (/* binding */ ADSENSE_GA4_TOP_EARNING_PAGES_NOTICE_DISMISSED_ITEM_KEY),
/* harmony export */   MODULE_SLUG_ADSENSE: () => (/* binding */ MODULE_SLUG_ADSENSE)
/* harmony export */ });
/**
 * AdSense module constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const ADSENSE_CTA_WIDGET_DISMISSED_ITEM_KEY = 'adsense-connect-cta';
const ADSENSE_CTA_WIDGET_TOOLTIP_STATE_KEY = 'adsense-connect-cta-tooltip-state';
const ADSENSE_GA4_TOP_EARNING_PAGES_NOTICE_DISMISSED_ITEM_KEY = 'adsense-ga4-top-earnings-notice';
const MODULE_SLUG_ADSENSE = 'adsense';

/***/ }),

/***/ "./js/modules/adsense/datastore/accounts.js":
/*!**************************************************!*\
  !*** ./js/modules/adsense/datastore/accounts.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   controls: () => (/* binding */ controls),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   initialState: () => (/* binding */ initialState),
/* harmony export */   reducer: () => (/* binding */ reducer),
/* harmony export */   resolvers: () => (/* binding */ resolvers),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/* harmony import */ var _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/**
 * `modules/adsense` data store: accounts.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */







// Actions
const RESET_ACCOUNTS = 'RESET_ACCOUNTS';
const fetchGetAccountsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'getAccounts',
  controlCallback: () => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_0__.get)('modules', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE, 'accounts', undefined, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createReducer)((state, accounts) => {
    state.accounts = accounts;
  })
});
const baseInitialState = {
  accounts: undefined
};
const baseActions = {
  *resetAccounts() {
    const {
      dispatch
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    yield {
      payload: {},
      type: RESET_ACCOUNTS
    };
    yield _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_5__.actions.clearErrors('getAccounts');
    return dispatch(_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).invalidateResolutionForStoreSelector('getAccounts');
  }
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createReducer)((state, action) => {
  switch (action.type) {
    case RESET_ACCOUNTS:
      {
        const {
          accountID,
          clientID,
          accountStatus,
          siteStatus,
          accountSetupComplete,
          siteSetupComplete
        } = state.savedSettings || {};
        state.accounts = baseInitialState.accounts;
        state.settings = {
          ...(state.settings || {}),
          accountID,
          clientID,
          accountStatus,
          siteStatus,
          accountSetupComplete,
          siteSetupComplete
        };
        break;
      }
    default:
      break;
  }
});
const baseResolvers = {
  *getAccounts() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const existingAccounts = registry.select(_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ADSENSE).getAccounts();

    // If there are already accounts loaded in state, consider it fulfilled
    // and don't make an API request.
    if (existingAccounts) {
      return;
    }
    yield fetchGetAccountsStore.actions.fetchGetAccounts();
  }
};
const baseSelectors = {
  /**
   * Gets all Google AdSense accounts this user has available.
   *
   * @since 1.9.0
   *
   * @param {Object} state Data store's state.
   * @return {(Array.<Object>|undefined)} An array of AdSense accounts; `undefined` if not loaded.
   */
  getAccounts(state) {
    const {
      accounts
    } = state;
    return accounts;
  }
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.combineStores)(fetchGetAccountsStore, {
  initialState: baseInitialState,
  actions: baseActions,
  reducer: baseReducer,
  resolvers: baseResolvers,
  selectors: baseSelectors
});
const initialState = store.initialState;
const actions = store.actions;
const controls = store.controls;
const reducer = store.reducer;
const resolvers = store.resolvers;
const selectors = store.selectors;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/ad-blocking-recovery.js":
/*!**************************************************************!*\
  !*** ./js/modules/adsense/datastore/ad-blocking-recovery.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_util_tag__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util/tag */ "./js/util/tag.js");
/* harmony import */ var _js_modules_adsense_util_ad_blocking_recovery_tag_matcher__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/adsense/util/ad-blocking-recovery-tag-matcher */ "./js/modules/adsense/util/ad-blocking-recovery-tag-matcher.js");
/* harmony import */ var _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/**
 * `modules/adsense` data store: Ad Blocking Recovery.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */










// Actions
const FETCH_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG = 'FETCH_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG';
const RECEIVE_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG = 'RECEIVE_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG';
const fetchSyncAdBlockingRecoveryTagsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_9__.createFetchStore)({
  baseName: 'syncAdBlockingRecoveryTags',
  controlCallback: () => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.set)('modules', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE, 'sync-ad-blocking-recovery-tags');
  }
});
const initialState = {
  existingAdBlockingRecoveryTag: undefined
};
const actions = {
  fetchGetExistingAdBlockingRecoveryTag() {
    return {
      payload: {},
      type: FETCH_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG
    };
  },
  receiveGetExistingAdBlockingRecoveryTag(existingAdBlockingRecoveryTag) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(existingAdBlockingRecoveryTag === null || 'string' === typeof existingAdBlockingRecoveryTag, 'existingAdBlockingRecoveryTag must be a tag string or null.');
    return {
      payload: {
        existingAdBlockingRecoveryTag: (0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_5__.isValidAccountID)(existingAdBlockingRecoveryTag) ? existingAdBlockingRecoveryTag : null
      },
      type: RECEIVE_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG
    };
  },
  /**
   * Triggers an API request to sync Ad Blocking Recovery and Error Protection tags on the server.
   *
   * @since 1.104.0
   *
   * @return {Object} Object with `response` and `error`.
   */
  syncAdBlockingRecoveryTags() {
    return fetchSyncAdBlockingRecoveryTagsStore.actions.fetchSyncAdBlockingRecoveryTags();
  }
};
const controls = {
  [FETCH_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG]: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistryControl)(registry => async () => {
    const homeURL = registry.select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getHomeURL();
    const existingTagURLs = await (0,_js_util_tag__WEBPACK_IMPORTED_MODULE_7__.getExistingTagURLs)({
      homeURL
    });
    const {
      getHTMLForURL
    } = registry.resolveSelect(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE);
    for (const url of existingTagURLs) {
      const html = await getHTMLForURL(url);
      const tagFound = (0,_js_util_tag__WEBPACK_IMPORTED_MODULE_7__.extractExistingTag)(html, _js_modules_adsense_util_ad_blocking_recovery_tag_matcher__WEBPACK_IMPORTED_MODULE_8__["default"]);
      if (tagFound) {
        return tagFound;
      }
    }
    return null;
  })
};
const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, {
  type,
  payload
}) => {
  switch (type) {
    case RECEIVE_GET_EXISTING_AD_BLOCKING_RECOVERY_TAG:
      {
        const {
          existingAdBlockingRecoveryTag
        } = payload;
        state.existingAdBlockingRecoveryTag = existingAdBlockingRecoveryTag;
        break;
      }
    default:
      break;
  }
});
const resolvers = {
  *getExistingAdBlockingRecoveryTag() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const existingAdBlockingRecoveryTag = registry.select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getExistingAdBlockingRecoveryTag();
    if (existingAdBlockingRecoveryTag === undefined) {
      const fetchedAdBlockingRecoveryTag = yield actions.fetchGetExistingAdBlockingRecoveryTag();
      yield actions.receiveGetExistingAdBlockingRecoveryTag(fetchedAdBlockingRecoveryTag);
    }
  }
};
const selectors = {
  /**
   * Gets the existing ad blocking recovery tag.
   *
   * @since 1.105.0
   *
   * @param {Object} state Data store's state.
   * @return {(string|null|undefined)} The existing ad blocking recovery tag `string` if present, `null` if not present, or `undefined` if not loaded yet.
   */
  getExistingAdBlockingRecoveryTag(state) {
    return state.existingAdBlockingRecoveryTag;
  },
  /**
   * Checks whether or not an existing ad blocking recovery tag is present.
   *
   * @since 1.105.0
   *
   * @return {(boolean|undefined)} Boolean if ad blocking recovery tag is present, `undefined` if ad blocking recovery tag presence has not been resolved yet.
   */
  hasExistingAdBlockingRecoveryTag: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const existingAdBlockingRecoveryTag = select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getExistingAdBlockingRecoveryTag();
    if (existingAdBlockingRecoveryTag === undefined) {
      return undefined;
    }
    return !!existingAdBlockingRecoveryTag;
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchSyncAdBlockingRecoveryTagsStore, {
  initialState,
  actions,
  reducer,
  controls,
  resolvers,
  selectors
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/adblocker.js":
/*!***************************************************!*\
  !*** ./js/modules/adsense/datastore/adblocker.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/**
 * `modules/adsense` data store: adblocker.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




const selectors = {
  /**
   * Returns appropriate ad blocker warning message based on modules connection status.
   *
   * @since 1.43.0
   *
   * @param {Object} state Data store's state.
   * @return {(string|null|undefined)} The error message string if an ad blocker is active,
   *                                   `null` if an ad blocker isn't detected,
   *                                   `undefined` if ad blocker detection has not completed yet.
   */
  getAdBlockerWarningMessage: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
    const isAdBlockerActive = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAdBlockerActive();
    if (undefined === isAdBlockerActive) {
      return undefined;
    }
    if (!isAdBlockerActive) {
      return null;
    }
    const isModuleConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).isModuleConnected(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE);
    if (isModuleConnected) {
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('To get the latest AdSense data you will need to disable your Ad blocker', 'google-site-kit');
    }
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('To set up AdSense you will need to disable your Ad blocker', 'google-site-kit');
  })
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  selectors
});

/***/ }),

/***/ "./js/modules/adsense/datastore/adunits.js":
/*!*************************************************!*\
  !*** ./js/modules/adsense/datastore/adunits.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   controls: () => (/* binding */ controls),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   initialState: () => (/* binding */ initialState),
/* harmony export */   reducer: () => (/* binding */ reducer),
/* harmony export */   resolvers: () => (/* binding */ resolvers),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/**
 * `modules/adsense` data store: Ad Units.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */





const fetchGetAdUnitsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'getAdUnits',
  controlCallback: ({
    accountID,
    clientID
  }) => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.get)('modules', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE, 'adunits', {
      accountID,
      clientID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, adunits, {
    accountID,
    clientID
  }) => {
    state.adunits = state.adunits || {};
    state.adunits[`${accountID}::${clientID}`] = adunits;
  }),
  argsToParams: (accountID, clientID) => {
    return {
      accountID,
      clientID
    };
  },
  validateParams: ({
    accountID,
    clientID
  } = {}) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(accountID, 'accountID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(clientID, 'clientID is required.');
  }
});
const baseInitialState = {
  adunits: {}
};
const baseActions = {};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, action) => {
  switch (action.type) {
    default:
      break;
  }
});
const baseResolvers = {
  *getAdUnits(accountID, clientID) {
    if (undefined === accountID || undefined === clientID) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const existingAdUnits = registry.select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getAdUnits(accountID, clientID);
    if (existingAdUnits) {
      return;
    }
    yield fetchGetAdUnitsStore.actions.fetchGetAdUnits(accountID, clientID);
  }
};
const baseSelectors = {
  /**
   * Gets all Google AdSense Account Ad Units for this account and client.
   *
   * @since 1.27.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The AdSense Account ID to fetch URL channels for.
   * @param {string} clientID  The AdSense Client ID to fetch URL channels for.
   * @return {(Array.<Object>|undefined)} An array of AdSense URL channels; `undefined` if not loaded.
   */
  getAdUnits(state, accountID, clientID) {
    if (undefined === accountID || undefined === clientID) {
      return undefined;
    }
    return state.adunits[`${accountID}::${clientID}`];
  }
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchGetAdUnitsStore, {
  initialState: baseInitialState,
  actions: baseActions,
  reducer: baseReducer,
  resolvers: baseResolvers,
  selectors: baseSelectors
});
const initialState = store.initialState;
const actions = store.actions;
const controls = store.controls;
const reducer = store.reducer;
const resolvers = store.resolvers;
const selectors = store.selectors;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/base.js":
/*!**********************************************!*\
  !*** ./js/modules/adsense/datastore/base.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var googlesitekit_modules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-modules */ "googlesitekit-modules");
/* harmony import */ var googlesitekit_modules__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_modules__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./settings */ "./js/modules/adsense/datastore/settings.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/**
 * `modules/adsense` base data store
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */





const baseModuleStore = googlesitekit_modules__WEBPACK_IMPORTED_MODULE_0___default().createModuleStore(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_2__.MODULE_SLUG_ADSENSE, {
  ownedSettingsSlugs: ['accountID', 'clientID'],
  storeName: _constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE,
  settingSlugs: ['accountID', 'clientID', 'useSnippet', 'accountStatus', 'siteStatus', 'accountSetupComplete', 'siteSetupComplete', 'ownerID', 'webStoriesAdUnit', 'autoAdsDisabled', 'setupCompletedTimestamp', 'useAdBlockingRecoverySnippet', 'useAdBlockingRecoveryErrorSnippet', 'adBlockingRecoverySetupStatus'],
  validateCanSubmitChanges: _settings__WEBPACK_IMPORTED_MODULE_3__.validateCanSubmitChanges,
  validateIsSetupBlocked: select => {
    if (select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isAdBlockerActive()) {
      throw new Error('Ad blocker detected');
    }
  }
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseModuleStore);

/***/ }),

/***/ "./js/modules/adsense/datastore/clients.js":
/*!*************************************************!*\
  !*** ./js/modules/adsense/datastore/clients.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   controls: () => (/* binding */ controls),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   initialState: () => (/* binding */ initialState),
/* harmony export */   reducer: () => (/* binding */ reducer),
/* harmony export */   resolvers: () => (/* binding */ resolvers),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/* harmony import */ var _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/**
 * `modules/adsense` data store: clients.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */








// Actions
const RESET_CLIENTS = 'RESET_CLIENTS';
const fetchGetClientsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'getClients',
  controlCallback: ({
    accountID
  }) => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.get)('modules', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE, 'clients', {
      accountID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, clients, {
    accountID
  }) => {
    if (Array.isArray(clients)) {
      state.clients = state.clients || {};
      state.clients[accountID] = clients;
    }
  }),
  argsToParams: accountID => {
    return {
      accountID
    };
  },
  validateParams: ({
    accountID
  } = {}) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(accountID, 'accountID is required.');
  }
});
const baseInitialState = {
  clients: {}
};
const baseActions = {
  *resetClients() {
    const {
      dispatch
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    yield {
      payload: {},
      type: RESET_CLIENTS
    };
    yield _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_7__.actions.clearErrors('getClients');
    return dispatch(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).invalidateResolutionForStoreSelector('getClients');
  }
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, action) => {
  switch (action.type) {
    case RESET_CLIENTS:
      {
        const {
          clientID,
          accountStatus,
          siteStatus,
          accountSetupComplete,
          siteSetupComplete
        } = state.savedSettings || {};
        state.clients = initialState.clients;
        state.settings = {
          ...(state.settings || {}),
          clientID,
          accountStatus,
          siteStatus,
          accountSetupComplete,
          siteSetupComplete
        };
        break;
      }
    default:
      break;
  }
});
const baseResolvers = {
  *getClients(accountID) {
    if (undefined === accountID || !(0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_5__.isValidAccountID)(accountID)) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const existingClients = registry.select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getClients(accountID);

    // If there are already clients loaded in state, consider it fulfilled
    // and don't make an API request.
    if (existingClients) {
      return;
    }
    yield fetchGetClientsStore.actions.fetchGetClients(accountID);
  }
};
const baseSelectors = {
  /**
   * Gets all Google AdSense clients this account can access.
   *
   * @since 1.9.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The AdSense Account ID to fetch clients for.
   * @return {(Array.<Object>|undefined)} An array of AdSense clients; `undefined` if not loaded.
   */
  getClients(state, accountID) {
    if (undefined === accountID) {
      return undefined;
    }
    const {
      clients
    } = state;
    return clients[accountID];
  },
  /**
   * Gets the AdSense For Content (AFC) client for the given AdSense account.
   *
   * @since 1.74.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The AdSense Account ID to fetch AFC client for.
   * @return {(Object|null|undefined)} An AdSense AFC client, or `null` if none exists; `undefined` if not loaded.
   */
  getAFCClient: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, accountID) => {
    if (undefined === accountID) {
      return undefined;
    }
    const clients = select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getClients(accountID);
    if (clients === undefined) {
      return undefined;
    }
    const afcClients = clients.filter(client => {
      return 'AFC' === client.productCode;
    });
    if (!afcClients.length) {
      return null;
    }

    // Pick the first AFC client. There should only ever be one anyway.
    return afcClients[0];
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchGetClientsStore, {
  initialState: baseInitialState,
  actions: baseActions,
  reducer: baseReducer,
  resolvers: baseResolvers,
  selectors: baseSelectors
});
const initialState = store.initialState;
const actions = store.actions;
const controls = store.controls;
const reducer = store.reducer;
const resolvers = store.resolvers;
const selectors = store.selectors;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/constants.js":
/*!***************************************************!*\
  !*** ./js/modules/adsense/datastore/constants.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AD_BLOCKING_FORM_SETTINGS: () => (/* binding */ AD_BLOCKING_FORM_SETTINGS),
/* harmony export */   AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY: () => (/* binding */ AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY),
/* harmony export */   AD_BLOCKING_RECOVERY_SETUP_CREATE_MESSAGE_CTA_CLICKED: () => (/* binding */ AD_BLOCKING_RECOVERY_SETUP_CREATE_MESSAGE_CTA_CLICKED),
/* harmony export */   API_STATE_GETTING_READY: () => (/* binding */ API_STATE_GETTING_READY),
/* harmony export */   API_STATE_NEEDS_ATTENTION: () => (/* binding */ API_STATE_NEEDS_ATTENTION),
/* harmony export */   API_STATE_READY: () => (/* binding */ API_STATE_READY),
/* harmony export */   API_STATE_REQUIRES_REVIEW: () => (/* binding */ API_STATE_REQUIRES_REVIEW),
/* harmony export */   BACKGROUND_SUBMIT_SUSPENDED: () => (/* binding */ BACKGROUND_SUBMIT_SUSPENDED),
/* harmony export */   DATE_RANGE_OFFSET: () => (/* binding */ DATE_RANGE_OFFSET),
/* harmony export */   ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS: () => (/* binding */ ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS),
/* harmony export */   ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP: () => (/* binding */ ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP),
/* harmony export */   MODULES_ADSENSE: () => (/* binding */ MODULES_ADSENSE)
/* harmony export */ });
/**
 * `modules/adsense` data store constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const MODULES_ADSENSE = 'modules/adsense';

// Date range offset days for AdSense report requests.
const DATE_RANGE_OFFSET = 0;
const API_STATE_READY = 'READY';
const API_STATE_NEEDS_ATTENTION = 'NEEDS_ATTENTION';
const API_STATE_REQUIRES_REVIEW = 'REQUIRES_REVIEW';
const API_STATE_GETTING_READY = 'GETTING_READY';

// State to determine whether background submission is allowable.
const BACKGROUND_SUBMIT_SUSPENDED = 'background-submit-suspended';
const AD_BLOCKING_FORM_SETTINGS = 'adsenseAdBlockingFormSettings';
const AD_BLOCKING_RECOVERY_SETUP_CREATE_MESSAGE_CTA_CLICKED = 'googlesitekit-ad-blocking-recovery-setup-create-message-cta-clicked';
const AD_BLOCKING_RECOVERY_MAIN_NOTIFICATION_KEY = 'ad-blocking-recovery-notification';

// Various ad blocking recovery setup statuses.
const ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS = {
  TAG_PLACED: 'tag-placed',
  SETUP_CONFIRMED: 'setup-confirmed'
};

// Zero-based index of the available ad blocking recovery setup steps.
const ENUM_AD_BLOCKING_RECOVERY_SETUP_STEP = {
  PLACE_TAGS: 0,
  CREATE_MESSAGE: 1,
  COMPLETE: 2
};

/***/ }),

/***/ "./js/modules/adsense/datastore/index.js":
/*!***********************************************!*\
  !*** ./js/modules/adsense/datastore/index.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   controls: () => (/* binding */ controls),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   initialState: () => (/* binding */ initialState),
/* harmony export */   reducer: () => (/* binding */ reducer),
/* harmony export */   registerStore: () => (/* binding */ registerStore),
/* harmony export */   resolvers: () => (/* binding */ resolvers),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ "./js/modules/adsense/datastore/base.js");
/* harmony import */ var _accounts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./accounts */ "./js/modules/adsense/datastore/accounts.js");
/* harmony import */ var _adunits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./adunits */ "./js/modules/adsense/datastore/adunits.js");
/* harmony import */ var _clients__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./clients */ "./js/modules/adsense/datastore/clients.js");
/* harmony import */ var _report__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./report */ "./js/modules/adsense/datastore/report.js");
/* harmony import */ var _tags__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tags */ "./js/modules/adsense/datastore/tags.js");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./settings */ "./js/modules/adsense/datastore/settings.js");
/* harmony import */ var _adblocker__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./adblocker */ "./js/modules/adsense/datastore/adblocker.js");
/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./service */ "./js/modules/adsense/datastore/service.js");
/* harmony import */ var _sites__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./sites */ "./js/modules/adsense/datastore/sites.js");
/* harmony import */ var _ad_blocking_recovery__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ad-blocking-recovery */ "./js/modules/adsense/datastore/ad-blocking-recovery.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/**
 * `modules/adsense` data store
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */













const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.combineStores)(_base__WEBPACK_IMPORTED_MODULE_1__["default"], _accounts__WEBPACK_IMPORTED_MODULE_2__["default"], _adunits__WEBPACK_IMPORTED_MODULE_3__["default"], _clients__WEBPACK_IMPORTED_MODULE_4__["default"], _report__WEBPACK_IMPORTED_MODULE_5__["default"], _tags__WEBPACK_IMPORTED_MODULE_6__["default"], _settings__WEBPACK_IMPORTED_MODULE_7__["default"], _adblocker__WEBPACK_IMPORTED_MODULE_8__["default"], _service__WEBPACK_IMPORTED_MODULE_9__["default"], _sites__WEBPACK_IMPORTED_MODULE_10__["default"], _ad_blocking_recovery__WEBPACK_IMPORTED_MODULE_11__["default"]);
const initialState = store.initialState;
const actions = store.actions;
const controls = store.controls;
const reducer = store.reducer;
const resolvers = store.resolvers;
const selectors = store.selectors;
function registerStore(registry) {
  registry.registerStore(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ADSENSE, store);
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/report.js":
/*!************************************************!*\
  !*** ./js/modules/adsense/datastore/report.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   controls: () => (/* binding */ controls),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   initialState: () => (/* binding */ initialState),
/* harmony export */   reducer: () => (/* binding */ reducer),
/* harmony export */   resolvers: () => (/* binding */ resolvers),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/* harmony import */ var _js_util_report_validation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/report-validation */ "./js/util/report-validation.js");
/* harmony import */ var _js_modules_adsense_util_report_validation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/adsense/util/report-validation */ "./js/modules/adsense/util/report-validation.js");
/**
 * `modules/adsense` data store: report.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */








const fetchGetReportStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_7__.createFetchStore)({
  baseName: 'getReport',
  controlCallback: ({
    options
  }) => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ADSENSE, 'report', options);
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, report, {
    options
  }) => {
    state.reports = state.reports || {};
    state.reports[(0,_js_util__WEBPACK_IMPORTED_MODULE_6__.stringifyObject)(options)] = report;
  }),
  argsToParams: options => {
    return {
      options
    };
  },
  validateParams: ({
    options
  } = {}) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(options), 'options must be an object.');

    // Account for additional date ranges supported by AdSense module in PHP.
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util_report_validation__WEBPACK_IMPORTED_MODULE_8__.isValidDateRange)(options), 'Either date range or start/end dates must be provided for AdSense report.');
    const {
      orderby,
      metrics,
      dimensions
    } = options;
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util_report_validation__WEBPACK_IMPORTED_MODULE_8__.isValidStringularItems)(metrics), 'Metrics for an AdSense report must be either a string or an array of strings.');
    (0,_js_modules_adsense_util_report_validation__WEBPACK_IMPORTED_MODULE_9__.validateMetrics)(metrics);
    if (dimensions) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util_report_validation__WEBPACK_IMPORTED_MODULE_8__.isValidStringularItems)(dimensions), 'Dimensions for an AdSense report must be either a string or an array of strings.');
      (0,_js_modules_adsense_util_report_validation__WEBPACK_IMPORTED_MODULE_9__.validateDimensions)(dimensions);
    }
    if (orderby) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util_report_validation__WEBPACK_IMPORTED_MODULE_8__.isValidOrders)(orderby), 'Orders for an AdSense report must be either an object or an array of objects where each object should have "fieldName" and "sortOrder" properties.');
    }
  }
});
const baseInitialState = {
  reports: {}
};
const baseResolvers = {
  *getReport(options = {}) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const existingReport = registry.select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getReport(options);

    // If there are already alerts loaded in state, consider it fulfilled
    // and don't make an API request.
    if (existingReport) {
      return;
    }
    yield fetchGetReportStore.actions.fetchGetReport(options);
  }
};
const baseSelectors = {
  /**
   * Gets a Google AdSense report for the given options.
   *
   * The report generated will include the following metrics:
   *
   * - 'ESTIMATED_EARNINGS'
   * - 'PAGE_VIEWS_RPM'
   * - 'IMPRESSIONS'
   *
   * An AdSense report will be returned; `undefined` if the report is not yet loaded.
   *
   * @since 1.9.0
   *
   * @param {Object}         state                Data store's state.
   * @param {Object}         options              Options for generating the report.
   * @param {string}         options.startDate    Required. Start date to query report data for as YYYY-mm-dd.
   * @param {string}         options.endDate      Required. Start date to query report data for as YYYY-mm-dd.
   * @param {Array.<string>} options.metrics      Required. List of {@link https://developers.google.com/adsense/management/metrics-dimensions#metrics|metrics} to query.
   * @param {Array.<string>} [options.dimensions] Optional. List of {@link https://developers.google.com/adsense/management/metrics-dimensions#dimensions|dimensions} to group results by.
   * @param {Array.<Object>} [options.orderby]    Optional. Order definition objects containing 'fieldName' and 'sortOrder'. 'sortOrder' must be either 'ASCENDING' or 'DESCENDING'. Default null.
   * @param {number}         [options.limit]      Optional. Maximum number of entries to return. Default 1000.
   * @return {(Array.<Object>|undefined)} An AdSense report; `undefined` if not loaded.
   */
  getReport(state, options = {}) {
    const {
      reports
    } = state;
    return reports[(0,_js_util__WEBPACK_IMPORTED_MODULE_6__.stringifyObject)(options)];
  }
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.combineStores)(fetchGetReportStore, {
  initialState: baseInitialState,
  resolvers: baseResolvers,
  selectors: baseSelectors
});
const initialState = store.initialState;
const actions = store.actions;
const controls = store.controls;
const reducer = store.reducer;
const resolvers = store.resolvers;
const selectors = store.selectors;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/service.js":
/*!*************************************************!*\
  !*** ./js/modules/adsense/datastore/service.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_modules_adsense_util_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/util/url */ "./js/modules/adsense/util/url.js");
/**
 * `modules/adsense` data store: service.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





const selectors = {
  /**
   * Gets a URL to the service.
   *
   * @since 1.14.0
   *
   * @param {Object} state        Data store's state.
   * @param {Object} [args]       Object containing optional path and query args.
   * @param {string} [args.path]  A path to append to the base url.
   * @param {Object} [args.query] Object of query params to be added to the URL.
   * @return {(string|undefined)} The URL to the service, or `undefined` if not loaded.
   */
  getServiceURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => (state, {
    path,
    query
  } = {}) => {
    // Note: /u/0 is necessary to keep here in order for paths to be resolved properly;
    // AccountChooser will update this part of the URL accordingly.
    let serviceURL = 'https://www.google.com/adsense/new/u/0';
    if (path) {
      const sanitizedPath = `/${path.replace(/^\//, '')}`;
      serviceURL = `${serviceURL}${sanitizedPath}`;
    }
    if (query) {
      serviceURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.addQueryArgs)(serviceURL, query);
    }
    const accountChooserBaseURI = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getAccountChooserURL(serviceURL);
    if (accountChooserBaseURI === undefined) {
      return undefined;
    }
    return accountChooserBaseURI;
  }),
  /**
   * Returns the service URL for creating a new AdSense account.
   *
   * @since 1.14.0
   *
   * @return {(string|undefined)} AdSense URL to create a new account (or `undefined` if not loaded).
   */
  getServiceCreateAccountURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => () => {
    const siteURL = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getReferenceSiteURL();
    const query = {
      source: 'site-kit',
      utm_source: 'site-kit',
      utm_medium: 'wordpress_signup'
    };
    if (undefined !== siteURL) {
      query.url = (0,_js_modules_adsense_util_url__WEBPACK_IMPORTED_MODULE_4__.parseDomain)(siteURL);
    }
    return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.addQueryArgs)('https://www.google.com/adsense/signup', query);
  }),
  /**
   * Returns the service URL to an AdSense account's overview page.
   *
   * @since 1.14.0
   *
   * @return {(string|undefined)} AdSense account overview URL (or `undefined` if not loaded).
   */
  getServiceAccountURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => () => {
    const accountID = select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getAccountID();
    if (accountID === undefined) {
      return undefined;
    }
    const query = {
      source: 'site-kit'
    };
    return select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getServiceURL({
      accountID,
      query
    });
  }),
  /**
   * Returns the service URL to an AdSense account report.
   *
   * @since 1.27.0
   *
   * @param {Object} reportArgs URL parameters to be passed to the query.
   * @return {(string|undefined)} AdSense account site overview URL (or `undefined` if not loaded).
   */
  getServiceReportURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => (state, reportArgs) => {
    const accountID = select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getAccountID();
    if (accountID === undefined) {
      return undefined;
    }
    const query = {
      ...reportArgs
    };
    const siteURL = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getReferenceSiteURL();
    const domain = siteURL && (0,_js_modules_adsense_util_url__WEBPACK_IMPORTED_MODULE_4__.parseDomain)(siteURL);
    if (domain) {
      query.dd = `1YsiteY1Y${domain}Y${domain}`;
    }
    const path = `${accountID}/reporting`;
    return select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getServiceURL({
      path,
      query
    });
  }),
  /**
   * Returns the service URL to an AdSense account's site management page.
   *
   * @since 1.14.0
   *
   * @return {(string|undefined)} AdSense account site management URL (or `undefined` if not loaded).
   */
  getServiceAccountManageSiteURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => () => {
    const accountID = select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getAccountID();
    const siteURL = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getReferenceSiteURL();
    if (accountID === undefined || siteURL === undefined) {
      return undefined;
    }
    const path = `${accountID}/sites/my-sites`;
    const query = {
      source: 'site-kit',
      url: (0,_js_modules_adsense_util_url__WEBPACK_IMPORTED_MODULE_4__.parseDomain)(siteURL) || siteURL
    };
    return select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getServiceURL({
      path,
      query
    });
  }),
  /**
   * Returns the service URL to the AdSense sites list.
   *
   * @since 1.14.0
   *
   * @return {(string|undefined)} AdSense account sites list URL (or `undefined` if not loaded).
   */
  getServiceAccountManageSitesURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => () => {
    const accountID = select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getAccountID();
    if (accountID === undefined) {
      return undefined;
    }
    const path = `${accountID}/sites/my-sites`;
    const query = {
      source: 'site-kit'
    };
    return select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getServiceURL({
      path,
      query
    });
  }),
  /**
   * Returns the service URL to an AdSense account's site ads preview page.
   *
   * @since 1.14.0
   *
   * @return {(string|undefined)} AdSense account site ads preview URL (or `undefined` if not loaded).
   */
  getServiceAccountSiteAdsPreviewURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => () => {
    const accountID = select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getAccountID();
    const siteURL = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getReferenceSiteURL();
    if (accountID === undefined || siteURL === undefined) {
      return undefined;
    }
    const path = `${accountID}/myads/sites/preview`;
    const query = {
      source: 'site-kit',
      url: (0,_js_modules_adsense_util_url__WEBPACK_IMPORTED_MODULE_4__.parseDomain)(siteURL) || siteURL
    };
    return select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getServiceURL({
      path,
      query
    });
  }),
  /**
   * Overrides the details link URL for this module.
   *
   * @since 1.144.0
   *
   * @return {(string|undefined)} AdSense account sites list URL (or `undefined` if not loaded).
   */
  getDetailsLinkURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.createRegistrySelector)(select => () => select(_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ADSENSE).getServiceAccountManageSitesURL())
};
const store = {
  selectors
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/settings.js":
/*!**************************************************!*\
  !*** ./js/modules/adsense/datastore/settings.js ***!
  \**************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   INVARIANT_INVALID_ACCOUNT_ID: () => (/* binding */ INVARIANT_INVALID_ACCOUNT_ID),
/* harmony export */   INVARIANT_INVALID_CLIENT_ID: () => (/* binding */ INVARIANT_INVALID_CLIENT_ID),
/* harmony export */   INVARIANT_MISSING_ACCOUNT_STATUS: () => (/* binding */ INVARIANT_MISSING_ACCOUNT_STATUS),
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   controls: () => (/* binding */ controls),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   initialState: () => (/* binding */ initialState),
/* harmony export */   reducer: () => (/* binding */ reducer),
/* harmony export */   resolvers: () => (/* binding */ resolvers),
/* harmony export */   selectors: () => (/* binding */ selectors),
/* harmony export */   validateCanSubmitChanges: () => (/* binding */ validateCanSubmitChanges)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/data/create-settings-store */ "./js/googlesitekit/data/create-settings-store.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.js");
/**
 * `modules/adsense` data store: settings.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */






// Invariant error messages.
const INVARIANT_MISSING_ACCOUNT_STATUS = 'require an account status to be present';
const INVARIANT_INVALID_ACCOUNT_ID = 'require account ID to be either empty (if impossible to determine) or valid';
const INVARIANT_INVALID_CLIENT_ID = 'require client ID to be either empty (if impossible to determine) or valid';

// Actions
const COMPLETE_ACCOUNT_SETUP = 'COMPLETE_ACCOUNT_SETUP';
const COMPLETE_SITE_SETUP = 'COMPLETE_SITE_SETUP';

// The original use-snippet on pageload is a specific requirement for
// certain parts of the AdSense setup flow.
const RECEIVE_ORIGINAL_USE_SNIPPET = 'RECEIVE_ORIGINAL_USE_SNIPPET';
const baseInitialState = {
  originalUseSnippet: undefined
};
const baseActions = {
  /**
   * Sets the accountSetupComplete flag to true and submits all changes.
   *
   * An asynchronous action is used to invoke this action's control, which ensures
   * `setAccountSetupComplete( true )` is called before we submit the changes.
   * See the `COMPLETE_ACCOUNT_SETUP` control below for more.
   *
   * @since 1.9.0
   *
   * @return {boolean} True on success, false on failure.
   */
  *completeAccountSetup() {
    const success = yield {
      payload: {},
      type: COMPLETE_ACCOUNT_SETUP
    };
    return success;
  },
  /**
   * Sets the siteSetupComplete flag to true and submits all changes.
   *
   * An asynchronous action is used to invoke this action's control, which ensures
   * `setSiteSetupComplete( true )` is called before we submit the changes.
   * See the `COMPLETE_SITE_SETUP` control below for more.
   *
   * @since 1.9.0
   *
   * @return {boolean} True on success, false on failure.
   */
  *completeSiteSetup() {
    const success = yield {
      payload: {},
      type: COMPLETE_SITE_SETUP
    };
    return success;
  },
  receiveOriginalUseSnippet(originalUseSnippet) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(originalUseSnippet, 'originalUseSnippet is required.');
    return {
      payload: {
        originalUseSnippet
      },
      type: RECEIVE_ORIGINAL_USE_SNIPPET
    };
  }
};
const baseControls = {
  // This is a control to allow for asynchronous logic using external action dispatchers.
  [COMPLETE_ACCOUNT_SETUP]: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistryControl)(registry => async () => {
    await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).setAccountSetupComplete(true);
    // canSubmitChanges cannot be checked before here because the settings
    // won't have changed yet.
    if (!registry.select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).canSubmitChanges()) {
      // Unset flag again.
      await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).setAccountSetupComplete(false);
      return false;
    }
    const {
      error
    } = await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).submitChanges();
    if (error) {
      // Unset flag again.
      await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).setAccountSetupComplete(false);
      return false;
    }
    return true;
  }),
  // This is a control to allow for asynchronous logic using external action dispatchers.
  [COMPLETE_SITE_SETUP]: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistryControl)(registry => async () => {
    await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).setSiteSetupComplete(true);
    // canSubmitChanges cannot be checked before here because the settings
    // won't have changed yet.
    if (!registry.select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).canSubmitChanges()) {
      // Unset flag again.
      await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).setSiteSetupComplete(false);
      return false;
    }
    const {
      error
    } = await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).submitChanges();
    if (error) {
      // Unset flag again.
      await registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).setSiteSetupComplete(false);
      return false;
    }
    return true;
  })
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createReducer)((state, action) => {
  switch (action.type) {
    case RECEIVE_ORIGINAL_USE_SNIPPET:
      {
        const {
          originalUseSnippet
        } = action.payload;
        state.originalUseSnippet = originalUseSnippet;
        break;
      }
    case 'RECEIVE_GET_SETTINGS':
      {
        const {
          response
        } = action.payload;
        const {
          useSnippet
        } = response;
        if (state.originalUseSnippet === undefined) {
          state.originalUseSnippet = useSnippet;
        }
        break;
      }
    default:
      break;
  }
});
const baseResolvers = {
  *getOriginalUseSnippet() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();

    // Do not do anything if original useSnippet is already known.
    const existingOriginalUseSnippet = registry.select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getOriginalUseSnippet();
    if (undefined !== existingOriginalUseSnippet) {
      return;
    }

    // Ensure settings are being fetched if not yet in progress.
    registry.select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getSettings();
  }
};
const baseSelectors = {
  /**
   * Checks whether the useSnippet value is currently being saved.
   *
   * @since 1.9.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean} `true` if saving useSnippet, `false` if not.
   */
  isDoingSaveUseSnippet(state) {
    // Since isFetchingSaveUseSnippet (via createFetchStore)
    // holds information based on specific values but we only need
    // generic information here, we need to check whether ANY such
    // request is in progress.
    return Object.values(state.isFetchingSaveUseSnippet).some(Boolean);
  },
  /**
   * Gets the original useSnippet stored before the current pageload.
   *
   * @since 1.72.0
   * @private
   *
   * @param {Object} state Data store's state.
   * @return {(boolean|undefined)} Original useSnippet, or undefined if not loaded yet.
   */
  getOriginalUseSnippet(state) {
    return state.originalUseSnippet;
  }
};
function validateCanSubmitChanges(select) {
  const strictSelect = (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_5__.createStrictSelect)(select);
  const {
    getAccountID,
    getClientID,
    getAccountStatus,
    haveSettingsChanged,
    isDoingSubmitChanges
  } = strictSelect(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE);

  // Note: these error messages are referenced in test assertions.
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(!isDoingSubmitChanges(), _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_2__.INVARIANT_DOING_SUBMIT_CHANGES);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(haveSettingsChanged(), _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_2__.INVARIANT_SETTINGS_NOT_CHANGED);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(getAccountStatus(), INVARIANT_MISSING_ACCOUNT_STATUS);
  const accountID = getAccountID();
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('' === accountID || (0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_3__.isValidAccountID)(accountID), INVARIANT_INVALID_ACCOUNT_ID);
  const clientID = getClientID();
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('' === clientID || (0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_3__.isValidClientID)(clientID), INVARIANT_INVALID_CLIENT_ID);
}
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.combineStores)({
  initialState: baseInitialState,
  actions: baseActions,
  controls: baseControls,
  reducer: baseReducer,
  resolvers: baseResolvers,
  selectors: baseSelectors
});
const initialState = store.initialState;
const actions = store.actions;
const controls = store.controls;
const reducer = store.reducer;
const resolvers = store.resolvers;
const selectors = store.selectors;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/sites.js":
/*!***********************************************!*\
  !*** ./js/modules/adsense/datastore/sites.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   actions: () => (/* binding */ actions),
/* harmony export */   controls: () => (/* binding */ controls),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   initialState: () => (/* binding */ initialState),
/* harmony export */   reducer: () => (/* binding */ reducer),
/* harmony export */   resolvers: () => (/* binding */ resolvers),
/* harmony export */   selectors: () => (/* binding */ selectors)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/* harmony import */ var _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/* harmony import */ var _js_modules_adsense_util_site__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/adsense/util/site */ "./js/modules/adsense/util/site.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/**
 * `modules/adsense` data store: sites.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */










// Actions
const RESET_SITES = 'RESET_SITES';
const fetchGetSitesStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'getSites',
  controlCallback: ({
    accountID
  }) => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.get)('modules', _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ADSENSE, 'sites', {
      accountID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, sites, {
    accountID
  }) => {
    if (Array.isArray(sites)) {
      state.sites = state.sites || {};
      state.sites[accountID] = sites;
    }
  }),
  argsToParams: accountID => {
    return {
      accountID
    };
  },
  validateParams: ({
    accountID
  } = {}) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(accountID, 'accountID is required.');
  }
});
const baseInitialState = {
  sites: {}
};
const baseActions = {
  /**
   * Clears received sites, and unsets related selections.
   *
   * The `getSites` selector will be invalidated to allow sites to be re-fetched from the server.
   *
   * @since 1.72.0
   *
   * @return {Object} Redux-style action.
   */
  *resetSites() {
    const {
      dispatch
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    yield {
      payload: {},
      type: RESET_SITES
    };
    yield _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_7__.actions.clearErrors('getSites');
    return dispatch(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).invalidateResolutionForStoreSelector('getSites');
  }
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, action) => {
  switch (action.type) {
    case RESET_SITES:
      {
        const {
          siteID,
          accountStatus,
          siteStatus,
          accountSetupComplete,
          siteSetupComplete
        } = state.savedSettings || {};
        state.sites = initialState.sites;
        state.settings = {
          ...(state.settings || {}),
          siteID,
          accountStatus,
          siteStatus,
          accountSetupComplete,
          siteSetupComplete
        };
        break;
      }
    default:
      break;
  }
});
const baseResolvers = {
  *getSites(accountID) {
    if (undefined === accountID || !(0,_js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_5__.isValidAccountID)(accountID)) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const existingSites = registry.select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getSites(accountID);

    // If there are already sites loaded in state, consider it fulfilled
    // and don't make an API request.
    if (existingSites) {
      return;
    }
    yield fetchGetSitesStore.actions.fetchGetSites(accountID);
  }
};
const baseSelectors = {
  /**
   * Gets all Google AdSense sites this account can access.
   *
   * @since 1.72.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The AdSense Account ID to fetch sites for.
   * @return {(Array.<Object>|undefined)} An array of AdSense Sites; `undefined` if not loaded.
   */
  getSites(state, accountID) {
    if (undefined === accountID) {
      return undefined;
    }
    const {
      sites
    } = state;
    return sites[accountID];
  },
  /**
   * Gets a Google AdSense site for a given domain, if it exists for the given account.
   *
   * @since 1.72.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The AdSense Account ID to find a site for.
   * @param {string} domain    The domain string to match to a site.
   * @return {(Array.<Object>|null|undefined)} An array of AdSense sites; null if no match
   * found or `undefined` if not loaded.
   */
  getSite: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, accountID, domain) => {
    const sites = select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getSites(accountID);
    return (0,_js_modules_adsense_util_site__WEBPACK_IMPORTED_MODULE_8__.determineSiteFromDomain)(sites, domain);
  }),
  /**
   * Gets the Google AdSense site object for the current site, if it exists for
   * the given AdSense account.
   *
   * @since 1.72.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The AdSense Account ID to find a site for.
   * @return {(Array.string|null|undefined)} An array of AdSense sites; null if no match
   * found or `undefined` if not loaded.
   */
  getCurrentSite: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, accountID) => {
    const currentSiteURL = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getReferenceSiteURL();
    const url = new URL(currentSiteURL);
    return select(_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ADSENSE).getSite(accountID, url.hostname);
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchGetSitesStore, {
  initialState: baseInitialState,
  actions: baseActions,
  reducer: baseReducer,
  resolvers: baseResolvers,
  selectors: baseSelectors
});
const initialState = store.initialState;
const actions = store.actions;
const controls = store.controls;
const reducer = store.reducer;
const resolvers = store.resolvers;
const selectors = store.selectors;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/datastore/tags.js":
/*!**********************************************!*\
  !*** ./js/modules/adsense/datastore/tags.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/util */ "./js/modules/adsense/util/index.js");
/* harmony import */ var _js_googlesitekit_data_create_existing_tag_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/data/create-existing-tag-store */ "./js/googlesitekit/data/create-existing-tag-store.js");
/* harmony import */ var _js_modules_adsense_util_tag_matchers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/util/tag-matchers */ "./js/modules/adsense/util/tag-matchers.js");
/**
 * `modules/adsense` data store: tags.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */




const store = (0,_js_googlesitekit_data_create_existing_tag_store__WEBPACK_IMPORTED_MODULE_2__.createExistingTagStore)({
  storeName: _constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ADSENSE,
  tagMatchers: _js_modules_adsense_util_tag_matchers__WEBPACK_IMPORTED_MODULE_3__["default"],
  isValidTag: _js_modules_adsense_util__WEBPACK_IMPORTED_MODULE_1__.isValidClientID
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ }),

/***/ "./js/modules/adsense/index.js":
/*!*************************************!*\
  !*** ./js/modules/adsense/index.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   registerModule: () => (/* binding */ registerModule),
/* harmony export */   registerNotifications: () => (/* reexport safe */ _notifications__WEBPACK_IMPORTED_MODULE_10__.registerNotifications),
/* harmony export */   registerStore: () => (/* reexport safe */ _datastore__WEBPACK_IMPORTED_MODULE_8__.registerStore),
/* harmony export */   registerWidgets: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_9__.registerWidgets)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _components_setup__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/setup */ "./js/modules/adsense/components/setup/index.js");
/* harmony import */ var _components_settings__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/settings */ "./js/modules/adsense/components/settings/index.js");
/* harmony import */ var _svg_graphics_adsense_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/graphics/adsense.svg */ "./svg/graphics/adsense.svg");
/* harmony import */ var _datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _components_DashboardMainEffectComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/DashboardMainEffectComponent */ "./js/modules/adsense/components/DashboardMainEffectComponent.js");
/* harmony import */ var _datastore__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./datastore */ "./js/modules/adsense/datastore/index.js");
/* harmony import */ var _widgets__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./widgets */ "./js/modules/adsense/widgets/index.js");
/* harmony import */ var _notifications__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./notifications */ "./js/modules/adsense/notifications/index.js");
/**
 * AdSense module initialization.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */










function registerModule(modules) {
  modules.registerModule(_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ADSENSE, {
    storeName: _datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE,
    SettingsEditComponent: _components_settings__WEBPACK_IMPORTED_MODULE_2__.SettingsEdit,
    SettingsViewComponent: _components_settings__WEBPACK_IMPORTED_MODULE_2__.SettingsView,
    SettingsSetupIncompleteComponent: _components_settings__WEBPACK_IMPORTED_MODULE_2__.SettingsSetupIncomplete,
    SetupComponent: _components_setup__WEBPACK_IMPORTED_MODULE_1__.SetupMain,
    DashboardMainEffectComponent: _components_DashboardMainEffectComponent__WEBPACK_IMPORTED_MODULE_7__["default"],
    Icon: _svg_graphics_adsense_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
    features: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Intelligent, automatic ad placement will be disabled', 'google-site-kit'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You will miss out on revenue from ads placed on your site', 'google-site-kit'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('You will lose access to AdSense insights through Site Kit', 'google-site-kit')],
    checkRequirements: async registry => {
      const adBlockerActive = await registry.resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).isAdBlockerActive();
      if (!adBlockerActive) {
        return;
      }
      const message = registry.select(_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ADSENSE).getAdBlockerWarningMessage();
      throw {
        code: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.ERROR_CODE_ADBLOCKER_ACTIVE,
        message,
        data: null
      };
    }
  });
}

/***/ }),

/***/ "./js/modules/adsense/notifications/index.js":
/*!***************************************************!*\
  !*** ./js/modules/adsense/notifications/index.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ADSENSE_NOTIFICATIONS: () => (/* binding */ ADSENSE_NOTIFICATIONS),
/* harmony export */   registerNotifications: () => (/* binding */ registerNotifications)
/* harmony export */ });
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.js");
/* harmony import */ var _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/modules/adsense/datastore/constants */ "./js/modules/adsense/datastore/constants.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_modules_adsense_components_dashboard_AdBlockingRecoverySetupSuccessNotification__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/adsense/components/dashboard/AdBlockingRecoverySetupSuccessNotification */ "./js/modules/adsense/components/dashboard/AdBlockingRecoverySetupSuccessNotification.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_components_OverlayNotification_AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/OverlayNotification/AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification */ "./js/components/OverlayNotification/AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification.js");
/* harmony import */ var _js_components_OverlayNotification_LinkAnalyticsAndAdSenseAccountsOverlayNotification__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/OverlayNotification/LinkAnalyticsAndAdSenseAccountsOverlayNotification */ "./js/components/OverlayNotification/LinkAnalyticsAndAdSenseAccountsOverlayNotification.js");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_googlesitekit_notifications_util_create_register_notifications__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/googlesitekit/notifications/util/create-register-notifications */ "./js/googlesitekit/notifications/util/create-register-notifications.js");
/**
 * AdSense module notification registrations.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */













const ADSENSE_NOTIFICATIONS = {
  'adsense-abr-success-notification': {
    Component: _js_modules_adsense_components_dashboard_AdBlockingRecoverySetupSuccessNotification__WEBPACK_IMPORTED_MODULE_6__["default"],
    priority: 10,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.NOTIFICATION_AREAS.DASHBOARD_TOP,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_5__.VIEW_CONTEXT_MAIN_DASHBOARD],
    checkRequirements: async ({
      select,
      resolveSelect
    }) => {
      // Check the query arg first as the simplest condition using global location.
      const notification = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_13__.getQueryArg)(location.href, 'notification');
      if (notification !== 'ad_blocking_recovery_setup_success') {
        return false;
      }
      const {
        isModuleConnected
      } = resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES);
      if (!(await isModuleConnected(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_1__.MODULE_SLUG_ADSENSE))) {
        return false;
      }
      await resolveSelect(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ADSENSE).getSettings();
      const adBlockingRecoverySetupStatus = select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ADSENSE).getAdBlockingRecoverySetupStatus();
      if (adBlockingRecoverySetupStatus === _js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.ENUM_AD_BLOCKING_RECOVERY_SETUP_STATUS.SETUP_CONFIRMED) {
        return true;
      }
      return false;
    }
  },
  [_js_components_OverlayNotification_AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification__WEBPACK_IMPORTED_MODULE_9__.ANALYTICS_ADSENSE_LINKED_OVERLAY_NOTIFICATION]: {
    Component: _js_components_OverlayNotification_AnalyticsAndAdSenseAccountsDetectedAsLinkedOverlayNotification__WEBPACK_IMPORTED_MODULE_9__["default"],
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.PRIORITY.SETUP_CTA_HIGH,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.NOTIFICATION_AREAS.OVERLAYS,
    groupID: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.NOTIFICATION_GROUPS.SETUP_CTAS,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_5__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_5__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY],
    isDismissible: true,
    checkRequirements: async ({
      select,
      resolveSelect
    }) => {
      await Promise.all([
      // The hasAccessToShareableModule() selector relies on
      // the resolution of getAuthentication().
      resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).getAuthentication(),
      // The isModuleConnected() and hasAccessToShareableModule() selectors
      // rely on the resolution of the getModules() resolver.
      resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).getModules()]);
      const adSenseModuleConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isModuleConnected(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_1__.MODULE_SLUG_ADSENSE);
      const analyticsModuleConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ANALYTICS_4);
      const canViewSharedAdsense = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).hasAccessToShareableModule(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_1__.MODULE_SLUG_ADSENSE);
      const canViewSharedAnalytics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).hasAccessToShareableModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ANALYTICS_4);
      if (!(adSenseModuleConnected && analyticsModuleConnected && canViewSharedAdsense && canViewSharedAnalytics)) {
        return false;
      }

      // The getAdSenseLinked() selector relies on the resolution
      // of the getSettings() resolver.
      await resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getSettings();
      const isAdSenseLinked = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getAdSenseLinked();
      if (!isAdSenseLinked) {
        return false;
      }

      // The getAccountID() selector relies on the resolution
      // of the getSettings() resolver.
      await resolveSelect(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ADSENSE).getSettings();
      const adSenseAccountID = select(_js_modules_adsense_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ADSENSE).getAccountID();
      const {
        startDate,
        endDate
      } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).getDateRangeDates({
        offsetDays: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.DATE_RANGE_OFFSET
      });
      const reportArgs = {
        startDate,
        endDate,
        dimensions: ['pagePath', 'adSourceName'],
        metrics: [{
          name: 'totalAdRevenue'
        }],
        dimensionFilters: {
          adSourceName: `Google AdSense account (${adSenseAccountID})`
        },
        orderby: [{
          metric: {
            metricName: 'totalAdRevenue'
          },
          desc: true
        }],
        limit: 1,
        reportID: 'notifications_analytics-adsense-linked-overlay_reportArgs'
      };
      const reportData = await resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getReport(reportArgs);
      return (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_11__.isZeroReport)(reportData) === false;
    }
  },
  [_js_components_OverlayNotification_LinkAnalyticsAndAdSenseAccountsOverlayNotification__WEBPACK_IMPORTED_MODULE_10__.LINK_ANALYTICS_ADSENSE_OVERLAY_NOTIFICATION]: {
    Component: _js_components_OverlayNotification_LinkAnalyticsAndAdSenseAccountsOverlayNotification__WEBPACK_IMPORTED_MODULE_10__["default"],
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.PRIORITY.SETUP_CTA_LOW,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.NOTIFICATION_AREAS.OVERLAYS,
    groupID: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.NOTIFICATION_GROUPS.SETUP_CTAS,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_5__.VIEW_CONTEXT_MAIN_DASHBOARD],
    isDismissible: true,
    checkRequirements: async ({
      select,
      resolveSelect
    }) => {
      await Promise.all([
      // The isModuleConnected() selector relies on the resolution
      // of the getModules() resolver.
      resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).getModules()]);
      const adSenseModuleConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isModuleConnected(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_1__.MODULE_SLUG_ADSENSE);
      const analyticsModuleConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ANALYTICS_4);
      if (!(adSenseModuleConnected && analyticsModuleConnected)) {
        return false;
      }

      // The getAdSenseLinked() selector relies on the resolution
      // of the getSettings() resolver.
      await resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getSettings();
      const isAdSenseLinked = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getAdSenseLinked();
      return isAdSenseLinked === false;
    }
  }
};
function registerNotifications(notifications) {
  (0,_js_googlesitekit_notifications_util_create_register_notifications__WEBPACK_IMPORTED_MODULE_12__.createRegisterNotifications)(notifications, ADSENSE_NOTIFICATIONS);
}

/***/ }),

/***/ "./js/modules/adsense/util/ad-blocking-recovery-tag-matcher.js":
/*!*********************************************************************!*\
  !*** ./js/modules/adsense/util/ad-blocking-recovery-tag-matcher.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Ad Blocking Recovery Tag matching patterns.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([
// Detect the src URL in script tag and capture the accountID.
/<script async src="https:\/\/fundingchoicesmessages\.google\.com\/i\/(.*?)\?ers=/]);

/***/ }),

/***/ "./js/modules/adsense/util/date.js":
/*!*****************************************!*\
  !*** ./js/modules/adsense/util/date.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   adsenseDateToInstance: () => (/* binding */ adsenseDateToInstance),
/* harmony export */   dateInstanceToAdSenseDate: () => (/* binding */ dateInstanceToAdSenseDate)
/* harmony export */ });
/**
 * AdSense Date utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * @since 1.36.0
 * @see (@link https://developers.google.com/adsense/management/reference/rest/v2/Date)
 *
 * @typedef {Object} AdSenseDate
 * @property {number} year  Full year (integer).
 * @property {number} month Month number (1-based integer).
 * @property {number} day   Day number (1-based integer).
 */

/**
 * Converts an AdSense date to Date instance.
 *
 * @since 1.36.0
 *
 * @param {AdSenseDate} adsenseDate AdSense date object.
 * @return {Date} Date instance.
 */
function adsenseDateToInstance({
  year = 0,
  month = 1,
  day = 0
} = {}) {
  return new Date(year, month - 1, day);
}

/**
 * Creates an AdSense date object from a Date instance.
 *
 * @since 1.36.0
 *
 * @param {Date} date Date instance.
 * @return {AdSenseDate} AdSense date object.
 */
function dateInstanceToAdSenseDate(date) {
  var _date$getFullYear, _ref, _date$getDate;
  return {
    year: (_date$getFullYear = date?.getFullYear()) !== null && _date$getFullYear !== void 0 ? _date$getFullYear : 0,
    month: (_ref = date?.getMonth() + 1) !== null && _ref !== void 0 ? _ref : 0,
    day: (_date$getDate = date?.getDate()) !== null && _date$getDate !== void 0 ? _date$getDate : 0
  };
}

/***/ }),

/***/ "./js/modules/adsense/util/index.js":
/*!******************************************!*\
  !*** ./js/modules/adsense/util/index.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ACCOUNT_STATUS_APPROVED: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_APPROVED),
/* harmony export */   ACCOUNT_STATUS_CLIENT_GETTING_READY: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_CLIENT_GETTING_READY),
/* harmony export */   ACCOUNT_STATUS_CLIENT_REQUIRES_REVIEW: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_CLIENT_REQUIRES_REVIEW),
/* harmony export */   ACCOUNT_STATUS_DISAPPROVED: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_DISAPPROVED),
/* harmony export */   ACCOUNT_STATUS_GRAYLISTED: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_GRAYLISTED),
/* harmony export */   ACCOUNT_STATUS_MULTIPLE: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_MULTIPLE),
/* harmony export */   ACCOUNT_STATUS_NEEDS_ATTENTION: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_NEEDS_ATTENTION),
/* harmony export */   ACCOUNT_STATUS_NONE: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_NONE),
/* harmony export */   ACCOUNT_STATUS_NO_CLIENT: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_NO_CLIENT),
/* harmony export */   ACCOUNT_STATUS_PENDING: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_PENDING),
/* harmony export */   ACCOUNT_STATUS_READY: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.ACCOUNT_STATUS_READY),
/* harmony export */   SITE_STATUS_ADDED: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.SITE_STATUS_ADDED),
/* harmony export */   SITE_STATUS_GETTING_READY: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.SITE_STATUS_GETTING_READY),
/* harmony export */   SITE_STATUS_NEEDS_ATTENTION: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.SITE_STATUS_NEEDS_ATTENTION),
/* harmony export */   SITE_STATUS_NONE: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.SITE_STATUS_NONE),
/* harmony export */   SITE_STATUS_READY: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.SITE_STATUS_READY),
/* harmony export */   SITE_STATUS_READY_NO_AUTO_ADS: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.SITE_STATUS_READY_NO_AUTO_ADS),
/* harmony export */   SITE_STATUS_REQUIRES_REVIEW: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.SITE_STATUS_REQUIRES_REVIEW),
/* harmony export */   errorToStatus: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.errorToStatus),
/* harmony export */   getSiteStatsDataForGoogleChart: () => (/* reexport safe */ _site_stats_data__WEBPACK_IMPORTED_MODULE_4__.getSiteStatsDataForGoogleChart),
/* harmony export */   isPendingAccountStatus: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.isPendingAccountStatus),
/* harmony export */   isValidAccountID: () => (/* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.isValidAccountID),
/* harmony export */   isValidClientID: () => (/* reexport safe */ _validation__WEBPACK_IMPORTED_MODULE_6__.isValidClientID),
/* harmony export */   isZeroReport: () => (/* reexport safe */ _is_zero_report__WEBPACK_IMPORTED_MODULE_2__.isZeroReport),
/* harmony export */   legacyAccountStatuses: () => (/* reexport safe */ _status__WEBPACK_IMPORTED_MODULE_5__.legacyAccountStatuses),
/* harmony export */   parseAccountID: () => (/* reexport safe */ _parsing__WEBPACK_IMPORTED_MODULE_3__.parseAccountID),
/* harmony export */   parseAccountIDFromExistingTag: () => (/* reexport safe */ _parsing__WEBPACK_IMPORTED_MODULE_3__.parseAccountIDFromExistingTag),
/* harmony export */   parseDomain: () => (/* reexport safe */ _url__WEBPACK_IMPORTED_MODULE_7__.parseDomain),
/* harmony export */   reduceAdSenseData: () => (/* binding */ reduceAdSenseData)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _is_zero_report__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-zero-report */ "./js/modules/adsense/util/is-zero-report.js");
/* harmony import */ var _parsing__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./parsing */ "./js/modules/adsense/util/parsing.js");
/* harmony import */ var _site_stats_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./site-stats-data */ "./js/modules/adsense/util/site-stats-data.js");
/* harmony import */ var _status__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./status */ "./js/modules/adsense/util/status.js");
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./validation */ "./js/modules/adsense/util/validation.js");
/* harmony import */ var _url__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./url */ "./js/modules/adsense/util/url.js");
/**
 * AdSense utility functions.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/*
 * Internal dependencies
 */







function reduceAdSenseData(rows) {
  const dataMap = [[{
    type: 'date',
    label: 'Day'
  }, {
    type: 'number',
    label: 'RPM'
  }, {
    type: 'number',
    label: 'Earnings'
  }, {
    type: 'number',
    label: 'Impressions'
  }]];
  (0,lodash__WEBPACK_IMPORTED_MODULE_0__.each)(rows, row => {
    const date = (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.stringToDate)(row.cells[0].value);
    dataMap.push([date, row.cells[2].value, row.cells[1].value, row.cells[3].value]);
  });
  return {
    dataMap
  };
}

/***/ }),

/***/ "./js/modules/adsense/util/is-zero-report.js":
/*!***************************************************!*\
  !*** ./js/modules/adsense/util/is-zero-report.js ***!
  \***************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isZeroReport: () => (/* binding */ isZeroReport)
/* harmony export */ });
/**
 * Report utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Checks whether the report data is empty or not.
 *
 * @since 1.21.0
 *
 * @param {Object} report             Report data.
 * @param {number} selectedStatsIndex The index of the selected stats tab.
 * @return {boolean|undefined} TRUE if the report has no data, otherwise FALSE. `undefined` if the `report` passed is undefined.
 */
function isZeroReport(report, selectedStatsIndex) {
  if (report === undefined) {
    return undefined;
  }
  const {
    rows,
    totals
  } = report || {};
  if (!rows?.length) {
    return true;
  }
  if (!totals?.cells?.length) {
    return true;
  }

  // Take into account the value of the selected tab.
  if (+totals.cells[selectedStatsIndex]?.value === 0) {
    return true;
  }
  return false;
}

/***/ }),

/***/ "./js/modules/adsense/util/parsing.js":
/*!********************************************!*\
  !*** ./js/modules/adsense/util/parsing.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parseAccountID: () => (/* binding */ parseAccountID),
/* harmony export */   parseAccountIDFromExistingTag: () => (/* binding */ parseAccountIDFromExistingTag)
/* harmony export */ });
/* harmony import */ var _validation__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./validation */ "./js/modules/adsense/util/validation.js");
/**
 * Parsing utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */


/**
 * Parses the AdSense account ID from a given AdSense client ID.
 *
 * @since 1.9.0
 *
 * @param {string} clientID AdSense client ID.
 * @return {(string|undefined)} AdSense account ID, or undefined if invalid client ID.
 */
function parseAccountID(clientID) {
  if (!(0,_validation__WEBPACK_IMPORTED_MODULE_0__.isValidClientID)(clientID)) {
    return undefined;
  }
  return clientID.match(/pub-\d+$/)[0];
}

/**
 * Parses the AdSense account ID from an existing tag.
 *
 * @since 1.105.0
 *
 * @param {string} existingTag Existing tag.
 * @return {(string|undefined)} AdSense account ID, or undefined if invalid tag.
 */
function parseAccountIDFromExistingTag(existingTag) {
  if (!(0,_validation__WEBPACK_IMPORTED_MODULE_0__.isValidAccountID)(existingTag)) {
    return undefined;
  }
  return existingTag.match(/pub-\d+$/)[0];
}

/***/ }),

/***/ "./js/modules/adsense/util/report-date-range-args.js":
/*!***********************************************************!*\
  !*** ./js/modules/adsense/util/report-date-range-args.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   generateDateRangeArgs: () => (/* binding */ generateDateRangeArgs)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * Report date range args utils.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Generates an object with the appropriate structure to pass to report selectors.
 *
 * @since 1.27.0
 *
 * @param {Object} dates           Object containing the start and end dates.
 * @param {string} dates.startDate Start date in YYYY-MM-DD format.
 * @param {string} dates.endDate   End date in YYYY-MM-DD format.
 * @return {Object} Date range object.
 */
function generateDateRangeArgs(dates) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(dates, 'A dates object is required.');
  const {
    startDate,
    endDate
  } = dates;
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util__WEBPACK_IMPORTED_MODULE_1__.isValidDateString)(startDate), 'A valid startDate is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util__WEBPACK_IMPORTED_MODULE_1__.isValidDateString)(endDate), 'A valid endDate is required.');
  return {
    d: `${startDate.replace(/-/g, '/')}-${endDate.replace(/-/g, '/')}`
  };
}

/***/ }),

/***/ "./js/modules/adsense/util/report-validation.js":
/*!******************************************************!*\
  !*** ./js/modules/adsense/util/report-validation.js ***!
  \******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   validateDimensions: () => (/* binding */ validateDimensions),
/* harmony export */   validateMetrics: () => (/* binding */ validateMetrics)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_1__);
/**
 * Reporting API validation utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


/* eslint-disable-next-line */
/** @see (@link https://developers.google.com/adsense/management/reference/rest/v2/Metric) */
const VALID_METRICS = ['ACTIVE_VIEW_MEASURABILITY', 'ACTIVE_VIEW_TIME', 'ACTIVE_VIEW_VIEWABILITY', 'AD_REQUESTS_COVERAGE', 'AD_REQUESTS_CTR', 'AD_REQUESTS_RPM', 'AD_REQUESTS_SPAM_RATIO', 'AD_REQUESTS', 'ADS_PER_IMPRESSION', 'CLICKS_SPAM_RATIO', 'CLICKS', 'COST_PER_CLICK', 'ESTIMATED_EARNINGS', 'IMPRESSIONS_CTR', 'IMPRESSIONS_RPM', 'IMPRESSIONS_SPAM_RATIO', 'IMPRESSIONS', 'INDIVIDUAL_AD_IMPRESSIONS_CTR', 'INDIVIDUAL_AD_IMPRESSIONS_RPM', 'INDIVIDUAL_AD_IMPRESSIONS_SPAM_RATIO', 'INDIVIDUAL_AD_IMPRESSIONS', 'MATCHED_AD_REQUESTS_CTR', 'MATCHED_AD_REQUESTS_RPM', 'MATCHED_AD_REQUESTS_SPAM_RATIO', 'MATCHED_AD_REQUESTS', 'METRIC_UNSPECIFIED', 'PAGE_VIEWS_CTR', 'PAGE_VIEWS_RPM', 'PAGE_VIEWS_SPAM_RATIO', 'PAGE_VIEWS', 'TOTAL_EARNINGS', 'TOTAL_IMPRESSIONS', 'WEBSEARCH_RESULT_PAGES'];

/* eslint-disable-next-line */
/** @see (@link https://developers.google.com/adsense/management/reference/rest/v2/Dimension) */
const VALID_DIMENSIONS = ['ACCOUNT_NAME', 'AD_CLIENT_ID', 'AD_FORMAT_CODE', 'AD_FORMAT_NAME', 'AD_PLACEMENT_CODE', 'AD_PLACEMENT_NAME', 'AD_UNIT_ID', 'AD_UNIT_NAME', 'AD_UNIT_SIZE_CODE', 'AD_UNIT_SIZE_NAME', 'BID_TYPE_CODE', 'BID_TYPE_NAME', 'BUYER_NETWORK_ID', 'BUYER_NETWORK_NAME', 'CONTENT_PLATFORM_CODE', 'CONTENT_PLATFORM_NAME', 'COUNTRY_CODE', 'COUNTRY_NAME', 'CREATIVE_SIZE_CODE', 'CREATIVE_SIZE_NAME', 'CUSTOM_CHANNEL_ID', 'CUSTOM_CHANNEL_NAME', 'CUSTOM_SEARCH_STYLE_ID', 'CUSTOM_SEARCH_STYLE_NAME', 'DATE', 'DIMENSION_UNSPECIFIED', 'DOMAIN_CODE', 'DOMAIN_NAME', 'DOMAIN_REGISTRANT', 'MONTH', 'OWNED_SITE_DOMAIN_NAME', 'OWNED_SITE_ID', 'PLATFORM_TYPE_CODE', 'PLATFORM_TYPE_NAME', 'PRODUCT_CODE', 'PRODUCT_NAME', 'REQUESTED_AD_TYPE_CODE', 'REQUESTED_AD_TYPE_NAME', 'SERVED_AD_TYPE_CODE', 'SERVED_AD_TYPE_NAME', 'TARGETING_TYPE_CODE', 'TARGETING_TYPE_NAME', 'URL_CHANNEL_ID', 'URL_CHANNEL_NAME', 'WEBSEARCH_QUERY_STRING', 'WEEK'];

/**
 * Validates the given metrics are valid to be used in a request.
 *
 * @since 1.36.0
 *
 * @param {(Array|string)} metrics Metric(s) to validate.
 */
function validateMetrics(metrics) {
  const metricsArray = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.castArray)(metrics);
  invariant__WEBPACK_IMPORTED_MODULE_1___default()(metricsArray.length, 'at least one metric is required.');
  const invalidMetrics = metricsArray.filter(metric => !VALID_METRICS.includes(metric));
  invariant__WEBPACK_IMPORTED_MODULE_1___default()(invalidMetrics.length === 0, `invalid AdSense metrics requested: ${invalidMetrics.toString()}`);
}

/**
 * Validates the given dimensions are valid to be used in a request.
 *
 * @since 1.36.0
 *
 * @param {(Array|string)} dimensions Dimension(s) to validate.
 */
function validateDimensions(dimensions) {
  const dimensionsArray = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.castArray)(dimensions);
  invariant__WEBPACK_IMPORTED_MODULE_1___default()(dimensionsArray.length, 'at least one dimension is required.');
  const invalidDimensions = dimensionsArray.filter(metric => !VALID_DIMENSIONS.includes(metric));
  invariant__WEBPACK_IMPORTED_MODULE_1___default()(invalidDimensions.length === 0, `invalid AdSense dimensions requested: ${invalidDimensions.toString()}`);
}

/***/ }),

/***/ "./js/modules/adsense/util/site-stats-data.js":
/*!****************************************************!*\
  !*** ./js/modules/adsense/util/site-stats-data.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getSiteStatsDataForGoogleChart: () => (/* binding */ getSiteStatsDataForGoogleChart)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _date__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date */ "./js/modules/adsense/util/date.js");
/**
 * Site stats utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Gets data for a Google Chart from an AdSense report.
 *
 * @since 1.23.0
 * @since 1.36.0 Updated for API v2 report format.
 *
 * @param {Object} current        A report object for the current period.
 * @param {Object} previous       A report object for the previous period.
 * @param {string} label          Metric label.
 * @param {number} selectedColumn Selected column index.
 * @param {Object} metadata       Data metadata.
 * @return {Array.<Array.<number|string>>} Data array.
 */
function getSiteStatsDataForGoogleChart(current, previous, label, selectedColumn, metadata) {
  const dataMap = [[{
    type: 'date',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Day', 'google-site-kit')
  }, {
    type: 'string',
    role: 'tooltip',
    p: {
      html: true
    }
  }, {
    type: 'number',
    label
  }, {
    type: 'number',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Previous period', 'google-site-kit')
  }]];
  function nextDate(date) {
    // Valid use of `new Date()` with an argument.
    // eslint-disable-next-line sitekit/no-direct-date
    const next = new Date(date);
    next.setDate(date.getDate() + 1);
    return next;
  }
  function findRowByDate(searchDate) {
    return row => searchDate.getTime() === (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.stringToDate)(row.cells[0].value).getTime();
  }
  let currentDate = (0,_date__WEBPACK_IMPORTED_MODULE_3__.adsenseDateToInstance)(current.startDate);
  let previousDate = (0,_date__WEBPACK_IMPORTED_MODULE_3__.adsenseDateToInstance)(previous.startDate);
  const endDate = (0,_date__WEBPACK_IMPORTED_MODULE_3__.adsenseDateToInstance)(current.endDate);
  const locale = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.getLocale)();
  const localeDateOptions = {
    weekday: 'short',
    month: 'short',
    day: 'numeric'
  };
  while (currentDate <= endDate) {
    const currentMonth = parseFloat((current?.rows || []).find(findRowByDate(currentDate))?.cells?.[selectedColumn]?.value || 0);
    const prevMonth = parseFloat((previous?.rows || []).find(findRowByDate(previousDate))?.cells?.[selectedColumn]?.value || 0);
    const difference = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.calculateDifferenceBetweenChartValues)(currentMonth, prevMonth);
    const svgArrow = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.getChartDifferenceArrow)(difference);
    const dateRange = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: date for user stats, 2: previous date for user stats comparison */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%1$s vs %2$s', 'Date range for chart tooltip', 'google-site-kit'), currentDate.toLocaleDateString(locale, localeDateOptions), previousDate.toLocaleDateString(locale, localeDateOptions));
    let tooltipData = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.numFmt)(currentMonth, metadata?.currencyCode);
    if (metadata?.type === 'METRIC_RATIO') {
      tooltipData = (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.numFmt)(currentMonth, '%');
    }
    const statInfo = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: selected stat label, 2: numeric value of selected stat, 3: up or down arrow , 4: different change in percentage, %%: percent symbol */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%1$s: <strong>%2$s</strong> <em>%3$s %4$s%%</em>', 'Stat information for chart tooltip', 'google-site-kit'), label, tooltipData, svgArrow, Math.abs(difference).toFixed(2).replace(/(.00|0)$/, '') // .replace( ... ) removes trailing zeros
    );
    dataMap.push([currentDate, `<div class="${classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-visualization-tooltip', {
      'googlesitekit-visualization-tooltip--up': difference > 0,
      'googlesitekit-visualization-tooltip--down': difference < 0
    })}">
				<p>${dateRange}</p>
				<p>${statInfo}</p>
			</div>`, currentMonth, prevMonth]);
    currentDate = nextDate(currentDate);
    previousDate = nextDate(previousDate);
  }
  return dataMap;
}

/***/ }),

/***/ "./js/modules/adsense/util/site.js":
/*!*****************************************!*\
  !*** ./js/modules/adsense/util/site.js ***!
  \*****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   determineSiteFromDomain: () => (/* binding */ determineSiteFromDomain)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Site utilities.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Determines the AdSense site from the given domain.
 *
 * This utility function should be used in combination with data retrieved from
 * the datastore, hence passing undefined (loading state) is supported.
 *
 * @since 1.72.0
 *
 * @param {(Array|undefined)}  sites  Array of AdSense site objects retrieved from the API.
 * @param {(string|undefined)} domain The domain string to match to a site.
 * @return {(Object|null|undefined)} AdSense site object that matches the domain, null if no match
 * found or undefined if any of the parameters are undefined.
 */
function determineSiteFromDomain(sites, domain) {
  if (undefined === sites || undefined === domain || !Array.isArray(sites)) {
    return undefined;
  }
  // Only consider sites with state (essentially non-subdomains).
  const sitesWithState = sites.filter(({
    state
  }) => !!state);

  // Look for an exact match first.
  const exactMatch = sitesWithState.find(site => site.domain === domain.toLowerCase());
  if (exactMatch) {
    return exactMatch;
  }
  const subdomainMatch = sitesWithState.find(site => {
    // Note the prefixed `.` to ensure only a subdomain is matched
    // not simply a substring of a longer domain with the same ending.
    const inclusiveRegExp = new RegExp(`\\.${(0,lodash__WEBPACK_IMPORTED_MODULE_0__.escapeRegExp)(site.domain)}$`, 'i' // case-insensitive
    );
    // Check to see if `domain` is a subdomain of the site
    return inclusiveRegExp.test(domain);
  });
  return subdomainMatch || null;
}

/***/ }),

/***/ "./js/modules/adsense/util/status.js":
/*!*******************************************!*\
  !*** ./js/modules/adsense/util/status.js ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ACCOUNT_STATUS_APPROVED: () => (/* binding */ ACCOUNT_STATUS_APPROVED),
/* harmony export */   ACCOUNT_STATUS_CLIENT_GETTING_READY: () => (/* binding */ ACCOUNT_STATUS_CLIENT_GETTING_READY),
/* harmony export */   ACCOUNT_STATUS_CLIENT_REQUIRES_REVIEW: () => (/* binding */ ACCOUNT_STATUS_CLIENT_REQUIRES_REVIEW),
/* harmony export */   ACCOUNT_STATUS_DISAPPROVED: () => (/* binding */ ACCOUNT_STATUS_DISAPPROVED),
/* harmony export */   ACCOUNT_STATUS_GRAYLISTED: () => (/* binding */ ACCOUNT_STATUS_GRAYLISTED),
/* harmony export */   ACCOUNT_STATUS_MULTIPLE: () => (/* binding */ ACCOUNT_STATUS_MULTIPLE),
/* harmony export */   ACCOUNT_STATUS_NEEDS_ATTENTION: () => (/* binding */ ACCOUNT_STATUS_NEEDS_ATTENTION),
/* harmony export */   ACCOUNT_STATUS_NONE: () => (/* binding */ ACCOUNT_STATUS_NONE),
/* harmony export */   ACCOUNT_STATUS_NO_CLIENT: () => (/* binding */ ACCOUNT_STATUS_NO_CLIENT),
/* harmony export */   ACCOUNT_STATUS_PENDING: () => (/* binding */ ACCOUNT_STATUS_PENDING),
/* harmony export */   ACCOUNT_STATUS_READY: () => (/* binding */ ACCOUNT_STATUS_READY),
/* harmony export */   SITE_STATUS_ADDED: () => (/* binding */ SITE_STATUS_ADDED),
/* harmony export */   SITE_STATUS_GETTING_READY: () => (/* binding */ SITE_STATUS_GETTING_READY),
/* harmony export */   SITE_STATUS_NEEDS_ATTENTION: () => (/* binding */ SITE_STATUS_NEEDS_ATTENTION),
/* harmony export */   SITE_STATUS_NONE: () => (/* binding */ SITE_STATUS_NONE),
/* harmony export */   SITE_STATUS_READY: () => (/* binding */ SITE_STATUS_READY),
/* harmony export */   SITE_STATUS_READY_NO_AUTO_ADS: () => (/* binding */ SITE_STATUS_READY_NO_AUTO_ADS),
/* harmony export */   SITE_STATUS_REQUIRES_REVIEW: () => (/* binding */ SITE_STATUS_REQUIRES_REVIEW),
/* harmony export */   errorToStatus: () => (/* binding */ errorToStatus),
/* harmony export */   isPendingAccountStatus: () => (/* binding */ isPendingAccountStatus),
/* harmony export */   legacyAccountStatuses: () => (/* binding */ legacyAccountStatuses)
/* harmony export */ });
/**
 * Status utlities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

// V1 setup flow.
const ACCOUNT_STATUS_DISAPPROVED = 'disapproved';
const ACCOUNT_STATUS_GRAYLISTED = 'graylisted';
const ACCOUNT_STATUS_PENDING = 'pending';
const ACCOUNT_STATUS_APPROVED = 'approved';

// V2 setup flow.
const ACCOUNT_STATUS_NEEDS_ATTENTION = 'needs-attention';
const ACCOUNT_STATUS_READY = 'ready';
const ACCOUNT_STATUS_CLIENT_REQUIRES_REVIEW = 'client-requires-review';
const ACCOUNT_STATUS_CLIENT_GETTING_READY = 'client-getting-ready';

// V1 and V2 setup flow.
const ACCOUNT_STATUS_NONE = 'none';
const ACCOUNT_STATUS_MULTIPLE = 'multiple';
const ACCOUNT_STATUS_NO_CLIENT = 'no-client';

// V1 setup flow.
const SITE_STATUS_ADDED = 'added';

// V2 setup flow.
const SITE_STATUS_NEEDS_ATTENTION = 'needs-attention';
const SITE_STATUS_REQUIRES_REVIEW = 'requires-review';
const SITE_STATUS_GETTING_READY = 'getting-ready';
const SITE_STATUS_READY = 'ready';
const SITE_STATUS_READY_NO_AUTO_ADS = 'ready-no-auto-ads';

// V1 and V2 setup flow.
const SITE_STATUS_NONE = 'none';
const legacyAccountStatuses = [ACCOUNT_STATUS_DISAPPROVED, ACCOUNT_STATUS_GRAYLISTED, ACCOUNT_STATUS_PENDING, ACCOUNT_STATUS_APPROVED];

/**
 * Checks whether the given account status is considered pending.
 *
 * @since 1.9.0
 *
 * @param {(string|undefined)} accountStatus Account status.
 * @return {boolean} True if pending, false otherwise.
 */
function isPendingAccountStatus(accountStatus) {
  return accountStatus === ACCOUNT_STATUS_GRAYLISTED || accountStatus === ACCOUNT_STATUS_PENDING;
}

/**
 * Transforms an AdSense API error to the appropriate status.
 *
 * @since 1.9.0
 *
 * @param {(Object|undefined)} error Error object or undefined.
 * @return {(string|undefined)} Status based on error, or undefined if no relevant error.
 */
function errorToStatus(error) {
  return accountsErrorToStatus(error) || alertsErrorToStatus(error) || urlChannelsErrorToStatus(error);
}
function accountsErrorToStatus(error) {
  // These specific errors represent account statuses for our purposes.
  // They can be returned from the 'accounts' datapoint.
  if (isError(error, 'noAdSenseAccount')) {
    return ACCOUNT_STATUS_NONE;
  }
  if (isError(error, 'disapprovedAccount')) {
    return ACCOUNT_STATUS_DISAPPROVED;
  }
  return undefined;
}
function alertsErrorToStatus(error) {
  // These specific errors represent account statuses for our purposes.
  // They can be returned from the 'alerts' datapoint.
  if (isError(error, 'accountPendingReview')) {
    return ACCOUNT_STATUS_PENDING;
  }
  return undefined;
}
function urlChannelsErrorToStatus(error) {
  if (error?.message && error.message.toLowerCase() === 'ad client not found.') {
    return ACCOUNT_STATUS_PENDING;
  }
  return undefined;
}
function isError(error, errorReason) {
  if (!error || !error.data) {
    return false;
  }
  return errorReason === error.data.reason;
}

/***/ }),

/***/ "./js/modules/adsense/util/tag-matchers.js":
/*!*************************************************!*\
  !*** ./js/modules/adsense/util/tag-matchers.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * Tag matching patterns.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ([
// Detect google_ad_client.
/google_ad_client: ?["|'](.*?)["|']/,
// Detect old style auto-ads tags.
/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/,
// Detect new style auto-ads tags.
/<(?:script|amp-auto-ads)[^>]*src="[^"]*\?client=(ca-pub-[^"]+)"[^>]*>/]);

/***/ }),

/***/ "./js/modules/adsense/util/url.js":
/*!****************************************!*\
  !*** ./js/modules/adsense/util/url.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   parseDomain: () => (/* binding */ parseDomain)
/* harmony export */ });
/* harmony import */ var psl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! psl */ "../node_modules/psl/dist/psl.mjs");
/**
 * URL utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Parses a URL to retrieve the domain.
 *
 * @since 1.14.0
 *
 * @param {string} url The url to parse.
 * @return {string} The domain of the url passed.
 */
function parseDomain(url) {
  const urlObj = new URL(url);
  const {
    domain
  } = (0,psl__WEBPACK_IMPORTED_MODULE_0__.parse)(urlObj.hostname);
  return domain;
}

/***/ }),

/***/ "./js/modules/adsense/util/validation.js":
/*!***********************************************!*\
  !*** ./js/modules/adsense/util/validation.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isValidAccountID: () => (/* binding */ isValidAccountID),
/* harmony export */   isValidClientID: () => (/* binding */ isValidClientID)
/* harmony export */ });
/**
 * Validation utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Checks if the given account ID appears to be a valid AdSense account.
 *
 * @since 1.9.0
 *
 * @param {string|number} accountID Account ID to test.
 * @return {boolean} True if the given account ID is valid, false otherwise.
 */
function isValidAccountID(accountID) {
  return typeof accountID === 'string' && /^pub-\d+$/.test(accountID);
}

/**
 * Checks if the given client ID appears to be a valid AdSense client.
 *
 * @since 1.9.0
 *
 * @param {string|number} clientID Client ID to test.
 * @return {boolean} True if the given client ID is valid, false otherwise.
 */
function isValidClientID(clientID) {
  return typeof clientID === 'string' && /^ca-pub-\d+$/.test(clientID);
}

/***/ }),

/***/ "./js/modules/adsense/widgets/index.js":
/*!*********************************************!*\
  !*** ./js/modules/adsense/widgets/index.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   registerWidgets: () => (/* binding */ registerWidgets)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _js_modules_adsense_components_dashboard__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/adsense/components/dashboard */ "./js/modules/adsense/components/dashboard/index.js");
/* harmony import */ var _js_modules_adsense_components_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/adsense/components/module */ "./js/modules/adsense/components/module/index.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_adsense_components_widgets__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/adsense/components/widgets */ "./js/modules/adsense/components/widgets/index.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/**
 * AdSense module widget registrations.
 *
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */








function registerWidgets(widgets) {
  widgets.registerWidget('adBlockingRecovery', {
    Component: _js_modules_adsense_components_dashboard__WEBPACK_IMPORTED_MODULE_1__.AdBlockingRecoverySetupCTAWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_0__.AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY]);

  /*
   * Key metrics widgets.
   */
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT, {
    Component: _js_modules_adsense_components_widgets__WEBPACK_IMPORTED_MODULE_4__.TopEarningContentWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE, _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => {
      const isViewOnly = !select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isAuthenticated();
      if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_ADSENSE_TOP_EARNING_CONTENT)) {
        return false;
      }
      const isAdSenseLinked = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getAdSenseLinked();
      if (isViewOnly && !isAdSenseLinked) {
        return false;
      }
      return true;
    }
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_0__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget('adBlockerWarning', {
    Component: _js_modules_adsense_components_dashboard__WEBPACK_IMPORTED_MODULE_1__.AdBlockerWarningWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_0__.AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY]);
  widgets.registerWidget('adsenseModuleOverview', {
    Component: _js_modules_adsense_components_module__WEBPACK_IMPORTED_MODULE_2__.ModuleOverviewWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 2,
    wrapWidget: false,
    modules: [_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_0__.AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY]);
  widgets.registerWidget('adsenseConnectCTA', {
    Component: _js_modules_adsense_components_dashboard__WEBPACK_IMPORTED_MODULE_1__.AdSenseConnectCTAWidget,
    width: [widgets.WIDGET_WIDTHS.FULL],
    priority: 2,
    wrapWidget: false,
    modules: [_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_0__.AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY]);

  // Register widget reliant on Analytics 4 (GA4).
  widgets.registerWidget('adsenseTopEarningPagesGA4', {
    Component: _js_modules_adsense_components_dashboard__WEBPACK_IMPORTED_MODULE_1__.DashboardTopEarningPagesWidgetGA4,
    width: [widgets.WIDGET_WIDTHS.HALF, widgets.WIDGET_WIDTHS.FULL],
    priority: 3,
    wrapWidget: false,
    modules: [_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ADSENSE, _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_0__.AREA_MAIN_DASHBOARD_MONETIZATION_PRIMARY]);
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreate/AccountField.js":
/*!********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/AccountField.js ***!
  \********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AccountField)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _CreateAccountField__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CreateAccountField */ "./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AccountField component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function AccountField() {
  const value = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.FORM_ACCOUNT_CREATE, 'accountName');
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_FORMS);
  const setValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(accountName => {
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.FORM_ACCOUNT_CREATE, {
      accountName
    });
  }, [setValues]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_CreateAccountField__WEBPACK_IMPORTED_MODULE_1__["default"], {
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Account', 'google-site-kit'),
    hasError: !value,
    value: value,
    setValue: setValue,
    name: "account"
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreate/CountrySelect.js":
/*!*********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/CountrySelect.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CountrySelect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/countries-timezones */ "./js/modules/analytics-4/utils/countries-timezones.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * CountrySelect component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







function CountrySelect() {
  const value = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, 'countryCode');
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_FORMS);
  const onEnhancedChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)((index, item) => {
    const newCountryCode = item.dataset.value;
    if (newCountryCode !== value && _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_3__.countriesByCode[newCountryCode]) {
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, {
        countryCode: newCountryCode,
        timezone:
        // eslint-disable-next-line sitekit/acronym-case
        _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_3__.countriesByCode[newCountryCode].defaultTimeZoneId
      });
    }
  }, [setValues, value]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Select, {
    className: "googlesitekit-analytics__select-country",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Country', 'google-site-kit'),
    value: value,
    onEnhancedChange: onEnhancedChange,
    enhanced: true,
    outlined: true,
    children: _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_3__.allCountries.map(({
      countryCode,
      displayName
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Option, {
      value: countryCode,
      children: displayName
    }, index))
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.js":
/*!**************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CreateAccountField)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * CreateAccountField component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


function CreateAccountField({
  hasError,
  value,
  setValue,
  name,
  label
}) {
  // Ensure field doesn't render until default value is available, fixing a potential render bug.
  if (value === undefined) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.TextField, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-text-field', {
      'mdc-text-field--error': hasError
    }),
    label: label,
    name: name,
    onChange: event => {
      setValue(event.target.value, name);
    },
    value: value,
    id: `googlesitekit_analytics_account_create_${name}`,
    outlined: true
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreate/PropertyField.js":
/*!*********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/PropertyField.js ***!
  \*********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PropertyField)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _CreateAccountField__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CreateAccountField */ "./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PropertyField component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */










function PropertyField() {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_2__.useFeature)('setupFlowRefresh');
  const value = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, 'propertyName');
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_FORMS);
  const isAnalyticsConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4));
  const setValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(propertyName => {
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, {
      propertyName
    });
  }, [setValues]);

  // Ensure the hint is not shown when editing Analytics settings.
  const showHint = setupFlowRefreshEnabled && !isAnalyticsConnected;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_CreateAccountField__WEBPACK_IMPORTED_MODULE_8__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Property', 'google-site-kit'),
      value: value,
      hasError: !value,
      setValue: setValue,
      name: "property"
    }), showHint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_9__.PropertyHint, {})]
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreate/TimezoneSelect.js":
/*!**********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/TimezoneSelect.js ***!
  \**********************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ TimezoneSelect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/countries-timezones */ "./js/modules/analytics-4/utils/countries-timezones.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TimezoneSelect component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







function TimezoneSelect() {
  const countryCode = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, 'countryCode');
  const value = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, 'timezone');
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_FORMS);
  const onEnhancedChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_8__.useCallback)((index, item) => {
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, {
      timezone: item.dataset.value
    });
  }, [setValues]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Select, {
    className: "googlesitekit-analytics__select-timezone",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Timezone', 'google-site-kit'),
    value: value,
    onEnhancedChange: onEnhancedChange,
    disabled: !countryCode,
    enhanced: true,
    outlined: true,
    children: (_js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_3__.timeZonesByCountryCode[countryCode] || []).map(
    // eslint-disable-next-line sitekit/acronym-case
    ({
      timeZoneId,
      displayName
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Option, {
      // eslint-disable-next-line sitekit/acronym-case
      value: timeZoneId,
      children: displayName
    }, index))
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreate/WebDataStreamField.js":
/*!**************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/WebDataStreamField.js ***!
  \**************************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ WebDataStreamField)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _CreateAccountField__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CreateAccountField */ "./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WebDataStreamField component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */










function WebDataStreamField() {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_2__.useFeature)('setupFlowRefresh');
  const value = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, 'dataStreamName');
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_FORMS);
  const isAnalyticsConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4));
  const setValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(dataStreamName => {
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, {
      dataStreamName
    });
  }, [setValues]);

  // Ensure the hint is not shown when editing Analytics settings.
  const showHint = setupFlowRefreshEnabled && !isAnalyticsConnected;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_CreateAccountField__WEBPACK_IMPORTED_MODULE_8__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Web data stream', 'google-site-kit'),
      value: value,
      hasError: !value,
      setValue: setValue,
      name: "dataStream"
    }), showHint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_9__.WebDataStreamHint, {})]
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreate/index.js":
/*!*************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/index.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AccountCreate)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_34___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_34__);
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.js");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_analytics_4_utils_account__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/account */ "./js/modules/analytics-4/utils/account.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.js");
/* harmony import */ var _TimezoneSelect__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./TimezoneSelect */ "./js/modules/analytics-4/components/common/AccountCreate/TimezoneSelect.js");
/* harmony import */ var _AccountField__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./AccountField */ "./js/modules/analytics-4/components/common/AccountCreate/AccountField.js");
/* harmony import */ var _PropertyField__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./PropertyField */ "./js/modules/analytics-4/components/common/AccountCreate/PropertyField.js");
/* harmony import */ var _CountrySelect__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./CountrySelect */ "./js/modules/analytics-4/components/common/AccountCreate/CountrySelect.js");
/* harmony import */ var _WebDataStreamField__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./WebDataStreamField */ "./js/modules/analytics-4/components/common/AccountCreate/WebDataStreamField.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_components_conversion_tracking_SetupPluginConversionTrackingNotice__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/js/components/conversion-tracking/SetupPluginConversionTrackingNotice */ "./js/components/conversion-tracking/SetupPluginConversionTrackingNotice.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AccountCreate component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */





/**
 * Internal dependencies
 */





























function AccountCreate({
  className
}) {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefresh');
  const [isNavigating, setIsNavigating] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_31__.useState)(false);
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getAccountSummaries());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const accountTicketTermsOfServiceURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getAccountTicketTermsOfServiceURL());
  const canSubmitAccountCreate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).canSubmitAccountCreate());
  const isDoingCreateAccount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).isDoingCreateAccount());
  const hasEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.EDIT_SCOPE));
  const hasGTMScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.GTM_SCOPE));
  const hasAccountCreateForm = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_FORMS).hasForm(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE));
  const autoSubmit = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_26__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, 'autoSubmit');
  const siteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getReferenceSiteURL());
  const siteName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getSiteName());
  const timezone = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getTimezone());
  const pluginConversionsDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getDocumentationLinkURL('plugin-conversion-tracking');
  });
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_23__["default"])();
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_FORMS);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_LOCATION);
  const {
    createAccount
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  const {
    setPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER);
  const {
    setConversionTrackingEnabled,
    saveConversionTrackingSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE);
  const hasRequiredScope = hasEditScope;

  // Redirect if the accountTicketTermsOfServiceURL is set.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_31__.useEffect)(() => {
    if (accountTicketTermsOfServiceURL) {
      (async () => {
        await (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.invalidateCache)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4);
        navigateTo(accountTicketTermsOfServiceURL);
      })();
    }
  }, [accountTicketTermsOfServiceURL, navigateTo]);

  // Set form defaults on initial render.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_31__.useEffect)(() => {
    // Only set the form if not already present in store.
    // e.g. after a snapshot has been restored.
    if (!hasAccountCreateForm) {
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, (0,_js_modules_analytics_4_utils_account__WEBPACK_IMPORTED_MODULE_14__.getAccountDefaults)({
        siteName,
        siteURL,
        timezone
      }));
    }
  }, [hasAccountCreateForm, siteName, siteURL, timezone, setValues]);
  const showProgress = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_32__.getQueryArg)(location.href, 'showProgress');
  const isInitialSetupFlow = !!showProgress && setupFlowRefreshEnabled;
  const handleSubmit = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_31__.useCallback)(async () => {
    const scopes = [];
    if (!hasEditScope) {
      scopes.push(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.EDIT_SCOPE);
    }
    // The GTM scope should be granted for GTE support, but
    // it is possible for it not to be at this point.
    // This saves an extra OAuth flow and is necessary for the
    // Google tag sync at the end of the post-provisioning flow.
    if (!hasGTMScope) {
      scopes.push(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.GTM_SCOPE);
    }

    // If scope not granted, trigger scope error right away. These are
    // typically handled automatically based on API responses, but
    // this particular case has some special handling to improve UX.
    if (scopes.length > 0) {
      // When state is restored, auto-submit the request again.
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, {
        autoSubmit: true
      });
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_12__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Additional permissions are required to create a new Analytics account.', 'google-site-kit'),
        data: {
          status: 403,
          scopes,
          skipModal: true
        }
      });
      return;
    }
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE, {
      autoSubmit: false
    });
    if (isInitialSetupFlow) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_setup`, 'setup_flow_v3_create_analytics_account');
    } else {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_analytics`, 'create_account', 'proxy');
    }
    const {
      error
    } = await createAccount({
      showProgress: showProgress === 'true'
    });
    if (!error) {
      setConversionTrackingEnabled(true);
      await saveConversionTrackingSettings();
      setIsNavigating(true);
    }
  }, [hasEditScope, hasGTMScope, setValues, isInitialSetupFlow, createAccount, showProgress, setPermissionScopeError, viewContext, setConversionTrackingEnabled, saveConversionTrackingSettings]);

  // If the user ends up back on this component with the required scope granted,
  // and already submitted the form, trigger the submit again.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_31__.useEffect)(() => {
    if (hasRequiredScope && autoSubmit) {
      handleSubmit();
    }
  }, [hasRequiredScope, autoSubmit, handleSubmit]);

  // If the user clicks "Back", rollback settings to restore saved values, if any.
  const {
    rollbackSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  const handleBack = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_31__.useCallback)(() => rollbackSettings(), [rollbackSettings]);
  if (isDoingCreateAccount || isNavigating || !hasResolvedAccounts || hasRequiredScope === undefined) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.ProgressBar, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsxs)("div", {
    className: className,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_16__["default"], {
      moduleSlug: "analytics-4",
      storeName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4
    }), !isInitialSetupFlow && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_25__["default"], {
      as: "h3",
      type: "title",
      size: "large",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Create your Analytics account', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_27__["default"], {
      size: isInitialSetupFlow ? 'large' : undefined,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('We’ve pre-filled the required information for your new account. Confirm or edit any details:', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_15__.Cell, {
        size: 6,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_AccountField__WEBPACK_IMPORTED_MODULE_18__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_15__.Cell, {
        size: 6,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_PropertyField__WEBPACK_IMPORTED_MODULE_19__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_15__.Cell, {
        size: 6,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_WebDataStreamField__WEBPACK_IMPORTED_MODULE_21__["default"], {})
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_15__.Cell, {
        size: 6,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_CountrySelect__WEBPACK_IMPORTED_MODULE_20__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_15__.Cell, {
        size: 6,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_TimezoneSelect__WEBPACK_IMPORTED_MODULE_17__["default"], {})
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_22__.EnhancedMeasurementSwitch, {
        formName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.FORM_ACCOUNT_CREATE,
        className: "googlesitekit-margin-bottom-0"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_components_conversion_tracking_SetupPluginConversionTrackingNotice__WEBPACK_IMPORTED_MODULE_24__["default"], {
        className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
          'googlesitekit-margin-top-0': !setupFlowRefreshEnabled
        }),
        message: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_33__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('To track how visitors interact with your site, Site Kit will enable plugin conversion tracking. You can always disable it in settings. <LearnMoreLink />', 'google-site-kit'), {
          LearnMoreLink: setupFlowRefreshEnabled ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_28__["default"], {
            href: pluginConversionsDocumentationURL,
            external: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more', 'google-site-kit')
          }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(_js_components_Null__WEBPACK_IMPORTED_MODULE_29__["default"], {})
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsxs)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_27__["default"], {
      className: "googlesitekit-analytics-setup__analytics-create-account-info",
      size: setupFlowRefreshEnabled ? 'small' : undefined,
      children: [hasRequiredScope && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)("span", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('You will be redirected to Google Analytics to accept the terms of service.', 'google-site-kit')
      }), !hasRequiredScope && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)("span", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('You will need to give Site Kit permission to create an Analytics account on your behalf and also accept the Google Analytics terms of service.', 'google-site-kit')
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsxs)("div", {
      className: "googlesitekit-setup-module__action",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
        disabled: !canSubmitAccountCreate,
        onClick: handleSubmit,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Create Account', 'google-site-kit')
      }), accounts && !!accounts.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_30__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
        className: "googlesitekit-setup-module__sub-action",
        onClick: handleBack,
        tertiary: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Back', 'google-site-kit')
      })]
    })]
  });
}
AccountCreate.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_34___default().string)
};

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountCreateLegacy.js":
/*!*************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreateLegacy.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AccountCreateLegacy)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _CreatePropertyInfoNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CreatePropertyInfoNotice */ "./js/modules/analytics-4/components/common/CreatePropertyInfoNotice.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Legacy Account Creation component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */









function AccountCreateLegacy() {
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getAccountSummaries());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getAccountID());
  const isCreateAccount = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.ACCOUNT_CREATE === accountID;
  const createAccountURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getServiceURL({
    path: '/provision/SignUp'
  }));
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const createAccountHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useCallback)(async event => {
    event.preventDefault();
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.trackEvent)(`${viewContext}_analytics`, 'create_account', 'custom-oauth');
    __webpack_require__.g.open(createAccountURL, '_blank');
  }, [createAccountURL, viewContext]);
  const {
    resetAccountSummaries,
    resetAccountSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4);
  const refetchAccountsHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.useCallback)(() => {
    resetAccountSummaries();
    resetAccountSettings();
  }, [resetAccountSettings, resetAccountSummaries]);
  if (!hasResolvedAccounts) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_CreatePropertyInfoNotice__WEBPACK_IMPORTED_MODULE_7__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_5__["default"], {
      moduleSlug: "analytics-4",
      storeName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4
    }), !isCreateAccount && accounts && accounts.length === 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Looks like you don’t have an Analytics account yet. Once you create it, click on "Re-fetch my account" and Site Kit will locate it.', 'google-site-kit')
    }), isCreateAccount && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_10__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('To create a new account, click the button below which will open the Google Analytics account creation screen in a new window.', 'google-site-kit')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Once completed, click the link below to re-fetch your accounts to continue.', 'google-site-kit')
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
      className: "googlesitekit-setup-module__action",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        onClick: createAccountHandler,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create an account', 'google-site-kit')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
        className: "googlesitekit-setup-module__sub-action",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
          onClick: refetchAccountsHandler,
          tertiary: true,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Re-fetch My Account', 'google-site-kit')
        })
      })]
    })]
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/AccountSelect.js":
/*!*******************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountSelect.js ***!
  \*******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ AccountSelect)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics-4 Account Select component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function AccountSelect({
  hasModuleAccess,
  onChange
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getAccountID());
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getAccountSummaries());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const {
    selectAccount
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4);
  const onAccountChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)((index, item) => {
    const newAccountID = item.dataset.value;
    if (accountID !== newAccountID) {
      selectAccount(newAccountID);
      const action = newAccountID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ACCOUNT_CREATE ? 'change_account_new' : 'change_account';
      (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_analytics`, action);
      if (onChange) {
        onChange();
      }
    }
  }, [accountID, selectAccount, viewContext, onChange]);
  if (!hasResolvedAccounts) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {
      small: true
    });
  }
  if (hasModuleAccess === false) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Select, {
      className: "googlesitekit-analytics__select-account",
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Account', 'google-site-kit'),
      value: accountID,
      enhanced: true,
      outlined: true,
      disabled: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Option, {
        value: accountID,
        children: accountID
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Select, {
    className: "googlesitekit-analytics__select-account",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Account', 'google-site-kit'),
    value: accountID,
    onEnhancedChange: onAccountChange,
    enhanced: true,
    outlined: true,
    children: (accounts || []).concat({
      _id: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.ACCOUNT_CREATE,
      displayName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Set up a new account', 'google-site-kit')
    }).map(({
      _id,
      displayName
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Option, {
      value: _id,
      children: displayName
    }, index))
  });
}
AccountSelect.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().bool)
};

/***/ }),

/***/ "./js/modules/analytics-4/components/common/CreatePropertyInfoNotice.js":
/*!******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/CreatePropertyInfoNotice.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ CreatePropertyInfoNotice)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_components_Notice_index__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/index */ "./js/components/Notice/index.js");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics GA4 Notice component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function CreatePropertyInfoNotice() {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getDocumentationLinkURL('ga4');
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Notice_index__WEBPACK_IMPORTED_MODULE_4__["default"], {
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__.TYPES.INFO,
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Got a Google Analytics property and want to find out how to use it with Site Kit? <a>Learn more</a>', 'google-site-kit'), {
      a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
        href: documentationURL,
        external: true
      })
    })
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/EnhancedMeasurementSwitch.js":
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/EnhancedMeasurementSwitch.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ EnhancedMeasurementSwitch)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_15___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_15__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_components_SupportLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/SupportLink */ "./js/components/SupportLink.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _svg_icons_tick_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/icons/tick.svg */ "./svg/icons/tick.svg");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EnhancedMeasurementSwitch component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */




/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */










function EnhancedMeasurementSwitch({
  className,
  onClick,
  disabled = false,
  loading = false,
  formName = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.ENHANCED_MEASUREMENT_FORM,
  isEnhancedMeasurementAlreadyEnabled = false,
  showTick = false
}) {
  const isEnhancedMeasurementEnabled = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_10__["default"])(formName, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.ENHANCED_MEASUREMENT_ENABLED);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_FORMS);
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_12__.useCallback)(() => {
    setValues(formName, {
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.ENHANCED_MEASUREMENT_ENABLED]: !isEnhancedMeasurementEnabled
    });
    (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_analytics`,
    // If the current status of enhanced measurement is enabled,
    // then it means that we disabled it, otherwise enabled it.
    isEnhancedMeasurementEnabled ? 'deactivate_enhanced_measurement' : 'activate_enhanced_measurement');
    onClick?.();
  }, [formName, isEnhancedMeasurementEnabled, onClick, setValues, viewContext]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_13__["default"])(() => {
    // Ensure the Enhanced Measurement activation banner won't be shown if we've updated the setting
    // via the switch.
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.ENHANCED_MEASUREMENT_FORM, {
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.ENHANCED_MEASUREMENT_SHOULD_DISMISS_ACTIVATION_BANNER]: true
    });
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-analytics-enable-enhanced-measurement', className, {
      'googlesitekit-analytics-enable-enhanced-measurement--loading': loading
    }),
    children: [loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.ProgressBar, {
      className: "googlesitekit-analytics-enable-enhanced-measurement__progress--settings-edit",
      small: true
    }), !loading && isEnhancedMeasurementAlreadyEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
      className: "googlesitekit-analytics-enable-enhanced-measurement__already-enabled-label",
      children: [showTick && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
        className: "googlesitekit-analytics-enable-enhanced-measurement__already-enabled-tick",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_svg_icons_tick_svg__WEBPACK_IMPORTED_MODULE_9__["default"], {})
      }), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Enhanced measurement is enabled for this web data stream', 'google-site-kit')]
    }), !loading && !isEnhancedMeasurementAlreadyEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Switch, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Enable enhanced measurement', 'google-site-kit'),
      checked: isEnhancedMeasurementEnabled,
      disabled: disabled,
      onClick: handleClick,
      hideLabel: false
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
      className: "googlesitekit-module-settings-group__helper-text",
      children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_14__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This allows you to measure interactions with your content (e.g. file downloads, form completions, video views). <a>Learn more</a>', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_SupportLink__WEBPACK_IMPORTED_MODULE_6__["default"], {
          path: "/analytics/answer/9216061",
          external: true
        })
      })
    })]
  });
}
EnhancedMeasurementSwitch.propTypes = {
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_15___default().func),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_15___default().bool),
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_15___default().bool),
  isEnhancedMeasurementAlreadyEnabled: (prop_types__WEBPACK_IMPORTED_MODULE_15___default().bool),
  showTick: (prop_types__WEBPACK_IMPORTED_MODULE_15___default().bool)
};

/***/ }),

/***/ "./js/modules/analytics-4/components/common/PropertyHint.js":
/*!******************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/PropertyHint.js ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PropertyHint)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_setup_StepHint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/setup/StepHint */ "./js/components/setup/StepHint/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics PropertyHint component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





function PropertyHint() {
  const learnMoreLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getDocumentationLinkURL('ga4-property'));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_setup_StepHint__WEBPACK_IMPORTED_MODULE_4__["default"], {
    leadingText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('What is an Analytics property?', 'google-site-kit'),
    tooltipText: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('An Analytics property is a container for data collected from a website. It represents a specific website, and within a property, you can view reports, manage data collection, attribution, privacy settings, and product links. <a>Learn more</a>', 'google-site-kit'), {
      a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
        href: learnMoreLink,
        external: true,
        hideExternalIndicator: true
      })
    })
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/PropertySelect.js":
/*!********************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/PropertySelect.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ PropertySelect)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GA4 Property Select component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







function PropertySelect(props) {
  const {
    isDisabled,
    hasModuleAccess,
    className,
    onChange = () => {}
  } = props;
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getAccountID());
  const properties = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => hasModuleAccess && !isDisabled ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getPropertySummaries(accountID) || [] : null);
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getPropertyID());
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (isDisabled) {
      return false;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).isLoadingPropertySummaries() || select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).isLoadingWebDataStreams({
      hasModuleAccess
    });
  });
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const {
    selectProperty
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4);
  const onPropertyChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)((index, {
    dataset
  }) => {
    const newPropertyID = dataset.value;
    if (propertyID === newPropertyID) {
      return;
    }
    selectProperty(newPropertyID);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_analytics`, newPropertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.PROPERTY_CREATE ? 'change_property_new' : 'change_property', 'ga4');
    onChange();
  }, [onChange, propertyID, selectProperty, viewContext]);
  if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidAccountID)(accountID)) {
    return null;
  } else if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {
      mobileVerticalSpacing: 76,
      desktopVerticalSpacing: 84,
      small: true
    });
  }
  const isValidSelection = propertyID === undefined || propertyID === '' ? true : (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidPropertySelection)(propertyID);
  if (hasModuleAccess === false) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Select, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-analytics-4__select-property', className),
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property', 'google-site-kit'),
      value: propertyID,
      enhanced: true,
      outlined: true,
      disabled: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Option, {
        value: propertyID,
        children: propertyID
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Select, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-analytics-4__select-property', className, {
      'mdc-select--invalid': !isValidSelection,
      'googlesitekit-analytics-4__select-property--loaded': !isDisabled && !isLoading
    }),
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property', 'google-site-kit'),
    value: propertyID,
    onEnhancedChange: onPropertyChange,
    disabled: isDisabled,
    enhanced: true,
    outlined: true,
    children: (properties || []).concat({
      _id: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.PROPERTY_CREATE,
      displayName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set up a new property', 'google-site-kit')
    }).map(({
      _id,
      displayName
    }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Option, {
      value: _id,
      children: _id === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.PROPERTY_CREATE ? displayName : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Property name. 2: Property ID. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%1$s (%2$s)', 'Analytics property name and ID', 'google-site-kit'), displayName, _id)
    }, _id))
  });
}
PropertySelect.propTypes = {
  isDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string),
  onChange: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().func)
};

/***/ }),

/***/ "./js/modules/analytics-4/components/common/TrackingExclusionSwitches.js":
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/TrackingExclusionSwitches.js ***!
  \*******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   TRACKING_CONTENT_CREATORS: () => (/* binding */ TRACKING_CONTENT_CREATORS),
/* harmony export */   TRACKING_LOGGED_IN_USERS: () => (/* binding */ TRACKING_LOGGED_IN_USERS),
/* harmony export */   "default": () => (/* binding */ TrackingExclusionSwitches),
/* harmony export */   trackingExclusionLabels: () => (/* binding */ trackingExclusionLabels)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics 4 Tracking Exclusion switches component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






const TRACKING_LOGGED_IN_USERS = 'loggedinUsers';
const TRACKING_CONTENT_CREATORS = 'contentCreators';
const trackingExclusionLabels = {
  [TRACKING_LOGGED_IN_USERS]: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All logged-in users', 'google-site-kit'),
  [TRACKING_CONTENT_CREATORS]: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Users that can write posts', 'google-site-kit')
};
function TrackingExclusionSwitches() {
  const trackingDisabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getTrackingDisabled());
  const {
    setTrackingDisabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4);
  let message;
  if (trackingDisabled && trackingDisabled.includes(TRACKING_LOGGED_IN_USERS)) {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All logged-in users will be excluded from Analytics tracking', 'google-site-kit');
  } else if (trackingDisabled && trackingDisabled.includes(TRACKING_CONTENT_CREATORS)) {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Users that can write posts will be excluded from Analytics tracking', 'google-site-kit');
  } else {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('All logged-in users will be included in Analytics tracking', 'google-site-kit');
  }
  const updateTrackingDisabled = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)((users, exclude) => {
    const trackingDisabledArray = exclude ? trackingDisabled.concat(users) : trackingDisabled.filter(item => item !== users);
    setTrackingDisabled(trackingDisabledArray);
  }, [trackingDisabled, setTrackingDisabled]);
  const onChangeTrackContentCreators = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(event => {
    const {
      checked: exclude
    } = event.target;
    updateTrackingDisabled(TRACKING_CONTENT_CREATORS, exclude);
  }, [updateTrackingDisabled]);
  const onChangeTrackLoggedInUsers = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(event => {
    const {
      checked: exclude
    } = event.target;
    updateTrackingDisabled(TRACKING_LOGGED_IN_USERS, exclude);
  }, [updateTrackingDisabled]);
  if (!Array.isArray(trackingDisabled)) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
    className: "googlesitekit-settings-module__fields-group",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_4__["default"], {
      as: "h4",
      size: "small",
      type: "title",
      className: "googlesitekit-settings-module__fields-group-title",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Exclude Analytics', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-item",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
        className: "googlesitekit-settings-module__inline-items",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
          className: "googlesitekit-settings-module__inline-item",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Switch, {
            label: trackingExclusionLabels[TRACKING_LOGGED_IN_USERS],
            checked: trackingDisabled.includes(TRACKING_LOGGED_IN_USERS),
            onClick: onChangeTrackLoggedInUsers,
            hideLabel: false
          })
        }), !trackingDisabled.includes(TRACKING_LOGGED_IN_USERS) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
          className: "googlesitekit-settings-module__inline-item",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Switch, {
            label: trackingExclusionLabels[TRACKING_CONTENT_CREATORS],
            checked: trackingDisabled.includes(TRACKING_CONTENT_CREATORS),
            onClick: onChangeTrackContentCreators,
            hideLabel: false
          })
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__["default"], {
        children: message
      })]
    })]
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/UseSnippetSwitch.js":
/*!**********************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/UseSnippetSwitch.js ***!
  \**********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ UseSnippetSwitch)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GA4 Use Snippet Switch component.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function UseSnippetSwitch({
  description
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const useSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getUseSnippet());
  const {
    setUseSnippet
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4);
  const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useCallback)(() => {
    const newUseSnippet = !useSnippet;
    setUseSnippet(newUseSnippet);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_analytics`, newUseSnippet ? 'enable_tag' : 'disable_tag', 'ga4');
  }, [useSnippet, setUseSnippet, viewContext]);
  if (useSnippet === undefined) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
    className: "googlesitekit-analytics-usesnippet",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Switch, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Place Google Analytics code', 'google-site-kit'),
      checked: useSnippet,
      onClick: onChange,
      hideLabel: false
    }), description]
  });
}
UseSnippetSwitch.propTypes = {
  description: (prop_types__WEBPACK_IMPORTED_MODULE_8___default().node)
};

/***/ }),

/***/ "./js/modules/analytics-4/components/common/WebDataStreamHint.js":
/*!***********************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/WebDataStreamHint.js ***!
  \***********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ WebDataStreamHint)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_setup_StepHint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/setup/StepHint */ "./js/components/setup/StepHint/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics WebDataStreamHint component.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





function WebDataStreamHint() {
  const learnMoreLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getDocumentationLinkURL('ga4-data-stream'));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_setup_StepHint__WEBPACK_IMPORTED_MODULE_4__["default"], {
    leadingText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('What is a web data stream?', 'google-site-kit'),
    tooltipText: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_6__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('A data stream is a flow of data from your visitors to Analytics. When a data stream is created, Analytics generates a snippet of code that is added to your site to collect that data. <a>Learn more</a>', 'google-site-kit'), {
      a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
        href: learnMoreLink,
        external: true,
        hideExternalIndicator: true
      })
    })
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/WebDataStreamNameInput.js":
/*!****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/WebDataStreamNameInput.js ***!
  \****************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ WebDataStreamNameInput)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/is-url.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_components_AccessibleWarningIcon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/AccessibleWarningIcon */ "./js/components/AccessibleWarningIcon.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics WebDataStreamNameInput component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */









function WebDataStreamNameInput() {
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getPropertyID());
  const webDataStreamID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getWebDataStreamID());
  const webDataStreamName = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.FORM_SETUP, 'webDataStreamName');
  const webDataStreamAlreadyExists = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID) ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).doesWebDataStreamExist(propertyID, webDataStreamName) : false);
  const siteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getReferenceSiteURL());
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_FORMS);
  const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_11__.useCallback)(({
    currentTarget
  }) => {
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.FORM_SETUP, {
      webDataStreamName: currentTarget.value
    });
  }, [setValues]);

  // Set the default web data stream name.
  (0,react_use__WEBPACK_IMPORTED_MODULE_12__["default"])(() => {
    if (!webDataStreamName && (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_13__.isURL)(siteURL)) {
      const {
        hostname
      } = new URL(siteURL);
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.FORM_SETUP, {
        webDataStreamName: hostname
      });
    }
  });

  // Return early if an existing web data stream is selected.
  if (webDataStreamID !== _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.WEBDATASTREAM_CREATE) {
    return null;
  }
  const error = webDataStreamAlreadyExists || !webDataStreamName || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamName)(webDataStreamName);
  let helperText = false;
  if (webDataStreamAlreadyExists) {
    helperText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('A web data stream with this name already exists.', 'google-site-kit');
  } else if (!webDataStreamName) {
    helperText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('A web data stream name is required.', 'google-site-kit');
  } else if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamName)(webDataStreamName)) {
    helperText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This is not a valid web data stream name.', 'google-site-kit');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
    className: "googlesitekit-analytics-webdatastreamname",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_7__.TextField, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
        'mdc-text-field--error': error
      }),
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Web data stream name', 'google-site-kit'),
      helperText: helperText,
      trailingIcon: error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "googlesitekit-text-field-icon--error",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_AccessibleWarningIcon__WEBPACK_IMPORTED_MODULE_6__["default"], {})
      }),
      value: webDataStreamName,
      onChange: onChange,
      outlined: true
    })
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/components/common/WebDataStreamSelect.js":
/*!*************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/WebDataStreamSelect.js ***!
  \*************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ WebDataStreamSelect)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_10__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







function WebDataStreamSelect(props) {
  const {
    hasModuleAccess,
    isDisabled,
    className,
    onChange
  } = props;
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getAccountID());
  const {
    propertyID,
    webDataStreamID,
    measurementID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getSettings() || {});
  const webDataStreams = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidPropertyID)(propertyID) && hasModuleAccess ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getWebDataStreams(propertyID) : []);
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (isDisabled) {
      return false;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).isLoadingWebDataStreams({
      hasModuleAccess
    });
  });
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const {
    setWebDataStreamID,
    updateSettingsForMeasurementID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4);
  const onWebDataStreamChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_9__.useCallback)((index, {
    dataset
  }) => {
    const newID = dataset.value;
    if (webDataStreamID === newID) {
      return;
    }
    setWebDataStreamID(newID);
    updateSettingsForMeasurementID(webDataStreams.find(({
      _id
    }) => _id === newID)?.webStreamData?.measurementId || '' // eslint-disable-line sitekit/acronym-case
    );
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_analytics`, newID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.WEBDATASTREAM_CREATE ? 'change_webdatastream_new' : 'change_webdatastream', 'ga4');
    if (onChange) {
      onChange();
    }
  }, [webDataStreams, webDataStreamID, setWebDataStreamID, updateSettingsForMeasurementID, viewContext, onChange]);
  if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidAccountID)(accountID)) {
    return null;
  } else if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {
      mobileVerticalSpacing: 76,
      desktopVerticalSpacing: 84,
      small: true
    });
  }
  const isValidSelection = webDataStreamID === undefined || webDataStreamID === '' ? true : (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidWebDataStreamSelection)(webDataStreamID);
  if (hasModuleAccess === false) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Select, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-analytics-4__select-webdatastream', className),
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Web data stream', 'google-site-kit'),
      value: measurementID,
      enhanced: true,
      outlined: true,
      disabled: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Option, {
        value: measurementID,
        children: measurementID
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Select, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-analytics-4__select-webdatastream', className, {
      'mdc-select--invalid': !isValidSelection
    }),
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Web data stream', 'google-site-kit'),
    value: webDataStreamID,
    onEnhancedChange: onWebDataStreamChange,
    disabled: isDisabled || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidPropertySelection)(propertyID),
    enhanced: true,
    outlined: true,
    children: (webDataStreams || []).concat({
      _id: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.WEBDATASTREAM_CREATE,
      displayName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set up a new web data stream', 'google-site-kit')
    }).map(({
      _id,
      displayName,
      webStreamData = {}
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Option, {
      value: _id,
      children: _id === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.WEBDATASTREAM_CREATE || !webStreamData?.measurementId // eslint-disable-line sitekit/acronym-case
      ? displayName : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Data stream name. 2: Measurement ID. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)('%1$s (%2$s)', 'Analytics data stream name and measurement ID', 'google-site-kit'), displayName, webStreamData.measurementId // eslint-disable-line sitekit/acronym-case
      )
    }, index))
  });
}
WebDataStreamSelect.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  isDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_10___default().string)
};

/***/ }),

/***/ "./js/modules/analytics-4/components/common/ZeroDataMessage.js":
/*!*********************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/ZeroDataMessage.js ***!
  \*********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ZeroDataMessage)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics ZeroDataMessage component.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function ZeroDataMessage({
  skipPrefix
}) {
  const url = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getCurrentEntityURL());
  if (skipPrefix) {
    return url ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your page hasn’t received any visitors yet', 'google-site-kit')
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site hasn’t received any visitors yet', 'google-site-kit')
    });
  }
  return url ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your page hasn’t received any visitors yet', 'google-site-kit')
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your site hasn’t received any visitors yet', 'google-site-kit')
  });
}
ZeroDataMessage.propTypes = {
  skipPrefix: (prop_types__WEBPACK_IMPORTED_MODULE_4___default().bool)
};

/***/ }),

/***/ "./js/modules/analytics-4/components/common/index.js":
/*!***********************************************************!*\
  !*** ./js/modules/analytics-4/components/common/index.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AccountCreate: () => (/* reexport safe */ _AccountCreate__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   AccountCreateLegacy: () => (/* reexport safe */ _AccountCreateLegacy__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   AccountSelect: () => (/* reexport safe */ _AccountSelect__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   CreatePropertyInfoNotice: () => (/* reexport safe */ _CreatePropertyInfoNotice__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   EnhancedMeasurementSwitch: () => (/* reexport safe */ _EnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   PropertyHint: () => (/* reexport safe */ _PropertyHint__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   PropertySelect: () => (/* reexport safe */ _PropertySelect__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   TrackingExclusionSwitches: () => (/* reexport safe */ _TrackingExclusionSwitches__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   UseSnippetSwitch: () => (/* reexport safe */ _UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_11__["default"]),
/* harmony export */   WebDataStreamHint: () => (/* reexport safe */ _WebDataStreamHint__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   WebDataStreamNameInput: () => (/* reexport safe */ _WebDataStreamNameInput__WEBPACK_IMPORTED_MODULE_9__["default"]),
/* harmony export */   WebDataStreamSelect: () => (/* reexport safe */ _WebDataStreamSelect__WEBPACK_IMPORTED_MODULE_10__["default"]),
/* harmony export */   ZeroDataMessage: () => (/* reexport safe */ _ZeroDataMessage__WEBPACK_IMPORTED_MODULE_12__["default"])
/* harmony export */ });
/* harmony import */ var _AccountCreate__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AccountCreate */ "./js/modules/analytics-4/components/common/AccountCreate/index.js");
/* harmony import */ var _AccountCreateLegacy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AccountCreateLegacy */ "./js/modules/analytics-4/components/common/AccountCreateLegacy.js");
/* harmony import */ var _AccountSelect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AccountSelect */ "./js/modules/analytics-4/components/common/AccountSelect.js");
/* harmony import */ var _CreatePropertyInfoNotice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CreatePropertyInfoNotice */ "./js/modules/analytics-4/components/common/CreatePropertyInfoNotice.js");
/* harmony import */ var _EnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./EnhancedMeasurementSwitch */ "./js/modules/analytics-4/components/common/EnhancedMeasurementSwitch.js");
/* harmony import */ var _PropertyHint__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PropertyHint */ "./js/modules/analytics-4/components/common/PropertyHint.js");
/* harmony import */ var _PropertySelect__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PropertySelect */ "./js/modules/analytics-4/components/common/PropertySelect.js");
/* harmony import */ var _TrackingExclusionSwitches__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./TrackingExclusionSwitches */ "./js/modules/analytics-4/components/common/TrackingExclusionSwitches.js");
/* harmony import */ var _WebDataStreamHint__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./WebDataStreamHint */ "./js/modules/analytics-4/components/common/WebDataStreamHint.js");
/* harmony import */ var _WebDataStreamNameInput__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./WebDataStreamNameInput */ "./js/modules/analytics-4/components/common/WebDataStreamNameInput.js");
/* harmony import */ var _WebDataStreamSelect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./WebDataStreamSelect */ "./js/modules/analytics-4/components/common/WebDataStreamSelect.js");
/* harmony import */ var _UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./UseSnippetSwitch */ "./js/modules/analytics-4/components/common/UseSnippetSwitch.js");
/* harmony import */ var _ZeroDataMessage__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ZeroDataMessage */ "./js/modules/analytics-4/components/common/ZeroDataMessage.js");
/**
 * GA4 common components.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */















/***/ }),

/***/ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js":
/*!******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js ***!
  \******************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ ConnectGA4CTATileWidget)
/* harmony export */ });
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! prop-types */ "../node_modules/prop-types/index.js");
/* harmony import */ var prop_types__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(prop_types__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/KeyMetrics/ConnectModuleCTATile */ "./js/components/KeyMetrics/ConnectModuleCTATile.js");
/* harmony import */ var _js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/hooks/useWidgetStateEffect */ "./js/googlesitekit/widgets/hooks/useWidgetStateEffect.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ConnectGA4CTATileWidget component.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */







const metadata = {
  moduleSlug: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ANALYTICS_4
};
function ConnectGA4CTATileWidget({
  Widget,
  widgetSlug
}) {
  const ga4DependantKeyMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const keyMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getKeyMetrics();
    if (!keyMetrics) {
      return [];
    }
    return keyMetrics.filter(keyMetric => _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.keyMetricsGA4Widgets.includes(keyMetric)).length;
  });

  // Only render the CTA if there are 3 or fewer GA4-dependent key metrics tiles.
  // Otherwise, render `Null` to hide the CTA.
  // If there are four GA4-dependent key metrics tiles, the `ConnectGA4CTAWidget` will be rendered instead.
  const ConnectModuleCTAComponent = ga4DependantKeyMetrics > 3 ? _js_components_Null__WEBPACK_IMPORTED_MODULE_5__["default"] : _js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_1__["default"];
  (0,_js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_2__["default"])(widgetSlug, ConnectModuleCTAComponent, metadata);

  // Note that we need to render the `Widget` component as a wrapper here so this component will display
  // correctly when used as a `FallbackComponent` for the `whenActive` HOC. Conversely, when `ConnectModuleCTATile`
  // is rendered as an `OverrideComponent` in `WidgetRenderer` (as a result of multiple adjacent widgets rendering
  // this component and thus sharing the same state), it is wrapped with a `Widget` component - the net
  // result being the ConnectModuleCTATile is correctly wrapped in a `Widget` in both cases.
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Widget, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_1__["default"], {
      ...metadata
    })
  });
}
ConnectGA4CTATileWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().elementType).isRequired,
  widgetSlug: (prop_types__WEBPACK_IMPORTED_MODULE_7___default().string).isRequired
};

/***/ }),

/***/ "./js/modules/analytics-4/constants.js":
/*!*********************************************!*\
  !*** ./js/modules/analytics-4/constants.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ACTIVATION_ACKNOWLEDGEMENT_TOOLTIP_STATE_KEY: () => (/* binding */ ACTIVATION_ACKNOWLEDGEMENT_TOOLTIP_STATE_KEY),
/* harmony export */   ACTIVATION_STEP_IN_PROGRESS: () => (/* binding */ ACTIVATION_STEP_IN_PROGRESS),
/* harmony export */   ACTIVATION_STEP_REMINDER: () => (/* binding */ ACTIVATION_STEP_REMINDER),
/* harmony export */   ACTIVATION_STEP_SETUP: () => (/* binding */ ACTIVATION_STEP_SETUP),
/* harmony export */   ACTIVATION_STEP_SUCCESS: () => (/* binding */ ACTIVATION_STEP_SUCCESS),
/* harmony export */   ENHANCED_MEASUREMENT_ACTIVATION_BANNER_TOOLTIP_STATE_KEY: () => (/* binding */ ENHANCED_MEASUREMENT_ACTIVATION_BANNER_TOOLTIP_STATE_KEY),
/* harmony export */   GA4_ACTIVATION_BANNER_STATE_KEY: () => (/* binding */ GA4_ACTIVATION_BANNER_STATE_KEY),
/* harmony export */   GA4_AUTO_SWITCH_DATE: () => (/* binding */ GA4_AUTO_SWITCH_DATE),
/* harmony export */   KM_CONNECT_GA4_CTA_WIDGET_DISMISSED_ITEM_KEY: () => (/* binding */ KM_CONNECT_GA4_CTA_WIDGET_DISMISSED_ITEM_KEY),
/* harmony export */   LEGACY_ENHANCED_MEASUREMENT_ACTIVATION_BANNER_DISMISSED_ITEM_KEY: () => (/* binding */ LEGACY_ENHANCED_MEASUREMENT_ACTIVATION_BANNER_DISMISSED_ITEM_KEY),
/* harmony export */   MODULE_SLUG_ANALYTICS_4: () => (/* binding */ MODULE_SLUG_ANALYTICS_4),
/* harmony export */   REPORT_ARGS_DATA_FILTERS_KEY: () => (/* binding */ REPORT_ARGS_DATA_FILTERS_KEY),
/* harmony export */   REPORT_ARGS_NAV_KEY: () => (/* binding */ REPORT_ARGS_NAV_KEY),
/* harmony export */   REPORT_ARGS_SELECTED_DIMENSION_KEY: () => (/* binding */ REPORT_ARGS_SELECTED_DIMENSION_KEY),
/* harmony export */   REPORT_ARGS_SELECTED_METRIC_KEY: () => (/* binding */ REPORT_ARGS_SELECTED_METRIC_KEY)
/* harmony export */ });
/**
 * GA4 module constants.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const ACTIVATION_STEP_REMINDER = 0;
const ACTIVATION_STEP_SETUP = 1;
const ACTIVATION_STEP_SUCCESS = 2;
const ACTIVATION_STEP_IN_PROGRESS = 3;
const ACTIVATION_ACKNOWLEDGEMENT_TOOLTIP_STATE_KEY = 'activation-acknowledgement-tooltip-state';
const GA4_ACTIVATION_BANNER_STATE_KEY = 'ga4-activation-banner-state';
const ENHANCED_MEASUREMENT_ACTIVATION_BANNER_TOOLTIP_STATE_KEY = 'enhanced-measurement-activation-banner-tooltip-state';
const LEGACY_ENHANCED_MEASUREMENT_ACTIVATION_BANNER_DISMISSED_ITEM_KEY = 'enhanced-measurement-activation-banner-dismissed-item';
const REPORT_ARGS_SELECTED_METRIC_KEY = '_r.explorerCard..selmet';
const REPORT_ARGS_SELECTED_DIMENSION_KEY = '_r.explorerCard..seldim';
const REPORT_ARGS_DATA_FILTERS_KEY = '_r..dataFilters';
const REPORT_ARGS_NAV_KEY = '_r..nav';
const KM_CONNECT_GA4_CTA_WIDGET_DISMISSED_ITEM_KEY = 'key-metrics-connect-ga4-cta-widget';

/**
 * Date that Site Kit will automatically switch to using GA4: September 25, 2023.
 *
 * With Site Kit's maximum date range being three months, once this period has passed since the UA cutoff date,
 * it will no longer be able to show any historical data for UA and will automatically switch to GA4.
 * For operational reasons, we automatically make the switch a few days before the three month cutoff point.
 *
 * @since 1.107.0
 * @see UA_CUTOFF_DATE.
 */
const GA4_AUTO_SWITCH_DATE = '2023-09-25';
const MODULE_SLUG_ANALYTICS_4 = 'analytics-4';

/***/ }),

/***/ "./js/modules/analytics-4/datastore/constants.js":
/*!*******************************************************!*\
  !*** ./js/modules/analytics-4/datastore/constants.js ***!
  \*******************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ACCOUNT_CREATE: () => (/* binding */ ACCOUNT_CREATE),
/* harmony export */   AUDIENCE_FILTER_CLAUSE_TYPE_ENUM: () => (/* binding */ AUDIENCE_FILTER_CLAUSE_TYPE_ENUM),
/* harmony export */   AUDIENCE_FILTER_SCOPE_ENUM: () => (/* binding */ AUDIENCE_FILTER_SCOPE_ENUM),
/* harmony export */   AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX: () => (/* binding */ AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX),
/* harmony export */   AUDIENCE_SEGMENTATION_SETUP_FORM: () => (/* binding */ AUDIENCE_SEGMENTATION_SETUP_FORM),
/* harmony export */   AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE: () => (/* binding */ AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE),
/* harmony export */   AUDIENCE_TYPE_SORT_ORDER: () => (/* binding */ AUDIENCE_TYPE_SORT_ORDER),
/* harmony export */   CONVERSION_REPORTING_LEAD_EVENTS: () => (/* binding */ CONVERSION_REPORTING_LEAD_EVENTS),
/* harmony export */   CUSTOM_DIMENSION_DEFINITIONS: () => (/* binding */ CUSTOM_DIMENSION_DEFINITIONS),
/* harmony export */   DATE_RANGE_OFFSET: () => (/* binding */ DATE_RANGE_OFFSET),
/* harmony export */   EDIT_SCOPE: () => (/* binding */ EDIT_SCOPE),
/* harmony export */   ENHANCED_MEASUREMENT_ENABLED: () => (/* binding */ ENHANCED_MEASUREMENT_ENABLED),
/* harmony export */   ENHANCED_MEASUREMENT_FORM: () => (/* binding */ ENHANCED_MEASUREMENT_FORM),
/* harmony export */   ENHANCED_MEASUREMENT_SHOULD_DISMISS_ACTIVATION_BANNER: () => (/* binding */ ENHANCED_MEASUREMENT_SHOULD_DISMISS_ACTIVATION_BANNER),
/* harmony export */   ENUM_CONVERSION_EVENTS: () => (/* binding */ ENUM_CONVERSION_EVENTS),
/* harmony export */   FORM_ACCOUNT_CREATE: () => (/* binding */ FORM_ACCOUNT_CREATE),
/* harmony export */   FORM_CUSTOM_DIMENSIONS_CREATE: () => (/* binding */ FORM_CUSTOM_DIMENSIONS_CREATE),
/* harmony export */   FORM_SETUP: () => (/* binding */ FORM_SETUP),
/* harmony export */   GTM_SCOPE: () => (/* binding */ GTM_SCOPE),
/* harmony export */   MAX_WEBDATASTREAMS_PER_BATCH: () => (/* binding */ MAX_WEBDATASTREAMS_PER_BATCH),
/* harmony export */   MODULES_ANALYTICS_4: () => (/* binding */ MODULES_ANALYTICS_4),
/* harmony export */   PROPERTY_CREATE: () => (/* binding */ PROPERTY_CREATE),
/* harmony export */   PROVISIONING_SCOPE: () => (/* binding */ PROVISIONING_SCOPE),
/* harmony export */   RESOURCE_TYPES: () => (/* binding */ RESOURCE_TYPES),
/* harmony export */   RESOURCE_TYPE_AUDIENCE: () => (/* binding */ RESOURCE_TYPE_AUDIENCE),
/* harmony export */   RESOURCE_TYPE_CUSTOM_DIMENSION: () => (/* binding */ RESOURCE_TYPE_CUSTOM_DIMENSION),
/* harmony export */   RESOURCE_TYPE_PROPERTY: () => (/* binding */ RESOURCE_TYPE_PROPERTY),
/* harmony export */   SITE_KIT_AUDIENCE_DEFINITIONS: () => (/* binding */ SITE_KIT_AUDIENCE_DEFINITIONS),
/* harmony export */   UI_ACTIVE_ROW_INDEX: () => (/* binding */ UI_ACTIVE_ROW_INDEX),
/* harmony export */   UI_ALL_TRAFFIC_LOADED: () => (/* binding */ UI_ALL_TRAFFIC_LOADED),
/* harmony export */   UI_DIMENSION_COLOR: () => (/* binding */ UI_DIMENSION_COLOR),
/* harmony export */   UI_DIMENSION_NAME: () => (/* binding */ UI_DIMENSION_NAME),
/* harmony export */   UI_DIMENSION_VALUE: () => (/* binding */ UI_DIMENSION_VALUE),
/* harmony export */   WEBDATASTREAM_CREATE: () => (/* binding */ WEBDATASTREAM_CREATE)
/* harmony export */ });
/**
 * `modules/analytics-4` data store constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const MODULES_ANALYTICS_4 = 'modules/analytics-4';

// A special Account ID value used for the "Set up a new account" option.
const ACCOUNT_CREATE = 'account_create';

// A special Property ID value used for the "Set up a new property" option.
const PROPERTY_CREATE = 'property_create';
const WEBDATASTREAM_CREATE = 'webdatastream_create';
const FORM_SETUP = 'analyticsSetup';
const MAX_WEBDATASTREAMS_PER_BATCH = 10;

// Date range offset days for Analytics 4 report requests.
const DATE_RANGE_OFFSET = 0;
const GTM_SCOPE = 'https://www.googleapis.com/auth/tagmanager.readonly';
const ENHANCED_MEASUREMENT_FORM = 'enhanced-measurement-form';
const ENHANCED_MEASUREMENT_ENABLED = 'enhanced-measurement-enabled';
const ENHANCED_MEASUREMENT_SHOULD_DISMISS_ACTIVATION_BANNER = 'enhanced-measurement-should-dismiss-activation-banner';

// Form ID for the account creation form.
const FORM_ACCOUNT_CREATE = 'analyticsAccountCreate';
const FORM_CUSTOM_DIMENSIONS_CREATE = 'analyticsCustomDimensionsCreate';

// OAuth scope required for provisioning a Google Analytics account.
const PROVISIONING_SCOPE = 'https://www.googleapis.com/auth/analytics.provision';
const EDIT_SCOPE = 'https://www.googleapis.com/auth/analytics.edit';

// Dashboard widget constants.
const UI_DIMENSION_NAME = 'dashboardAllTrafficWidgetDimensionName';
const UI_DIMENSION_COLOR = 'dashboardAllTrafficWidgetDimensionColor';
const UI_DIMENSION_VALUE = 'dashboardAllTrafficWidgetDimensionValue';
const UI_ACTIVE_ROW_INDEX = 'dashboardAllTrafficWidgetActiveRowIndex';
const UI_ALL_TRAFFIC_LOADED = 'dashboardAllTrafficWidgetLoaded';

// Note: names and descriptions are not translated as these are not surfaced in Site Kit
// and are also subject to hard limits on the length which would be unpredictable if translated.
// See https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1beta/properties.customDimensions#CustomDimension
const CUSTOM_DIMENSION_DEFINITIONS = {
  googlesitekit_post_date: {
    parameterName: 'googlesitekit_post_date',
    displayName: 'WordPress Post Date',
    description: 'Created by Site Kit: Date when a post was published',
    scope: 'EVENT'
  },
  googlesitekit_post_author: {
    parameterName: 'googlesitekit_post_author',
    displayName: 'WordPress Post Author',
    description: 'Created by Site Kit: WordPress name of the post author',
    scope: 'EVENT'
  },
  googlesitekit_post_categories: {
    parameterName: 'googlesitekit_post_categories',
    displayName: 'WordPress Post Categories',
    description: 'Created by Site Kit: Names of categories assigned to a post',
    scope: 'EVENT'
  },
  googlesitekit_post_type: {
    parameterName: 'googlesitekit_post_type',
    displayName: 'WordPress Post Type',
    description: 'Created by Site Kit: Content type of a post',
    scope: 'EVENT'
  }
};
const ENUM_CONVERSION_EVENTS = {
  ADD_TO_CART: 'add_to_cart',
  PURCHASE: 'purchase',
  SUBMIT_LEAD_FORM: 'submit_lead_form',
  GENERATE_LEAD: 'generate_lead',
  CONTACT: 'contact'
};
const CONVERSION_REPORTING_LEAD_EVENTS = [ENUM_CONVERSION_EVENTS.CONTACT, ENUM_CONVERSION_EVENTS.GENERATE_LEAD, ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM];

// Audience enums.
const AUDIENCE_FILTER_CLAUSE_TYPE_ENUM = {
  AUDIENCE_CLAUSE_TYPE_UNSPECIFIED: 'AUDIENCE_CLAUSE_TYPE_UNSPECIFIED',
  INCLUDE: 'INCLUDE',
  EXCLUDE: 'EXCLUDE'
};
const AUDIENCE_FILTER_SCOPE_ENUM = {
  AUDIENCE_FILTER_SCOPE_UNSPECIFIED: 'AUDIENCE_FILTER_SCOPE_UNSPECIFIED',
  AUDIENCE_FILTER_SCOPE_WITHIN_SAME_EVENT: 'AUDIENCE_FILTER_SCOPE_WITHIN_SAME_EVENT',
  AUDIENCE_FILTER_SCOPE_WITHIN_SAME_SESSION: 'AUDIENCE_FILTER_SCOPE_WITHIN_SAME_SESSION',
  AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS: 'AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS'
};
const SITE_KIT_AUDIENCE_DEFINITIONS = {
  'new-visitors': {
    description: 'People who visited the site for the first time',
    displayName: 'New visitors',
    membershipDurationDays: -1,
    // The longest duration, 540 days.
    filterClauses: [{
      clauseType: 'INCLUDE',
      simpleFilter: {
        scope: 'AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS',
        filterExpression: {
          andGroup: {
            filterExpressions: [{
              orGroup: {
                filterExpressions: [{
                  dimensionOrMetricFilter: {
                    fieldName: 'newVsReturning',
                    stringFilter: {
                      matchType: 'EXACT',
                      value: 'new'
                    }
                  }
                }]
              }
            }, {
              orGroup: {
                filterExpressions: [{
                  notExpression: {
                    dimensionOrMetricFilter: {
                      fieldName: 'groupId',
                      stringFilter: {
                        matchType: 'EXACT',
                        value: 'created_by_googlesitekit:new_visitors'
                      }
                    }
                  }
                }]
              }
            }]
          }
        }
      }
    }]
  },
  'returning-visitors': {
    description: 'People who have visited your site at least once before',
    displayName: 'Returning visitors',
    membershipDurationDays: -1,
    // The longest duration, 540 days.
    filterClauses: [{
      clauseType: 'INCLUDE',
      simpleFilter: {
        scope: 'AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS',
        filterExpression: {
          andGroup: {
            filterExpressions: [{
              orGroup: {
                filterExpressions: [{
                  dimensionOrMetricFilter: {
                    fieldName: 'newVsReturning',
                    stringFilter: {
                      matchType: 'EXACT',
                      value: 'returning'
                    }
                  }
                }]
              }
            }, {
              orGroup: {
                filterExpressions: [{
                  notExpression: {
                    dimensionOrMetricFilter: {
                      fieldName: 'groupId',
                      stringFilter: {
                        matchType: 'EXACT',
                        value: 'created_by_googlesitekit:returning_visitors'
                      }
                    }
                  }
                }]
              }
            }]
          }
        }
      }
    }]
  }
};
const AUDIENCE_SEGMENTATION_SETUP_FORM = 'audiencePermissionsSetup';
const AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE = 'audienceTileCustomDimensionCreate';
const AUDIENCE_TYPE_SORT_ORDER = {
  USER_AUDIENCE: 0,
  SITE_KIT_AUDIENCE: 1,
  DEFAULT_AUDIENCE: 2
};
const AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX = 'audience-selection-panel-expirable-new-badge-';
const RESOURCE_TYPE_AUDIENCE = 'audience';
const RESOURCE_TYPE_CUSTOM_DIMENSION = 'customDimension';
const RESOURCE_TYPE_PROPERTY = 'property';
const RESOURCE_TYPES = [RESOURCE_TYPE_AUDIENCE, RESOURCE_TYPE_CUSTOM_DIMENSION, RESOURCE_TYPE_PROPERTY];

/***/ }),

/***/ "./js/modules/analytics-4/utils/account.js":
/*!*************************************************!*\
  !*** ./js/modules/analytics-4/utils/account.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAccountDefaults: () => (/* binding */ getAccountDefaults),
/* harmony export */   populateAccountID: () => (/* binding */ populateAccountID),
/* harmony export */   populateAccountSummaries: () => (/* binding */ populateAccountSummaries),
/* harmony export */   populatePropertyAndAccountIds: () => (/* binding */ populatePropertyAndAccountIds)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/is-url.js");
/* harmony import */ var _countries_timezones__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./countries-timezones */ "./js/modules/analytics-4/utils/countries-timezones.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/**
 * Account helpers.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Gets default values for a new account.
 *
 * @since 1.98.0
 * @since 1.111.0 Added enhanced measurement enabled state to return value.
 *
 * @param {Object} args              Site information.
 * @param {string} args.siteName     Site name.
 * @param {string} args.siteURL      Site home URL.
 * @param {string} args.timezone     Site timezone.
 * @param {string} _fallbackTimezone Fallback timezone. Defaults to local timezone.
 *                                   This parameter should only be used for providing a deterministic fallback in tests.
 * @return {Object} Default property values for a new account.
 */
function getAccountDefaults({
  siteName,
  siteURL,
  timezone
}, _fallbackTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_3__.isURL)(siteURL), 'A valid siteURL is required.');
  const {
    hostname,
    pathname
  } = new URL(siteURL);
  return {
    accountName: siteName || hostname,
    propertyName: `${hostname}${pathname}`.replace(/\/$/, ''),
    dataStreamName: hostname,
    countryCode: _countries_timezones__WEBPACK_IMPORTED_MODULE_1__.countryCodesByTimezone[timezone] || _countries_timezones__WEBPACK_IMPORTED_MODULE_1__.countryCodesByTimezone[_fallbackTimezone],
    timezone: _countries_timezones__WEBPACK_IMPORTED_MODULE_1__.countryCodesByTimezone[timezone] ? timezone : _fallbackTimezone,
    [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.ENHANCED_MEASUREMENT_ENABLED]: true
  };
}

/**
 * Appends an account ID to an account object.
 *
 * @since 1.138.0
 *
 * @param {Object} account Account object.
 * @return {Object} Account object with an appended ID.
 */
function populateAccountID(account) {
  const matches = account.account?.match(/accounts\/([^/]+)/);
  const _id = matches?.[1];
  return {
    ...account,
    _id
  };
}

/**
 * Appends property and account IDs to a property object.
 *
 * @since 1.138.0
 *
 * @param {Object} property Property object.
 * @return {Object} Property object with appended IDs.
 */
function populatePropertyAndAccountIds(property) {
  const propertyMatches = property.property?.match(/properties\/([^/]+)/);
  const _id = propertyMatches?.[1];
  const accountMatches = property.parent?.match(/accounts\/([^/]+)/);
  const _accountID = accountMatches?.[1];
  return {
    ...property,
    _id,
    _accountID
  };
}

/**
 * Populates a list of accountSummaries with IDs for accounts and properties.
 *
 * @since 1.147.0
 *
 * @param {Array|unknown} accountSummaries Account summaries to populate.
 * @return {Array|unknown} Populated account summaries or given value if not an array.
 */
function populateAccountSummaries(accountSummaries) {
  if (!Array.isArray(accountSummaries)) {
    return accountSummaries;
  }
  return accountSummaries.map(account => {
    return {
      ...populateAccountID(account),
      propertySummaries: (account.propertySummaries || []).map(property => populatePropertyAndAccountIds(property))
    };
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/chart.js":
/*!***********************************************!*\
  !*** ./js/modules/analytics-4/utils/chart.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   extractAnalyticsDataForPieChart: () => (/* binding */ extractAnalyticsDataForPieChart),
/* harmony export */   isSingleSlice: () => (/* binding */ isSingleSlice)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Analytics utility functions.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Extracts data required for a pie chart from the Analytics 4 report information.
 *
 * @since 1.96.0
 *
 * @param {Array}    report                    The report data.
 * @param {Object}   [options]                 Optional. Data extraction options.
 * @param {number}   [options.keyColumnIndex]  Optional. The number of a column to extract metrics data from.
 * @param {number}   [options.maxSlices]       Optional. Limit the number of slices to display.
 * @param {boolean}  [options.withOthers]      Optional. Whether to add "Others" record to the data map. Only relevant
 *                                             if `maxSlices` is passed. If passed, the final slice will be the
 *                                             "Others" slice, i.e. the number of actual row slices will be
 *                                             `maxSlices - 1`.
 * @param {Function} [options.tooltipCallback] Optional. A callback function for tooltip column values.
 * @return {Array} Extracted data.
 */
function extractAnalyticsDataForPieChart(report, options = {}) {
  const {
    keyColumnIndex = 0,
    maxSlices,
    withOthers = false,
    tooltipCallback
  } = options;
  const {
    rows = []
  } = report || {};
  const withTooltips = typeof tooltipCallback === 'function';
  const columns = ['Source', 'Percent'];
  if (withTooltips) {
    columns.push({
      type: 'string',
      role: 'tooltip',
      p: {
        html: true
      }
    });
  }
  const dataMap = [columns];
  const currentDateRangeRows = rows.filter(({
    dimensionValues
  }) => dimensionValues[1].value === 'date_range_0');
  const totalCurrent = currentDateRangeRows.reduce((sum, row) => sum + parseInt(row.metricValues[0].value, 10), 0);
  const previousDateRangeRows = rows.filter(({
    dimensionValues
  }) => dimensionValues[1].value === 'date_range_1');
  const totalPrevious = previousDateRangeRows.reduce((sum, row) => sum + parseInt(row.metricValues[0].value, 10), 0);
  let hasOthers = withOthers;
  let rowsNumber = currentDateRangeRows.length;
  let othersCurrent = totalCurrent;
  let othersPrevious = totalPrevious;
  if (maxSlices > 0) {
    hasOthers = withOthers && currentDateRangeRows.length > maxSlices;
    rowsNumber = Math.min(currentDateRangeRows.length, hasOthers ? maxSlices - 1 : maxSlices);
  } else {
    hasOthers = false;
    rowsNumber = currentDateRangeRows.length;
  }
  for (let index = 0; index < rowsNumber; index++) {
    const row = currentDateRangeRows[index];
    const usersCurrent = row.metricValues[keyColumnIndex].value;
    const previousRow = previousDateRangeRows.find(({
      dimensionValues
    }) => dimensionValues[0].value === row.dimensionValues[0].value);
    const usersPrevious = previousRow ? previousRow.metricValues[keyColumnIndex].value : 0;
    othersCurrent -= usersCurrent;
    othersPrevious -= usersPrevious;
    const percent = totalCurrent > 0 ? usersCurrent / totalCurrent : 0;
    const rowData = [row.dimensionValues[0].value, percent];
    if (withTooltips) {
      const previousDateRangeRow = rows.find(({
        dimensionValues
      }) => dimensionValues[1].value === 'date_range_1' && dimensionValues[0].value === row.dimensionValues[0].value);
      rowData.push(tooltipCallback(row, previousDateRangeRow, rowData));
    }
    dataMap.push(rowData);
  }
  if (hasOthers && othersCurrent > 0) {
    const rowData = [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Others', 'google-site-kit'), othersCurrent / totalCurrent];
    if (withTooltips) {
      rowData.push(tooltipCallback({
        metricValues: [{
          value: othersCurrent
        }]
      }, {
        metricValues: [{
          value: othersPrevious
        }]
      }, rowData));
    }
    dataMap.push(rowData);
  }
  return dataMap;
}

/**
 * Checks if there is a single row of data or one row of the provided GA4 report is contributing 100% of the total for a given dimension.
 *
 * Note that chart reports will be in the multi-date range format.
 *
 * @since 1.96.0
 *
 * @param {Object} report The report data object.
 * @return {(boolean|undefined)} Returns undefined if report is undefined, true/false for the above conditions.
 */
function isSingleSlice(report) {
  if (report === undefined) {
    return undefined;
  }
  const currentDateRangeRows = (report?.rows || []).filter(({
    dimensionValues
  }) => dimensionValues[1].value === 'date_range_0');
  if (currentDateRangeRows?.length === 1 || currentDateRangeRows?.[0]?.metricValues?.[0]?.value === report?.totals?.[0]?.metricValues?.[0]?.value) {
    return true;
  }
  return false;
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/countries-data.js":
/*!********************************************************!*\
  !*** ./js/modules/analytics-4/utils/countries-data.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   countries: () => (/* binding */ countries)
/* harmony export */ });
/* eslint-disable sitekit/acronym-case */
const countries = {
  default: {
    defaultCountryCode: 'US',
    country: [{
      countryCode: 'AF',
      displayName: 'Afghanistan',
      defaultTimeZoneId: 'Asia/Kabul',
      timeZone: [{
        timeZoneId: 'Asia/Kabul',
        displayName: '(GMT+04:30) Afghanistan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'AL',
      displayName: 'Albania',
      defaultTimeZoneId: 'Europe/Tirane',
      timeZone: [{
        timeZoneId: 'Europe/Tirane',
        displayName: '(GMT+02:00) Albania Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'DZ',
      displayName: 'Algeria',
      defaultTimeZoneId: 'Africa/Algiers',
      timeZone: [{
        timeZoneId: 'Africa/Algiers',
        displayName: '(GMT+01:00) Algeria Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'AS',
      displayName: 'American Samoa',
      defaultTimeZoneId: 'Pacific/Pago_Pago',
      timeZone: [{
        timeZoneId: 'Pacific/Pago_Pago',
        displayName: '(GMT-11:00) American Samoa Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'AD',
      displayName: 'Andorra',
      defaultTimeZoneId: 'Europe/Andorra',
      timeZone: [{
        timeZoneId: 'Europe/Andorra',
        displayName: '(GMT+02:00) Andorra Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'AQ',
      displayName: 'Antarctica',
      defaultTimeZoneId: 'Antarctica/Palmer',
      timeZone: [{
        timeZoneId: 'Antarctica/Palmer',
        displayName: '(GMT-03:00) Palmer Time'
      }, {
        timeZoneId: 'Antarctica/Rothera',
        displayName: '(GMT-03:00) Rothera Time'
      }, {
        timeZoneId: 'Antarctica/Syowa',
        displayName: '(GMT+03:00) Syowa Time'
      }, {
        timeZoneId: 'Antarctica/Mawson',
        displayName: '(GMT+05:00) Mawson Time'
      }, {
        timeZoneId: 'Antarctica/Vostok',
        displayName: '(GMT+06:00) Vostok Time'
      }, {
        timeZoneId: 'Antarctica/Davis',
        displayName: '(GMT+07:00) Davis Time'
      }, {
        timeZoneId: 'Antarctica/Casey',
        displayName: '(GMT+08:00) Casey Time'
      }, {
        timeZoneId: 'Antarctica/DumontDUrville',
        displayName: '(GMT+10:00) Dumont d\u2019Urville Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'AR',
      displayName: 'Argentina',
      defaultTimeZoneId: 'America/Buenos_Aires',
      timeZone: [{
        timeZoneId: 'America/Buenos_Aires',
        displayName: '(GMT-03:00) Buenos Aires Time'
      }, {
        timeZoneId: 'America/Cordoba',
        displayName: '(GMT-03:00) Cordoba Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'AM',
      displayName: 'Armenia',
      defaultTimeZoneId: 'Asia/Yerevan',
      timeZone: [{
        timeZoneId: 'Asia/Yerevan',
        displayName: '(GMT+04:00) Armenia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'AU',
      displayName: 'Australia',
      defaultTimeZoneId: 'Australia/Perth',
      timeZone: [{
        timeZoneId: 'Australia/Perth',
        displayName: '(GMT+08:00) Perth Time'
      }, {
        timeZoneId: 'Australia/Adelaide',
        displayName: '(GMT+09:30) Adelaide Time'
      }, {
        timeZoneId: 'Australia/Darwin',
        displayName: '(GMT+09:30) Darwin Time'
      }, {
        timeZoneId: 'Australia/Brisbane',
        displayName: '(GMT+10:00) Brisbane Time'
      }, {
        timeZoneId: 'Australia/Hobart',
        displayName: '(GMT+10:00) Hobart Time'
      }, {
        timeZoneId: 'Australia/Melbourne',
        displayName: '(GMT+10:00) Melbourne Time'
      }, {
        timeZoneId: 'Australia/Sydney',
        displayName: '(GMT+10:00) Sydney Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'AT',
      displayName: 'Austria',
      defaultTimeZoneId: 'Europe/Vienna',
      timeZone: [{
        timeZoneId: 'Europe/Vienna',
        displayName: '(GMT+02:00) Austria Time'
      }],
      tosLocale: {
        language: 'de',
        country: 'DE'
      }
    }, {
      countryCode: 'AZ',
      displayName: 'Azerbaijan',
      defaultTimeZoneId: 'Asia/Baku',
      timeZone: [{
        timeZoneId: 'Asia/Baku',
        displayName: '(GMT+04:00) Azerbaijan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'BS',
      displayName: 'Bahamas',
      defaultTimeZoneId: 'America/Nassau',
      timeZone: [{
        timeZoneId: 'America/Nassau',
        displayName: '(GMT-04:00) Bahamas Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'BD',
      displayName: 'Bangladesh',
      defaultTimeZoneId: 'Asia/Dhaka',
      timeZone: [{
        timeZoneId: 'Asia/Dhaka',
        displayName: '(GMT+06:00) Bangladesh Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'BB',
      displayName: 'Barbados',
      defaultTimeZoneId: 'America/Barbados',
      timeZone: [{
        timeZoneId: 'America/Barbados',
        displayName: '(GMT-04:00) Barbados Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'BY',
      displayName: 'Belarus',
      defaultTimeZoneId: 'Europe/Minsk',
      timeZone: [{
        timeZoneId: 'Europe/Minsk',
        displayName: '(GMT+03:00) Belarus Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'BE',
      displayName: 'Belgium',
      defaultTimeZoneId: 'Europe/Brussels',
      timeZone: [{
        timeZoneId: 'Europe/Brussels',
        displayName: '(GMT+02:00) Belgium Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'BZ',
      displayName: 'Belize',
      defaultTimeZoneId: 'America/Belize',
      timeZone: [{
        timeZoneId: 'America/Belize',
        displayName: '(GMT-06:00) Belize Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'BM',
      displayName: 'Bermuda',
      defaultTimeZoneId: 'Atlantic/Bermuda',
      timeZone: [{
        timeZoneId: 'Atlantic/Bermuda',
        displayName: '(GMT-03:00) Bermuda Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'BT',
      displayName: 'Bhutan',
      defaultTimeZoneId: 'Asia/Thimphu',
      timeZone: [{
        timeZoneId: 'Asia/Thimphu',
        displayName: '(GMT+06:00) Bhutan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'BO',
      displayName: 'Bolivia',
      defaultTimeZoneId: 'America/La_Paz',
      timeZone: [{
        timeZoneId: 'America/La_Paz',
        displayName: '(GMT-04:00) Bolivia Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'BA',
      displayName: 'Bosnia \u0026 Herzegovina',
      defaultTimeZoneId: 'Europe/Sarajevo',
      timeZone: [{
        timeZoneId: 'Europe/Sarajevo',
        displayName: '(GMT+02:00) Bosnia \u0026 Herzegovina Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'BR',
      displayName: 'Brazil',
      defaultTimeZoneId: 'America/Rio_Branco',
      timeZone: [{
        timeZoneId: 'America/Rio_Branco',
        displayName: '(GMT-05:00) Rio Branco Time'
      }, {
        timeZoneId: 'America/Boa_Vista',
        displayName: '(GMT-04:00) Boa Vista Time'
      }, {
        timeZoneId: 'America/Campo_Grande',
        displayName: '(GMT-04:00) Campo Grande Time'
      }, {
        timeZoneId: 'America/Cuiaba',
        displayName: '(GMT-04:00) Cuiaba Time'
      }, {
        timeZoneId: 'America/Manaus',
        displayName: '(GMT-04:00) Manaus Time'
      }, {
        timeZoneId: 'America/Porto_Velho',
        displayName: '(GMT-04:00) Porto Velho Time'
      }, {
        timeZoneId: 'America/Araguaina',
        displayName: '(GMT-03:00) Araguaina Time'
      }, {
        timeZoneId: 'America/Bahia',
        displayName: '(GMT-03:00) Bahia Time'
      }, {
        timeZoneId: 'America/Belem',
        displayName: '(GMT-03:00) Belem Time'
      }, {
        timeZoneId: 'America/Fortaleza',
        displayName: '(GMT-03:00) Fortaleza Time'
      }, {
        timeZoneId: 'America/Maceio',
        displayName: '(GMT-03:00) Maceio Time'
      }, {
        timeZoneId: 'America/Recife',
        displayName: '(GMT-03:00) Recife Time'
      }, {
        timeZoneId: 'America/Sao_Paulo',
        displayName: '(GMT-03:00) Sao Paulo Time'
      }, {
        timeZoneId: 'America/Noronha',
        displayName: '(GMT-02:00) Noronha Time'
      }],
      tosLocale: {
        language: 'pt',
        country: 'BR'
      }
    }, {
      countryCode: 'IO',
      displayName: 'British Indian Ocean Territory',
      defaultTimeZoneId: 'Indian/Chagos',
      timeZone: [{
        timeZoneId: 'Indian/Chagos',
        displayName: '(GMT+06:00) British Indian Ocean Territory Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'BN',
      displayName: 'Brunei',
      defaultTimeZoneId: 'Asia/Brunei',
      timeZone: [{
        timeZoneId: 'Asia/Brunei',
        displayName: '(GMT+08:00) Brunei Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'BG',
      displayName: 'Bulgaria',
      defaultTimeZoneId: 'Europe/Sofia',
      timeZone: [{
        timeZoneId: 'Europe/Sofia',
        displayName: '(GMT+03:00) Bulgaria Time'
      }],
      tosLocale: {
        language: 'bg',
        country: 'BG'
      }
    }, {
      countryCode: 'CA',
      displayName: 'Canada',
      defaultTimeZoneId: 'America/Dawson',
      timeZone: [{
        timeZoneId: 'America/Dawson',
        displayName: '(GMT-07:00) Dawson Time'
      }, {
        timeZoneId: 'America/Vancouver',
        displayName: '(GMT-07:00) Vancouver Time'
      }, {
        timeZoneId: 'America/Whitehorse',
        displayName: '(GMT-07:00) Whitehorse Time'
      }, {
        timeZoneId: 'America/Edmonton',
        displayName: '(GMT-06:00) Edmonton Time'
      }, {
        timeZoneId: 'America/Yellowknife',
        displayName: '(GMT-06:00) Yellowknife Time'
      }, {
        timeZoneId: 'America/Dawson_Creek',
        displayName: '(GMT-07:00) Dawson Creek Time'
      }, {
        timeZoneId: 'America/Winnipeg',
        displayName: '(GMT-05:00) Winnipeg Time'
      }, {
        timeZoneId: 'America/Regina',
        displayName: '(GMT-06:00) Regina Time'
      }, {
        timeZoneId: 'America/Iqaluit',
        displayName: '(GMT-04:00) Iqaluit Time'
      }, {
        timeZoneId: 'America/Toronto',
        displayName: '(GMT-04:00) Toronto Time'
      }, {
        timeZoneId: 'America/Halifax',
        displayName: '(GMT-03:00) Halifax Time'
      }, {
        timeZoneId: 'America/St_Johns',
        displayName: '(GMT-02:30) St. John\u2019s Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'CV',
      displayName: 'Cape Verde',
      defaultTimeZoneId: 'Atlantic/Cape_Verde',
      timeZone: [{
        timeZoneId: 'Atlantic/Cape_Verde',
        displayName: '(GMT-01:00) Cape Verde Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'TD',
      displayName: 'Chad',
      defaultTimeZoneId: 'Africa/Ndjamena',
      timeZone: [{
        timeZoneId: 'Africa/Ndjamena',
        displayName: '(GMT+01:00) Chad Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'CL',
      displayName: 'Chile',
      defaultTimeZoneId: 'Pacific/Easter',
      timeZone: [{
        timeZoneId: 'Pacific/Easter',
        displayName: '(GMT-06:00) Easter Time'
      }, {
        timeZoneId: 'America/Santiago',
        displayName: '(GMT-04:00) Chile Time'
      }, {
        timeZoneId: 'America/Punta_Arenas',
        displayName: '(GMT-03:00) Punta Arenas Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'CN',
      displayName: 'China',
      defaultTimeZoneId: 'Asia/Shanghai',
      timeZone: [{
        timeZoneId: 'Asia/Shanghai',
        displayName: '(GMT+08:00) China Time'
      }],
      tosLocale: {
        language: 'zh',
        country: 'CN'
      }
    }, {
      countryCode: 'CX',
      displayName: 'Christmas Island',
      defaultTimeZoneId: 'Indian/Christmas',
      timeZone: [{
        timeZoneId: 'Indian/Christmas',
        displayName: '(GMT+07:00) Christmas Island Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'CC',
      displayName: 'Cocos (Keeling) Islands',
      defaultTimeZoneId: 'Indian/Cocos',
      timeZone: [{
        timeZoneId: 'Indian/Cocos',
        displayName: '(GMT+06:30) Cocos (Keeling) Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'CO',
      displayName: 'Colombia',
      defaultTimeZoneId: 'America/Bogota',
      timeZone: [{
        timeZoneId: 'America/Bogota',
        displayName: '(GMT-05:00) Colombia Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'CK',
      displayName: 'Cook Islands',
      defaultTimeZoneId: 'Pacific/Rarotonga',
      timeZone: [{
        timeZoneId: 'Pacific/Rarotonga',
        displayName: '(GMT-10:00) Cook Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'CR',
      displayName: 'Costa Rica',
      defaultTimeZoneId: 'America/Costa_Rica',
      timeZone: [{
        timeZoneId: 'America/Costa_Rica',
        displayName: '(GMT-06:00) Costa Rica Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'CI',
      displayName: 'C\u00f4te d\u2019Ivoire',
      defaultTimeZoneId: 'Africa/Abidjan',
      timeZone: [{
        timeZoneId: 'Africa/Abidjan',
        displayName: '(GMT+00:00) C\u00f4te d\u2019Ivoire Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'HR',
      displayName: 'Croatia',
      defaultTimeZoneId: 'Europe/Zagreb',
      timeZone: [{
        timeZoneId: 'Europe/Zagreb',
        displayName: '(GMT+02:00) Croatia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'CU',
      displayName: 'Cuba',
      defaultTimeZoneId: 'America/Havana',
      timeZone: [{
        timeZoneId: 'America/Havana',
        displayName: '(GMT-04:00) Cuba Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'CW',
      displayName: 'Cura\u00e7ao',
      defaultTimeZoneId: 'America/Curacao',
      timeZone: [{
        timeZoneId: 'America/Curacao',
        displayName: '(GMT-04:00) Cura\u00e7ao Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'CY',
      displayName: 'Cyprus',
      defaultTimeZoneId: 'Asia/Nicosia',
      timeZone: [{
        timeZoneId: 'Asia/Nicosia',
        displayName: '(GMT+03:00) Nicosia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'CZ',
      displayName: 'Czechia',
      defaultTimeZoneId: 'Europe/Prague',
      timeZone: [{
        timeZoneId: 'Europe/Prague',
        displayName: '(GMT+02:00) Czechia Time'
      }],
      tosLocale: {
        language: 'cs',
        country: 'CZ'
      }
    }, {
      countryCode: 'DK',
      displayName: 'Denmark',
      defaultTimeZoneId: 'Europe/Copenhagen',
      timeZone: [{
        timeZoneId: 'Europe/Copenhagen',
        displayName: '(GMT+02:00) Denmark Time'
      }],
      tosLocale: {
        language: 'da',
        country: 'DK'
      }
    }, {
      countryCode: 'DO',
      displayName: 'Dominican Republic',
      defaultTimeZoneId: 'America/Santo_Domingo',
      timeZone: [{
        timeZoneId: 'America/Santo_Domingo',
        displayName: '(GMT-04:00) Dominican Republic Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'EC',
      displayName: 'Ecuador',
      defaultTimeZoneId: 'Pacific/Galapagos',
      timeZone: [{
        timeZoneId: 'Pacific/Galapagos',
        displayName: '(GMT-06:00) Galapagos Time'
      }, {
        timeZoneId: 'America/Guayaquil',
        displayName: '(GMT-05:00) Ecuador Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'EG',
      displayName: 'Egypt',
      defaultTimeZoneId: 'Africa/Cairo',
      timeZone: [{
        timeZoneId: 'Africa/Cairo',
        displayName: '(GMT+02:00) Egypt Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SV',
      displayName: 'El Salvador',
      defaultTimeZoneId: 'America/El_Salvador',
      timeZone: [{
        timeZoneId: 'America/El_Salvador',
        displayName: '(GMT-06:00) El Salvador Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'EE',
      displayName: 'Estonia',
      defaultTimeZoneId: 'Europe/Tallinn',
      timeZone: [{
        timeZoneId: 'Europe/Tallinn',
        displayName: '(GMT+03:00) Estonia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'FK',
      displayName: 'Falkland Islands (Islas Malvinas)',
      defaultTimeZoneId: 'Atlantic/Stanley',
      timeZone: [{
        timeZoneId: 'Atlantic/Stanley',
        displayName: '(GMT-03:00) Falkland Islands (Islas Malvinas) Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'FO',
      displayName: 'Faroe Islands',
      defaultTimeZoneId: 'Atlantic/Faeroe',
      timeZone: [{
        timeZoneId: 'Atlantic/Faeroe',
        displayName: '(GMT+01:00) Faroe Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'FJ',
      displayName: 'Fiji',
      defaultTimeZoneId: 'Pacific/Fiji',
      timeZone: [{
        timeZoneId: 'Pacific/Fiji',
        displayName: '(GMT+12:00) Fiji Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'FI',
      displayName: 'Finland',
      defaultTimeZoneId: 'Europe/Helsinki',
      timeZone: [{
        timeZoneId: 'Europe/Helsinki',
        displayName: '(GMT+03:00) Finland Time'
      }],
      tosLocale: {
        language: 'fi',
        country: 'FI'
      }
    }, {
      countryCode: 'FR',
      displayName: 'France',
      defaultTimeZoneId: 'Europe/Paris',
      timeZone: [{
        timeZoneId: 'Europe/Paris',
        displayName: '(GMT+02:00) France Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'GF',
      displayName: 'French Guiana',
      defaultTimeZoneId: 'America/Cayenne',
      timeZone: [{
        timeZoneId: 'America/Cayenne',
        displayName: '(GMT-03:00) French Guiana Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'PF',
      displayName: 'French Polynesia',
      defaultTimeZoneId: 'Pacific/Tahiti',
      timeZone: [{
        timeZoneId: 'Pacific/Tahiti',
        displayName: '(GMT-10:00) Tahiti Time'
      }, {
        timeZoneId: 'Pacific/Marquesas',
        displayName: '(GMT-09:30) Marquesas Time'
      }, {
        timeZoneId: 'Pacific/Gambier',
        displayName: '(GMT-09:00) Gambier Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'TF',
      displayName: 'French Southern Territories',
      defaultTimeZoneId: 'Indian/Kerguelen',
      timeZone: [{
        timeZoneId: 'Indian/Kerguelen',
        displayName: '(GMT+05:00) French Southern Territories Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'GE',
      displayName: 'Georgia',
      defaultTimeZoneId: 'Asia/Tbilisi',
      timeZone: [{
        timeZoneId: 'Asia/Tbilisi',
        displayName: '(GMT+04:00) Georgia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'DE',
      displayName: 'Germany',
      defaultTimeZoneId: 'Europe/Berlin',
      timeZone: [{
        timeZoneId: 'Europe/Berlin',
        displayName: '(GMT+02:00) Germany Time'
      }],
      tosLocale: {
        language: 'de',
        country: 'DE'
      }
    }, {
      countryCode: 'GH',
      displayName: 'Ghana',
      defaultTimeZoneId: 'Africa/Accra',
      timeZone: [{
        timeZoneId: 'Africa/Accra',
        displayName: '(GMT+00:00) Ghana Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'GI',
      displayName: 'Gibraltar',
      defaultTimeZoneId: 'Europe/Gibraltar',
      timeZone: [{
        timeZoneId: 'Europe/Gibraltar',
        displayName: '(GMT+02:00) Gibraltar Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'GR',
      displayName: 'Greece',
      defaultTimeZoneId: 'Europe/Athens',
      timeZone: [{
        timeZoneId: 'Europe/Athens',
        displayName: '(GMT+03:00) Greece Time'
      }],
      tosLocale: {
        language: 'el',
        country: 'GR'
      }
    }, {
      countryCode: 'GL',
      displayName: 'Greenland',
      defaultTimeZoneId: 'America/Thule',
      timeZone: [{
        timeZoneId: 'America/Thule',
        displayName: '(GMT-03:00) Thule Time'
      }, {
        timeZoneId: 'America/Godthab',
        displayName: '(GMT-02:00) Nuuk Time'
      }, {
        timeZoneId: 'America/Scoresbysund',
        displayName: '(GMT+00:00) Ittoqqortoormiit Time'
      }, {
        timeZoneId: 'America/Danmarkshavn',
        displayName: '(GMT+00:00) Danmarkshavn Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'GU',
      displayName: 'Guam',
      defaultTimeZoneId: 'Pacific/Guam',
      timeZone: [{
        timeZoneId: 'Pacific/Guam',
        displayName: '(GMT+10:00) Guam Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'GT',
      displayName: 'Guatemala',
      defaultTimeZoneId: 'America/Guatemala',
      timeZone: [{
        timeZoneId: 'America/Guatemala',
        displayName: '(GMT-06:00) Guatemala Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'GW',
      displayName: 'Guinea-Bissau',
      defaultTimeZoneId: 'Africa/Bissau',
      timeZone: [{
        timeZoneId: 'Africa/Bissau',
        displayName: '(GMT+00:00) Guinea-Bissau Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'GY',
      displayName: 'Guyana',
      defaultTimeZoneId: 'America/Guyana',
      timeZone: [{
        timeZoneId: 'America/Guyana',
        displayName: '(GMT-04:00) Guyana Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'HT',
      displayName: 'Haiti',
      defaultTimeZoneId: 'America/Port-au-Prince',
      timeZone: [{
        timeZoneId: 'America/Port-au-Prince',
        displayName: '(GMT-04:00) Haiti Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'HN',
      displayName: 'Honduras',
      defaultTimeZoneId: 'America/Tegucigalpa',
      timeZone: [{
        timeZoneId: 'America/Tegucigalpa',
        displayName: '(GMT-06:00) Honduras Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'HK',
      displayName: 'Hong Kong',
      defaultTimeZoneId: 'Asia/Hong_Kong',
      timeZone: [{
        timeZoneId: 'Asia/Hong_Kong',
        displayName: '(GMT+08:00) Hong Kong Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'HU',
      displayName: 'Hungary',
      defaultTimeZoneId: 'Europe/Budapest',
      timeZone: [{
        timeZoneId: 'Europe/Budapest',
        displayName: '(GMT+02:00) Hungary Time'
      }],
      tosLocale: {
        language: 'hu',
        country: 'HU'
      }
    }, {
      countryCode: 'IS',
      displayName: 'Iceland',
      defaultTimeZoneId: 'Atlantic/Reykjavik',
      timeZone: [{
        timeZoneId: 'Atlantic/Reykjavik',
        displayName: '(GMT+00:00) Iceland Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'IN',
      displayName: 'India',
      defaultTimeZoneId: 'Asia/Calcutta',
      timeZone: [{
        timeZoneId: 'Asia/Calcutta',
        displayName: '(GMT+05:30) India Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'ID',
      displayName: 'Indonesia',
      defaultTimeZoneId: 'Asia/Jakarta',
      timeZone: [{
        timeZoneId: 'Asia/Jakarta',
        displayName: '(GMT+07:00) Jakarta Time'
      }, {
        timeZoneId: 'Asia/Makassar',
        displayName: '(GMT+08:00) Makassar Time'
      }, {
        timeZoneId: 'Asia/Jayapura',
        displayName: '(GMT+09:00) Jayapura Time'
      }],
      tosLocale: {
        language: 'in',
        country: 'ID'
      }
    }, {
      countryCode: 'IR',
      displayName: 'Iran',
      defaultTimeZoneId: 'Asia/Tehran',
      timeZone: [{
        timeZoneId: 'Asia/Tehran',
        displayName: '(GMT+04:30) Iran Time'
      }]
    }, {
      countryCode: 'IQ',
      displayName: 'Iraq',
      defaultTimeZoneId: 'Asia/Baghdad',
      timeZone: [{
        timeZoneId: 'Asia/Baghdad',
        displayName: '(GMT+03:00) Iraq Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'IE',
      displayName: 'Ireland',
      defaultTimeZoneId: 'Europe/Dublin',
      timeZone: [{
        timeZoneId: 'Europe/Dublin',
        displayName: '(GMT+01:00) Ireland Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'IL',
      displayName: 'Israel',
      defaultTimeZoneId: 'Asia/Jerusalem',
      timeZone: [{
        timeZoneId: 'Asia/Jerusalem',
        displayName: '(GMT+03:00) Israel Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'IT',
      displayName: 'Italy',
      defaultTimeZoneId: 'Europe/Rome',
      timeZone: [{
        timeZoneId: 'Europe/Rome',
        displayName: '(GMT+02:00) Italy Time'
      }],
      tosLocale: {
        language: 'it',
        country: 'IT'
      }
    }, {
      countryCode: 'JM',
      displayName: 'Jamaica',
      defaultTimeZoneId: 'America/Jamaica',
      timeZone: [{
        timeZoneId: 'America/Jamaica',
        displayName: '(GMT-05:00) Jamaica Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'JP',
      displayName: 'Japan',
      defaultTimeZoneId: 'Asia/Tokyo',
      timeZone: [{
        timeZoneId: 'Asia/Tokyo',
        displayName: '(GMT+09:00) Japan Time'
      }],
      tosLocale: {
        language: 'ja',
        country: 'JP'
      }
    }, {
      countryCode: 'JO',
      displayName: 'Jordan',
      defaultTimeZoneId: 'Asia/Amman',
      timeZone: [{
        timeZoneId: 'Asia/Amman',
        displayName: '(GMT+03:00) Jordan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'KZ',
      displayName: 'Kazakhstan',
      defaultTimeZoneId: 'Asia/Aqtau',
      timeZone: [{
        timeZoneId: 'Asia/Aqtau',
        displayName: '(GMT+05:00) Aqtau Time'
      }, {
        timeZoneId: 'Asia/Aqtobe',
        displayName: '(GMT+05:00) Aqtobe Time'
      }, {
        timeZoneId: 'Asia/Almaty',
        displayName: '(GMT+06:00) Almaty Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'KE',
      displayName: 'Kenya',
      defaultTimeZoneId: 'Africa/Nairobi',
      timeZone: [{
        timeZoneId: 'Africa/Nairobi',
        displayName: '(GMT+03:00) Kenya Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'KI',
      displayName: 'Kiribati',
      defaultTimeZoneId: 'Pacific/Tarawa',
      timeZone: [{
        timeZoneId: 'Pacific/Tarawa',
        displayName: '(GMT+12:00) Tarawa Time'
      }, {
        timeZoneId: 'Pacific/Enderbury',
        displayName: '(GMT+13:00) Enderbury Time'
      }, {
        timeZoneId: 'Pacific/Kiritimati',
        displayName: '(GMT+14:00) Kiritimati Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'KG',
      displayName: 'Kyrgyzstan',
      defaultTimeZoneId: 'Asia/Bishkek',
      timeZone: [{
        timeZoneId: 'Asia/Bishkek',
        displayName: '(GMT+06:00) Kyrgyzstan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'LV',
      displayName: 'Latvia',
      defaultTimeZoneId: 'Europe/Riga',
      timeZone: [{
        timeZoneId: 'Europe/Riga',
        displayName: '(GMT+03:00) Latvia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'LB',
      displayName: 'Lebanon',
      defaultTimeZoneId: 'Asia/Beirut',
      timeZone: [{
        timeZoneId: 'Asia/Beirut',
        displayName: '(GMT+03:00) Lebanon Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'LR',
      displayName: 'Liberia',
      defaultTimeZoneId: 'Africa/Monrovia',
      timeZone: [{
        timeZoneId: 'Africa/Monrovia',
        displayName: '(GMT+00:00) Liberia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'LY',
      displayName: 'Libya',
      defaultTimeZoneId: 'Africa/Tripoli',
      timeZone: [{
        timeZoneId: 'Africa/Tripoli',
        displayName: '(GMT+02:00) Libya Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'LT',
      displayName: 'Lithuania',
      defaultTimeZoneId: 'Europe/Vilnius',
      timeZone: [{
        timeZoneId: 'Europe/Vilnius',
        displayName: '(GMT+03:00) Lithuania Time'
      }],
      tosLocale: {
        language: 'lt',
        country: 'LT'
      }
    }, {
      countryCode: 'LU',
      displayName: 'Luxembourg',
      defaultTimeZoneId: 'Europe/Luxembourg',
      timeZone: [{
        timeZoneId: 'Europe/Luxembourg',
        displayName: '(GMT+02:00) Luxembourg Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'MO',
      displayName: 'Macao',
      defaultTimeZoneId: 'Asia/Macau',
      timeZone: [{
        timeZoneId: 'Asia/Macau',
        displayName: '(GMT+08:00) Macao Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'MY',
      displayName: 'Malaysia',
      defaultTimeZoneId: 'Asia/Kuala_Lumpur',
      timeZone: [{
        timeZoneId: 'Asia/Kuala_Lumpur',
        displayName: '(GMT+08:00) Malaysia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'MV',
      displayName: 'Maldives',
      defaultTimeZoneId: 'Indian/Maldives',
      timeZone: [{
        timeZoneId: 'Indian/Maldives',
        displayName: '(GMT+05:00) Maldives Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'MT',
      displayName: 'Malta',
      defaultTimeZoneId: 'Europe/Malta',
      timeZone: [{
        timeZoneId: 'Europe/Malta',
        displayName: '(GMT+02:00) Malta Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'MH',
      displayName: 'Marshall Islands',
      defaultTimeZoneId: 'Pacific/Kwajalein',
      timeZone: [{
        timeZoneId: 'Pacific/Kwajalein',
        displayName: '(GMT+12:00) Kwajalein Time'
      }, {
        timeZoneId: 'Pacific/Majuro',
        displayName: '(GMT+12:00) Marshall Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'MQ',
      displayName: 'Martinique',
      defaultTimeZoneId: 'America/Martinique',
      timeZone: [{
        timeZoneId: 'America/Martinique',
        displayName: '(GMT-04:00) Martinique Time'
      }],
      tosLocale: {
        language: 'fr',
        country: 'FR'
      }
    }, {
      countryCode: 'MU',
      displayName: 'Mauritius',
      defaultTimeZoneId: 'Indian/Mauritius',
      timeZone: [{
        timeZoneId: 'Indian/Mauritius',
        displayName: '(GMT+04:00) Mauritius Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'MX',
      displayName: 'Mexico',
      defaultTimeZoneId: 'America/Tijuana',
      timeZone: [{
        timeZoneId: 'America/Tijuana',
        displayName: '(GMT-07:00) Tijuana Time'
      }, {
        timeZoneId: 'America/Mazatlan',
        displayName: '(GMT-06:00) Mazatlan Time'
      }, {
        timeZoneId: 'America/Hermosillo',
        displayName: '(GMT-07:00) Hermosillo Time'
      }, {
        timeZoneId: 'America/Mexico_City',
        displayName: '(GMT-05:00) Mexico City Time'
      }, {
        timeZoneId: 'America/Cancun',
        displayName: '(GMT-05:00) Cancun Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'FM',
      displayName: 'Micronesia',
      defaultTimeZoneId: 'Pacific/Truk',
      timeZone: [{
        timeZoneId: 'Pacific/Truk',
        displayName: '(GMT+10:00) Chuuk Time'
      }, {
        timeZoneId: 'Pacific/Kosrae',
        displayName: '(GMT+11:00) Kosrae Time'
      }, {
        timeZoneId: 'Pacific/Ponape',
        displayName: '(GMT+11:00) Pohnpei Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'MD',
      displayName: 'Moldova',
      defaultTimeZoneId: 'Europe/Chisinau',
      timeZone: [{
        timeZoneId: 'Europe/Chisinau',
        displayName: '(GMT+03:00) Moldova Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'MC',
      displayName: 'Monaco',
      defaultTimeZoneId: 'Europe/Monaco',
      timeZone: [{
        timeZoneId: 'Europe/Monaco',
        displayName: '(GMT+02:00) Monaco Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'MN',
      displayName: 'Mongolia',
      defaultTimeZoneId: 'Asia/Hovd',
      timeZone: [{
        timeZoneId: 'Asia/Hovd',
        displayName: '(GMT+07:00) Hovd Time'
      }, {
        timeZoneId: 'Asia/Choibalsan',
        displayName: '(GMT+08:00) Choibalsan Time'
      }, {
        timeZoneId: 'Asia/Ulaanbaatar',
        displayName: '(GMT+08:00) Ulaanbaatar Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'MA',
      displayName: 'Morocco',
      defaultTimeZoneId: 'Africa/Casablanca',
      timeZone: [{
        timeZoneId: 'Africa/Casablanca',
        displayName: '(GMT+01:00) Morocco Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'MZ',
      displayName: 'Mozambique',
      defaultTimeZoneId: 'Africa/Maputo',
      timeZone: [{
        timeZoneId: 'Africa/Maputo',
        displayName: '(GMT+02:00) Mozambique Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'MM',
      displayName: 'Myanmar (Burma)',
      defaultTimeZoneId: 'Asia/Rangoon',
      timeZone: [{
        timeZoneId: 'Asia/Rangoon',
        displayName: '(GMT+06:30) Myanmar (Burma) Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'NA',
      displayName: 'Namibia',
      defaultTimeZoneId: 'Africa/Windhoek',
      timeZone: [{
        timeZoneId: 'Africa/Windhoek',
        displayName: '(GMT+02:00) Namibia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'NR',
      displayName: 'Nauru',
      defaultTimeZoneId: 'Pacific/Nauru',
      timeZone: [{
        timeZoneId: 'Pacific/Nauru',
        displayName: '(GMT+12:00) Nauru Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'NP',
      displayName: 'Nepal',
      defaultTimeZoneId: 'Asia/Katmandu',
      timeZone: [{
        timeZoneId: 'Asia/Katmandu',
        displayName: '(GMT+05:45) Nepal Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'NL',
      displayName: 'Netherlands',
      defaultTimeZoneId: 'Europe/Amsterdam',
      timeZone: [{
        timeZoneId: 'Europe/Amsterdam',
        displayName: '(GMT+02:00) Netherlands Time'
      }],
      tosLocale: {
        language: 'nl',
        country: 'NL'
      }
    }, {
      countryCode: 'NC',
      displayName: 'New Caledonia',
      defaultTimeZoneId: 'Pacific/Noumea',
      timeZone: [{
        timeZoneId: 'Pacific/Noumea',
        displayName: '(GMT+11:00) New Caledonia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'NZ',
      displayName: 'New Zealand',
      defaultTimeZoneId: 'Pacific/Auckland',
      timeZone: [{
        timeZoneId: 'Pacific/Auckland',
        displayName: '(GMT+12:00) New Zealand Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'NI',
      displayName: 'Nicaragua',
      defaultTimeZoneId: 'America/Managua',
      timeZone: [{
        timeZoneId: 'America/Managua',
        displayName: '(GMT-06:00) Nicaragua Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'NG',
      displayName: 'Nigeria',
      defaultTimeZoneId: 'Africa/Lagos',
      timeZone: [{
        timeZoneId: 'Africa/Lagos',
        displayName: '(GMT+01:00) Nigeria Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'NU',
      displayName: 'Niue',
      defaultTimeZoneId: 'Pacific/Niue',
      timeZone: [{
        timeZoneId: 'Pacific/Niue',
        displayName: '(GMT-11:00) Niue Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'NF',
      displayName: 'Norfolk Island',
      defaultTimeZoneId: 'Pacific/Norfolk',
      timeZone: [{
        timeZoneId: 'Pacific/Norfolk',
        displayName: '(GMT+11:00) Norfolk Island Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'KP',
      displayName: 'North Korea',
      defaultTimeZoneId: 'Asia/Pyongyang',
      timeZone: [{
        timeZoneId: 'Asia/Pyongyang',
        displayName: '(GMT+09:00) North Korea Time'
      }]
    }, {
      countryCode: 'MK',
      displayName: 'North Macedonia',
      defaultTimeZoneId: 'Europe/Skopje',
      timeZone: [{
        timeZoneId: 'Europe/Skopje',
        displayName: '(GMT+02:00) North Macedonia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'NO',
      displayName: 'Norway',
      defaultTimeZoneId: 'Europe/Oslo',
      timeZone: [{
        timeZoneId: 'Europe/Oslo',
        displayName: '(GMT+02:00) Norway Time'
      }],
      tosLocale: {
        language: 'no',
        country: 'NO'
      }
    }, {
      countryCode: 'PK',
      displayName: 'Pakistan',
      defaultTimeZoneId: 'Asia/Karachi',
      timeZone: [{
        timeZoneId: 'Asia/Karachi',
        displayName: '(GMT+05:00) Pakistan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'PW',
      displayName: 'Palau',
      defaultTimeZoneId: 'Pacific/Palau',
      timeZone: [{
        timeZoneId: 'Pacific/Palau',
        displayName: '(GMT+09:00) Palau Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'PS',
      displayName: 'Palestine',
      defaultTimeZoneId: 'Asia/Gaza',
      timeZone: [{
        timeZoneId: 'Asia/Gaza',
        displayName: '(GMT+03:00) Gaza Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'PA',
      displayName: 'Panama',
      defaultTimeZoneId: 'America/Panama',
      timeZone: [{
        timeZoneId: 'America/Panama',
        displayName: '(GMT-05:00) Panama Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'PG',
      displayName: 'Papua New Guinea',
      defaultTimeZoneId: 'Pacific/Port_Moresby',
      timeZone: [{
        timeZoneId: 'Pacific/Port_Moresby',
        displayName: '(GMT+10:00) Port Moresby Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'PY',
      displayName: 'Paraguay',
      defaultTimeZoneId: 'America/Asuncion',
      timeZone: [{
        timeZoneId: 'America/Asuncion',
        displayName: '(GMT-04:00) Paraguay Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'PE',
      displayName: 'Peru',
      defaultTimeZoneId: 'America/Lima',
      timeZone: [{
        timeZoneId: 'America/Lima',
        displayName: '(GMT-05:00) Peru Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'PH',
      displayName: 'Philippines',
      defaultTimeZoneId: 'Asia/Manila',
      timeZone: [{
        timeZoneId: 'Asia/Manila',
        displayName: '(GMT+08:00) Philippines Time'
      }],
      tosLocale: {
        language: 'tl',
        country: 'PH'
      }
    }, {
      countryCode: 'PN',
      displayName: 'Pitcairn Islands',
      defaultTimeZoneId: 'Pacific/Pitcairn',
      timeZone: [{
        timeZoneId: 'Pacific/Pitcairn',
        displayName: '(GMT-08:00) Pitcairn Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'PL',
      displayName: 'Poland',
      defaultTimeZoneId: 'Europe/Warsaw',
      timeZone: [{
        timeZoneId: 'Europe/Warsaw',
        displayName: '(GMT+02:00) Poland Time'
      }],
      tosLocale: {
        language: 'pl',
        country: 'PL'
      }
    }, {
      countryCode: 'PT',
      displayName: 'Portugal',
      defaultTimeZoneId: 'Atlantic/Azores',
      timeZone: [{
        timeZoneId: 'Atlantic/Azores',
        displayName: '(GMT+00:00) Azores Time'
      }, {
        timeZoneId: 'Europe/Lisbon',
        displayName: '(GMT+01:00) Portugal Time'
      }],
      tosLocale: {
        language: 'pt',
        country: 'PT'
      }
    }, {
      countryCode: 'PR',
      displayName: 'Puerto Rico',
      defaultTimeZoneId: 'America/Puerto_Rico',
      timeZone: [{
        timeZoneId: 'America/Puerto_Rico',
        displayName: '(GMT-04:00) Puerto Rico Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'QA',
      displayName: 'Qatar',
      defaultTimeZoneId: 'Asia/Qatar',
      timeZone: [{
        timeZoneId: 'Asia/Qatar',
        displayName: '(GMT+03:00) Qatar Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'RE',
      displayName: 'R\u00e9union',
      defaultTimeZoneId: 'Indian/Reunion',
      timeZone: [{
        timeZoneId: 'Indian/Reunion',
        displayName: '(GMT+04:00) R\u00e9union Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'RO',
      displayName: 'Romania',
      defaultTimeZoneId: 'Europe/Bucharest',
      timeZone: [{
        timeZoneId: 'Europe/Bucharest',
        displayName: '(GMT+03:00) Romania Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'RU',
      displayName: 'Russia',
      defaultTimeZoneId: 'Europe/Kaliningrad',
      timeZone: [{
        timeZoneId: 'Europe/Kaliningrad',
        displayName: '(GMT+02:00) Kaliningrad Time'
      }, {
        timeZoneId: 'Europe/Moscow',
        displayName: '(GMT+03:00) Moscow Time'
      }, {
        timeZoneId: 'Europe/Samara',
        displayName: '(GMT+04:00) Samara Time'
      }, {
        timeZoneId: 'Asia/Yekaterinburg',
        displayName: '(GMT+05:00) Yekaterinburg Time'
      }, {
        timeZoneId: 'Asia/Omsk',
        displayName: '(GMT+06:00) Omsk Time'
      }, {
        timeZoneId: 'Asia/Krasnoyarsk',
        displayName: '(GMT+07:00) Krasnoyarsk Time'
      }, {
        timeZoneId: 'Asia/Irkutsk',
        displayName: '(GMT+08:00) Irkutsk Time'
      }, {
        timeZoneId: 'Asia/Yakutsk',
        displayName: '(GMT+09:00) Yakutsk Time'
      }, {
        timeZoneId: 'Asia/Vladivostok',
        displayName: '(GMT+10:00) Vladivostok Time'
      }, {
        timeZoneId: 'Asia/Magadan',
        displayName: '(GMT+11:00) Magadan Time'
      }, {
        timeZoneId: 'Asia/Kamchatka',
        displayName: '(GMT+12:00) Kamchatka Time'
      }],
      tosLocale: {
        language: 'ru',
        country: 'RU'
      }
    }, {
      countryCode: 'WS',
      displayName: 'Samoa',
      defaultTimeZoneId: 'Pacific/Apia',
      timeZone: [{
        timeZoneId: 'Pacific/Apia',
        displayName: '(GMT+13:00) Samoa Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'SM',
      displayName: 'San Marino',
      defaultTimeZoneId: 'Europe/San_Marino',
      timeZone: [{
        timeZoneId: 'Europe/San_Marino',
        displayName: '(GMT+02:00) San Marino Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'ST',
      displayName: 'S\u00e3o Tom\u00e9 \u0026 Pr\u00edncipe',
      defaultTimeZoneId: 'Africa/Sao_Tome',
      timeZone: [{
        timeZoneId: 'Africa/Sao_Tome',
        displayName: '(GMT+00:00) S\u00e3o Tom\u00e9 \u0026 Pr\u00edncipe Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SA',
      displayName: 'Saudi Arabia',
      defaultTimeZoneId: 'Asia/Riyadh',
      timeZone: [{
        timeZoneId: 'Asia/Riyadh',
        displayName: '(GMT+03:00) Saudi Arabia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'RS',
      displayName: 'Serbia',
      defaultTimeZoneId: 'Europe/Belgrade',
      timeZone: [{
        timeZoneId: 'Europe/Belgrade',
        displayName: '(GMT+02:00) Serbia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SC',
      displayName: 'Seychelles',
      defaultTimeZoneId: 'Indian/Mahe',
      timeZone: [{
        timeZoneId: 'Indian/Mahe',
        displayName: '(GMT+04:00) Seychelles Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SG',
      displayName: 'Singapore',
      defaultTimeZoneId: 'Asia/Singapore',
      timeZone: [{
        timeZoneId: 'Asia/Singapore',
        displayName: '(GMT+08:00) Singapore Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'SK',
      displayName: 'Slovakia',
      defaultTimeZoneId: 'Europe/Bratislava',
      timeZone: [{
        timeZoneId: 'Europe/Bratislava',
        displayName: '(GMT+02:00) Slovakia Time'
      }],
      tosLocale: {
        language: 'sk',
        country: 'SK'
      }
    }, {
      countryCode: 'SI',
      displayName: 'Slovenia',
      defaultTimeZoneId: 'Europe/Ljubljana',
      timeZone: [{
        timeZoneId: 'Europe/Ljubljana',
        displayName: '(GMT+02:00) Slovenia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SB',
      displayName: 'Solomon Islands',
      defaultTimeZoneId: 'Pacific/Guadalcanal',
      timeZone: [{
        timeZoneId: 'Pacific/Guadalcanal',
        displayName: '(GMT+11:00) Solomon Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'ZA',
      displayName: 'South Africa',
      defaultTimeZoneId: 'Africa/Johannesburg',
      timeZone: [{
        timeZoneId: 'Africa/Johannesburg',
        displayName: '(GMT+02:00) South Africa Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'GS',
      displayName: 'South Georgia \u0026 South Sandwich Islands',
      defaultTimeZoneId: 'Atlantic/South_Georgia',
      timeZone: [{
        timeZoneId: 'Atlantic/South_Georgia',
        displayName: '(GMT-02:00) South Georgia \u0026 South Sandwich Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'KR',
      displayName: 'South Korea',
      defaultTimeZoneId: 'Asia/Seoul',
      timeZone: [{
        timeZoneId: 'Asia/Seoul',
        displayName: '(GMT+09:00) South Korea Time'
      }],
      tosLocale: {
        language: 'ko',
        country: 'KR'
      }
    }, {
      countryCode: 'ES',
      displayName: 'Spain',
      defaultTimeZoneId: 'Atlantic/Canary',
      timeZone: [{
        timeZoneId: 'Atlantic/Canary',
        displayName: '(GMT+01:00) Canary Time'
      }, {
        timeZoneId: 'Africa/Ceuta',
        displayName: '(GMT+02:00) Ceuta Time'
      }, {
        timeZoneId: 'Europe/Madrid',
        displayName: '(GMT+02:00) Spain Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'LK',
      displayName: 'Sri Lanka',
      defaultTimeZoneId: 'Asia/Colombo',
      timeZone: [{
        timeZoneId: 'Asia/Colombo',
        displayName: '(GMT+05:30) Sri Lanka Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'PM',
      displayName: 'St. Pierre \u0026 Miquelon',
      defaultTimeZoneId: 'America/Miquelon',
      timeZone: [{
        timeZoneId: 'America/Miquelon',
        displayName: '(GMT-02:00) St. Pierre \u0026 Miquelon Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SD',
      displayName: 'Sudan',
      defaultTimeZoneId: 'Africa/Khartoum',
      timeZone: [{
        timeZoneId: 'Africa/Khartoum',
        displayName: '(GMT+02:00) Sudan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SR',
      displayName: 'Suriname',
      defaultTimeZoneId: 'America/Paramaribo',
      timeZone: [{
        timeZoneId: 'America/Paramaribo',
        displayName: '(GMT-03:00) Suriname Time'
      }],
      tosLocale: {
        language: 'nl',
        country: 'NL'
      }
    }, {
      countryCode: 'SJ',
      displayName: 'Svalbard \u0026 Jan Mayen',
      defaultTimeZoneId: 'Arctic/Longyearbyen',
      timeZone: [{
        timeZoneId: 'Arctic/Longyearbyen',
        displayName: '(GMT+02:00) Svalbard \u0026 Jan Mayen Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'SE',
      displayName: 'Sweden',
      defaultTimeZoneId: 'Europe/Stockholm',
      timeZone: [{
        timeZoneId: 'Europe/Stockholm',
        displayName: '(GMT+02:00) Sweden Time'
      }],
      tosLocale: {
        language: 'sv',
        country: 'SE'
      }
    }, {
      countryCode: 'CH',
      displayName: 'Switzerland',
      defaultTimeZoneId: 'Europe/Zurich',
      timeZone: [{
        timeZoneId: 'Europe/Zurich',
        displayName: '(GMT+02:00) Switzerland Time'
      }],
      tosLocale: {
        language: 'de',
        country: 'DE'
      }
    }, {
      countryCode: 'SY',
      displayName: 'Syria',
      defaultTimeZoneId: 'Asia/Damascus',
      timeZone: [{
        timeZoneId: 'Asia/Damascus',
        displayName: '(GMT+03:00) Syria Time'
      }]
    }, {
      countryCode: 'TW',
      displayName: 'Taiwan',
      defaultTimeZoneId: 'Asia/Taipei',
      timeZone: [{
        timeZoneId: 'Asia/Taipei',
        displayName: '(GMT+08:00) Taiwan Time'
      }],
      tosLocale: {
        language: 'zh',
        country: 'TW'
      }
    }, {
      countryCode: 'TJ',
      displayName: 'Tajikistan',
      defaultTimeZoneId: 'Asia/Dushanbe',
      timeZone: [{
        timeZoneId: 'Asia/Dushanbe',
        displayName: '(GMT+05:00) Tajikistan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'TH',
      displayName: 'Thailand',
      defaultTimeZoneId: 'Asia/Bangkok',
      timeZone: [{
        timeZoneId: 'Asia/Bangkok',
        displayName: '(GMT+07:00) Thailand Time'
      }],
      tosLocale: {
        language: 'th',
        country: 'TH'
      }
    }, {
      countryCode: 'TL',
      displayName: 'Timor-Leste',
      defaultTimeZoneId: 'Asia/Dili',
      timeZone: [{
        timeZoneId: 'Asia/Dili',
        displayName: '(GMT+09:00) Timor-Leste Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'TK',
      displayName: 'Tokelau',
      defaultTimeZoneId: 'Pacific/Fakaofo',
      timeZone: [{
        timeZoneId: 'Pacific/Fakaofo',
        displayName: '(GMT+13:00) Tokelau Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'TO',
      displayName: 'Tonga',
      defaultTimeZoneId: 'Pacific/Tongatapu',
      timeZone: [{
        timeZoneId: 'Pacific/Tongatapu',
        displayName: '(GMT+13:00) Tonga Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'TT',
      displayName: 'Trinidad \u0026 Tobago',
      defaultTimeZoneId: 'America/Port_of_Spain',
      timeZone: [{
        timeZoneId: 'America/Port_of_Spain',
        displayName: '(GMT-04:00) Trinidad \u0026 Tobago Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'TN',
      displayName: 'Tunisia',
      defaultTimeZoneId: 'Africa/Tunis',
      timeZone: [{
        timeZoneId: 'Africa/Tunis',
        displayName: '(GMT+01:00) Tunisia Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'TR',
      displayName: 'Turkey',
      defaultTimeZoneId: 'Europe/Istanbul',
      timeZone: [{
        timeZoneId: 'Europe/Istanbul',
        displayName: '(GMT+03:00) Turkey Time'
      }],
      tosLocale: {
        language: 'tr',
        country: 'TR'
      }
    }, {
      countryCode: 'TM',
      displayName: 'Turkmenistan',
      defaultTimeZoneId: 'Asia/Ashgabat',
      timeZone: [{
        timeZoneId: 'Asia/Ashgabat',
        displayName: '(GMT+05:00) Turkmenistan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'TC',
      displayName: 'Turks \u0026 Caicos Islands',
      defaultTimeZoneId: 'America/Grand_Turk',
      timeZone: [{
        timeZoneId: 'America/Grand_Turk',
        displayName: '(GMT-04:00) Turks \u0026 Caicos Islands Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'TV',
      displayName: 'Tuvalu',
      defaultTimeZoneId: 'Pacific/Funafuti',
      timeZone: [{
        timeZoneId: 'Pacific/Funafuti',
        displayName: '(GMT+12:00) Tuvalu Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'UM',
      displayName: 'U.S. Outlying Islands',
      defaultTimeZoneId: 'Pacific/Wake',
      timeZone: [{
        timeZoneId: 'Pacific/Wake',
        displayName: '(GMT+12:00) Wake Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'UA',
      displayName: 'Ukraine',
      defaultTimeZoneId: 'Europe/Kiev',
      timeZone: [{
        timeZoneId: 'Europe/Kiev',
        displayName: '(GMT+03:00) Ukraine Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'AE',
      displayName: 'United Arab Emirates',
      defaultTimeZoneId: 'Asia/Dubai',
      timeZone: [{
        timeZoneId: 'Asia/Dubai',
        displayName: '(GMT+04:00) United Arab Emirates Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'GB',
      displayName: 'United Kingdom',
      defaultTimeZoneId: 'Etc/GMT',
      timeZone: [{
        timeZoneId: 'Etc/GMT',
        displayName: '(GMT+00:00) GMT'
      }, {
        timeZoneId: 'Europe/London',
        displayName: '(GMT+01:00) United Kingdom Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'US',
      displayName: 'United States',
      defaultTimeZoneId: 'America/Los_Angeles',
      timeZone: [{
        timeZoneId: 'Pacific/Honolulu',
        displayName: '(GMT-10:00) Honolulu Time'
      }, {
        timeZoneId: 'America/Anchorage',
        displayName: '(GMT-08:00) Anchorage Time'
      }, {
        timeZoneId: 'America/Los_Angeles',
        displayName: '(GMT-07:00) Los Angeles Time'
      }, {
        timeZoneId: 'America/Boise',
        displayName: '(GMT-06:00) Boise Time'
      }, {
        timeZoneId: 'America/Denver',
        displayName: '(GMT-06:00) Denver Time'
      }, {
        timeZoneId: 'America/Phoenix',
        displayName: '(GMT-07:00) Phoenix Time'
      }, {
        timeZoneId: 'America/Chicago',
        displayName: '(GMT-05:00) Chicago Time'
      }, {
        timeZoneId: 'America/Detroit',
        displayName: '(GMT-04:00) Detroit Time'
      }, {
        timeZoneId: 'America/New_York',
        displayName: '(GMT-04:00) New York Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'UY',
      displayName: 'Uruguay',
      defaultTimeZoneId: 'America/Montevideo',
      timeZone: [{
        timeZoneId: 'America/Montevideo',
        displayName: '(GMT-03:00) Uruguay Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'UZ',
      displayName: 'Uzbekistan',
      defaultTimeZoneId: 'Asia/Tashkent',
      timeZone: [{
        timeZoneId: 'Asia/Tashkent',
        displayName: '(GMT+05:00) Uzbekistan Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'VU',
      displayName: 'Vanuatu',
      defaultTimeZoneId: 'Pacific/Efate',
      timeZone: [{
        timeZoneId: 'Pacific/Efate',
        displayName: '(GMT+11:00) Vanuatu Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'US'
      }
    }, {
      countryCode: 'VA',
      displayName: 'Vatican City',
      defaultTimeZoneId: 'Europe/Vatican',
      timeZone: [{
        timeZoneId: 'Europe/Vatican',
        displayName: '(GMT+02:00) Vatican City Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'VE',
      displayName: 'Venezuela',
      defaultTimeZoneId: 'America/Caracas',
      timeZone: [{
        timeZoneId: 'America/Caracas',
        displayName: '(GMT-04:00) Venezuela Time'
      }],
      tosLocale: {
        language: 'es',
        country: 'ES'
      }
    }, {
      countryCode: 'VN',
      displayName: 'Vietnam',
      defaultTimeZoneId: 'Asia/Saigon',
      timeZone: [{
        timeZoneId: 'Asia/Saigon',
        displayName: '(GMT+07:00) Vietnam Time'
      }],
      tosLocale: {
        language: 'vi',
        country: 'VN'
      }
    }, {
      countryCode: 'WF',
      displayName: 'Wallis \u0026 Futuna',
      defaultTimeZoneId: 'Pacific/Wallis',
      timeZone: [{
        timeZoneId: 'Pacific/Wallis',
        displayName: '(GMT+12:00) Wallis \u0026 Futuna Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }, {
      countryCode: 'EH',
      displayName: 'Western Sahara',
      defaultTimeZoneId: 'Africa/El_Aaiun',
      timeZone: [{
        timeZoneId: 'Africa/El_Aaiun',
        displayName: '(GMT+01:00) Western Sahara Time'
      }],
      tosLocale: {
        language: 'en',
        country: 'GB'
      }
    }]
  }
};

/***/ }),

/***/ "./js/modules/analytics-4/utils/countries-timezones.js":
/*!*************************************************************!*\
  !*** ./js/modules/analytics-4/utils/countries-timezones.js ***!
  \*************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   allCountries: () => (/* binding */ allCountries),
/* harmony export */   countriesByCode: () => (/* binding */ countriesByCode),
/* harmony export */   countryCodesByTimezone: () => (/* binding */ countryCodesByTimezone),
/* harmony export */   timeZonesByCountryCode: () => (/* binding */ timeZonesByCountryCode)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _countries_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./countries-data */ "./js/modules/analytics-4/utils/countries-data.js");
/**
 * Country and Time Zone utilities.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */

const allCountries = _countries_data__WEBPACK_IMPORTED_MODULE_1__.countries.default.country;
const timeZonesByCountryCode = allCountries.reduce((map, country) => {
  map[country.countryCode] = country.timeZone;
  return map;
}, {});
const countriesByCode = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.keyBy)(allCountries, 'countryCode');
const countryCodesByTimezone = allCountries.reduce((map, country) => {
  country.timeZone.forEach(
  // eslint-disable-next-line sitekit/acronym-case
  ({
    timeZoneId
  }) => map[timeZoneId] = country.countryCode);
  return map;
}, {});

/***/ }),

/***/ "./js/modules/analytics-4/utils/extract-dashboard-data.js":
/*!****************************************************************!*\
  !*** ./js/modules/analytics-4/utils/extract-dashboard-data.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   extractAnalytics4DashboardData: () => (/* binding */ extractAnalytics4DashboardData)
/* harmony export */ });
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! classnames */ "../node_modules/classnames/index.js");
/* harmony import */ var classnames__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(classnames__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _js_util_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util/i18n */ "./js/util/i18n.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _partition_report__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./partition-report */ "./js/modules/analytics-4/utils/partition-report.js");
/* harmony import */ var _parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parseDimensionStringToDate */ "./js/modules/analytics-4/utils/parseDimensionStringToDate.js");
/**
 * Analytics-4 Dashboard data extraction functions.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





/**
 * Reduces and processes an array of analytics-4 row data.
 *
 * @since 1.96.0
 *
 * @param {Array}  rows          An array of rows to reduce.
 * @param {number} selectedStats The currently selected stat we need to return data for.
 * @return {Array} Array of selected stats from analytics row data.
 */
function reduceAnalytics4RowsData(rows, selectedStats) {
  const dataMap = [];
  rows.forEach(row => {
    if (!row.metricValues) {
      return;
    }
    const {
      value
    } = row.metricValues[selectedStats];
    const dateString = row.dimensionValues[0].value;
    const date = (0,_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_6__["default"])(dateString);
    dataMap.push([date, value]);
  });
  return dataMap;
}

/**
 * Extracts the data required from an analytics 'site-analytics' request.
 *
 * @since 1.96.0
 * @since 1.98.0 Added chartDataFormats parameter.
 *
 * @param {Object} report             The data returned from the Analytics API call.
 * @param {Array}  selectedStats      The currently selected stat we need to return data for.
 * @param {number} days               The number of days to extract data for. Pads empty data days.
 * @param {string} referenceDate      The reference date.
 * @param {Array}  dataLabels         The labels to be displayed.
 * @param {Array}  tooltipDataFormats The formats to be used for the tooltip data.
 * @param {Array}  chartDataFormats   The formats to be used for the chart data.
 * @return {Array} The dataMap ready for charting.
 */
function extractAnalytics4DashboardData(report, selectedStats, days, referenceDate, dataLabels = [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Users', 'google-site-kit'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Sessions', 'google-site-kit'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Engagement Rate', 'google-site-kit'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Session Duration', 'google-site-kit')], tooltipDataFormats = [x => parseFloat(x).toLocaleString(), x => parseFloat(x).toLocaleString(), x => (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.numFmt)(x / 100, {
  style: 'percent',
  signDisplay: 'never',
  maximumFractionDigits: 2
}), x => (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.numFmt)(x, 's')], chartDataFormats = [lodash__WEBPACK_IMPORTED_MODULE_1__.identity, lodash__WEBPACK_IMPORTED_MODULE_1__.identity, x => x * 100, lodash__WEBPACK_IMPORTED_MODULE_1__.identity]) {
  const rows = [...(report?.rows || [])]; // Copying it to escape side effects by manipulating with rows.
  const rowLength = rows.length;

  // Pad rows to 2 x number of days data points to accommodate new accounts.
  if (days * 2 > rowLength) {
    const date = (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.stringToDate)(referenceDate);
    for (let index = 0; days > index; index++) {
      const month = (date.getMonth() + 1).toString();
      const day = date.getDate().toString();
      const dateString = date.getFullYear().toString() + (2 > month.length ? '0' : '') + month + (2 > day.length ? '0' : '') + day;
      if (index > rowLength) {
        const emptyDay = [{
          dimensionValues: [{
            value: dateString
          }, {
            value: 'date_range_0'
          }],
          metricValues: [{
            value: 0
          }, {
            value: 0
          }]
        }, {
          dimensionValues: [{
            value: dateString
          }, {
            value: 'date_range_1'
          }],
          metricValues: [{
            value: 0
          }, {
            value: 0
          }]
        }];
        rows.unshift(...emptyDay);
      }
      date.setDate(date.getDate() - 1);
    }
    rows.push({
      dimensionValues: [{
        value: '0'
      }, {
        value: 'date_range_0'
      }]
    }, {
      dimensionValues: [{
        value: '0'
      }, {
        value: 'date_range_1'
      }]
    });
  }
  const isSessionDuration = dataLabels[selectedStats] === (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Session Duration', 'google-site-kit');
  const dataType = isSessionDuration ? 'timeofday' : 'number';
  const dataMap = [[{
    type: 'date',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Day', 'google-site-kit')
  }, {
    type: 'string',
    role: 'tooltip',
    p: {
      html: true
    }
  }, {
    type: dataType,
    label: dataLabels[selectedStats]
  }, {
    type: dataType,
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Previous period', 'google-site-kit')
  }]];
  const {
    compareRange,
    currentRange
  } = (0,_partition_report__WEBPACK_IMPORTED_MODULE_5__.partitionAnalytics4Report)(rows, {
    dateRangeLength: days
  });
  const lastMonthData = reduceAnalytics4RowsData(currentRange, selectedStats);
  const previousMonthData = reduceAnalytics4RowsData(compareRange, selectedStats);
  const locale = (0,_js_util_i18n__WEBPACK_IMPORTED_MODULE_3__.getLocale)();
  const localeDateOptions = {
    weekday: 'short',
    month: 'short',
    day: 'numeric'
  };
  lastMonthData.forEach((row, index) => {
    if (!row[0] || !row[1] || !previousMonthData[index]) {
      return;
    }
    const chartDataFormat = chartDataFormats[selectedStats];
    const currentMonthDatum = chartDataFormat(row[1]);
    const previousMonthDatum = chartDataFormat(previousMonthData[index][1]);
    const prevMonth = parseFloat(previousMonthDatum);
    const difference = (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.calculateDifferenceBetweenChartValues)(currentMonthDatum, prevMonth);
    const svgArrow = (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.getChartDifferenceArrow)(difference);
    const dateRange = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: 1: date for user stats, 2: previous date for user stats comparison */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._x)('%1$s vs %2$s', 'Date range for chart tooltip', 'google-site-kit'), row[0].toLocaleDateString(locale, localeDateOptions), previousMonthData[index][0].toLocaleDateString(locale, localeDateOptions));
    const statInfo = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: 1: selected stat label, 2: numeric value of selected stat, 3: up or down arrow , 4: different change in percentage */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._x)('%1$s: <strong>%2$s</strong> <em>%3$s %4$s</em>', 'Stat information for chart tooltip', 'google-site-kit'), dataLabels[selectedStats], tooltipDataFormats[selectedStats](currentMonthDatum), svgArrow, (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.numFmt)(Math.abs(difference), '%'));
    dataMap.push([row[0], `<div class="${classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-visualization-tooltip', {
      'googlesitekit-visualization-tooltip--up': difference > 0,
      'googlesitekit-visualization-tooltip--down': difference < 0
    })}">
				<p>${dateRange}</p>
				<p>${statInfo}</p>
			</div>`, isSessionDuration ? (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.convertSecondsToArray)(currentMonthDatum) : currentMonthDatum, isSessionDuration ? (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.convertSecondsToArray)(previousMonthDatum) : previousMonthDatum]);
  });
  return dataMap;
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/formatting.js":
/*!****************************************************!*\
  !*** ./js/modules/analytics-4/utils/formatting.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   decodeAmpersand: () => (/* binding */ decodeAmpersand),
/* harmony export */   splitCategories: () => (/* binding */ splitCategories)
/* harmony export */ });
/**
 * Formatting helpers.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Converts ampersand HTML entities into characters.
 *
 * @since 1.152.0
 *
 * @param {string} input Input string.
 * @return {string} String with ampersand converted to char, if present.
 */
function decodeAmpersand(input) {
  return input.replace(/&amp;/gi, '&');
}

/**
 * Splits a string of categories separated by ; and returns an array of categories.
 * Decodes ampersands before doing so.
 *
 * @since 1.152.0
 *
 * @param {string} input Input string containing categories separated by ;.
 * @return {Array.<string>} Array of categories.
 */
function splitCategories(input) {
  return decodeAmpersand(input).split('; ');
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/index.js":
/*!***********************************************!*\
  !*** ./js/modules/analytics-4/utils/index.js ***!
  \***********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   decodeAmpersand: () => (/* reexport safe */ _formatting__WEBPACK_IMPORTED_MODULE_5__.decodeAmpersand),
/* harmony export */   extractAnalytics4DashboardData: () => (/* reexport safe */ _extract_dashboard_data__WEBPACK_IMPORTED_MODULE_4__.extractAnalytics4DashboardData),
/* harmony export */   extractAnalyticsDataForPieChart: () => (/* reexport safe */ _chart__WEBPACK_IMPORTED_MODULE_0__.extractAnalyticsDataForPieChart),
/* harmony export */   isSingleSlice: () => (/* reexport safe */ _chart__WEBPACK_IMPORTED_MODULE_0__.isSingleSlice),
/* harmony export */   isValidDimensionFilters: () => (/* reexport safe */ _report_validation__WEBPACK_IMPORTED_MODULE_3__.isValidDimensionFilters),
/* harmony export */   isValidDimensions: () => (/* reexport safe */ _report_validation__WEBPACK_IMPORTED_MODULE_3__.isValidDimensions),
/* harmony export */   isValidMetricFilters: () => (/* reexport safe */ _report_validation__WEBPACK_IMPORTED_MODULE_3__.isValidMetricFilters),
/* harmony export */   isValidMetrics: () => (/* reexport safe */ _report_validation__WEBPACK_IMPORTED_MODULE_3__.isValidMetrics),
/* harmony export */   isValidOrders: () => (/* reexport safe */ _report_validation__WEBPACK_IMPORTED_MODULE_3__.isValidOrders),
/* harmony export */   isZeroReport: () => (/* reexport safe */ _is_zero_report__WEBPACK_IMPORTED_MODULE_1__.isZeroReport),
/* harmony export */   normalizeReportOptions: () => (/* reexport safe */ _report_normalization__WEBPACK_IMPORTED_MODULE_2__.normalizeReportOptions),
/* harmony export */   splitCategories: () => (/* reexport safe */ _formatting__WEBPACK_IMPORTED_MODULE_5__.splitCategories)
/* harmony export */ });
/* harmony import */ var _chart__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./chart */ "./js/modules/analytics-4/utils/chart.js");
/* harmony import */ var _is_zero_report__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-zero-report */ "./js/modules/analytics-4/utils/is-zero-report.js");
/* harmony import */ var _report_normalization__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./report-normalization */ "./js/modules/analytics-4/utils/report-normalization.js");
/* harmony import */ var _report_validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./report-validation */ "./js/modules/analytics-4/utils/report-validation.js");
/* harmony import */ var _extract_dashboard_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./extract-dashboard-data */ "./js/modules/analytics-4/utils/extract-dashboard-data.js");
/* harmony import */ var _formatting__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./formatting */ "./js/modules/analytics-4/utils/formatting.js");
/**
 * Analytics 4 utility functions.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */








/***/ }),

/***/ "./js/modules/analytics-4/utils/is-zero-report.js":
/*!********************************************************!*\
  !*** ./js/modules/analytics-4/utils/is-zero-report.js ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isZeroReport: () => (/* binding */ isZeroReport)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Report utilities.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Checks whether the report data has only zero values.
 *
 * @since 1.95.0
 *
 * @param {Object} report Report data object.
 * @return {(boolean|undefined)} Returns TRUE if the report data is empty or has only zero values, FALSE if there is at least one non-zero value, or undefined if the report data is not resolved yet.
 */
function isZeroReport(report) {
  if (report === undefined) {
    return undefined;
  }

  // If there is no rows array, no totals array, or totals is an array of empty objects, this is an empty report.
  if (!report?.rows || !report?.totals || report?.totals?.every(lodash__WEBPACK_IMPORTED_MODULE_0__.isEmpty)) {
    return true;
  }

  // false means there _is_ some report data
  return !report.totals.some(totals => {
    if (!totals.metricValues) {
      return false;
    }
    return totals.metricValues.some(({
      value
    }) => value > 0);
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/parseDimensionStringToDate.js":
/*!********************************************************************!*\
  !*** ./js/modules/analytics-4/utils/parseDimensionStringToDate.js ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/**
 * `parseDimensionStringToDate` utility.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Converts a dimnension string date into a Date object accounting for differences in timezones.
 *
 * @since 1.10.0
 * @since 1.123.0 Migrated from analytics to analytics-4.
 * @private
 *
 * @param {string} dateString String representing the date in the format of `YYYYMMDD`.
 * @return {(Date|boolean)} Object representing the date passed, or false if parsing fails or a non-string is passed.
 */
function parseDimensionStringToDate(dateString) {
  if ('string' === typeof dateString && dateString.match(/[0-9]{8}/)) {
    const year = dateString.slice(0, 4);
    const monthIndex = Number(dateString.slice(4, 6)) - 1;
    const day = dateString.slice(6, 8);
    return new Date(year, monthIndex.toString(), day);
  }
  return false;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (parseDimensionStringToDate);

/***/ }),

/***/ "./js/modules/analytics-4/utils/partition-report.js":
/*!**********************************************************!*\
  !*** ./js/modules/analytics-4/utils/partition-report.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   partitionAnalytics4Report: () => (/* binding */ partitionAnalytics4Report)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Analytics-4 partition report utility.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Splits report data into segments for current and comparison ranges.
 *
 * @since 1.96.0
 *
 * @param {Array}  report               Report rows.
 * @param {Object} args                 Additional arguments.
 * @param {number} args.dateRangeLength Date range length of report segments.
 * @return {Object} Object with keys for `compareRange` and `currentRange`.
 */
function partitionAnalytics4Report(report, {
  dateRangeLength
}) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(report), 'report must be an array to partition.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Number.isInteger(dateRangeLength) && dateRangeLength > 0, 'dateRangeLength must be a positive integer.');
  function getRowsForDateRange(dateRange) {
    // Filter the report to get only rows that match the given date range.
    return report.filter(({
      dimensionValues: [, dateValue]
    }) => dateValue.value === dateRange);
  }

  // Use a negative date range length for reverse slicing.
  const reverseDateRangeLength = -1 * dateRangeLength;

  // Get the rows for the current date range and the compare date range.
  // The current range should always be sliced from the end.
  const currentRange = getRowsForDateRange('date_range_0').slice(reverseDateRangeLength);
  // The compare range continues from where the current left off (slicing towards the start),
  // and may be shorter (where older data is not available yet) which is fine.
  const compareRange = getRowsForDateRange('date_range_1').slice(reverseDateRangeLength * 2, reverseDateRangeLength);
  return {
    currentRange,
    compareRange
  };
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/report-date-range-args.js":
/*!****************************************************************!*\
  !*** ./js/modules/analytics-4/utils/report-date-range-args.js ***!
  \****************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   generateDateRangeArgs: () => (/* binding */ generateDateRangeArgs)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * Report date range args utils.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Generates an object with the appropriate structure to pass to report selectors.
 *
 * @since 1.27.0
 * @since 1.123.0 Migrated from analytics to analytics-4.
 *
 * @param {Object} dates                    Object containing the dates.
 * @param {string} dates.startDate          Start date in YYYY-MM-DD format.
 * @param {string} dates.endDate            End date in YYYY-MM-DD format.
 * @param {string} [dates.compareStartDate] Optional. Start date in YYYY-MM-DD format.
 * @param {string} [dates.compareEndDate]   Optional. End date in YYYY-MM-DD format.
 * @return {Object} Date range object.
 */
function generateDateRangeArgs(dates) {
  const {
    startDate,
    endDate,
    compareStartDate,
    compareEndDate
  } = dates;
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util__WEBPACK_IMPORTED_MODULE_1__.isValidDateString)(startDate), 'A valid startDate is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util__WEBPACK_IMPORTED_MODULE_1__.isValidDateString)(endDate), 'A valid endDate is required.');
  const range = {
    '_u.date00': startDate.replace(/-/g, ''),
    '_u.date01': endDate.replace(/-/g, '')
  };
  if (compareStartDate || compareEndDate) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util__WEBPACK_IMPORTED_MODULE_1__.isValidDateString)(compareStartDate) && (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.isValidDateString)(compareEndDate), 'Valid compareStartDate and compareEndDate values are required.');
    range['_u.date10'] = compareStartDate.replace(/-/g, '');
    range['_u.date11'] = compareEndDate.replace(/-/g, '');
  }
  return range;
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/report-normalization.js":
/*!**************************************************************!*\
  !*** ./js/modules/analytics-4/utils/report-normalization.js ***!
  \**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   normalizeReportOptions: () => (/* binding */ normalizeReportOptions)
/* harmony export */ });
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! memize */ "../node_modules/memize/index.js");
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/**
 * Analytics 4 report normalization utilities.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Normalizes report options.
 *
 * @since 1.94.0
 *
 * @param {Object} options Report options object.
 * @return {Object} Normalized options object.
 */
const normalizeReportOptions = memize__WEBPACK_IMPORTED_MODULE_0___default()(({
  metrics,
  dimensions,
  ...options
} = {}) => {
  return {
    metrics: normalizeMetrics(metrics),
    dimensions: normalizeDimensions(dimensions),
    ...options
  };
});
function normalizeMetrics(metrics) {
  return (0,lodash__WEBPACK_IMPORTED_MODULE_1__.castArray)(metrics).map(metric => typeof metric === 'string' ? {
    name: metric
  } : metric).filter(metric => (0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(metric));
}
function normalizeDimensions(dimensions) {
  return (0,lodash__WEBPACK_IMPORTED_MODULE_1__.castArray)(dimensions).map(dimension => typeof dimension === 'string' ? {
    name: dimension
  } : dimension).filter(dimension => (0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(dimension));
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/report-validation.js":
/*!***********************************************************!*\
  !*** ./js/modules/analytics-4/utils/report-validation.js ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isValidDimensionFilters: () => (/* binding */ isValidDimensionFilters),
/* harmony export */   isValidDimensions: () => (/* binding */ isValidDimensions),
/* harmony export */   isValidMetricFilters: () => (/* binding */ isValidMetricFilters),
/* harmony export */   isValidMetrics: () => (/* binding */ isValidMetrics),
/* harmony export */   isValidOrders: () => (/* binding */ isValidOrders)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_util_report_validation__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util/report-validation */ "./js/util/report-validation.js");
/**
 * Analytics 4 reporting API validation utilities.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* eslint complexity: [ "error", 17 ] */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Verifies that provided metrics match allowed values. Metrics can be a string,
 * an array of string, an array of objects or mix of strings and objects.
 * Objects must have a "name" property that matches the regex `/^[a-zA-Z0-9_]+$/`
 * to be valid. Objects can optionally include an "expression" property.
 *
 * When a single string is provided, it must be a metric name or a comma-separated
 * list of metric names.
 *
 * A metric name must match the regular expression `/^[a-zA-Z0-9_]+$/`.
 *
 * @since 1.94.0
 * @since 1.98.0 Added a regular expression to validate metric names, in keeping with the GA4 API.
 *
 * @param {string|string[]|Object|Object[]} metrics The metrics to check.
 * @return {boolean} TRUE if metrics are valid, otherwise FALSE.
 */
function isValidMetrics(metrics) {
  function isValidName(metricName) {
    return typeof metricName === 'string' && /^[a-zA-Z0-9_]+$/.test(metricName);
  }
  if (typeof metrics === 'string') {
    const metricNames = metrics.split(',');
    return metricNames.every(isValidName);
  }
  return (0,_js_util_report_validation__WEBPACK_IMPORTED_MODULE_1__.isValidStringsOrObjects)(metrics, metric => {
    const validName = metric.hasOwnProperty('name') && isValidName(metric.name);

    // 'expression' is optional, so if it wasn't provided, we can
    // return early.
    if (!metric.hasOwnProperty('expression')) {
      return validName;
    }

    // 'expression', if provided, must be a string.
    const validExpression = typeof metric.expression === 'string';
    return validName && validExpression;
  }, isValidName);
}

/**
 * Verifies provided dimensions to make sure it matches allowed values. It can be a string,
 * array of strings, an object with "name" field, array of such objects or an array of strings
 * and objects.
 *
 * @since 1.94.0
 *
 * @param {string|string[]|Object|Object[]} dimensions The dimensions to check.
 * @return {boolean} TRUE if dimensions are valid, otherwise FALSE.
 */
function isValidDimensions(dimensions) {
  return (0,_js_util_report_validation__WEBPACK_IMPORTED_MODULE_1__.isValidStringsOrObjects)(dimensions, dimension => {
    return dimension.hasOwnProperty('name') && typeof dimension.name === 'string';
  });
}

/**
 * Verifies provided dimensionFilters to make sure they match allowed values found in dimensions.
 *
 * @since 1.94.0
 *
 * @param {Object} filters The dimension filters to check.
 * @return {boolean} TRUE if dimension filters are valid, otherwise FALSE.
 */
function isValidDimensionFilters(filters) {
  // Ensure every dimensionFilter key corresponds to a valid dimension.
  const validType = ['string'];
  return Object.keys(filters).every(dimension => {
    if (validType.includes(typeof filters[dimension])) {
      return true;
    }
    if (Array.isArray(filters[dimension])) {
      return filters[dimension].every(param => validType.includes(typeof param));
    }
    if ((0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(filters[dimension])) {
      const props = Object.keys(filters[dimension]);
      if (!props.includes('filterType')) {
        return false;
      }
      if (filters[dimension].filterType !== 'emptyFilter' && !props.includes('value')) {
        return false;
      }
      return true;
    }
    return false;
  });
}

/**
 * Verifies provided metricFilters to make sure they match allowed values found in metrics and supported filters.
 *
 * @since 1.111.0
 *
 * @param {Object} filters The metric filters to check.
 * @return {boolean} TRUE if dimension filters are valid, otherwise FALSE.
 */
function isValidMetricFilters(filters) {
  const validType = ['string'];
  const allowedFilterTypes = ['numericFilter', 'betweenFilter'];
  return Object.values(filters).every(filter => {
    if (validType.includes(typeof filter)) {
      return true;
    }
    if (Array.isArray(filter)) {
      return filter.every(param => validType.includes(typeof param));
    }
    if (!(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(filter)) {
      return false;
    }
    const {
      filterType,
      value,
      fromValue,
      toValue
    } = filter;

    // Validate filterType if present
    if (filterType && !allowedFilterTypes.includes(filterType)) {
      return false;
    }
    const props = Object.keys(filter);

    // Numeric Filter (default if filterType is missing)
    if (!filterType || filterType === 'numericFilter') {
      return props.includes('operation') && props.includes('value') && (!(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(value) || 'int64Value' in value);
    }

    // Between Filter
    if (filterType === 'betweenFilter') {
      return props.includes('fromValue') && props.includes('toValue') && [fromValue, toValue].every(value_ => !(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(value_) || 'int64Value' in value_);
    }
    return false;
  });
}

/**
 * Verifies that order definitions are valid for a report. It should be an array
 * of objects where each object has either a "metric" or a "dimension" property,
 * and an optional "desc" property. The "metric" and "dimension" properties should
 * be objects with "metricName" and "dimensionName" properties respectively.
 *
 * @since 1.95.0
 *
 * @param {Object[]} orders The order definitions to check.
 * @return {boolean} TRUE if order definitions are valid, otherwise FALSE.
 */
function isValidOrders(orders) {
  if (!Array.isArray(orders)) {
    return false;
  }
  return orders.every(order => {
    if (!(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(order)) {
      return false;
    }
    if (order.hasOwnProperty('desc') && typeof order.desc !== 'boolean') {
      return false;
    }
    if (order.metric) {
      return !order.dimension && typeof order.metric?.metricName === 'string';
    }
    if (order.dimension) {
      return typeof order.dimension?.dimensionName === 'string';
    }
    return false;
  });
}

/***/ }),

/***/ "./js/modules/analytics-4/utils/validation.js":
/*!****************************************************!*\
  !*** ./js/modules/analytics-4/utils/validation.js ***!
  \****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isValidAccountID: () => (/* reexport safe */ _js_util__WEBPACK_IMPORTED_MODULE_3__.isValidNumericID),
/* harmony export */   isValidAccountSelection: () => (/* binding */ isValidAccountSelection),
/* harmony export */   isValidGoogleTagAccountID: () => (/* binding */ isValidGoogleTagAccountID),
/* harmony export */   isValidGoogleTagContainerID: () => (/* binding */ isValidGoogleTagContainerID),
/* harmony export */   isValidGoogleTagID: () => (/* binding */ isValidGoogleTagID),
/* harmony export */   isValidMeasurementID: () => (/* binding */ isValidMeasurementID),
/* harmony export */   isValidPropertyID: () => (/* binding */ isValidPropertyID),
/* harmony export */   isValidPropertySelection: () => (/* binding */ isValidPropertySelection),
/* harmony export */   isValidWebDataStreamID: () => (/* binding */ isValidWebDataStreamID),
/* harmony export */   isValidWebDataStreamName: () => (/* binding */ isValidWebDataStreamName),
/* harmony export */   isValidWebDataStreamSelection: () => (/* binding */ isValidWebDataStreamSelection),
/* harmony export */   validateAudience: () => (/* binding */ validateAudience),
/* harmony export */   validateReport: () => (/* binding */ validateReport)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_report_validation__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/report-validation */ "./js/util/report-validation.js");
/* harmony import */ var _report_normalization__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./report-normalization */ "./js/modules/analytics-4/utils/report-normalization.js");
/* harmony import */ var _report_validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./report-validation */ "./js/modules/analytics-4/utils/report-validation.js");
/**
 * Validation utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */






/**
 * Checks if the given value is a valid selection for an Account.
 *
 * @since 1.119.0
 *
 * @param {?string} value Selected value.
 * @return {boolean} True if valid, otherwise false.
 */
function isValidAccountSelection(value) {
  if (value === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.ACCOUNT_CREATE) {
    return true;
  }
  return (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.isValidNumericID)(value);
}

/**
 * Checks if the given account ID appears to be a valid Analytics account.
 *
 * @since 1.8.0
 * @since 1.121.0 Migrated from analytics to analytics-4.
 *
 * @param {(string|number)} accountID Account ID to test.
 * @return {boolean} Whether or not the given account ID is valid.
 */


/**
 * Checks whether the given property ID appears to be valid.
 *
 * @since 1.31.0
 *
 * @param {*} propertyID Property ID to check.
 * @return {boolean} Whether or not the given property ID is valid.
 */
function isValidPropertyID(propertyID) {
  return typeof propertyID === 'string' && /^\d+$/.test(propertyID);
}

/**
 * Checks if the given value is a valid selection for a Property.
 *
 * @since 1.31.0
 *
 * @param {?string} value Selected value.
 * @return {boolean} True if valid, otherwise false.
 */
function isValidPropertySelection(value) {
  if (value === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.PROPERTY_CREATE) {
    return true;
  }
  return isValidPropertyID(value);
}

/**
 * Checks whether the given web data stream ID appears to be valid.
 *
 * @since 1.33.0
 *
 * @param {*} webDataStreamID Web data stream ID to check.
 * @return {boolean} TRUE if the web data stream ID is valid, otherwise FALSE.
 */
function isValidWebDataStreamID(webDataStreamID) {
  return typeof webDataStreamID === 'string' && /^\d+$/.test(webDataStreamID);
}

/**
 * Checks whether the given web data stream is a valid selection.
 *
 * @since 1.35.0
 *
 * @param {?string} webDataStreamID Web data stream to check.
 * @return {boolean} TRUE if the web data stream selection is valid, otherwise FALSE.
 */
function isValidWebDataStreamSelection(webDataStreamID) {
  if (webDataStreamID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.WEBDATASTREAM_CREATE) {
    return true;
  }
  return isValidWebDataStreamID(webDataStreamID);
}

/**
 * Checks if the given web data stream name appears to be valid.
 *
 * @since 1.124.0
 *
 * @param {string} value Web data stream name to test.
 * @return {boolean} True if valid, otherwise false.
 */
function isValidWebDataStreamName(value) {
  return typeof value === 'string' && value.trim().length > 0;
}

/**
 * Checks whether the given measurementID appears to be valid.
 *
 * @since 1.35.0
 *
 * @param {*} measurementID Web data stream measurementID to check.
 * @return {boolean} TRUE if the measurementID is valid, otherwise FALSE.
 */
function isValidMeasurementID(measurementID) {
  return typeof measurementID === 'string' && /^G-[a-zA-Z0-9]+$/.test(measurementID);
}

/**
 * Checks whether the given googleTagId appears to be valid.
 *
 * @since 1.90.0
 *
 * @param {*} googleTagID Google Tag ID to check.
 * @return {boolean} TRUE if the googleTagID is valid, otherwise FALSE.
 */
function isValidGoogleTagID(googleTagID) {
  return typeof googleTagID === 'string' && /^(G|GT|AW)-[a-zA-Z0-9]+$/.test(googleTagID);
}

/**
 * Checks whether the given googleTagAccountID appears to be valid.
 *
 * @since 1.90.0
 *
 * @param {*} googleTagAccountID Google Tag ID to check.
 * @return {boolean} TRUE if the googleTagAccountID is valid, otherwise FALSE.
 */
function isValidGoogleTagAccountID(googleTagAccountID) {
  return (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.isValidNumericID)(googleTagAccountID);
}

/**
 * Checks whether the given googleTagContainerID appears to be valid.
 *
 * @since 1.90.0
 *
 * @param {*} googleTagContainerID Google Tag ID to check.
 * @return {boolean} TRUE if the googleTagContainerID is valid, otherwise FALSE.
 */
function isValidGoogleTagContainerID(googleTagContainerID) {
  return (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.isValidNumericID)(googleTagContainerID);
}

/**
 * Checks whether a given report options object is valid.
 *
 * @since 1.130.0
 *
 * @param {Object} options The options for the report.
 */
function validateReport(options) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(options), 'options for Analytics 4 report must be an object.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_util_report_validation__WEBPACK_IMPORTED_MODULE_4__.isValidDateRange)(options), 'Either date range or start/end dates must be provided for Analytics 4 report.');
  const {
    metrics,
    dimensions,
    dimensionFilters,
    metricFilters,
    orderby
  } = (0,_report_normalization__WEBPACK_IMPORTED_MODULE_5__.normalizeReportOptions)(options);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(metrics.length, 'Requests must specify at least one metric for an Analytics 4 report.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_report_validation__WEBPACK_IMPORTED_MODULE_6__.isValidMetrics)(metrics), 'metrics for an Analytics 4 report must be either a string, an array of strings, an object, an array of objects, or a mix of strings and objects. Objects must have a "name" property. Metric names must match the expression ^[a-zA-Z0-9_]+$.');
  if (dimensions) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_report_validation__WEBPACK_IMPORTED_MODULE_6__.isValidDimensions)(dimensions), 'dimensions for an Analytics 4 report must be either a string, an array of strings, an object, an array of objects, or a mix of strings and objects. Objects must have a "name" property.');
  }
  if (dimensionFilters) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_report_validation__WEBPACK_IMPORTED_MODULE_6__.isValidDimensionFilters)(dimensionFilters), 'dimensionFilters for an Analytics 4 report must be a map of dimension names as keys and dimension values as values.');
  }
  if (metricFilters) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_report_validation__WEBPACK_IMPORTED_MODULE_6__.isValidMetricFilters)(metricFilters), 'metricFilters for an Analytics 4 report must be a map of metric names as keys and filter value(s) as numeric fields, depending on the filterType.');
  }
  if (orderby) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_report_validation__WEBPACK_IMPORTED_MODULE_6__.isValidOrders)(orderby), 'orderby for an Analytics 4 report must be an array of OrderBy objects where each object should have either a "metric" or "dimension" property, and an optional "desc" property.');
  }
}

/**
 * Checks whether the passed audience object is valid.
 *
 * @since 1.120.0
 *
 * @param {Object} audience Audience object to check.
 */
function validateAudience(audience) {
  const audienceFields = ['displayName', 'description', 'membershipDurationDays', 'eventTrigger', 'exclusionDurationMode', 'filterClauses'];
  const audienceRequiredFields = ['displayName', 'description', 'membershipDurationDays', 'filterClauses'];
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(audience), 'Audience must be an object.');
  Object.keys(audience).forEach(key => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(audienceFields.includes(key), `Audience object must contain only valid keys. Invalid key: "${key}"`);
  });
  audienceRequiredFields.forEach(key => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(audience[key], `Audience object must contain required keys. Missing key: "${key}"`);
  });
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isArray)(audience.filterClauses), 'filterClauses must be an array with AudienceFilterClause objects.');
}

/***/ }),

/***/ "./js/modules/search-console/constants.js":
/*!************************************************!*\
  !*** ./js/modules/search-console/constants.js ***!
  \************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   MODULE_SLUG_SEARCH_CONSOLE: () => (/* binding */ MODULE_SLUG_SEARCH_CONSOLE)
/* harmony export */ });
/**
 * Search Console module constants.
 *
 * Site Kit by Google, Copyright 2025 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const MODULE_SLUG_SEARCH_CONSOLE = 'search-console';

/***/ }),

/***/ "./js/modules/search-console/datastore/constants.js":
/*!**********************************************************!*\
  !*** ./js/modules/search-console/datastore/constants.js ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DATE_RANGE_OFFSET: () => (/* binding */ DATE_RANGE_OFFSET),
/* harmony export */   MODULES_SEARCH_CONSOLE: () => (/* binding */ MODULES_SEARCH_CONSOLE)
/* harmony export */ });
/**
 * `modules/search-console` data store constants.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

const MODULES_SEARCH_CONSOLE = 'modules/search-console';

// Date range offset days for Search Console report requests.
const DATE_RANGE_OFFSET = 0;

/***/ }),

/***/ "./js/util/chart.js":
/*!**************************!*\
  !*** ./js/util/chart.js ***!
  \**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   calculateDifferenceBetweenChartValues: () => (/* binding */ calculateDifferenceBetweenChartValues),
/* harmony export */   getChartDifferenceArrow: () => (/* binding */ getChartDifferenceArrow),
/* harmony export */   isSingleSlice: () => (/* binding */ isSingleSlice)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/serialize.js");
/* harmony import */ var _js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/ChangeArrow */ "./js/components/ChangeArrow.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Utility functions for charts.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Gets the up/down SVG arrow for Google Chart tooltips.
 *
 * @since 1.30.0
 *
 * @param {number}  difference            The difference which can be positive or negative.
 * @param {string}  [options]             Options to be passed to the ChangeArrow component.
 * @param {boolean} [options.invertColor] Whether we need to reverse the +/- colors of the arrow.
 * @return {string} SVG for the +/- difference.
 */

function getChartDifferenceArrow(difference, options = {}) {
  if (Number.isNaN(Number(difference))) {
    return '';
  }
  const {
    invertColor = false
  } = options;
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_0__["default"], {
    direction: difference > 0 ? 'up' : 'down',
    invertColor: invertColor
  }));
}

/**
 * Checks if there is a single row of data or one row is contributing 100% of the total for a given dimension.
 *
 * @since 1.31.0
 *
 * @param {Array.<Object>} report An array of report data objects.
 * @return {(boolean|undefined)} Returns undefined if report is undefined, true/false for the above conditions.
 */
function isSingleSlice(report) {
  if (report === undefined) {
    return undefined;
  }
  if (report?.[0]?.data?.rows?.length === 1 || report?.[0]?.data?.rows?.[0]?.metrics?.[0]?.values?.[0] === report?.[0]?.data?.totals?.[0]?.values?.[0]) {
    return true;
  }
  return false;
}

/**
 * Calculates difference between two chart values.
 *
 * @since 1.48.0
 *
 * @param {number} currentValue  Current chart value.
 * @param {number} previousValue Previous chart value.
 * @return {number} The difference.
 */
function calculateDifferenceBetweenChartValues(currentValue, previousValue) {
  if (currentValue > 0 && previousValue > 0) {
    return currentValue / previousValue - 1;
  }
  if (currentValue > 0) {
    return 1;
  }
  if (previousValue > 0) {
    return -1;
  }
  return 0;
}

/***/ }),

/***/ "./js/util/convert-time.js":
/*!*********************************!*\
  !*** ./js/util/convert-time.js ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   convertDateStringToUNIXTimestamp: () => (/* binding */ convertDateStringToUNIXTimestamp),
/* harmony export */   convertSecondsToArray: () => (/* binding */ convertSecondsToArray)
/* harmony export */ });
/**
 * Time related utility functions.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Converts seconds into an array with the following values [HH, MM, SS, MS] as described below.
 * HH: hours.
 * MM: minutes.
 * SS: seconds.
 * MS: milliseconds.
 *
 * For example, passing 196.385 returns [ 0, 3, 16, 385 ].
 *
 * @since 1.27.0
 *
 * @param {number} seconds The number of seconds.
 * @return {Array} Array containing the hours, minutes, seconds and milliseconds.
 */
function convertSecondsToArray(seconds) {
  seconds = parseFloat(seconds);
  if (isNaN(seconds) || 0 === seconds) {
    return [0, 0, 0, 0];
  }
  return [Math.floor(seconds / 60 / 60), Math.floor(seconds / 60 % 60), Math.floor(seconds % 60), Math.floor(seconds * 1000) - Math.floor(seconds) * 1000];
}

/**
 * Converts Date time string into UNIX timestamp in milliseconds.
 *
 * For example, passing "2014-10-02T15:01:23Z" returns 1412262083000.
 *
 * @since 1.116.0
 *
 * @param {string} dateStringValue The date time string.
 * @return {number} UNIX timestamp in milliseconds.
 */
function convertDateStringToUNIXTimestamp(dateStringValue) {
  const unixTimestamp = dateStringValue && !Number.isInteger(dateStringValue) ?
  // Valid use of `new Date()` with an argument, because this should only
  // be passed full time strings, not `YYYY-MM-DD` style dates.
  //
  // See: https://github.com/google/site-kit-wp/pull/9459#discussion_r1790660073
  // eslint-disable-next-line sitekit/no-direct-date
  new Date(dateStringValue).getTime() : dateStringValue;
  if (isNaN(unixTimestamp) || !unixTimestamp) {
    return 0;
  }
  return unixTimestamp;
}

/***/ }),

/***/ "./js/util/create-incremental-array-by-size.js":
/*!*****************************************************!*\
  !*** ./js/util/create-incremental-array-by-size.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createIncrementalArrayBySize: () => (/* binding */ createIncrementalArrayBySize)
/* harmony export */ });
/**
 * Create Incremental Array by Size utility.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Creates an array of length equal to size with incremental values starting at 0.
 *
 * @since 1.28.0
 *
 * @param {number} size Array length.
 * @return {number[]} Array of incremental numbers.
 * @example createIncrementalArrayBySize(3); // [0, 1, 2]
 */
function createIncrementalArrayBySize(size) {
  return new Array(size !== null && size !== void 0 ? size : 0).fill().map((_, index) => index);
}

/***/ }),

/***/ "./js/util/dates.js":
/*!**************************!*\
  !*** ./js/util/dates.js ***!
  \**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DAY_IN_SECONDS: () => (/* binding */ DAY_IN_SECONDS),
/* harmony export */   HOUR_IN_SECONDS: () => (/* binding */ HOUR_IN_SECONDS),
/* harmony export */   INVALID_DATE_INSTANCE_ERROR: () => (/* binding */ INVALID_DATE_INSTANCE_ERROR),
/* harmony export */   INVALID_DATE_RANGE_ERROR: () => (/* binding */ INVALID_DATE_RANGE_ERROR),
/* harmony export */   INVALID_DATE_STRING_ERROR: () => (/* binding */ INVALID_DATE_STRING_ERROR),
/* harmony export */   MINUTE_IN_SECONDS: () => (/* binding */ MINUTE_IN_SECONDS),
/* harmony export */   MONTH_IN_SECONDS: () => (/* binding */ MONTH_IN_SECONDS),
/* harmony export */   WEEK_IN_SECONDS: () => (/* binding */ WEEK_IN_SECONDS),
/* harmony export */   dateSub: () => (/* binding */ dateSub),
/* harmony export */   getAvailableDateRanges: () => (/* binding */ getAvailableDateRanges),
/* harmony export */   getCurrentDateRangeDayCount: () => (/* binding */ getCurrentDateRangeDayCount),
/* harmony export */   getDateString: () => (/* binding */ getDateString),
/* harmony export */   getPreviousDate: () => (/* binding */ getPreviousDate),
/* harmony export */   isValidDateRange: () => (/* binding */ isValidDateRange),
/* harmony export */   isValidDateString: () => (/* binding */ isValidDateString),
/* harmony export */   stringToDate: () => (/* binding */ stringToDate)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/**
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */

const INVALID_DATE_INSTANCE_ERROR = 'Date param must construct to a valid date instance or be a valid date instance itself.';
const INVALID_DATE_STRING_ERROR = 'Invalid dateString parameter, it must be a string.';
const INVALID_DATE_RANGE_ERROR = 'Invalid date range, it must be a string with the format "last-x-days".';
const MINUTE_IN_SECONDS = 60;
const HOUR_IN_SECONDS = 60 * MINUTE_IN_SECONDS;
const DAY_IN_SECONDS = 24 * HOUR_IN_SECONDS;
const WEEK_IN_SECONDS = 7 * DAY_IN_SECONDS;
const MONTH_IN_SECONDS = 30 * DAY_IN_SECONDS;

/**
 * Gets the hash of available date ranges.
 *
 * @since 1.12.0
 *
 * @return {Object} The object hash where every key is a date range slug, and the value is an object with the date range slug and its translation.
 */
function getAvailableDateRanges() {
  function label(days) {
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: number of days */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('Last %s day', 'Last %s days', days, 'google-site-kit'), days);
  }
  return {
    'last-7-days': {
      slug: 'last-7-days',
      label: label(7),
      days: 7
    },
    'last-14-days': {
      slug: 'last-14-days',
      label: label(14),
      days: 14
    },
    'last-28-days': {
      slug: 'last-28-days',
      label: label(28),
      days: 28
    },
    'last-90-days': {
      slug: 'last-90-days',
      label: label(90),
      days: 90
    }
  };
}

/**
 * Gets the current dateRange day count.
 *
 * @since 1.19.0
 * @since 1.26.0 `dateRange` is now a required argument.
 *
 * @param {string} dateRange The date range slug.
 * @return {number} The number of days in the range.
 */
function getCurrentDateRangeDayCount(dateRange) {
  const daysMatch = dateRange.match(/last-(\d+)-days/);
  if (daysMatch && daysMatch[1]) {
    return parseInt(daysMatch[1], 10);
  }
  throw new Error('Unrecognized date range slug.');
}

/**
 * Asserts whether a given date string is valid or invalid.
 *
 * @since 1.18.0
 *
 * @param {string} dateString Date string to be asserted against. Defaults to an empty string.
 * @return {boolean}          True if the given date string is valid.
 */
function isValidDateString(dateString = '') {
  if (!(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isString)(dateString)) {
    return false;
  }
  const dateArray = dateString.split('-');
  if (dateArray.length !== 3) {
    return false;
  }

  // Valid use of `new Date()`, constructing a new date from the string.
  // eslint-disable-next-line sitekit/no-direct-date
  const date = new Date(dateString);
  return (0,lodash__WEBPACK_IMPORTED_MODULE_1__.isDate)(date) && !isNaN(date);
}

/**
 * Parses the given Date instance and returns a date string (YYYY-MM-DD).
 *
 * @since 1.18.0
 * @since 1.85.0 Updated the function signature to only accept a Date argument.
 *
 * @param {Date} date Date to parse into a string.
 * @return {string}                 The parsed date string (YYYY-MM-DD).
 */
function getDateString(date) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isDate)(date) && !isNaN(date), INVALID_DATE_INSTANCE_ERROR);
  const month = `${date.getMonth() + 1}`;
  const day = `${date.getDate()}`;
  const year = date.getFullYear();
  return [year, month.length < 2 ? `0${month}` : month, day.length < 2 ? `0${day}` : day].join('-');
}

/**
 * Converts a valid date string to a Date instance.
 *
 * @since 1.38.0
 *
 * @param {string} dateString The date string to parse.
 * @return {Date} Date instance.
 */
function stringToDate(dateString) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(isValidDateString(dateString), INVALID_DATE_STRING_ERROR);

  /**
   * Split date into explicit parts rather than pass directly into date constructor
   * to avoid timezone issues caused by parsing as UTC. Ensures date is accurate for
   * the user's local time, otherwise has a chance to return a different day than was
   * passed in depending on timezone.
   */
  const [year, month, day] = dateString.split('-');
  return new Date(year, month - 1, day);
}

/**
 * Parses the given date and returns the previous date (daysBefore).
 *
 * @since 1.18.0
 *
 * @param {string} relativeDate Date string (YYYY-MM-DD) to subtract days from.
 * @param {number} daysBefore   Number of days to subtract from relativeDate.
 * @return {string}             The date string (YYYY-MM-DD) for the previous date.
 */
function getPreviousDate(relativeDate, daysBefore) {
  return getDateString(dateSub(relativeDate, daysBefore * DAY_IN_SECONDS));
}

/**
 * Asserts whether a given dateRange string is valid or invalid.
 *
 * @since 1.18.0
 *
 * @param {string} dateRange Date string to be asserted against. Defaults to an empty string.
 * @return {boolean}          True if the given dateRange string is valid.
 */
function isValidDateRange(dateRange) {
  const parts = dateRange.split('-');
  return parts.length === 3 && parts[0] === 'last' && !Number.isNaN(parts[1]) && !Number.isNaN(parseFloat(parts[1])) && parts[2] === 'days';
}

/**
 * Subtracts duration from the prodived date and returns it.
 *
 * @since 1.132.0
 *
 * @param {Date|string} relativeDate Date string (YYYY-MM-DD) or date object to subtract duration from.
 * @param {number}      duration     The duration in seconds to subtract from relativeDate.
 * @return {Date} Resulting date.
 */
function dateSub(relativeDate, duration) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(isValidDateString(relativeDate) || (0,lodash__WEBPACK_IMPORTED_MODULE_1__.isDate)(relativeDate) && !isNaN(relativeDate), INVALID_DATE_STRING_ERROR);
  const timestamp = isValidDateString(relativeDate) ? Date.parse(relativeDate) : relativeDate.getTime();

  // Valid use of `new Date()` using calculations.
  // eslint-disable-next-line sitekit/no-direct-date
  return new Date(timestamp - duration * 1000);
}

/***/ }),

/***/ "./js/util/errors.js":
/*!***************************!*\
  !*** ./js/util/errors.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ERROR_CODE_MISSING_REQUIRED_SCOPE: () => (/* binding */ ERROR_CODE_MISSING_REQUIRED_SCOPE),
/* harmony export */   ERROR_INTERNAL_SERVER_ERROR: () => (/* binding */ ERROR_INTERNAL_SERVER_ERROR),
/* harmony export */   ERROR_INVALID_JSON: () => (/* binding */ ERROR_INVALID_JSON),
/* harmony export */   ERROR_REASON_BAD_REQUEST: () => (/* binding */ ERROR_REASON_BAD_REQUEST),
/* harmony export */   ERROR_REASON_FORBIDDEN: () => (/* binding */ ERROR_REASON_FORBIDDEN),
/* harmony export */   ERROR_REASON_INSUFFICIENT_PERMISSIONS: () => (/* binding */ ERROR_REASON_INSUFFICIENT_PERMISSIONS),
/* harmony export */   getReportErrorMessage: () => (/* binding */ getReportErrorMessage),
/* harmony export */   isAuthError: () => (/* binding */ isAuthError),
/* harmony export */   isErrorRetryable: () => (/* binding */ isErrorRetryable),
/* harmony export */   isInsufficientPermissionsError: () => (/* binding */ isInsufficientPermissionsError),
/* harmony export */   isPermissionScopeError: () => (/* binding */ isPermissionScopeError),
/* harmony export */   isWPError: () => (/* binding */ isWPError)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__);
/**
 * Error Utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


// Error codes and reasons.
const ERROR_CODE_MISSING_REQUIRED_SCOPE = 'missing_required_scopes'; // When scopes are missing.
const ERROR_REASON_INSUFFICIENT_PERMISSIONS = 'insufficientPermissions';
const ERROR_REASON_FORBIDDEN = 'forbidden';
const ERROR_INTERNAL_SERVER_ERROR = 'internal_server_error';
const ERROR_INVALID_JSON = 'invalid_json';
const ERROR_REASON_BAD_REQUEST = 'bad_request';

/**
 * Checks if the provided object is an instance of WP_Error class.
 *
 * @since 1.13.0
 *
 * @param {Object} obj The object to check.
 * @return {boolean} TRUE if the object has "code", "data" and "message" properties, otherwise FALSE.
 */
function isWPError(obj) {
  return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(obj) && obj.hasOwnProperty('code') && (typeof obj.code === 'string' || typeof obj.code === 'number') && obj.hasOwnProperty('message') && typeof obj.message === 'string' && obj.hasOwnProperty('data'); // We don't check "obj.data" type because it can be anything.
}

/**
 * Checks if the given error is a permission scope error.
 *
 * @since 1.9.0
 * @private
 *
 * @param {Object} error Input to test as a possible permission scope error.
 * @return {boolean} TRUE if permission scope error, otherwise FALSE.
 */
function isPermissionScopeError(error) {
  return error?.code === ERROR_CODE_MISSING_REQUIRED_SCOPE;
}

/**
 * Checks if the given error has insufficient permissions reason.
 *
 * @since 1.16.0
 * @since 1.70.0 Add support for "forbidden" reason.
 *
 * @param {Object} error The error object to check.
 * @return {boolean} TRUE if it's insufficient permissions error, otherwise FALSE.
 */
function isInsufficientPermissionsError(error) {
  return [ERROR_REASON_INSUFFICIENT_PERMISSIONS, ERROR_REASON_FORBIDDEN].includes(error?.data?.reason);
}

/**
 * Checks if the given error is an auth error.
 *
 * @since 1.78.0
 *
 * @param {Object} error The error object to check.
 * @return {boolean} TRUE if it's an auth error, otherwise FALSE.
 */
function isAuthError(error) {
  return !!error?.data?.reconnectURL;
}

/**
 * Checks if the given error can be retried.
 *
 * @since 1.86.0
 *
 * @param {Object} error          The error object to check.
 * @param {Object} [selectorData] The error's associated selector data object.
 * @return {boolean} TRUE if the error is retryable, otherwise FALSE.
 */
function isErrorRetryable(error, selectorData) {
  return !!selectorData?.storeName && !isInsufficientPermissionsError(error) && !isPermissionScopeError(error) && !isAuthError(error);
}

/**
 * Sets the error message for specific error codes.
 *
 * @since 1.92.0
 *
 * @param {Object} error The error object to check.
 * @return {Object} The updated error object.
 */
function getReportErrorMessage(error) {
  if (error?.code === ERROR_INTERNAL_SERVER_ERROR) {
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('There was a critical error on this website while fetching data', 'google-site-kit');
  } else if (error?.code === ERROR_INVALID_JSON) {
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The server provided an invalid response', 'google-site-kit');
  }
  return error?.message;
}

/***/ }),

/***/ "./js/util/finite-number-or-zero.js":
/*!******************************************!*\
  !*** ./js/util/finite-number-or-zero.js ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   finiteNumberOrZero: () => (/* binding */ finiteNumberOrZero)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Utility function `finiteNumberOrZero()`.
 *
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Returns the passed value if it's a finite number, otherwise returns 0.
 *
 * @since 1.98.0
 *
 * @param {any} value The value to check.
 * @return {number} The finite number `value`, or 0 if `value` is not a finite number.
 */
function finiteNumberOrZero(value) {
  return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isFinite)(value) ? value : 0;
}

/***/ }),

/***/ "./js/util/i18n.js":
/*!*************************!*\
  !*** ./js/util/i18n.js ***!
  \*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createDurationFormat: () => (/* binding */ createDurationFormat),
/* harmony export */   expandNumFmtOptions: () => (/* binding */ expandNumFmtOptions),
/* harmony export */   getLocale: () => (/* binding */ getLocale),
/* harmony export */   listFormat: () => (/* binding */ listFormat),
/* harmony export */   numFmt: () => (/* binding */ numFmt),
/* harmony export */   numberFormat: () => (/* binding */ numberFormat),
/* harmony export */   prepareForReadableLargeNumber: () => (/* binding */ prepareForReadableLargeNumber),
/* harmony export */   readableLargeNumber: () => (/* binding */ readableLargeNumber)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! memize */ "../node_modules/memize/index.js");
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(memize__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__);
/**
 * Internationalization Utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Converts seconds to a display ready string indicating
 * the number of hours, minutes and seconds that have elapsed.
 *
 * For example, passing 65 returns '1m 5s'.
 *
 * @since 1.0.0
 * @since 1.28.0 Refactored and renamed to improve localization.
 * @private
 *
 * @param {number}                     durationInSeconds The number of seconds.
 * @param {(Intl.NumberFormatOptions)} [options]         Optional formatting options.
 * @return {string} Human readable string indicating time elapsed.
 */
function durationFormat(durationInSeconds, options = {}) {
  const {
    formatUnit,
    formatDecimal
  } = createDurationFormat(durationInSeconds, options);
  try {
    // Some browsers, e.g. Safari, throw a RangeError when options.style is
    // not one of decimal, percent, or currency.
    return formatUnit();
  } catch {
    // Fallback to XXh YYm ZZs using localized decimals with hardcoded units.
    return formatDecimal();
  }
}

/**
 * Converts seconds to a display ready string indicating
 * the number of hours, minutes and seconds that have elapsed
 * in ISO format - HH:mm:ss.
 *
 * If the duration is less than an hour, the HH part of the string
 * is truncated.
 * For example, passing 65 returns '01:05'.
 * Passing 5400 returns '01:30:00'.
 *
 * @since 1.111.0
 * @private
 *
 * @param {number} durationInSeconds The number of seconds.
 * @return {string} Human readable string indicating time elapsed.
 */
function durationISOFormat(durationInSeconds) {
  let {
    hours,
    minutes,
    seconds
  } = parseDuration(durationInSeconds);
  seconds = ('0' + seconds).slice(-2);
  minutes = ('0' + minutes).slice(-2);
  hours = ('0' + hours).slice(-2);
  return hours === '00' ? `${minutes}:${seconds}` : `${hours}:${minutes}:${seconds}`;
}

/**
 * Parses the duration in seconds into hours, minutes and seconds.
 *
 * @since 1.111.0
 * @private
 *
 * @param {number} durationInSeconds The number of seconds.
 * @return {Object} Number of hours, minutes and seconds equivalent
 * to the given duration in seconds.
 */
function parseDuration(durationInSeconds) {
  durationInSeconds = parseInt(durationInSeconds, 10);
  if (Number.isNaN(durationInSeconds)) {
    durationInSeconds = 0;
  }
  const hours = Math.floor(durationInSeconds / 60 / 60);
  const minutes = Math.floor(durationInSeconds / 60 % 60);
  const seconds = Math.floor(durationInSeconds % 60);
  return {
    hours,
    minutes,
    seconds
  };
}

/**
 * Creates duration formatting utilities.
 *
 * Not intended to be used directly.
 * Use `numFmt( number, { style: 'duration' } )` instead.
 *
 * @since 1.29.0
 * @private
 *
 * @param {number} durationInSeconds Duration to format.
 * @param {Object} [options]         Formatting options.
 * @return {Object} Formatting functions.
 */
function createDurationFormat(durationInSeconds, options = {}) {
  const {
    hours,
    minutes,
    seconds
  } = parseDuration(durationInSeconds);
  return {
    hours,
    minutes,
    seconds,
    formatUnit() {
      const {
        unitDisplay = 'short',
        ...restOptions
      } = options;
      const commonOptions = {
        unitDisplay,
        ...restOptions,
        style: 'unit'
      };
      if (durationInSeconds === 0) {
        return numberFormat(seconds, {
          ...commonOptions,
          unit: 'second'
        });
      }
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._x)('%3$s %2$s %1$s', 'duration of time: hh mm ss', 'google-site-kit'), seconds ? numberFormat(seconds, {
        ...commonOptions,
        unit: 'second'
      }) : '', minutes ? numberFormat(minutes, {
        ...commonOptions,
        unit: 'minute'
      }) : '', hours ? numberFormat(hours, {
        ...commonOptions,
        unit: 'hour'
      }) : '').trim();
    },
    /**
     * Formats the duration using integers and translatable strings.
     * This is only used as a fallback when the above `formatUnit` fails.
     *
     * @since 1.29.0
     *
     * @return {string} Formatted duration.
     */
    formatDecimal() {
      const formattedSeconds = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
      // translators: %s: number of seconds with "s" as the abbreviated unit.
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%ds', 'google-site-kit'), seconds);
      if (durationInSeconds === 0) {
        return formattedSeconds;
      }
      const formattedMinutes = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
      // translators: %s: number of minutes with "m" as the abbreviated unit.
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%dm', 'google-site-kit'), minutes);
      const formattedHours = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
      // translators: %s: number of hours with "h" as the abbreviated unit.
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%dh', 'google-site-kit'), hours);
      return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._x)('%3$s %2$s %1$s', 'duration of time: hh mm ss', 'google-site-kit'), seconds ? formattedSeconds : '', minutes ? formattedMinutes : '', hours ? formattedHours : '').trim();
    }
  };
}

/**
 * Prepares a number to be used in readableLargeNumber.
 *
 * @since 1.7.0
 *
 * @param {number} number The large number to prepare.
 * @return {number} The prepared number.
 */
function prepareForReadableLargeNumber(number) {
  if (1000000 <= number) {
    return Math.round(number / 100000) / 10;
  }
  if (10000 <= number) {
    return Math.round(number / 1000);
  }
  if (1000 <= number) {
    return Math.round(number / 100) / 10;
  }
  return number;
}

/**
 * Formats a large number for shortened display.
 *
 * @since 1.0.0
 *
 * @param {number} number The large number to format.
 * @return {string} The formatted number.
 */
function readableLargeNumber(number) {
  const withSingleDecimal = {
    minimumFractionDigits: 1,
    maximumFractionDigits: 1
  };

  // Numbers over 1,000,000 round normally and display a single decimal unless the decimal is 0.
  if (1000000 <= number) {
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
    // translators: %s: an abbreviated number in millions.
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%sM', 'google-site-kit'), numberFormat(prepareForReadableLargeNumber(number), number % 10 === 0 ? {} : withSingleDecimal));
  }

  // Numbers between 10,000 and 1,000,000 round normally and have no decimals
  if (10000 <= number) {
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
    // translators: %s: an abbreviated number in thousands.
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%sK', 'google-site-kit'), numberFormat(prepareForReadableLargeNumber(number)));
  }

  // Numbers between 1,000 and 10,000 round normally and display a single decimal unless the decimal is 0.
  if (1000 <= number) {
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(
    // translators: %s: an abbreviated number in thousands.
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%sK', 'google-site-kit'), numberFormat(prepareForReadableLargeNumber(number), number % 10 === 0 ? {} : withSingleDecimal));
  }
  return numberFormat(number, {
    signDisplay: 'never',
    maximumFractionDigits: 1
  });
}

/**
 * Parses formatting options and returns an object with options for selected formatting.
 *
 * @since 1.103.0
 *
 * @param {(Intl.NumberFormatOptions|string)} options Formatting options or unit shorthand. Possible shorthand values are '%', 's', or a currency code.
 * @return {Object} Formatting options.
 */
function expandNumFmtOptions(options) {
  let formatOptions = {};

  // Expand shorthand values for units.
  if ('%' === options) {
    formatOptions = {
      style: 'percent',
      maximumFractionDigits: 2
    };
  } else if ('s' === options) {
    formatOptions = {
      style: 'duration',
      unitDisplay: 'narrow'
    };
  } else if (!!options && typeof options === 'string') {
    formatOptions = {
      style: 'currency',
      currency: options
    };
  } else if ((0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(options)) {
    formatOptions = {
      ...options
    };
  }
  return formatOptions;
}

/**
 * Formats a number with unit using the JS Internationalization Number Format API.
 *
 * In addition to the supported 'style' values of the lower-level `numberFormat` function, this function
 * supports two additional 'style' values 'metric' and 'duration' (expects a number in seconds).
 *
 * Another differentiation in behavior is that by default the function will use 'metric' formatting instead
 * of 'decimal' formatting.
 *
 * @since 1.24.0
 *
 * @param {number|string}                     number    The number to format.
 * @param {(Intl.NumberFormatOptions|string)} [options] Formatting options or unit shorthand.
 *                                                      Possible shorthand values are '%', 's',
 *                                                      or a currency code.
 * @return {string} The formatted number.
 */
function numFmt(number, options = {}) {
  // Cast parsable values to numeric types.
  number = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isFinite)(number) ? number : Number(number);
  if (!(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isFinite)(number)) {
    // eslint-disable-next-line no-console
    console.warn('Invalid number', number, typeof number);
    number = 0;
  }
  const formatOptions = expandNumFmtOptions(options);
  const {
    style = 'metric'
  } = formatOptions; // Note: `metric` is our custom, default style.

  if ('metric' === style) {
    return readableLargeNumber(number);
  }
  if ('duration' === style) {
    return durationFormat(number, formatOptions);
  }
  if ('durationISO' === style) {
    return durationISOFormat(number);
  }
  return numberFormat(number, formatOptions);
}

// Warn once for a given message.
const warnOnce = memize__WEBPACK_IMPORTED_MODULE_1___default()(console.warn); // eslint-disable-line no-console

/**
 * Formats a number using the JS Internationalization Number Format API.
 *
 * @since 1.8.0
 * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat/NumberFormat|`options` parameter} For all available formatting options.
 *
 * @param {number}                   number           The number to format.
 * @param {Intl.NumberFormatOptions} [options]        Formatting options.
 * @param {string}                   [options.locale] Locale to use for formatting. Defaults to current locale used by Site Kit.
 * @return {string} The formatted number.
 */
function numberFormat(number, options = {}) {
  const {
    locale = getLocale(),
    ...formatOptions
  } = options;
  try {
    /**
     * Per https://github.com/google/site-kit-wp/issues/3255 there have been issues with some versions of Safari
     * on some operating systems throwing issues with some parameters in the formatOptions.
     *
     * If an error is thrown, we remove some troublesome params from the formatOptions object and fallback to no formatting.
     *
     * This allows us to degrade somewhat gracefully without breaking the dashboard for users of unaffected browsers.
     */
    return new Intl.NumberFormat(locale, formatOptions).format(number);
  } catch (error) {
    warnOnce(`Site Kit numberFormat error: Intl.NumberFormat( ${JSON.stringify(locale)}, ${JSON.stringify(formatOptions)} ).format( ${typeof number} )`, error.message);
  }

  // Remove these key/values from formatOptions.
  const unstableFormatOptionValues = {
    currencyDisplay: 'narrow',
    currencySign: 'accounting',
    style: 'unit'
  };

  // Remove these keys from formatOptions irrespective of value.
  const unstableFormatOptions = ['signDisplay', 'compactDisplay'];
  const reducedFormatOptions = {};
  for (const [key, value] of Object.entries(formatOptions)) {
    if (unstableFormatOptionValues[key] && value === unstableFormatOptionValues[key]) {
      continue;
    }
    if (unstableFormatOptions.includes(key)) {
      continue;
    }
    reducedFormatOptions[key] = value;
  }
  try {
    return new Intl.NumberFormat(locale, reducedFormatOptions).format(number);
  } catch {
    return new Intl.NumberFormat(locale).format(number);
  }
}

/**
 * Flattens an array of strings into a string using the JS Internationalization List Format API.
 *
 * @since 1.23.0
 * @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat|`options` parameter} For all available options.
 *
 * @param {Array}  list             The list to flatten.
 * @param {Object} [options]        Formatting options.
 * @param {string} [options.locale] Locale to use for formatting. Defaults to current locale used by Site Kit.
 * @param {string} [options.style]  Length of the formatted message. Defaults to long.
 * @param {string} [options.type]   Type of list. Defaults to 'conjunction' (A, B, and C).
 *                                  Also available 'disjunction' (A, B, or C)
 *                                  Also available 'unit' (5 pounds, 12 ounces)
 * @return {string} The flattened list.
 */
function listFormat(list, options = {}) {
  const {
    locale = getLocale(),
    style = 'long',
    type = 'conjunction'
  } = options;

  // Not all browsers support Intl.Listformat per
  // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/ListFormat/ListFormat#Browser_compatibility
  // We've seen that the built versions don't polyfill for the unsupported browsers (iOS/safari) so we provide a fallback.
  if (Intl.ListFormat) {
    const formatter = new Intl.ListFormat(locale, {
      style,
      type
    });
    return formatter.format(list);
  }

  /* translators: used between list items, there is a space after the comma. */
  const listSeparator = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)(', ', 'google-site-kit');
  return list.join(listSeparator);
}

/**
 * Gets the current locale for use with browser APIs.
 *
 * @since 1.8.0
 *
 * @param {Object} _global The global window object.
 * @return {string} Current Site Kit locale if set, otherwise the current language set by the browser.
 *                  E.g. `en-US` or `de-DE`
 */
function getLocale(_global = __webpack_require__.g) {
  const siteKitLocale = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(_global, ['_googlesitekitLegacyData', 'locale']);
  if (siteKitLocale) {
    const matches = siteKitLocale.match(/^(\w{2})?(_)?(\w{2})/);
    if (matches && matches[0]) {
      return matches[0].replace(/_/g, '-');
    }
  }
  return _global.navigator.language;
}

/***/ }),

/***/ "./js/util/index.js":
/*!**************************!*\
  !*** ./js/util/index.js ***!
  \**************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DAY_IN_SECONDS: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.DAY_IN_SECONDS),
/* harmony export */   HOUR_IN_SECONDS: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.HOUR_IN_SECONDS),
/* harmony export */   INVALID_DATE_INSTANCE_ERROR: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.INVALID_DATE_INSTANCE_ERROR),
/* harmony export */   INVALID_DATE_RANGE_ERROR: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.INVALID_DATE_RANGE_ERROR),
/* harmony export */   INVALID_DATE_STRING_ERROR: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.INVALID_DATE_STRING_ERROR),
/* harmony export */   MINUTE_IN_SECONDS: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.MINUTE_IN_SECONDS),
/* harmony export */   MONTH_IN_SECONDS: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.MONTH_IN_SECONDS),
/* harmony export */   WEEK_IN_SECONDS: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.WEEK_IN_SECONDS),
/* harmony export */   calculateChange: () => (/* binding */ calculateChange),
/* harmony export */   calculateDifferenceBetweenChartValues: () => (/* reexport safe */ _chart__WEBPACK_IMPORTED_MODULE_9__.calculateDifferenceBetweenChartValues),
/* harmony export */   convertDateStringToUNIXTimestamp: () => (/* reexport safe */ _convert_time__WEBPACK_IMPORTED_MODULE_7__.convertDateStringToUNIXTimestamp),
/* harmony export */   convertSecondsToArray: () => (/* reexport safe */ _convert_time__WEBPACK_IMPORTED_MODULE_7__.convertSecondsToArray),
/* harmony export */   createDurationFormat: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.createDurationFormat),
/* harmony export */   dateSub: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.dateSub),
/* harmony export */   decodeHTMLEntity: () => (/* binding */ decodeHTMLEntity),
/* harmony export */   expandNumFmtOptions: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.expandNumFmtOptions),
/* harmony export */   getAvailableDateRanges: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.getAvailableDateRanges),
/* harmony export */   getChartDifferenceArrow: () => (/* reexport safe */ _chart__WEBPACK_IMPORTED_MODULE_9__.getChartDifferenceArrow),
/* harmony export */   getCurrentDateRangeDayCount: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.getCurrentDateRangeDayCount),
/* harmony export */   getDateString: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.getDateString),
/* harmony export */   getFullURL: () => (/* reexport safe */ _urls__WEBPACK_IMPORTED_MODULE_10__.getFullURL),
/* harmony export */   getLocale: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.getLocale),
/* harmony export */   getPreviousDate: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.getPreviousDate),
/* harmony export */   getStorage: () => (/* reexport safe */ _storage__WEBPACK_IMPORTED_MODULE_4__.getStorage),
/* harmony export */   getURLPath: () => (/* reexport safe */ _urls__WEBPACK_IMPORTED_MODULE_10__.getURLPath),
/* harmony export */   isHashOnly: () => (/* reexport safe */ _urls__WEBPACK_IMPORTED_MODULE_10__.isHashOnly),
/* harmony export */   isNumeric: () => (/* reexport safe */ _isnumeric__WEBPACK_IMPORTED_MODULE_12__.isNumeric),
/* harmony export */   isSingleSlice: () => (/* reexport safe */ _chart__WEBPACK_IMPORTED_MODULE_9__.isSingleSlice),
/* harmony export */   isValidDateRange: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.isValidDateRange),
/* harmony export */   isValidDateString: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.isValidDateString),
/* harmony export */   isValidNumericID: () => (/* reexport safe */ _is_valid_numeric_id__WEBPACK_IMPORTED_MODULE_11__.isValidNumericID),
/* harmony export */   listFormat: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.listFormat),
/* harmony export */   markdownToHTML: () => (/* reexport safe */ _markdown__WEBPACK_IMPORTED_MODULE_6__.markdownToHTML),
/* harmony export */   normalizeURL: () => (/* reexport safe */ _urls__WEBPACK_IMPORTED_MODULE_10__.normalizeURL),
/* harmony export */   numFmt: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.numFmt),
/* harmony export */   numberFormat: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.numberFormat),
/* harmony export */   partitionReport: () => (/* reexport safe */ _partition_report__WEBPACK_IMPORTED_MODULE_14__.partitionReport),
/* harmony export */   prepareForReadableLargeNumber: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.prepareForReadableLargeNumber),
/* harmony export */   readableLargeNumber: () => (/* reexport safe */ _i18n__WEBPACK_IMPORTED_MODULE_5__.readableLargeNumber),
/* harmony export */   safelySort: () => (/* reexport safe */ _safely_sort__WEBPACK_IMPORTED_MODULE_13__.safelySort),
/* harmony export */   sanitizeHTML: () => (/* reexport safe */ _sanitize__WEBPACK_IMPORTED_MODULE_2__.sanitizeHTML),
/* harmony export */   shortenURL: () => (/* reexport safe */ _urls__WEBPACK_IMPORTED_MODULE_10__.shortenURL),
/* harmony export */   storageAvailable: () => (/* reexport safe */ _storage__WEBPACK_IMPORTED_MODULE_4__.storageAvailable),
/* harmony export */   stringToDate: () => (/* reexport safe */ _dates__WEBPACK_IMPORTED_MODULE_8__.stringToDate),
/* harmony export */   stringifyObject: () => (/* reexport safe */ _stringify__WEBPACK_IMPORTED_MODULE_3__.stringifyObject),
/* harmony export */   trackEvent: () => (/* reexport safe */ _tracking__WEBPACK_IMPORTED_MODULE_1__.trackEvent),
/* harmony export */   trackEventOnce: () => (/* reexport safe */ _tracking__WEBPACK_IMPORTED_MODULE_1__.trackEventOnce),
/* harmony export */   untrailingslashit: () => (/* reexport safe */ _sanitize__WEBPACK_IMPORTED_MODULE_2__.untrailingslashit),
/* harmony export */   validateJSON: () => (/* binding */ validateJSON)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _tracking__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tracking */ "./js/util/tracking/index.js");
/* harmony import */ var _sanitize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./sanitize */ "./js/util/sanitize.js");
/* harmony import */ var _stringify__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stringify */ "./js/util/stringify.js");
/* harmony import */ var _storage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./storage */ "./js/util/storage.js");
/* harmony import */ var _i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./i18n */ "./js/util/i18n.js");
/* harmony import */ var _markdown__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./markdown */ "./js/util/markdown.js");
/* harmony import */ var _convert_time__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./convert-time */ "./js/util/convert-time.js");
/* harmony import */ var _dates__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./dates */ "./js/util/dates.js");
/* harmony import */ var _chart__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./chart */ "./js/util/chart.js");
/* harmony import */ var _urls__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./urls */ "./js/util/urls.js");
/* harmony import */ var _is_valid_numeric_id__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./is-valid-numeric-id */ "./js/util/is-valid-numeric-id.js");
/* harmony import */ var _isnumeric__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./isnumeric */ "./js/util/isnumeric.js");
/* harmony import */ var _safely_sort__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./safely-sort */ "./js/util/safely-sort.js");
/* harmony import */ var _partition_report__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./partition-report */ "./js/util/partition-report.js");
/**
 * Utility functions.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */
















/**
 * Calculates the change between two values.
 *
 * @since 1.24.0
 *
 * @param {number} previous The previous value.
 * @param {number} current  The current value.
 * @return {(number|null)} The percent change. Null if the input or output is invalid.
 */
function calculateChange(previous, current) {
  function isZero(value) {
    return value === '0' || value === 0;
  }

  // Prevent null result when both values are legitimately zero.
  if (isZero(previous) && isZero(current)) {
    return 0;
  }

  // Prevent divide by zero errors.
  if (isZero(previous) || Number.isNaN(previous)) {
    return null;
  }

  // Avoid NaN at all costs.
  const change = (current - previous) / previous;
  if (Number.isNaN(change) || !Number.isFinite(change)) {
    return null;
  }
  return change;
}

/**
 * Verifies whether JSON is valid.
 *
 * @since 1.0.0
 *
 * @param {string} stringToValidate The string to validate.
 * @return {boolean} Indicates JSON is valid.
 */
function validateJSON(stringToValidate) {
  try {
    return JSON.parse(stringToValidate) && !!stringToValidate;
  } catch (error) {
    return false;
  }
}

/**
 * Converts HTML text into an HTML entity.
 *
 * _.unescape doesn't seem to decode some entities for admin bar titles.
 * adding combination in this helper as a workaround.
 *
 * @since 1.0.0
 *
 * @param {string} str The string to decode.
 * @return {string} Decoded HTML entity.
 */
function decodeHTMLEntity(str) {
  if (!str) {
    return '';
  }
  const decoded = str.replace(/&#(\d+);/g, (match, dec) => {
    return String.fromCharCode(dec);
  }).replace(/(\\)/g, '');
  return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.unescape)(decoded);
}

/***/ }),

/***/ "./js/util/initialize-google-global.js":
/*!*********************************************!*\
  !*** ./js/util/initialize-google-global.js ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __unused_webpack_exports, __webpack_require__) => {

/**
 * Side Effect to initialize `google` global.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

if (!Object.prototype.hasOwnProperty.call(__webpack_require__.g, 'google')) {
  __webpack_require__.g.google = {};
}

/***/ }),

/***/ "./js/util/insufficient-permissions-error-description.js":
/*!***************************************************************!*\
  !*** ./js/util/insufficient-permissions-error-description.js ***!
  \***************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getInsufficientPermissionsErrorDescription: () => (/* binding */ getInsufficientPermissionsErrorDescription)
/* harmony export */ });
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_modules_search_console_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/search-console/constants */ "./js/modules/search-console/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/**
 * `getInsufficientPermissionsErrorDescription` function.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */




/**
 * Gets a description for an insufficient permissions error.
 *
 * @since 1.16.0
 *
 * @param {string} error              Original error message.
 * @param {Object} module             Module data.
 * @param {string} module.name        The name of the module.
 * @param {string} module.slug        The slug of the module.
 * @param {Object} module.owner       The owner of the module.
 * @param {string} module.owner.login The The login of the current owner.
 * @return {string}                   Error description.
 */
function getInsufficientPermissionsErrorDescription(error = '', module = {}) {
  const {
    slug = '',
    name = '',
    owner = {}
  } = module || {};

  // If no module data provided, it is impossible to provide a more clear message.
  if (!slug || !name) {
    return error;
  }
  let message = '';
  let userInfo = '';
  if (_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_2__.MODULE_SLUG_ANALYTICS_4 === slug) {
    if (error.match(/account/i)) {
      message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your Google account does not have sufficient permissions for this Analytics account, so you won’t be able to see stats from it on the Site Kit dashboard.', 'google-site-kit');
    } else if (error.match(/property/i)) {
      message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your Google account does not have sufficient permissions for this Analytics property, so you won’t be able to see stats from it on the Site Kit dashboard.', 'google-site-kit');
    } else if (error.match(/view/i)) {
      message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your Google account does not have sufficient permissions for this Analytics view, so you won’t be able to see stats from it on the Site Kit dashboard.', 'google-site-kit');
    }
  } else if (_js_modules_search_console_constants__WEBPACK_IMPORTED_MODULE_1__.MODULE_SLUG_SEARCH_CONSOLE === slug) {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your Google account does not have sufficient permissions for this Search Console property, so you won’t be able to see stats from it on the Site Kit dashboard.', 'google-site-kit');
  }
  if (!message) {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: module name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your Google account does not have sufficient permissions to access %s data, so you won’t be able to see stats from it on the Site Kit dashboard.', 'google-site-kit'), name);
  }
  if (owner && owner.login) {
    userInfo = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: owner name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This service was originally connected by the administrator "%s" — you can contact them for more information.', 'google-site-kit'), owner.login);
  }
  if (!userInfo) {
    userInfo = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('This service was originally connected by an administrator — you can contact them for more information.', 'google-site-kit');
  }
  return `${message} ${userInfo}`;
}

/***/ }),

/***/ "./js/util/is-site-kit-screen.js":
/*!***************************************!*\
  !*** ./js/util/is-site-kit-screen.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isSiteKitScreen: () => (/* binding */ isSiteKitScreen)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/**
 * Utility function to check whether or not a view-context is a Site Kit view.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */


/**
 * Checks whether or not the current viewContext is a Site Kit screen.
 *
 * @since 1.80.0
 *
 * @param {string} viewContext The view-context.
 * @return {boolean} TRUE if the passed view-context is a site kit view; otherwise FALSE.
 */
function isSiteKitScreen(viewContext) {
  return _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_0__.SITE_KIT_VIEW_CONTEXTS.includes(viewContext);
}

/***/ }),

/***/ "./js/util/is-valid-numeric-id.js":
/*!****************************************!*\
  !*** ./js/util/is-valid-numeric-id.js ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isValidNumericID: () => (/* binding */ isValidNumericID)
/* harmony export */ });
/**
 * Utility function related to checking if a given value is numeric.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Checks the given value to see if it is a positive integer.
 *
 * @since 1.11.0 Function introduced.
 * @since 1.90.0 Moved outside Tag Manager to a generic utility function.
 *
 * @param {*} input Value to check.
 * @return {boolean} Validity.
 */
function isValidNumericID(input) {
  const id = parseFloat(input) || 0;
  if (!Number.isInteger(id)) {
    return false;
  }
  return id > 0;
}

/***/ }),

/***/ "./js/util/isnumeric.js":
/*!******************************!*\
  !*** ./js/util/isnumeric.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isNumeric: () => (/* binding */ isNumeric)
/* harmony export */ });
/**
 * Utility function related to checking if a given value is numeric.
 *
 * Site Kit by Google, Copyright 2022 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Checks if a given value is numeric.
 *
 * @since 1.80.0
 *
 * @param {*} value The value to check.
 * @return {boolean} TRUE if a value is numeric FALSE otherwise.
 */
function isNumeric(value) {
  if (typeof value === 'number') {
    return true;
  }
  const string = (value || '').toString();
  if (!string) {
    return false;
  }
  return !isNaN(string);
}

/***/ }),

/***/ "./js/util/markdown.js":
/*!*****************************!*\
  !*** ./js/util/markdown.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   markdownToHTML: () => (/* binding */ markdownToHTML)
/* harmony export */ });
/**
 * Markdown utility.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Replaces markdown links with its HTML equivalents.
 *
 * @since 1.22.0
 *
 * @param {string} text Markdown text.
 * @return {string} Text with HTML links.
 */
function markdownLinks(text) {
  return text.replace(new RegExp('\\[([^\\]]+)\\]\\((https?://[^/]+\\.\\w+/?.*?)\\)', 'gi'), '<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>');
}

/**
 * Adds paragraphs to the text.
 *
 * @since 1.22.0
 *
 * @param {string} text Markdown text.
 * @return {string} Text with HTML links.
 */
function markdownParagraphs(text) {
  return `<p>${text.replace(/\n{2,}/g, '</p><p>')}</p>`;
}

/**
 * Replaces line breaks in the text.
 *
 * @since 1.22.0
 *
 * @param {string} text Markdown text.
 * @return {string} Text with HTML links.
 */
function markdownBreaks(text) {
  return text.replace(/\n/gi, '<br>');
}

/**
 * Converts markdown to HTML.
 *
 * @since 1.22.0
 *
 * @param {string} text Markdown text.
 * @return {string} HTML version of the markdown text.
 */
function markdownToHTML(text) {
  const rules = [markdownLinks, markdownParagraphs, markdownBreaks];
  let html = text;
  for (const rule of rules) {
    html = rule(html);
  }
  return html;
}

/***/ }),

/***/ "./js/util/partition-report.js":
/*!*************************************!*\
  !*** ./js/util/partition-report.js ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   partitionReport: () => (/* binding */ partitionReport)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Report partitioning utility.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Splits report data into segments for current and comparison ranges.
 *
 * @since 1.33.0
 * @since 1.34.0 Updated to support incomplete `report` arrays.
 *
 * @param {Array}  report               Report rows.
 * @param {Object} args                 Additional arguments.
 * @param {number} args.dateRangeLength Date range length of report segments.
 * @return {Object} Object with keys for `compareRange` and `currentRange`.
 */
function partitionReport(report, {
  dateRangeLength
}) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(report), 'report must be an array to partition.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Number.isInteger(dateRangeLength) && dateRangeLength > 0, 'dateRangeLength must be a positive integer.');

  // Use a negative date range length for reverse slicing.
  const _dateRangeLength = -1 * dateRangeLength;
  return {
    // The current range should always be sliced from the end.
    currentRange: report.slice(_dateRangeLength),
    // The compare range continues from where the current left off (slicing towards the start),
    // and may be shorter (where older data is not available yet) which is fine.
    compareRange: report.slice(_dateRangeLength * 2, _dateRangeLength)
  };
}

/***/ }),

/***/ "./js/util/purify.js":
/*!***************************!*\
  !*** ./js/util/purify.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   purify: () => (/* binding */ purify)
/* harmony export */ });
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! dompurify */ "../node_modules/dompurify/dist/purify.js");
/* harmony import */ var dompurify__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(dompurify__WEBPACK_IMPORTED_MODULE_0__);
/**
 * External dependencies
 */

const purify = dompurify__WEBPACK_IMPORTED_MODULE_0___default()(__webpack_require__.g);

/***/ }),

/***/ "./js/util/report-validation.js":
/*!**************************************!*\
  !*** ./js/util/report-validation.js ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isValidDateRange: () => (/* binding */ isValidDateRange),
/* harmony export */   isValidOrders: () => (/* binding */ isValidOrders),
/* harmony export */   isValidStringsOrObjects: () => (/* binding */ isValidStringsOrObjects),
/* harmony export */   isValidStringularItems: () => (/* binding */ isValidStringularItems)
/* harmony export */ });
/**
 * Reporting API validation utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Validates data that can be either string or object of the certain type, or array of them.
 *
 * @since 1.13.0
 * @since 1.98.0 Added verifyStringFunction parameter.
 *
 * @param {string|string[]|Object|Object[]} data                   The data to check.
 * @param {Function}                        verifyObjectFunction   The callback to verify an object.
 * @param {Function}                        [verifyStringFunction] The callback to verify a string (optional).
 * @return {boolean} TRUE if data is valid, otherwise FALSE.
 */
function isValidStringsOrObjects(data, verifyObjectFunction, verifyStringFunction = () => true) {
  if (typeof data === 'string') {
    return verifyStringFunction(data);
  }
  if (typeof data === 'object' && verifyObjectFunction(data)) {
    return true;
  }
  if (Array.isArray(data)) {
    return data.every(item => {
      if (typeof item === 'string') {
        return verifyStringFunction(item);
      }
      if (typeof item === 'object') {
        return verifyObjectFunction(item);
      }
      return false;
    });
  }

  // Arguably this should fail/throw, because none of our allowed types were encountered.
  return false;
}

/**
 * Verifies that either date range or start and end dates are valid.
 *
 * @since 1.13.0
 *
 * @param {Object} dates           The object containing dates to check.
 * @param {string} dates.startDate The start date to check.
 * @param {string} dates.endDate   The end date to check.
 * @return {boolean} TRUE if either date range or start/end dates are valid, otherwise FALSE.
 */
function isValidDateRange({
  startDate,
  endDate
}) {
  const validStartDate = startDate && startDate.match(/^\d{4}-\d{2}-\d{2}$/);
  const validEndDate = endDate && endDate.match(/^\d{4}-\d{2}-\d{2}$/);
  return validStartDate && validEndDate;
}

/**
 * Verifies that order definitions are valid. It can be either an object or an array
 * of objects where each object has "fieldName" and valid "sortOrder" properties.
 *
 * @since 1.13.0
 *
 * @param {Object|Object[]} orders The order definitions to check.
 * @return {boolean} TRUE if order definitions are valid, otherwise FALSE.
 */
function isValidOrders(orders) {
  function isValidOrder(order) {
    const isValidFieldName = order.hasOwnProperty('fieldName') && !!order.fieldName;
    const isValidSortOrder = order.hasOwnProperty('sortOrder') && /(ASCENDING|DESCENDING)/i.test(order.sortOrder.toString());
    return isValidFieldName && isValidSortOrder;
  }
  if (Array.isArray(orders)) {
    return orders.every(item => typeof item === 'object' && isValidOrder(item));
  }
  if (typeof orders === 'object') {
    return isValidOrder(orders);
  }

  // Arguably this should fail/throw, because none of our allowed types were encountered.
  return false;
}

/**
 * Verifies that provided parameter is either a string or an array of strings.
 *
 * @since 1.15.0
 *
 * @param {(string|Array.<string>)} items Items to validate.
 * @return {boolean} TRUE if items are either a string or an array of strings, otherwise FALSE.
 */
function isValidStringularItems(items) {
  if (typeof items === 'string') {
    return true;
  }
  if (Array.isArray(items)) {
    return items.every(item => typeof item === 'string');
  }
  return false;
}

/***/ }),

/***/ "./js/util/safely-sort.js":
/*!********************************!*\
  !*** ./js/util/safely-sort.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   safelySort: () => (/* binding */ safelySort)
/* harmony export */ });
/**
 * `safelySort` utility function.
 *
 * Site Kit by Google, Copyright 2024 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Sorts an array without causing the mutation if the given parameter is an array.
 * If the parameter is not an array, it returns the parameter as is.
 *
 * @since 1.110.0
 * @since 1.128.0 Moved to the common utility directory from the key metrics directory.
 *
 * @param {Array|*} arr Param to be sorted.
 * @return {Array|*} 	Safely sorted array without mutation.
 */
function safelySort(arr) {
  return Array.isArray(arr) ? [...arr].sort() : arr;
}

/***/ }),

/***/ "./js/util/sanitize.js":
/*!*****************************!*\
  !*** ./js/util/sanitize.js ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   sanitizeHTML: () => (/* binding */ sanitizeHTML),
/* harmony export */   untrailingslashit: () => (/* binding */ untrailingslashit)
/* harmony export */ });
/* harmony import */ var _purify__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./purify */ "./js/util/purify.js");
/**
 * Internal dependencies
 */

function sanitizeHTML(unsafeHTML, domPurifyConfig = {}) {
  return {
    __html: _purify__WEBPACK_IMPORTED_MODULE_0__.purify.sanitize(unsafeHTML, domPurifyConfig)
  };
}

/**
 * Takes a string or an URL object, removes the trailing slash if any and returns it.
 *
 * @since 1.20.0
 * @private
 *
 * @param {Object|string} url A string with or without trailing slash or an URL object.
 * @return {string|undefined} The URL string after removing the trailing slash.
 */
function untrailingslashit(url) {
  const originalURL = typeof url === 'object' ? url.toString() : url;
  return originalURL?.replace?.(/\/+$/, '');
}

/***/ }),

/***/ "./js/util/scroll.js":
/*!***************************!*\
  !*** ./js/util/scroll.js ***!
  \***************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getNavigationalScrollTop: () => (/* binding */ getNavigationalScrollTop),
/* harmony export */   getStickyHeaderHeight: () => (/* binding */ getStickyHeaderHeight),
/* harmony export */   getStickyHeaderHeightWithoutNav: () => (/* binding */ getStickyHeaderHeightWithoutNav)
/* harmony export */ });
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _finite_number_or_zero__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./finite-number-or-zero */ "./js/util/finite-number-or-zero.js");
/**
 * Utility functions related to window scrolling.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */



/**
 * Gets the y coordinate to scroll to the top of a context element, taking the sticky admin bar, header and navigation height into account.
 *
 * @since 1.137.0 Renamed from getContextScrollTop to getNavigationalScrollTop.
 *
 * @param {string} selector   Selector for the element to scroll to. The id (prepend #) or class (prepend .).
 * @param {string} breakpoint The current breakpoint.
 * @return {number} The offset to scroll to.
 */
function getNavigationalScrollTop(selector, breakpoint) {
  const contextElement = document.querySelector(selector);
  if (!contextElement) {
    return 0;
  }
  const contextTop = contextElement.getBoundingClientRect().top;
  const headerHeight = getStickyHeaderHeight(breakpoint);
  return contextTop + __webpack_require__.g.scrollY - headerHeight;
}

/**
 * Gets the height of the sticky header.
 *
 * @since 1.69.0
 * @since 1.98.0 Renamed from `getHeaderHeight()` to `getStickyHeaderHeight()`.
 *
 * @param {string} breakpoint The current breakpoint.
 * @return {number} The height of the sticky header.
 */
function getStickyHeaderHeight(breakpoint) {
  let headerHeight = getStickyHeaderHeightWithoutNav(breakpoint);
  const navigation = document.querySelectorAll('.googlesitekit-navigation, .googlesitekit-entity-header');
  headerHeight += Array.from(navigation).reduce((height, element) => height + element.offsetHeight, 0);
  return headerHeight;
}

/**
 * Returns the height of the sticky WordPress admin bar, if present.
 *
 * @since 1.98.0
 *
 * @param {string} breakpoint The current breakpoint.
 * @return {number} The height of the sticky WordPress admin bar, if present.
 */
function getWordPressAdminBarHeight(breakpoint) {
  // WordPress admin bar is only sticky for breakpoints larger than BREAKPOINT_SMALL. If it's also not sticky then we can return a height of 0.
  const wpAdminBar = document.querySelector('#wpadminbar');
  if (wpAdminBar && breakpoint !== _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__.BREAKPOINT_SMALL) {
    return wpAdminBar.offsetHeight;
  }
  return 0;
}

/**
 * Returns the height of the sticky Site Kit header including the sticky WordPress admin bar when it's present.
 *
 * @since 1.98.0
 *
 * @param {string} breakpoint The current breakpoint.
 * @return {number} The height of the sticky Site Kit header including the sticky WordPress admin bar when it's present.
 */
function getGoogleSiteKitHeaderHeight(breakpoint) {
  // This function calculates the height of the sticky Site Kit header including the sticky WordPress admin bar when it's present.
  const header = document.querySelector('.googlesitekit-header');
  if (header) {
    // If the breakpoint is BREAKPOINT_SMALL, the WordPress admin bar is not sticky and we can return the height of the Site Kit header alone.
    // Otherwise, we use the value of the bottom of the Site Kit header's bounding box as this will take into account the sticky WordPress admin bar.
    if (breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_0__.BREAKPOINT_SMALL) {
      return header.offsetHeight;
    }
    const headerBottom = header.getBoundingClientRect().bottom;
    // In case the header is unexpectedly _not_ sticky and the value for .bottom is negative, we return 0.
    return headerBottom < 0 ? 0 : headerBottom;
  }
  return 0;
}

/**
 * Gets the height of the sticky header without the Site Kit navigation bar.
 *
 * @since 1.95.0
 * @since 1.98.0 Renamed from `getHeaderHeightWithoutNav()` to `getStickyHeaderHeightWithoutNav()`.
 *
 * @param {string} breakpoint The current breakpoint.
 * @return {number} The height of the sticky header without the navigation bar.
 */
function getStickyHeaderHeightWithoutNav(breakpoint) {
  let headerHeight = 0;
  const header = document.querySelector('.googlesitekit-header');
  const isSiteKitHeaderSticky = !!header && __webpack_require__.g.getComputedStyle(header).position === 'sticky';
  if (isSiteKitHeaderSticky) {
    headerHeight = getGoogleSiteKitHeaderHeight(breakpoint);
  } else {
    // If the Site Kit header is not sticky, we only need to calculate the height of the sticky WordPress admin bar.
    headerHeight = getWordPressAdminBarHeight(breakpoint);
  }

  // Provide a safety net in case something unexpected has happened.
  headerHeight = (0,_finite_number_or_zero__WEBPACK_IMPORTED_MODULE_1__.finiteNumberOrZero)(headerHeight);
  return headerHeight < 0 ? 0 : headerHeight;
}

/***/ }),

/***/ "./js/util/storage.js":
/*!****************************!*\
  !*** ./js/util/storage.js ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getStorage: () => (/* binding */ getStorage),
/* harmony export */   storageAvailable: () => (/* binding */ storageAvailable)
/* harmony export */ });
/**
 * Storage abstraction.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Detects whether browser storage is both supported and available.
 *
 * @since 1.0.0
 *
 * @param {string} type Browser storage to test. ex localStorage or sessionStorage.
 * @return {boolean} True if the given storage is available, false otherwise.
 */
function storageAvailable(type) {
  const storage = __webpack_require__.g[type];
  if (!storage) {
    return false;
  }
  try {
    const x = '__storage_test__';
    storage.setItem(x, x);
    storage.removeItem(x);
    return true;
  } catch (error) {
    return error instanceof DOMException && (
    // everything except Firefox
    22 === error.code ||
    // Firefox
    1014 === error.code ||
    // test name field too, because code might not be present
    // everything except Firefox
    'QuotaExceededError' === error.name ||
    // Firefox
    'NS_ERROR_DOM_QUOTA_REACHED' === error.name) &&
    // acknowledge QuotaExceededError only if there's something already stored
    0 !== storage.length;
  }
}

// Custom no-op implementation of window.Storage.
class NullStorage {
  get length() {
    return 0;
  }
  key() {
    return null;
  }
  getItem() {
    return null;
  }
  setItem() {
    // Empty method body.
  }
  removeItem() {
    // Empty method body.
  }
  clear() {
    // Empty method body.
  }
}
let storageObj;

/**
 * Gets the storage object to use.
 *
 * @since 1.0.0
 *
 * @return {Storage} Either window.sessionStorage, window.localStorage', or a
 *                   no-op implementation if neither is available.
 */
function getStorage() {
  // Only run the logic to determine the storage object once.
  if (!storageObj) {
    if (storageAvailable('sessionStorage')) {
      storageObj = __webpack_require__.g.sessionStorage;
    } else if (storageAvailable('localStorage')) {
      storageObj = __webpack_require__.g.localStorage;
    } else {
      storageObj = new NullStorage();
    }
  }
  return storageObj;
}

/***/ }),

/***/ "./js/util/stringify.js":
/*!******************************!*\
  !*** ./js/util/stringify.js ***!
  \******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   stringifyObject: () => (/* binding */ stringifyObject)
/* harmony export */ });
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! md5 */ "../node_modules/md5/md5.js");
/* harmony import */ var md5__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(md5__WEBPACK_IMPORTED_MODULE_0__);
/**
 * Stringify function.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Transforms an object into a hash string.
 *
 * This function can be used to e.g. generate cache keys, based on the given
 * object. Object properties are sorted, so even if they are provided in
 * different order, the hash will match. The function furthermore supports
 * nested objects.
 *
 * @since 1.7.0
 *
 * @param {Object} obj The object to stringify.
 * @return {string} Hash for the object.
 */
function stringifyObject(obj) {
  return md5__WEBPACK_IMPORTED_MODULE_0___default()(JSON.stringify(sortObjectProperties(obj)));
}
function sortObjectProperties(obj) {
  const orderedData = {};
  Object.keys(obj).sort().forEach(key => {
    let value = obj[key];
    if (value && 'object' === typeof value && !Array.isArray(value)) {
      value = sortObjectProperties(value);
    }
    orderedData[key] = value;
  });
  return orderedData;
}

/***/ }),

/***/ "./js/util/tag.js":
/*!************************!*\
  !*** ./js/util/tag.js ***!
  \************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   extractExistingTag: () => (/* binding */ extractExistingTag),
/* harmony export */   getExistingTagURLs: () => (/* binding */ getExistingTagURLs)
/* harmony export */ });
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! invariant */ "../node_modules/invariant/browser.js");
/* harmony import */ var invariant__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(invariant__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/api-fetch */ "./js/api-fetch-shim.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/is-url.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/**
 * Utility functions for Tags
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */


/**
 * Extracts a tag from the given HTML string matched by given matchers.
 *
 * @since 1.13.0
 *
 * @param {string} html        The string of html from which to extract the tag.
 * @param {Array}  tagMatchers An array of the matchers to use.
 * @return {(string|boolean)} The tag id if found, otherwise false.
 */
function extractExistingTag(html, tagMatchers) {
  const matchingPattern = tagMatchers.find(pattern => pattern.test(html));
  if (matchingPattern) {
    return matchingPattern.exec(html)[1];
  }
  return false;
}

/**
 * Gets the existing tag URLs.
 *
 * @since 1.13.0
 *
 * @param {Object} args           Arguments to use to get URLs.
 * @param {string} args.homeURL   The site's home URL.
 * @param {string} [args.ampMode] Optional. The site's AMP mode.
 * @return {Array} An array of the existing tag URLs.
 */
const getExistingTagURLs = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.memoize)(async ({
  homeURL,
  ampMode
}) => {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_4__.isURL)(homeURL), 'homeURL must be valid URL');

  // Initialize urls with home URL
  const urls = [homeURL];

  // Add first post in AMP mode if AMP mode is secondary.
  if (_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.AMP_MODE_SECONDARY === ampMode) {
    try {
      const ampPostURL = await (0,_wordpress_api_fetch__WEBPACK_IMPORTED_MODULE_2__["default"])({
        path: '/wp/v2/posts?per_page=1'
      }).then(posts => posts.slice(0, 1).map(post => (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.addQueryArgs)(post.link, {
        amp: 1
      })).pop());
      if (ampPostURL) {
        urls.push(ampPostURL);
      }
    } catch {
      return urls;
    }
  }
  return urls;
});

/***/ }),

/***/ "./js/util/tracking/constants.js":
/*!***************************************!*\
  !*** ./js/util/tracking/constants.js ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DATA_LAYER: () => (/* binding */ DATA_LAYER),
/* harmony export */   SCRIPT_IDENTIFIER: () => (/* binding */ SCRIPT_IDENTIFIER)
/* harmony export */ });
/**
 * Constants related to event tracking.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Data layer global used for internal/private Site Kit data.
 *
 * @since 1.8.0
 * @private
 */
const DATA_LAYER = '_googlesitekitDataLayer';

/**
 * The `gtag` `<script>` identifier.
 *
 * @since 1.8.0
 * @private
 */
const SCRIPT_IDENTIFIER = 'data-googlesitekit-gtag';

/***/ }),

/***/ "./js/util/tracking/createDataLayerPush.js":
/*!*************************************************!*\
  !*** ./js/util/tracking/createDataLayerPush.js ***!
  \*************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ createDataLayerPush)
/* harmony export */ });
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./js/util/tracking/constants.js");
/**
 * Internal dependencies
 */


/**
 * Returns a function which, when invoked will initialize the dataLayer and push data onto it.
 *
 * @since 1.3.0
 *
 * @param {Object} target Object to enhance with dataLayer data.
 * @return {Function} Function that pushes data onto the dataLayer.
 */
function createDataLayerPush(target) {
  /**
   * Pushes data onto the data layer.
   *
   * Must push an instance of Arguments to the target.
   * Using an ES6 spread operator (i.e. `...args`) will cause tracking events to
   * _silently_ fail.
   *
   * @since 1.0.0
   * @see {@link https://github.com/google/site-kit-wp/issues/1181}
   */
  return function dataLayerPush() {
    target[_constants__WEBPACK_IMPORTED_MODULE_0__.DATA_LAYER] = target[_constants__WEBPACK_IMPORTED_MODULE_0__.DATA_LAYER] || [];
    target[_constants__WEBPACK_IMPORTED_MODULE_0__.DATA_LAYER].push(arguments);
  };
}

/***/ }),

/***/ "./js/util/tracking/createInitializeSnippet.js":
/*!*****************************************************!*\
  !*** ./js/util/tracking/createInitializeSnippet.js ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ createInitializeSnippet)
/* harmony export */ });
/* harmony import */ var _createDataLayerPush__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createDataLayerPush */ "./js/util/tracking/createDataLayerPush.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./js/util/tracking/constants.js");
/* harmony import */ var _js_features_index__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/features/index */ "./js/features/index.js");
/**
 * Internal dependencies
 */




/**
 * Returns a function which, when invoked injects the gtag script if necessary.
 *
 * @since 1.44.0
 *
 * @param {Object} config          Tracking configuration.
 * @param {Object} dataLayerTarget Data layer parent object.
 * @return {Function} Function that injects gtag script if it isn't yet present.
 */
function createInitializeSnippet(config, dataLayerTarget) {
  const dataLayerPush = (0,_createDataLayerPush__WEBPACK_IMPORTED_MODULE_0__["default"])(dataLayerTarget);
  let hasInsertedTag;
  const {
    activeModules,
    referenceSiteURL,
    userIDHash,
    userRoles = [],
    isAuthenticated,
    pluginVersion
  } = config;

  /**
   * Injects the necessary script tag if not present.
   *
   * @since 1.118.0
   *
   * @return {boolean|Object} Tag src as scriptTagSrc property.
   */
  return function initializeSnippet() {
    const {
      document
    } = __webpack_require__.g;
    if (undefined === hasInsertedTag) {
      hasInsertedTag = !!document.querySelector(`script[${_constants__WEBPACK_IMPORTED_MODULE_1__.SCRIPT_IDENTIFIER}]`);
    }
    if (hasInsertedTag) {
      return false;
    }
    hasInsertedTag = true;

    // Sometimes the user roles returned by Site Kit/WordPress is not an
    // array, as expected, so we guard against it here.
    //
    // See: https://github.com/google/site-kit-wp/issues/8266
    const userRolesAsString = userRoles?.length ? userRoles.join(',') : '';

    // We should use the real time, and not the reference date, when
    // measuring when we initialized tracking.
    dataLayerPush('js', new Date()); // eslint-disable-line sitekit/no-direct-date
    dataLayerPush('config', config.trackingID, {
      groups: 'site_kit',
      send_page_view: config.isSiteKitScreen,
      domain: referenceSiteURL,
      plugin_version: pluginVersion || '',
      enabled_features: Array.from(_js_features_index__WEBPACK_IMPORTED_MODULE_2__.enabledFeatures).join(','),
      active_modules: activeModules.join(','),
      authenticated: isAuthenticated ? '1' : '0',
      user_properties: {
        user_roles: userRolesAsString,
        user_identifier: userIDHash
      }
    });

    // If not present, inject it and initialize dataLayer.
    const scriptTag = document.createElement('script');
    scriptTag.setAttribute(_constants__WEBPACK_IMPORTED_MODULE_1__.SCRIPT_IDENTIFIER, '');
    scriptTag.async = true;
    scriptTag.src = `https://www.googletagmanager.com/gtag/js?id=${config.trackingID}&l=${_constants__WEBPACK_IMPORTED_MODULE_1__.DATA_LAYER}`;
    document.head.appendChild(scriptTag);
    return {
      scriptTagSrc: `https://www.googletagmanager.com/gtag/js?id=${config.trackingID}&l=${_constants__WEBPACK_IMPORTED_MODULE_1__.DATA_LAYER}`
    };
  };
}

/***/ }),

/***/ "./js/util/tracking/createTrackEvent.js":
/*!**********************************************!*\
  !*** ./js/util/tracking/createTrackEvent.js ***!
  \**********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ createTrackEvent)
/* harmony export */ });
/* harmony import */ var _createDataLayerPush__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createDataLayerPush */ "./js/util/tracking/createDataLayerPush.js");
/**
 * Internal dependencies
 */


/**
 * Returns a function which, when invoked tracks a single event.
 *
 * @since 1.3.0
 *
 * @param {Object}   config            Tracking configuration.
 * @param {Object}   dataLayerTarget   Data layer parent object.
 * @param {Function} initializeSnippet Function to initialize tracking.
 * @param {Object}   _global           The global window object.
 * @return {Function} Function that tracks an event.
 */
function createTrackEvent(config, dataLayerTarget, initializeSnippet, _global) {
  const dataLayerPush = (0,_createDataLayerPush__WEBPACK_IMPORTED_MODULE_0__["default"])(dataLayerTarget);

  /**
   * Send an Analytics tracking event.
   *
   * @since 1.3.0
   *
   * @param {string} category The category of the event.
   * @param {string} action   The action name of the event.
   * @param {string} [label]  Optional. The label of the event.
   * @param {number} [value]  Optional. A non-negative integer that will appear as the event value.
   * @return {Promise} Promise that always resolves.
   */
  // eslint-disable-next-line require-await
  return async function trackEvent(category, action, label, value) {
    const {
      trackingEnabled
    } = config;
    if (!trackingEnabled) {
      // Resolve immediately if tracking is disabled.
      return null;
    }
    initializeSnippet();
    const eventData = {
      send_to: 'site_kit',
      event_category: category,
      event_label: label,
      value
    };
    return new Promise(resolve => {
      // This timeout ensures a tracking event does not block the user
      // event if it is not sent (in time).
      // If the event beacon fails, it shouldn't reject the promise since event
      // tracking should not result in user-facing errors. It will just
      // trigger a console warning.
      function failCallback() {
        _global.console.warn(`Tracking event "${action}" (category "${category}") took too long to fire.`);
        resolve();
      }
      const failTimeout = setTimeout(failCallback, 1000);
      // eslint-disable-next-line camelcase
      function event_callback() {
        clearTimeout(failTimeout);
        resolve();
      }
      dataLayerPush('event', action, {
        ...eventData,
        event_callback
      });

      // If the client-side opt-out is present, the event_callback will never be called
      // so we call it here to prevent the warning and added delay.
      if (_global._gaUserPrefs?.ioo?.()) {
        event_callback();
      }
    });
  };
}

/***/ }),

/***/ "./js/util/tracking/createTracking.js":
/*!********************************************!*\
  !*** ./js/util/tracking/createTracking.js ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ createTracking)
/* harmony export */ });
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash */ "../node_modules/lodash/lodash.js");
/* harmony import */ var lodash__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _createInitializeSnippet__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./createInitializeSnippet */ "./js/util/tracking/createInitializeSnippet.js");
/* harmony import */ var _createTrackEvent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createTrackEvent */ "./js/util/tracking/createTrackEvent.js");
/**
 * Site Kit by Google, Copyright 2023 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */


const DEFAULT_CONFIG = {
  activeModules: [],
  isAuthenticated: false,
  referenceSiteURL: '',
  trackingEnabled: false,
  trackingID: '',
  userIDHash: '',
  userRoles: []
};

/**
 * Initializes tracking.
 *
 * @since 1.3.0
 *
 * @param {Object} newConfig       New configuration.
 * @param {Object} dataLayerTarget Data layer parent object.
 * @param {Object} _global         The global window object.
 * @return {Object} Tracking config.
 */
function createTracking(newConfig, dataLayerTarget = __webpack_require__.g, _global = __webpack_require__.g) {
  const config = {
    ...DEFAULT_CONFIG,
    ...newConfig
  };
  // Remove any trailing slash from the reference URL.
  if (config.referenceSiteURL) {
    config.referenceSiteURL = config.referenceSiteURL.toString().replace(/\/+$/, '');
  }
  const initializeSnippet = (0,_createInitializeSnippet__WEBPACK_IMPORTED_MODULE_1__["default"])(config, dataLayerTarget);
  const trackEvent = (0,_createTrackEvent__WEBPACK_IMPORTED_MODULE_2__["default"])(config, dataLayerTarget, initializeSnippet, _global);
  const onceTrackedEventsMap = {};
  function trackEventOnce(...params) {
    const key = JSON.stringify(params);
    if (!onceTrackedEventsMap[key]) {
      onceTrackedEventsMap[key] = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.once)(trackEvent);
    }
    onceTrackedEventsMap[key](...params);
  }
  return {
    enableTracking: function enableTracking() {
      config.trackingEnabled = true;
    },
    disableTracking: function disableTracking() {
      config.trackingEnabled = false;
    },
    initializeSnippet,
    isTrackingEnabled: function isTrackingEnabled() {
      return !!config.trackingEnabled;
    },
    trackEvent,
    trackEventOnce
  };
}

/***/ }),

/***/ "./js/util/tracking/index.js":
/*!***********************************!*\
  !*** ./js/util/tracking/index.js ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   disableTracking: () => (/* binding */ disableTracking),
/* harmony export */   enableTracking: () => (/* binding */ enableTracking),
/* harmony export */   isTrackingEnabled: () => (/* binding */ isTrackingEnabled),
/* harmony export */   toggleTracking: () => (/* binding */ toggleTracking),
/* harmony export */   trackEvent: () => (/* binding */ trackEvent),
/* harmony export */   trackEventOnce: () => (/* binding */ trackEventOnce)
/* harmony export */ });
/* harmony import */ var _createTracking__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./createTracking */ "./js/util/tracking/createTracking.js");
/**
 * Event tracking utilities.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/* eslint-disable sitekit/jsdoc-no-unnamed-boolean-params */

/**
 * Internal dependencies
 */

const {
  activeModules = [],
  isSiteKitScreen,
  trackingEnabled,
  trackingID,
  referenceSiteURL,
  userIDHash,
  isAuthenticated,
  userRoles
} = __webpack_require__.g._googlesitekitTrackingData || {};

// Access the plugin version directly without destructuring as Webpack's DefinePlugin
// performs text replacement at build time and doesn't support destructuring patterns.
// See: https://github.com/google/site-kit-wp/issues/11802#issuecomment-3562955579
const pluginVersion = "1.175.0";
const initialConfig = {
  activeModules,
  trackingEnabled,
  trackingID,
  referenceSiteURL,
  userIDHash,
  isSiteKitScreen,
  userRoles,
  isAuthenticated,
  pluginVersion
};
const {
  enableTracking,
  disableTracking,
  isTrackingEnabled,
  initializeSnippet,
  trackEvent,
  trackEventOnce
} = (0,_createTracking__WEBPACK_IMPORTED_MODULE_0__["default"])(initialConfig);

/**
 * Changes the active state of tracking.
 *
 * @since 1.3.0
 *
 * @param {boolean} activeStatus The new state to set.
 */
function toggleTracking(activeStatus) {
  if (!!activeStatus) {
    enableTracking();
  } else {
    disableTracking();
  }
}

// Bootstrap on import if tracking is allowed.
if (isSiteKitScreen && trackingEnabled) {
  initializeSnippet();
}


/***/ }),

/***/ "./js/util/urls.js":
/*!*************************!*\
  !*** ./js/util/urls.js ***!
  \*************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getFullURL: () => (/* binding */ getFullURL),
/* harmony export */   getURLPath: () => (/* binding */ getURLPath),
/* harmony export */   isHashOnly: () => (/* binding */ isHashOnly),
/* harmony export */   normalizeURL: () => (/* binding */ normalizeURL),
/* harmony export */   shortenURL: () => (/* binding */ shortenURL)
/* harmony export */ });
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/is-url.js");
/**
 * URL pathname getter utility function.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Returns the path from a URL, omitting its protocol, hostname, query params, and hash.
 *
 * @since 1.24.0
 *
 * @param {string} url The URL to get the path from.
 * @return {string} The URL path.
 */
function getURLPath(url) {
  try {
    return new URL(url).pathname;
  } catch {}
  return null;
}

/**
 * Returns the absolute URL from a path including the siteURL.
 *
 * @since 1.32.0
 *
 * @param {string} siteURL The siteURL fo the WordPress install.
 * @param {string} path    The path.
 * @return {string} The URL path.
 */
function getFullURL(siteURL, path) {
  try {
    return new URL(path, siteURL).href;
  } catch {}
  return (typeof siteURL === 'string' ? siteURL : '') + (typeof path === 'string' ? path : '');
}

/**
 * Normalizes URL by removing protocol, www subdomain and trailing slash.
 *
 * @since 1.33.0
 *
 * @param {string} incomingURL The original URL.
 * @return {string} Normalized URL.
 */
function normalizeURL(incomingURL) {
  if (typeof incomingURL !== 'string') {
    return incomingURL;
  }
  return incomingURL
  // Remove protocol and optional "www." prefix from the URL.
  .replace(/^https?:\/\/(www\.)?/i, '')
  // Remove trailing slash.
  .replace(/\/$/, '');
}

/**
 * Checks if a string is not a full URL and simply a hash / anchor link.
 *
 * @since 1.49.0
 *
 * @param {string} url The URL or Hash string to test.
 * @return {boolean} Returns true if the string is only a hash and not a full URL.
 */
function isHashOnly(url) {
  return /^#\w[A-Za-z0-9-_]*$/.test(url);
}

/**
 * Shortens a URL to fit a given length.
 *
 * @since 1.49.0
 *
 * @param {string} url      The original URL to shorten.
 * @param {number} maxChars The maximum length of the URL.
 * @return {string} The shortened URL.
 */
function shortenURL(url, maxChars) {
  if (!(0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.isURL)(url)) {
    return url;
  }
  if (url.length <= maxChars) {
    return url;
  }
  const urlObject = new URL(url);
  const shortenedURL = url.replace(urlObject.origin, '');
  if (shortenedURL.length < maxChars) {
    return shortenedURL;
  }
  const extraChars = shortenedURL.length - Math.floor(maxChars) + 1; // 1 is the length of "…".
  return '…' + shortenedURL.substr(extraChars);
}

/***/ }),

/***/ "./js/util/welcome-modal.ts":
/*!**********************************!*\
  !*** ./js/util/welcome-modal.ts ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isInitialWelcomeModalActive: () => (/* binding */ isInitialWelcomeModalActive)
/* harmony export */ });
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.js");
/**
 * Site Kit by Google, Copyright 2026 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * WordPress dependencies
 */


/**
 * Returns whether the welcome modal is active.
 *
 * @since 1.173.0
 *
 * @return {boolean} Whether the welcome modal is currently active.
 */
function isInitialWelcomeModalActive() {
  return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_0__.getQueryArg)(location.href, 'notification') === 'initial_setup_success';
}

/***/ }),

/***/ "./js/util/when-active.js":
/*!********************************!*\
  !*** ./js/util/when-active.js ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (/* binding */ whenActive)
/* harmony export */ });
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_data_transform_case__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/data/transform-case */ "./js/googlesitekit/data/transform-case.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * `whenActive` HOC.
 *
 * Site Kit by Google, Copyright 2021 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * Internal dependencies
 */




/**
 * Higher-Order Component to render wrapped components when selected module is active and connected.
 *
 * A higher-order component is used here instead of hooks because there is potential for
 * related selectors in components this HOC wraps to call out to resolvers that call endpoints
 * for modules that aren't active. This would cause 404s at best and possibly errors, so
 * it's better to wrap them in HOCs and "return early".
 *
 * @since 1.16.0
 *
 * @param {Object}      options                       Options for enhancing function.
 * @param {string}      options.moduleName            Name of a module to check.
 * @param {WPComponent} [options.FallbackComponent]   Optional. Fallback component to render when the module is not active.
 * @param {WPComponent} [options.IncompleteComponent] Optional. Fallback component to render when the module is active but not connected.
 * @return {Function} Enhancing function.
 */

function whenActive({
  moduleName,
  FallbackComponent,
  IncompleteComponent
}) {
  return WrappedComponent => {
    function WhenActiveComponent(props) {
      const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_MODULES).getModule(moduleName), [moduleName]);

      // Return null if the module is not loaded yet or doesn't exist.
      if (!module) {
        return null;
      }

      // This component isn't widget-specific but widgets need to use `WidgetNull`
      // from props when rendering "null" output.
      const DefaultFallbackComponent = FallbackComponent || props.WidgetNull || null;

      // Return a fallback if the module is not active.
      if (module.active === false) {
        return DefaultFallbackComponent && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(DefaultFallbackComponent, {
          ...props
        });
      }

      // Return a fallback if the module is active but not connected yet.
      if (module.connected === false) {
        // If no IncompleteComponent is provided, use the default fallback.
        const IncompleteFallbackComponent = IncompleteComponent || DefaultFallbackComponent;
        return IncompleteFallbackComponent && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(IncompleteFallbackComponent, {
          ...props
        });
      }

      // Return the active and connected component.
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(WrappedComponent, {
        ...props
      });
    }
    WhenActiveComponent.displayName = `When${(0,_js_googlesitekit_data_transform_case__WEBPACK_IMPORTED_MODULE_2__.hyphenCaseToPascalCase)(moduleName)}Active`;
    if (WrappedComponent.displayName || WrappedComponent.name) {
      WhenActiveComponent.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return WhenActiveComponent;
  };
}

/***/ }),

/***/ "./svg/graphics/ad-blocking-recovery-setup.svg":
/*!*****************************************************!*\
  !*** ./svg/graphics/ad-blocking-recovery-setup.svg ***!
  \*****************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _g, _rect, _circle, _path2, _path3, _rect2, _rect3, _rect4, _rect5, _rect6, _rect7, _rect8, _g2, _rect9, _rect0, _circle2, _path4, _rect1, _defs;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAdBlockingRecoverySetup = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 390 273"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#F3F5F7",
  d: "M22.56 28.885a85 85 0 0 1 8.606-7.899C60.044-2.097 83.903-2.06 116.934 2.153 139.265 5 158.642 18.5 182.13 17.185 205.617 15.871 238.088 7.743 264 9.5c29.5 2 37 5.5 63.227 19.385 24.273 12.85 46.312 35.426 57.388 65.284 18.985 51.177-14.865 143.285-60.259 147.628-32.893 3.148-60.039-33.973-93.239-25.376-20.452 5.297-32.583 27.515-48.362 42.177-18.409 17.107-48.199 16.032-69.755 6.902-20.542-8.699-35.63-25.926-42.338-51.32-5.107-19.338-4.595-38.709-16.86-53.857C36.497 138.947 9.432 134 1.281 94.168c-5.16-25.213 5.942-49.13 21.279-65.283"
})), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#ad-blocking-recovery-setup_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 257.906,
  height: 176.087,
  x: 50.837,
  y: 42.913,
  fill: "#fff",
  rx: 14.086
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 259.302,
  height: 177.484,
  x: 50.139,
  y: 42.214,
  stroke: "#CBD0D3",
  strokeWidth: 1.396,
  rx: 14.785
}))), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 78,
  height: 126.285,
  x: 65,
  y: 78.486,
  fill: "#EE92DA",
  rx: 5.282
})), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 104.5,
  cy: 139.528,
  r: 11,
  stroke: "#fff",
  strokeWidth: 3
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#fff",
  strokeWidth: 3,
  d: "m112 132.028-15.5 15.5"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M50.837 56.999c0-7.78 6.307-14.086 14.087-14.086h229.733c7.78 0 14.086 6.306 14.086 14.086v7.258H50.837z"
})), _rect2 || (_rect2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 7.115,
  height: 7.115,
  x: 61.509,
  y: 50.027,
  fill: "#CBD0D3",
  rx: 3.557
})), _rect3 || (_rect3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 7.115,
  height: 7.115,
  x: 72.181,
  y: 50.027,
  fill: "#CBD0D3",
  rx: 3.557
})), _rect4 || (_rect4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 125.396,
  height: 42.688,
  x: 164,
  y: 78.486,
  fill: "#EBEEF0",
  rx: 5.585
})), _rect5 || (_rect5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 92.49,
  height: 14.229,
  x: 164,
  y: 129,
  fill: "#EBEEF0",
  rx: 7.115
})), _rect6 || (_rect6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 108.498,
  height: 5.585,
  x: 164,
  y: 151,
  fill: "#EBEEF0",
  rx: 2.793
})), _rect7 || (_rect7 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 92.49,
  height: 5.585,
  x: 164,
  y: 165,
  fill: "#EBEEF0",
  rx: 2.793
})), _rect8 || (_rect8 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 125.396,
  height: 5.585,
  x: 164,
  y: 179,
  fill: "#EBEEF0",
  rx: 2.793
})), _g2 || (_g2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#ad-blocking-recovery-setup_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M199 163c0-6.075 4.925-11 11-11h126c6.075 0 11 4.925 11 11v83.038c0 6.076-4.925 11-11 11H210c-6.075 0-11-4.924-11-11z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#CBD0D3",
  d: "M199.5 163c0-5.799 4.701-10.5 10.5-10.5h126c5.799 0 10.5 4.701 10.5 10.5v83.038c0 5.799-4.701 10.5-10.5 10.5H210c-5.799 0-10.5-4.701-10.5-10.5z"
}))), _rect9 || (_rect9 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 96.635,
  height: 5.224,
  x: 224.247,
  y: 192.918,
  fill: "#EBEEF0",
  rx: 2.612
})), _rect0 || (_rect0 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 53.106,
  height: 22.635,
  x: 246.882,
  y: 222.518,
  fill: "#77AD8C",
  rx: 11.318
})), _circle2 || (_circle2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 273,
  cy: 172.023,
  r: 9.576,
  fill: "#EBEEF0"
})), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#fff",
  strokeWidth: 3,
  d: "m266.906 233.539 5.003 5.003 9.495-9.495"
})), _rect1 || (_rect1 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 98.376,
  height: 5.224,
  x: 222.506,
  y: 205.106,
  fill: "#EBEEF0",
  rx: 2.612
})), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "ad-blocking-recovery-setup_svg__a",
  width: 264.699,
  height: 183.88,
  x: 49.441,
  y: 41.516,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dx: 4,
  dy: 5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0.796078 0 0 0 0 0.815686 0 0 0 0 0.827451 0 0 0 1 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_149_3117"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_149_3117",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "ad-blocking-recovery-setup_svg__b",
  width: 152,
  height: 110.038,
  x: 199,
  y: 152,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dx: 4,
  dy: 5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0.796078 0 0 0 0 0.815686 0 0 0 0 0.827451 0 0 0 1 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_149_3117"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_149_3117",
  result: "shape"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAdBlockingRecoverySetup);

/***/ }),

/***/ "./svg/graphics/adsense-circular.svg":
/*!*******************************************!*\
  !*** ./svg/graphics/adsense-circular.svg ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _circle, _path, _path2, _path3;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAdsenseCircular = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 52 52"
}, props), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 26,
  cy: 26,
  r: 26,
  fill: "#fff"
})), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#547EC0",
  d: "M30.514 38.167a4.63 4.63 0 0 0 3.991-2.27l4.85-8.013a4.62 4.62 0 0 0-1.629-6.332 4.636 4.636 0 0 0-6.344 1.625l-4.85 8.013a4.62 4.62 0 0 0 1.63 6.331c.739.437 1.55.646 2.352.646"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#F9B918",
  d: "M15.909 38.171a4.6 4.6 0 0 1-2.353-.644 4.62 4.62 0 0 1-1.629-6.332l9.259-15.925a4.64 4.64 0 0 1 6.344-1.626 4.617 4.617 0 0 1 1.628 6.332L19.9 35.9a4.63 4.63 0 0 1-3.991 2.271"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#31A751",
  d: "M15.887 38.171a4.6 4.6 0 0 0 4.604-4.596 4.6 4.6 0 0 0-4.604-4.595 4.6 4.6 0 0 0-4.605 4.595 4.6 4.6 0 0 0 4.605 4.596"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAdsenseCircular);

/***/ }),

/***/ "./svg/graphics/adsense.svg":
/*!**********************************!*\
  !*** ./svg/graphics/adsense.svg ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAdsense = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 173 152"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  fill: "none",
  fillRule: "evenodd"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FBBC04",
  d: "M107.91 41.72c7.73-13.22 3.14-30.12-10.24-37.75S67.18.87 59.45 14.09c-.35.59-.66 1.2-.96 1.81l-26.1 44.66q-.435.66-.84 1.35c-.27.46-.52.93-.76 1.4L3.67 110.1l48.45 27.16 26.98-46.4q.435-.66.84-1.35c.27-.46.52-.93.76-1.39l26.11-44.67c.38-.57.76-1.14 1.1-1.73"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#34A853",
  d: "M52.34 137.11c-7.68 13.43-25 18.38-38.31 10.62s-18.02-24.57-10.34-38 24.86-18.39 38.16-10.64 18.18 24.59 10.49 38.02"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#4285F4",
  d: "M158.79 51.86c-13.23-7.62-30.15-3.1-37.79 10.1l-27.66 47.8c-7.64 13.2-3.11 30.08 10.13 37.7 13.23 7.62 30.15 3.1 37.79-10.1l27.66-47.8c7.63-13.2 3.1-30.08-10.13-37.7"
}))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAdsense);

/***/ }),

/***/ "./svg/graphics/analytics-adsense-connect-desktop.svg":
/*!************************************************************!*\
  !*** ./svg/graphics/analytics-adsense-connect-desktop.svg ***!
  \************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g, _defs;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAnalyticsAdsenseConnectDesktop = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 296 163"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#analytics-adsense-connect-desktop_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M0 16C0 7.163 7.163 0 16 0h264c8.837 0 16 7.163 16 16v147H0z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#analytics-adsense-connect-desktop_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 252,
  height: 172.055,
  x: 22,
  y: 30,
  fill: "#fff",
  rx: 13.764
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 224,
  height: 47,
  x: 36,
  y: 65,
  fill: "#DCE8FF",
  rx: 5.161
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 30,
  height: 3,
  x: 43,
  y: 145,
  fill: "#9BB8F0",
  rx: 1.5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 40,
  height: 3,
  x: 43,
  y: 151,
  fill: "#9BB8F0",
  rx: 1.5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#9BB8F0",
  d: "M168.539 90.857 188 112h-81l29.455-32 21.039 22.857z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M22 43.764C22 36.162 28.162 30 35.764 30h224.472C267.838 30 274 36.162 274 43.764v7.091H22z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 6.952,
  height: 6.952,
  x: 32.427,
  y: 36.952,
  fill: "#CBD0D3",
  rx: 3.476
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 6.952,
  height: 6.952,
  x: 42.855,
  y: 36.952,
  fill: "#CBD0D3",
  rx: 3.476
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 59,
  height: 55,
  x: 36,
  y: 122,
  fill: "#EBEEF0",
  rx: 5.457
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 54,
  height: 10,
  x: 107,
  y: 122,
  fill: "#EBEEF0",
  rx: 5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 153,
  height: 5,
  x: 107,
  y: 141,
  fill: "#EBEEF0",
  rx: 2.5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 153,
  height: 5,
  x: 107,
  y: 154,
  fill: "#EBEEF0",
  rx: 2.5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M238.51 171.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 238.51,
  cy: 159.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M237.859 162.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M238.51 165.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 238.51,
  cy: 153.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M237.859 156.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M238.51 159.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 238.51,
  cy: 147.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M237.859 150.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M238.51 153.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 238.51,
  cy: 141.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M237.859 144.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M238.51 147.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 238.51,
  cy: 135.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M237.859 138.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M238.51 141.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 238.51,
  cy: 129.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M237.859 132.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#E1B155",
  strokeWidth: 1.624,
  d: "M238.51 124.244c5.077 0 9.639.714 12.904 1.844 1.635.566 2.902 1.222 3.743 1.91.847.693 1.166 1.334 1.166 1.882s-.32 1.188-1.166 1.881c-.841.688-2.107 1.343-3.743 1.91-3.265 1.13-7.827 1.844-12.904 1.844s-9.64-.714-12.904-1.844c-1.636-.567-2.902-1.222-3.743-1.91-.847-.693-1.166-1.333-1.166-1.881s.319-1.189 1.166-1.882c.841-.688 2.107-1.344 3.743-1.91 3.264-1.13 7.827-1.844 12.904-1.844Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 209.51,
  cy: 166.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M209.51 172.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 209.51,
  cy: 160.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M208.859 163.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M209.51 166.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 209.51,
  cy: 154.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M208.859 157.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M209.51 160.625c11.868 0 21.49-3.528 21.49-7.88v-2.865h-42.98v2.865c0 4.352 9.621 7.88 21.49 7.88"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 209.51,
  cy: 148.88,
  fill: "#FECE72",
  rx: 21.49,
  ry: 7.88
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M208.859 151.363v-.48a4.5 4.5 0 0 1-.901-.154 2.9 2.9 0 0 1-.77-.342 1.4 1.4 0 0 1-.496-.534l.952-.209q.122.242.446.435.334.192.769.248v-1.223l-.03-.011q-.81-.166-1.337-.43-.526-.27-.526-.689 0-.248.222-.468.233-.221.659-.364a3.6 3.6 0 0 1 1.012-.176v-.474h.81v.485q.527.044.882.17.364.122.567.281.212.16.293.304l-.931.22a.9.9 0 0 0-.284-.243 1.5 1.5 0 0 0-.527-.181v1.157q.547.121.973.27.425.143.668.347a.6.6 0 0 1 .253.496.69.69 0 0 1-.273.551q-.264.226-.699.358a4.2 4.2 0 0 1-.922.171v.485zm-.85-3.389q0 .177.212.298.224.115.638.225v-.991a1.8 1.8 0 0 0-.617.17q-.234.127-.233.298m2.501 1.829q0-.187-.223-.303a2.8 2.8 0 0 0-.618-.22v1.041q.366-.05.598-.181.243-.133.243-.337"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#E1B155",
  strokeWidth: 1.624,
  d: "M209.51 143.244c5.077 0 9.639.714 12.904 1.844 1.635.566 2.902 1.222 3.743 1.91.847.693 1.166 1.334 1.166 1.882s-.32 1.188-1.166 1.881c-.841.688-2.107 1.343-3.743 1.91-3.265 1.13-7.827 1.844-12.904 1.844s-9.64-.714-12.904-1.844c-1.636-.567-2.902-1.222-3.743-1.91-.847-.693-1.166-1.333-1.166-1.881s.319-1.189 1.166-1.882c.841-.688 2.107-1.344 3.743-1.91 3.264-1.13 7.827-1.844 12.904-1.844Z"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "analytics-adsense-connect-desktop_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 16C0 7.163 7.163 0 16 0h264c8.837 0 16 7.163 16 16v147H0z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "analytics-adsense-connect-desktop_svg__b",
  width: 284,
  height: 204.055,
  x: 6,
  y: 18,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dy: 4
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 8
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_50_9707"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_50_9707",
  result: "shape"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAnalyticsAdsenseConnectDesktop);

/***/ }),

/***/ "./svg/graphics/analytics-adsense-connect-mobile.svg":
/*!***********************************************************!*\
  !*** ./svg/graphics/analytics-adsense-connect-mobile.svg ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g, _defs;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAnalyticsAdsenseConnectMobile = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 343 123"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#analytics-adsense-connect-mobile_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M311.553 64.365c2.4 22.73-4.803 32.78-23.025 59.95-18.222 27.169 7.404 59.276-20.779 89.868-33.528 36.394-150.686 39.364-201.232 24.212-50.546-15.153-63.58-46.473-59.948-75.155C11.5 124.315 38.52 112.077 51.5 93 70.776 64.675 48.687 38.214 86 15.5s80.086 6.697 120.326 4.388c23.216-1.332 46.017-5.627 66.626.968 20.832 6.667 36.719 25.428 38.601 43.509"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#analytics-adsense-connect-mobile_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 209.444,
  height: 143,
  x: 56,
  y: 14,
  fill: "#fff",
  rx: 11.44
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 186.173,
  height: 39.063,
  x: 67.635,
  y: 43.09,
  fill: "#DCE8FF",
  rx: 4.29
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 24.934,
  height: 2.493,
  x: 73.454,
  y: 109.58,
  fill: "#9BB8F0",
  rx: 1.247
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 33.245,
  height: 2.493,
  x: 73.454,
  y: 114.567,
  fill: "#9BB8F0",
  rx: 1.247
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#9BB8F0",
  d: "m177.792 64.58 16.175 17.573h-67.322l24.481-26.597 17.486 18.998z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M56 25.44C56 19.121 61.122 14 67.44 14h186.565c6.318 0 11.439 5.122 11.439 11.44v5.893H56z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5.778,
  height: 5.778,
  x: 64.666,
  y: 19.778,
  fill: "#CBD0D3",
  rx: 2.889
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5.778,
  height: 5.778,
  x: 73.333,
  y: 19.778,
  fill: "#CBD0D3",
  rx: 2.889
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 49.037,
  height: 45.712,
  x: 67.635,
  y: 90.464,
  fill: "#EBEEF0",
  rx: 4.536
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 44.881,
  height: 8.311,
  x: 126.646,
  y: 90.464,
  fill: "#EBEEF0",
  rx: 4.156
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 127.163,
  height: 4.156,
  x: 126.646,
  y: 106.255,
  fill: "#EBEEF0",
  rx: 2.078
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 127.163,
  height: 4.156,
  x: 126.646,
  y: 117.06,
  fill: "#EBEEF0",
  rx: 2.078
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M235.947 131.708c9.864 0 17.861-2.932 17.861-6.549v-2.381h-35.722v2.381c0 3.617 7.997 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 235.947,
  cy: 121.947,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M235.406 124.011v-.399a3.8 3.8 0 0 1-.749-.128 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.201.37.361.279.16.64.207v-1.017l-.025-.009q-.673-.138-1.111-.358-.438-.224-.438-.572 0-.206.185-.389.194-.183.547-.303a3 3 0 0 1 .842-.146v-.394h.674v.403q.436.036.732.142.303.1.471.234a.9.9 0 0 1 .244.251l-.774.184a.7.7 0 0 0-.236-.202 1.3 1.3 0 0 0-.437-.151v.962q.454.1.808.224.352.12.555.289.21.165.21.412 0 .27-.227.458a1.6 1.6 0 0 1-.581.298q-.353.11-.765.142v.403zm-.707-2.817q0 .147.177.247.185.096.53.188v-.824a1.5 1.5 0 0 0-.513.142q-.194.105-.194.247m2.079 1.52q0-.155-.185-.251a2.3 2.3 0 0 0-.513-.184v.866q.303-.042.496-.151.202-.11.202-.28"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M235.947 126.722c9.864 0 17.861-2.932 17.861-6.549v-2.382h-35.722v2.382c0 3.617 7.997 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 235.947,
  cy: 116.96,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M235.406 119.024v-.399a3.8 3.8 0 0 1-.749-.128 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.201.37.362.279.16.64.206v-1.017l-.025-.009a4.6 4.6 0 0 1-1.111-.357q-.438-.225-.438-.573 0-.206.185-.389a1.5 1.5 0 0 1 .547-.302q.354-.124.842-.147v-.394h.674v.403q.436.037.732.142.303.1.471.234a.9.9 0 0 1 .244.252l-.774.183a.75.75 0 0 0-.236-.202 1.3 1.3 0 0 0-.437-.151v.962q.454.1.808.224.352.12.555.289.21.165.21.412 0 .27-.227.458a1.6 1.6 0 0 1-.581.298q-.353.11-.765.142v.403zm-.707-2.817q0 .147.177.248.185.096.53.187v-.824a1.5 1.5 0 0 0-.513.142q-.194.106-.194.247m2.079 1.521q0-.156-.185-.252a2.4 2.4 0 0 0-.513-.183v.865q.303-.041.496-.151.202-.11.202-.279"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M235.947 121.735c9.864 0 17.861-2.932 17.861-6.549v-2.382h-35.722v2.382c0 3.617 7.997 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 235.947,
  cy: 111.973,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M235.406 114.037v-.398a4 4 0 0 1-.749-.129 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.201.37.362.279.16.64.206v-1.017l-.025-.009a4.5 4.5 0 0 1-1.111-.357q-.438-.225-.438-.573 0-.206.185-.389a1.5 1.5 0 0 1 .547-.302q.354-.124.842-.147v-.393h.674v.403q.436.036.732.141.303.102.471.234a.9.9 0 0 1 .244.252l-.774.183a.7.7 0 0 0-.236-.201 1.2 1.2 0 0 0-.437-.152v.962q.454.1.808.225.352.118.555.288.21.165.21.412 0 .27-.227.458a1.6 1.6 0 0 1-.581.298 3.5 3.5 0 0 1-.765.142v.403zm-.707-2.817q0 .147.177.248.185.096.53.188v-.825a1.5 1.5 0 0 0-.513.142q-.194.105-.194.247m2.079 1.521q0-.156-.185-.252a2.4 2.4 0 0 0-.513-.183v.865q.303-.04.496-.151.202-.11.202-.279"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M235.947 116.748c9.864 0 17.861-2.932 17.861-6.549v-2.381h-35.722v2.381c0 3.617 7.997 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 235.947,
  cy: 106.986,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M235.406 109.05v-.398a4 4 0 0 1-.749-.128 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.445l.791-.174q.101.202.37.362.279.16.64.206v-1.016l-.025-.01q-.673-.136-1.111-.357-.438-.224-.438-.572 0-.206.185-.39.194-.182.547-.302a3 3 0 0 1 .842-.146v-.394h.674v.403q.436.036.732.142.303.1.471.233a.9.9 0 0 1 .244.252l-.774.183a.7.7 0 0 0-.236-.201 1.2 1.2 0 0 0-.437-.151v.961q.454.101.808.225.352.119.555.288.21.165.21.413 0 .27-.227.458a1.6 1.6 0 0 1-.581.297 3.5 3.5 0 0 1-.765.142v.403zm-.707-2.816q0 .146.177.247.185.096.53.188v-.825a1.5 1.5 0 0 0-.513.142q-.194.106-.194.248m2.079 1.52q0-.156-.185-.252a2.4 2.4 0 0 0-.513-.183v.866q.303-.042.496-.151.202-.11.202-.28"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M235.947 111.761c9.864 0 17.861-2.932 17.861-6.549v-2.381h-35.722v2.381c0 3.617 7.997 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 235.947,
  cy: 102,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M235.406 104.063v-.398a3.8 3.8 0 0 1-.749-.128 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.201.37.361.279.16.64.206v-1.016l-.025-.009q-.673-.138-1.111-.358-.438-.224-.438-.572 0-.206.185-.389.194-.183.547-.303a3 3 0 0 1 .842-.146v-.394h.674v.403q.436.037.732.142.303.1.471.234a.9.9 0 0 1 .244.251l-.774.184a.7.7 0 0 0-.236-.202 1.3 1.3 0 0 0-.437-.151v.962q.454.1.808.224.352.119.555.289.21.165.21.412 0 .27-.227.458a1.6 1.6 0 0 1-.581.297 3.4 3.4 0 0 1-.765.142v.403zm-.707-2.816q0 .147.177.247.185.096.53.188v-.824a1.5 1.5 0 0 0-.513.142q-.194.105-.194.247m2.079 1.52q0-.154-.185-.252a2.4 2.4 0 0 0-.513-.183v.866q.303-.042.496-.151.202-.11.202-.28"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M235.947 106.775c9.864 0 17.861-2.933 17.861-6.549v-2.382h-35.722v2.382c0 3.616 7.997 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 235.947,
  cy: 97.013,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M235.406 99.077v-.399a3.8 3.8 0 0 1-.749-.128 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.201.37.362a1.7 1.7 0 0 0 .64.206v-1.017l-.025-.01a4.5 4.5 0 0 1-1.111-.356q-.438-.224-.438-.573 0-.206.185-.39.194-.182.547-.301.354-.124.842-.147v-.394h.674v.403q.436.037.732.142.303.1.471.234a.9.9 0 0 1 .244.252l-.774.183a.7.7 0 0 0-.236-.202 1.2 1.2 0 0 0-.437-.15v.96q.454.102.808.225.352.12.555.289.21.165.21.412 0 .27-.227.458a1.6 1.6 0 0 1-.581.298q-.353.11-.765.142v.403zm-.707-2.817q0 .147.177.247.185.097.53.188v-.824a1.5 1.5 0 0 0-.513.142q-.194.105-.194.247m2.079 1.52q0-.155-.185-.251a2.4 2.4 0 0 0-.513-.183v.865q.303-.041.496-.151.202-.11.202-.28"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#E1B155",
  strokeWidth: 1.349,
  d: "M250.751 97.013c0 .455-.265.987-.969 1.563-.698.572-1.751 1.117-3.11 1.588-2.713.939-6.505 1.532-10.725 1.532s-8.012-.593-10.725-1.532c-1.36-.47-2.412-1.016-3.111-1.588-.704-.576-.969-1.108-.969-1.563 0-.456.265-.988.969-1.564.699-.572 1.751-1.117 3.111-1.587 2.713-.94 6.505-1.533 10.725-1.533s8.012.593 10.725 1.533c1.359.47 2.412 1.015 3.11 1.587.704.576.969 1.108.969 1.564Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 211.845,
  cy: 127.765,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 211.845,
  cy: 122.778,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M211.304 124.842v-.399a3.8 3.8 0 0 1-.749-.128 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.201.37.362.279.16.64.206v-1.017l-.025-.009a4.6 4.6 0 0 1-1.111-.357q-.438-.225-.438-.573 0-.206.185-.389a1.5 1.5 0 0 1 .547-.302q.354-.124.842-.147v-.394h.673v.403q.438.037.733.142.303.1.471.234a.9.9 0 0 1 .244.252l-.774.183a.7.7 0 0 0-.236-.202 1.3 1.3 0 0 0-.438-.151v.962q.455.1.808.224.354.12.556.289.21.165.21.412 0 .27-.227.458a1.6 1.6 0 0 1-.581.298 3.5 3.5 0 0 1-.766.142v.403zm-.707-2.817q0 .147.177.247.185.097.53.188v-.824a1.5 1.5 0 0 0-.513.142q-.194.105-.194.247m2.079 1.521q0-.156-.185-.252a2.4 2.4 0 0 0-.514-.183v.865q.303-.041.497-.151.202-.11.202-.279"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M211.845 127.553c9.864 0 17.861-2.932 17.861-6.549v-2.382h-35.722v2.382c0 3.617 7.996 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 211.845,
  cy: 117.791,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M211.304 119.855v-.399a3.8 3.8 0 0 1-.749-.128 2.5 2.5 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.201.37.362.279.16.64.206v-1.017l-.025-.009a4.6 4.6 0 0 1-1.111-.357q-.438-.225-.438-.573 0-.206.185-.389a1.5 1.5 0 0 1 .547-.302q.354-.124.842-.147v-.394h.673v.403q.438.037.733.142.303.101.471.234a.9.9 0 0 1 .244.252l-.774.183a.7.7 0 0 0-.236-.201 1.2 1.2 0 0 0-.438-.152v.962q.455.1.808.225.354.118.556.288.21.165.21.412 0 .27-.227.458a1.6 1.6 0 0 1-.581.298 3.5 3.5 0 0 1-.766.142v.403zm-.707-2.817q0 .147.177.248.185.096.53.187v-.824a1.5 1.5 0 0 0-.513.142q-.194.105-.194.247m2.079 1.521q0-.156-.185-.252a2.4 2.4 0 0 0-.514-.183v.865q.303-.041.497-.151.202-.11.202-.279"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E1B155",
  d: "M211.845 122.566c9.864 0 17.861-2.932 17.861-6.549v-2.381h-35.722v2.381c0 3.617 7.996 6.549 17.861 6.549"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 211.845,
  cy: 112.804,
  fill: "#FECE72",
  rx: 17.861,
  ry: 6.549
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#AA7A1E",
  d: "M211.304 114.868v-.398a3.8 3.8 0 0 1-.749-.129 2.4 2.4 0 0 1-.64-.284 1.2 1.2 0 0 1-.412-.444l.791-.174q.101.202.37.362.279.16.64.206v-1.017l-.025-.009q-.673-.136-1.111-.357-.438-.225-.438-.572 0-.207.185-.39a1.5 1.5 0 0 1 .547-.302q.354-.123.842-.147v-.393h.673v.403q.438.036.733.142.303.1.471.233a.9.9 0 0 1 .244.252l-.774.183a.7.7 0 0 0-.236-.201 1.2 1.2 0 0 0-.438-.151v.961q.455.101.808.225.354.118.556.288.21.166.21.412a.57.57 0 0 1-.227.458 1.6 1.6 0 0 1-.581.298 3.5 3.5 0 0 1-.766.142v.403zm-.707-2.816q0 .146.177.247.185.096.53.188v-.825a1.5 1.5 0 0 0-.513.142q-.194.105-.194.248m2.079 1.52q0-.156-.185-.252a2.4 2.4 0 0 0-.514-.183v.866q.303-.042.497-.152.202-.11.202-.279"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#E1B155",
  strokeWidth: 1.349,
  d: "M226.649 112.804c0 .456-.265.988-.969 1.564-.698.572-1.751 1.117-3.11 1.587-2.713.94-6.505 1.533-10.725 1.533s-8.012-.593-10.725-1.533c-1.36-.47-2.412-1.015-3.111-1.587-.704-.576-.969-1.108-.969-1.564s.265-.987.969-1.563c.699-.572 1.751-1.117 3.111-1.588 2.713-.939 6.505-1.532 10.725-1.532s8.012.593 10.725 1.532c1.359.471 2.412 1.016 3.11 1.588.704.576.969 1.108.969 1.563Z"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "analytics-adsense-connect-mobile_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 0h343v123H0z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "analytics-adsense-connect-mobile_svg__b",
  width: 236.04,
  height: 169.596,
  x: 42.702,
  y: 4.026,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dy: 3.325
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 6.649
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_413_2382"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_413_2382",
  result: "shape"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAnalyticsAdsenseConnectMobile);

/***/ }),

/***/ "./svg/graphics/analytics-adsense-linked-desktop.svg":
/*!***********************************************************!*\
  !*** ./svg/graphics/analytics-adsense-linked-desktop.svg ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g, _defs;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAnalyticsAdsenseLinkedDesktop = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 296 163"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#analytics-adsense-linked-desktop_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M0 16C0 7.163 7.163 0 16 0h264c8.837 0 16 7.163 16 16v147H0z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#analytics-adsense-linked-desktop_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 248,
  height: 174,
  x: 24,
  y: 23,
  fill: "#fff",
  rx: 11
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 116,
  height: 14,
  x: 48,
  y: 96,
  fill: "#9CEBEB",
  rx: 7
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 141,
  height: 14,
  x: 48,
  y: 124,
  fill: "#9CEBEB",
  rx: 7
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 97,
  height: 14,
  x: 48,
  y: 153,
  fill: "#9CEBEB",
  rx: 7
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M222 103a7 7 0 0 1 7-7h12a7 7 0 1 1 0 14h-12a7 7 0 0 1-7-7M222 131a7 7 0 0 1 7-7h12a7 7 0 1 1 0 14h-12a7 7 0 0 1-7-7M222 159a7 7 0 0 1 7-7h12a7 7 0 1 1 0 14h-12a7 7 0 0 1-7-7"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 36,
  height: 9,
  x: 48,
  y: 44,
  fill: "#EBEEF0",
  rx: 4.5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 55.734,
  height: 9.516,
  x: 46.672,
  y: 162.656,
  fill: "#EBEEF0",
  rx: 4.758
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 2,
  d: "M272 72H24"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "analytics-adsense-linked-desktop_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 16C0 7.163 7.163 0 16 0h264c8.837 0 16 7.163 16 16v147H0z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "analytics-adsense-linked-desktop_svg__b",
  width: 280,
  height: 206,
  x: 8,
  y: 11,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dy: 4
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 8
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_100_3563"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_100_3563",
  result: "shape"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAnalyticsAdsenseLinkedDesktop);

/***/ }),

/***/ "./svg/graphics/analytics-adsense-linked-mobile.svg":
/*!**********************************************************!*\
  !*** ./svg/graphics/analytics-adsense-linked-mobile.svg ***!
  \**********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g, _defs;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAnalyticsAdsenseLinkedMobile = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 343 123"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#analytics-adsense-linked-mobile_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M311.553 64.365c2.4 22.73-4.803 32.78-23.025 59.95-18.222 27.169 7.404 59.276-20.779 89.868-33.528 36.394-150.686 39.364-201.232 24.212-50.546-15.153-63.58-46.473-59.948-75.155C11.5 124.315 38.52 112.077 51.5 93 70.776 64.675 48.687 38.214 86 15.5s80.086 6.697 120.326 4.388c23.216-1.332 46.017-5.627 66.626.968 20.832 6.667 36.719 25.428 38.601 43.509"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#analytics-adsense-linked-mobile_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 193.381,
  height: 135.679,
  x: 74.81,
  y: 12.732,
  fill: "#fff",
  rx: 8.577
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 90.452,
  height: 10.917,
  x: 93.524,
  y: 69.655,
  fill: "#9CEBEB",
  rx: 5.458
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 109.946,
  height: 10.917,
  x: 93.524,
  y: 91.488,
  fill: "#9CEBEB",
  rx: 5.458
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 75.637,
  height: 10.917,
  x: 93.524,
  y: 114.101,
  fill: "#9CEBEB",
  rx: 5.458
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M229.202 75.113a5.46 5.46 0 0 1 5.458-5.458h9.358a5.458 5.458 0 0 1 0 10.916h-9.358a5.46 5.46 0 0 1-5.458-5.458M229.202 96.946a5.46 5.46 0 0 1 5.458-5.458h9.358a5.458 5.458 0 0 1 0 10.917h-9.358a5.46 5.46 0 0 1-5.458-5.459M229.202 118.78a5.46 5.46 0 0 1 5.458-5.459h9.358a5.459 5.459 0 0 1 0 10.917h-9.358a5.46 5.46 0 0 1-5.458-5.458"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 28.071,
  height: 7.018,
  x: 93.524,
  y: 29.107,
  fill: "#EBEEF0",
  rx: 3.509
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 43.459,
  height: 7.42,
  x: 92.488,
  y: 121.631,
  fill: "#EBEEF0",
  rx: 3.71
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.56,
  d: "M268.19 50.94H74.81"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "analytics-adsense-linked-mobile_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 0h343v123H0z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "analytics-adsense-linked-mobile_svg__b",
  width: 218.333,
  height: 160.631,
  x: 62.333,
  y: 3.375,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dy: 3.119
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 6.238
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_413_2990"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_413_2990",
  result: "shape"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAnalyticsAdsenseLinkedMobile);

/***/ }),

/***/ "./svg/graphics/banner-ad-blocking-recovery-setup-cta-mobile.svg?url":
/*!***************************************************************************!*\
  !*** ./svg/graphics/banner-ad-blocking-recovery-setup-cta-mobile.svg?url ***!
  \***************************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64, ");

/***/ }),

/***/ "./svg/graphics/banner-ad-blocking-recovery-setup-cta.svg?url":
/*!********************************************************************!*\
  !*** ./svg/graphics/banner-ad-blocking-recovery-setup-cta.svg?url ***!
  \********************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64, ");

/***/ }),

/***/ "./svg/graphics/banner-conversions-setup-cta-mobile.svg?url":
/*!******************************************************************!*\
  !*** ./svg/graphics/banner-conversions-setup-cta-mobile.svg?url ***!
  \******************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64, ");

/***/ }),

/***/ "./svg/graphics/banner-conversions-setup-cta.svg?url":
/*!***********************************************************!*\
  !*** ./svg/graphics/banner-conversions-setup-cta.svg?url ***!
  \***********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64, ");

/***/ }),

/***/ "./svg/graphics/banner-error.svg?url":
/*!*******************************************!*\
  !*** ./svg/graphics/banner-error.svg?url ***!
  \*******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64, ");

/***/ }),

/***/ "./svg/graphics/banner-warning.svg?url":
/*!*********************************************!*\
  !*** ./svg/graphics/banner-warning.svg?url ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ("data:image/svg+xml;base64, ");

/***/ }),

/***/ "./svg/graphics/key-metrics-no-selected-items.svg":
/*!********************************************************!*\
  !*** ./svg/graphics/key-metrics-no-selected-items.svg ***!
  \********************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _g, _rect, _rect2, _rect3, _path2, _rect4, _g2, _rect5, _rect6, _rect7, _path3, _rect8, _g3, _rect9, _rect0, _rect1, _path4, _rect10, _path5, _g4, _defs;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgKeyMetricsNoSelectedItems = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 383 238"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M59.238 58.571c-2.136 20.178 4.272 29.099 20.48 53.216 16.209 24.118-29.092 62.914 5.475 101.268 33.827 37.532 69.419.009 111.314-4.555 29.443-3.208 57.819 12.98 90.86 5.9s46.385-42.599 43.153-68.059c-5.59-44.041-26.24-49.107-34.893-66.461s2.902-52.997-30.287-73.16-76.71 14.42-112.503 12.37c-20.651-1.182-40.932-4.995-59.264.86-18.53 5.918-32.662 22.571-34.335 38.621"
})), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#key-metrics-no-selected-items_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 130.621,
  height: 89.651,
  x: 242.455,
  y: 45.266,
  fill: "#fff",
  rx: 10.957,
  transform: "rotate(15 242.455 45.266)"
}))), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 24.903,
  height: 7.969,
  x: 253.726,
  y: 64.785,
  fill: "#EBEEF0",
  rx: 3.985,
  transform: "rotate(15 253.726 64.785)"
})), _rect2 || (_rect2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 49.806,
  height: 19.923,
  x: 249.342,
  y: 81.144,
  fill: "#FFDED3",
  rx: 9.961,
  transform: "rotate(15 249.342 81.144)"
})), _rect3 || (_rect3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 99.428,
  height: 8.773,
  x: 240.436,
  y: 114.357,
  fill: "#EBEEF0",
  rx: 3.985,
  transform: "rotate(15 240.436 114.357)"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#fff",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.494,
  d: "m256.195 90.198 4.644 8.044m0 0 1.412-4.986m-1.412 4.986-5.023-1.27"
})), _rect4 || (_rect4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 19.923,
  height: 5.977,
  x: 268.706,
  y: 93.551,
  fill: "#fff",
  rx: 1.992,
  transform: "rotate(15 268.706 93.55)"
})), _g2 || (_g2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#key-metrics-no-selected-items_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 130.621,
  height: 89.68,
  x: 13.887,
  y: 79.094,
  fill: "#fff",
  rx: 10.957,
  transform: "rotate(-15 13.887 79.094)"
}))), _rect5 || (_rect5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 62.386,
  height: 7.798,
  x: 32.989,
  y: 90.122,
  fill: "#EBEEF0",
  rx: 3.899,
  transform: "rotate(-15 32.99 90.122)"
})), _rect6 || (_rect6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 49.806,
  height: 19.923,
  x: 37.691,
  y: 106.902,
  fill: "#FFDED3",
  rx: 9.961,
  transform: "rotate(-15 37.691 106.902)"
})), _rect7 || (_rect7 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 99.428,
  height: 7.798,
  x: 46.612,
  y: 140.967,
  fill: "#EBEEF0",
  rx: 3.899,
  transform: "rotate(-15 46.612 140.967)"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#fff",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.494,
  d: "m48.152 111.318 8.044 4.645m0 0-1.27-5.024m1.27 5.024-4.986 1.411"
})), _rect8 || (_rect8 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 19.923,
  height: 5.977,
  x: 60.663,
  y: 107.966,
  fill: "#fff",
  rx: 1.992,
  transform: "rotate(-15 60.663 107.966)"
})), _g3 || (_g3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#key-metrics-no-selected-items_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 130.621,
  height: 89.68,
  x: 126.251,
  y: 37.4,
  fill: "#fff",
  rx: 10.957
}))), _rect9 || (_rect9 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 98.333,
  height: 7.867,
  x: 143.013,
  y: 53.134,
  fill: "#EBEEF0",
  rx: 3.933
})), _rect0 || (_rect0 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 49.806,
  height: 19.923,
  x: 142.369,
  y: 70.423,
  fill: "#B8E6CA",
  rx: 9.961
})), _rect1 || (_rect1 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 33.04,
  height: 7.867,
  x: 143.013,
  y: 105.84,
  fill: "#EBEEF0",
  rx: 3.933
})), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#fff",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.494,
  d: "m151.336 84.036 6.568-6.567m0 0-5.182-.073m5.182.073.073 5.18"
})), _rect10 || (_rect10 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 19.923,
  height: 5.977,
  x: 164.287,
  y: 77.395,
  fill: "#fff",
  rx: 1.992
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "key-metrics-no-selected-items_svg__d",
  width: 273,
  height: 230,
  x: 58,
  y: 0,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path5 || (_path5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M59.237 58.571C57.1 78.75 63.509 87.67 79.717 111.787c16.209 24.118-29.091 62.914 5.475 101.268 33.827 37.532 69.419.009 111.314-4.555 29.444-3.208 57.82 12.98 90.86 5.9s46.385-42.599 43.153-68.059c-5.59-44.041-26.24-49.107-34.893-66.461s2.902-52.997-30.287-73.16-76.71 14.42-112.503 12.37c-20.651-1.182-40.932-4.995-59.264.86C75.042 25.868 60.91 42.52 59.237 58.57"
}))), _g4 || (_g4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#key-metrics-no-selected-items_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#CBD0D3",
  strokeMiterlimit: 10,
  strokeWidth: 3.147,
  d: "m227.674 108.973 11.312-8.418M218.925 98.852l2.868-12.68M205.623 102.87l-5.375-13.037"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#3C7251",
  strokeLinejoin: "round",
  strokeWidth: 9.44,
  d: "M63.953 190.487c16.127 12.193 38.716 10.349 55.335 5.162 16.618-5.187 31.107-14.61 45.314-23.791 6.717-4.337 13.617-8.738 21.496-11.119s17.057-2.39 22.958 1.658c3.392 2.328 5.205 5.923 5.36 9.702"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#CBD0D3",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 9.44,
  d: "m215.831 109.67-19.169 71.73"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeMiterlimit: 10,
  strokeWidth: 9.44,
  d: "m213.975 116.472-19.169 71.731"
}))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "key-metrics-no-selected-items_svg__a",
  width: 176.33,
  height: 147.36,
  x: 205.773,
  y: 35.772,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dy: 3.985
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.969
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_2200_11981"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_2200_11981",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "key-metrics-no-selected-items_svg__b",
  width: 176.337,
  height: 147.388,
  x: 0.409,
  y: 35.793,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dy: 3.985
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.969
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_2200_11981"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_2200_11981",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "key-metrics-no-selected-items_svg__c",
  width: 162.497,
  height: 121.556,
  x: 110.313,
  y: 25.447,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  in: "SourceAlpha",
  result: "hardAlpha",
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feOffset", {
  dy: 3.985
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.969
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feComposite", {
  in2: "hardAlpha",
  operator: "out"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feColorMatrix", {
  values: "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in2: "BackgroundImageFix",
  result: "effect1_dropShadow_2200_11981"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_2200_11981",
  result: "shape"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgKeyMetricsNoSelectedItems);

/***/ }),

/***/ "./svg/graphics/logo-g.svg":
/*!*********************************!*\
  !*** ./svg/graphics/logo-g.svg ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgLogoG = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 43 44"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  fill: "none",
  fillRule: "evenodd"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FBBC05",
  d: "m2.253 12.252 7.399 5.658A13 13 0 0 0 9 22c0 1.43.229 2.805.652 4.09l-7.4 5.658A22 22 0 0 1 0 22c0-3.506.81-6.814 2.253-9.748"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EA4335",
  d: "m9.652 17.91-7.4-5.658A21.94 21.94 0 0 1 22 0c5.6 0 10.6 2.1 14.5 5.5l-6.4 6.4C27.9 10.1 25.1 9 22 9c-5.77 0-10.64 3.725-12.348 8.91"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#34A853",
  d: "m2.25 31.742 7.396-5.67A12.975 12.975 0 0 0 22 35c6.1 0 10.7-3.1 11.8-8.5H22V18h20.5c.3 1.3.5 2.7.5 4 0 14-10 22-21 22A21.94 21.94 0 0 1 2.25 31.742"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#4285F4",
  d: "m36.34 38.52-7.025-5.437c2.297-1.45 3.895-3.685 4.485-6.583H22V18h20.5c.3 1.3.5 2.7.5 4 0 7.17-2.623 12.767-6.66 16.52"
}))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgLogoG);

/***/ }),

/***/ "./svg/graphics/logo-sitekit.svg":
/*!***************************************!*\
  !*** ./svg/graphics/logo-sitekit.svg ***!
  \***************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgLogoSitekit = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 80 21"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#5F6368",
  d: "M62.09 1.664h3.038v.1L58.34 9.593l7.241 10.224v.1H62.7L56.755 11.4 53.95 14.64v5.278h-2.351V1.664h2.35v9.415h.1zM69.985 3.117c0 .454-.167.853-.488 1.175-.322.322-.71.488-1.176.488-.455 0-.854-.166-1.175-.488a1.6 1.6 0 0 1-.488-1.175c0-.466.166-.854.488-1.176s.71-.488 1.175-.488c.455 0 .854.166 1.176.488.332.333.487.72.487 1.176m-.477 4.313v12.498h-2.351V7.43zM77.016 20.128c-1.02 0-1.864-.31-2.54-.943q-1.014-.948-1.031-2.628V9.57h-2.196V7.43h2.196V3.603h2.35V7.43h3.061v2.14h-3.06v6.222c0 .831.166 1.397.488 1.696.321.3.687.444 1.097.444.189 0 .366-.022.555-.067.188-.044.344-.1.499-.166l.743 2.096c-.632.222-1.342.333-2.162.333M2.673 18.952C1.375 18.009.488 16.678 0 14.97l2.883-1.176c.289 1.076.799 1.94 1.542 2.628.732.677 1.619 1.02 2.65 1.02.965 0 1.774-.244 2.45-.742.677-.5 1.01-1.187 1.01-2.052 0-.798-.3-1.453-.887-1.974q-.883-.781-3.094-1.564l-1.22-.432Q3.371 9.997 2.04 8.716C1.153 7.862.71 6.742.71 5.346c0-.966.266-1.853.787-2.673S2.75 1.209 3.693.72C4.624.244 5.678 0 6.864 0c1.708 0 3.072.41 4.081 1.242 1.02.832 1.697 1.752 2.04 2.795L10.236 5.2c-.2-.621-.576-1.164-1.142-1.63-.565-.477-1.286-.71-2.173-.71s-1.641.222-2.251.676-.91 1.032-.91 1.742c0 .676.278 1.22.82 1.663.544.432 1.398.854 2.563 1.253l1.22.41c1.674.577 2.96 1.342 3.88 2.274.921.931 1.376 2.184 1.376 3.748 0 1.275-.322 2.34-.976 3.193a6 6 0 0 1-2.495 1.919 8 8 0 0 1-3.116.621c-1.62 0-3.072-.466-4.358-1.408M15.969 3.449a1.95 1.95 0 0 1-.588-1.43c0-.566.2-1.043.588-1.431A1.95 1.95 0 0 1 17.399 0c.566 0 1.043.2 1.43.588.389.388.588.865.588 1.43 0 .566-.2 1.043-.587 1.43a1.95 1.95 0 0 1-1.43.589c-.566-.012-1.043-.2-1.431-.588m-.067 2.595h2.994v13.883h-2.994zM25.406 19.85c-.544-.2-.987-.466-1.331-.788-.776-.776-1.176-1.84-1.176-3.182V8.683h-2.428v-2.64h2.428V2.13h2.994v3.926h3.372v2.639h-3.372v6.531c0 .743.145 1.276.433 1.575.277.366.743.543 1.42.543.31 0 .576-.044.82-.122q.35-.116.765-.399v2.917c-.599.277-1.32.41-2.173.41a5 5 0 0 1-1.753-.3M33.623 19.407a6.63 6.63 0 0 1-2.529-2.628c-.61-1.12-.909-2.373-.909-3.77 0-1.332.3-2.551.887-3.693.588-1.132 1.409-2.04 2.462-2.706s2.251-1.01 3.593-1.01c1.397 0 2.606.311 3.637.921a6.1 6.1 0 0 1 2.34 2.528c.532 1.076.799 2.274.799 3.627 0 .255-.023.576-.078.953H33.179c.111 1.287.566 2.285 1.375 2.983a4.16 4.16 0 0 0 2.817 1.043c.854 0 1.597-.189 2.218-.588a4.27 4.27 0 0 0 1.508-1.597l2.528 1.198q-.981 1.713-2.561 2.694c-1.054.655-2.318.976-3.782.976q-2.046.033-3.66-.931m7.23-8.051a3.3 3.3 0 0 0-.466-1.453c-.277-.477-.687-.887-1.242-1.208-.554-.322-1.23-.488-2.03-.488-.964 0-1.773.288-2.439.853-.665.566-1.12 1.342-1.375 2.296z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgLogoSitekit);

/***/ }),

/***/ "./svg/icons/adsense-help.svg":
/*!************************************!*\
  !*** ./svg/icons/adsense-help.svg ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgAdsenseHelp = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#6C726E",
  strokeWidth: 1.5,
  d: "M15.244 10.59a2.156 2.156 0 0 1 2.95-.755 2.145 2.145 0 0 1 .76 2.935l-3.039 5.022-.004.006a2.153 2.153 0 0 1-2.95.756v-.001a2.144 2.144 0 0 1-.757-2.94v-.002l3.036-5.014zM8.854 5.635a2.157 2.157 0 0 1 2.95-.756 2.144 2.144 0 0 1 .756 2.94l-.003.005-5.8 9.977a2.153 2.153 0 0 1-2.95.756 2.145 2.145 0 0 1-.757-2.94l.003-.007z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#6C726E",
  stroke: "#6C726E",
  strokeWidth: 1.5,
  d: "M4.887 14.595c1.18 0 2.135.955 2.135 2.13 0 1.176-.954 2.13-2.135 2.13a2.134 2.134 0 0 1-2.137-2.13c0-1.175.955-2.13 2.137-2.13Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAdsenseHelp);

/***/ }),

/***/ "./svg/icons/arrow-inverse.svg":
/*!*************************************!*\
  !*** ./svg/icons/arrow-inverse.svg ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgArrowInverse = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 13 13"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  fill: "none",
  fillRule: "evenodd"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 6.5,
  cy: 6.5,
  r: 6.5,
  fill: "#FFF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M3.461 6.96h5.15L6.36 9.21a.464.464 0 0 0 .325.79.46.46 0 0 0 .325-.135l3.037-3.038a.46.46 0 0 0 0-.65L7.015 3.135a.46.46 0 0 0-.65.65L8.61 6.039H3.461a.46.46 0 0 0-.461.46c0 .254.207.462.461.462z"
}), ".")));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgArrowInverse);

/***/ }),

/***/ "./svg/icons/arrow.svg":
/*!*****************************!*\
  !*** ./svg/icons/arrow.svg ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgArrow = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 13 13"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  fill: "none",
  fillRule: "evenodd"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 6.5,
  cy: 6.5,
  r: 6.5,
  fill: "currentColor"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFF",
  d: "M3.461 6.96h5.15L6.36 9.21a.464.464 0 0 0 .325.79.46.46 0 0 0 .325-.135l3.037-3.038a.46.46 0 0 0 0-.65L7.015 3.135a.46.46 0 0 0-.65.65L8.61 6.039H3.461a.46.46 0 0 0-.461.46c0 .254.207.462.461.462z"
}), ".")));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgArrow);

/***/ }),

/***/ "./svg/icons/back.svg":
/*!****************************!*\
  !*** ./svg/icons/back.svg ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgBack = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "currentColor",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "m12 20-8-8 8-8 1.425 1.4-5.6 5.6H20v2H7.825l5.6 5.6z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgBack);

/***/ }),

/***/ "./svg/icons/check-2.svg":
/*!*******************************!*\
  !*** ./svg/icons/check-2.svg ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgCheck2 = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 12 9"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeLinecap: "square",
  strokeWidth: 1.6,
  d: "m2 5.309 1.474 2.14c.69 1.001 1.946 1.001 2.636 0L10 1.8"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgCheck2);

/***/ }),

/***/ "./svg/icons/check-fill.svg":
/*!**********************************!*\
  !*** ./svg/icons/check-fill.svg ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgCheckFill = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  fillRule: "evenodd",
  d: "M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1m4.806 8.592.592-.806-1.612-1.184-.592.806-3.89 5.296c-.166.226-.36.296-.512.296s-.346-.07-.512-.296l-1.474-2.007-.592-.806-1.612 1.184.592.806 1.474 2.007C9.191 15.6 9.971 16 10.792 16s1.6-.4 2.124-1.112z",
  clipRule: "evenodd"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgCheckFill);

/***/ }),

/***/ "./svg/icons/close.svg":
/*!*****************************!*\
  !*** ./svg/icons/close.svg ***!
  \*****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgClose = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 14 14"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M14 1.41 12.59 0 7 5.59 1.41 0 0 1.41 5.59 7 0 12.59 1.41 14 7 8.41 12.59 14 14 12.59 8.41 7z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgClose);

/***/ }),

/***/ "./svg/icons/compass.svg":
/*!*******************************!*\
  !*** ./svg/icons/compass.svg ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _circle, _path, _circle2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgCompass = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 12,
  cy: 11,
  r: 8.25,
  stroke: "#6C726E",
  strokeWidth: 1.5
})), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#6C726E",
  d: "m10 9 7-3-2.953 7.047L7 16z"
})), _circle2 || (_circle2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 12,
  cy: 11,
  r: 1,
  fill: "#fff"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgCompass);

/***/ }),

/***/ "./svg/icons/connected.svg":
/*!*********************************!*\
  !*** ./svg/icons/connected.svg ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgConnected = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 16 12"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  fill: "currentColor",
  fillRule: "evenodd"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M0 6.414 1.415 5l5.292 5.292-1.414 1.415z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "m14.146.146 1.415 1.414L5.414 11.707 4 10.292z"
}))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgConnected);

/***/ }),

/***/ "./svg/icons/disconnect.svg":
/*!**********************************!*\
  !*** ./svg/icons/disconnect.svg ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgDisconnect = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#6C726E",
  strokeLinecap: "round",
  strokeWidth: 1.7,
  d: "m11.775 5.701.58-.58a4.547 4.547 0 0 1 6.43 0v0a4.547 4.547 0 0 1 0 6.43l-.598.599m-12.504-.357-.562.562a4.547 4.547 0 0 0 0 6.43v0a4.547 4.547 0 0 0 6.43 0l.58-.58"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#6C726E",
  strokeLinecap: "round",
  strokeWidth: 1.5,
  d: "m8.543 15.363 1.118-1.118m5.684-5.684L14.226 9.68M5.107 5.134l13.664 13.664"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgDisconnect);

/***/ }),

/***/ "./svg/icons/documentation.svg":
/*!*************************************!*\
  !*** ./svg/icons/documentation.svg ***!
  \*************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2, _path3;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgDocumentation = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#6C726E",
  strokeWidth: 1.5,
  d: "M19 8v11a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h7z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#6C726E",
  d: "M13.5 9V3L19 9z"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#6C726E",
  strokeWidth: 1.5,
  d: "M8.5 11.5h7M8.5 14.5h7M8.5 17.5H13"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgDocumentation);

/***/ }),

/***/ "./svg/icons/exclamation.svg":
/*!***********************************!*\
  !*** ./svg/icons/exclamation.svg ***!
  \***********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _g;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgExclamation = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 2 12"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  fill: "currentColor",
  fillRule: "evenodd"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M0 0h2v7H0zM0 10h2v2H0z"
}))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgExclamation);

/***/ }),

/***/ "./svg/icons/external-rounded.svg":
/*!****************************************!*\
  !*** ./svg/icons/external-rounded.svg ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgExternalRounded = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 13 14"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeWidth: 1.5,
  d: "M4.5 1.5H3a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V9M7 1.5h5v5M5 8.5 11.5 2"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgExternalRounded);

/***/ }),

/***/ "./svg/icons/external.svg":
/*!********************************!*\
  !*** ./svg/icons/external.svg ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgExternal = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "currentColor",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M5 21a2 2 0 0 1-1.425-.575A2 2 0 0 1 3 19V5q0-.825.575-1.4Q4.175 3 5 3h7v2H5v14h14v-7h2v7q0 .825-.6 1.425Q19.825 21 19 21zm4.7-5.3-1.4-1.4L17.6 5H14V3h7v7h-2V6.4z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgExternal);

/***/ }),

/***/ "./svg/icons/feedback.svg":
/*!********************************!*\
  !*** ./svg/icons/feedback.svg ***!
  \********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgFeedback = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#6C726E",
  strokeWidth: 1.5,
  d: "M5 5.75h14c.69 0 1.25.56 1.25 1.25v9.161c0 .69-.56 1.25-1.25 1.25H6.633l-.219.213-2.664 2.597V7c0-.69.56-1.25 1.25-1.25Z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#6C726E",
  d: "M11.5 8.5H13v4h-1.5zM11.5 13.5H13V15h-1.5z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgFeedback);

/***/ }),

/***/ "./svg/icons/help.svg":
/*!****************************!*\
  !*** ./svg/icons/help.svg ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgHelp = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 20"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M9 16h2v-2H9zm1-16C4.48 0 0 4.48 0 10s4.48 10 10 10 10-4.48 10-10S15.52 0 10 0m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14C7.79 4 6 5.79 6 8h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgHelp);

/***/ }),

/***/ "./svg/icons/info-green.svg":
/*!**********************************!*\
  !*** ./svg/icons/info-green.svg ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgInfoGreen = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 16 16"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M7.334 11.333h1.333v-4H7.334zM8.001 6a.658.658 0 0 0 .667-.667.6.6 0 0 0-.2-.467.6.6 0 0 0-.467-.2.66.66 0 0 0-.667.667q0 .284.183.483A.7.7 0 0 0 8.001 6m0 8.666a6.6 6.6 0 0 1-2.6-.516 6.9 6.9 0 0 1-2.117-1.434A6.9 6.9 0 0 1 1.851 10.6 6.6 6.6 0 0 1 1.334 8q0-1.385.517-2.6a6.9 6.9 0 0 1 1.433-2.117q.9-.9 2.117-1.417A6.4 6.4 0 0 1 8 1.333q1.383 0 2.6.533a6.6 6.6 0 0 1 2.116 1.417q.9.9 1.417 2.117.533 1.215.533 2.6 0 1.383-.533 2.6a6.6 6.6 0 0 1-1.417 2.116 6.9 6.9 0 0 1-2.116 1.434 6.6 6.6 0 0 1-2.6.516m0-1.333q2.233 0 3.783-1.55T13.334 8t-1.55-3.784-3.783-1.55-3.784 1.55T2.667 8t1.55 3.783 3.784 1.55"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgInfoGreen);

/***/ }),

/***/ "./svg/icons/keyboard-backspace.svg":
/*!******************************************!*\
  !*** ./svg/icons/keyboard-backspace.svg ***!
  \******************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgKeyboardBackspace = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "none",
  d: "M0 0h24v24H0z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M21 11H6.83l3.58-3.59L9 6l-6 6 6 6 1.41-1.41L6.83 13H21z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgKeyboardBackspace);

/***/ }),

/***/ "./svg/icons/manage-email-reports.svg":
/*!********************************************!*\
  !*** ./svg/icons/manage-email-reports.svg ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _rect, _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgManageEmailReports = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 18,
  height: 12,
  x: 3,
  y: 6,
  stroke: "currentColor",
  strokeWidth: 1.5,
  rx: 2
})), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.5,
  d: "m3.566 7.5 7.086 7.086a2 2 0 0 0 2.829 0l7.019-7.02"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeLinecap: "round",
  strokeWidth: 1.5,
  d: "M20.246 17.5 15.5 12.754M4 17.5l4.746-4.746"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgManageEmailReports);

/***/ }),

/***/ "./svg/icons/manage-sites.svg":
/*!************************************!*\
  !*** ./svg/icons/manage-sites.svg ***!
  \************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _rect, _path, _path2, _circle, _circle2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgManageSites = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 18,
  height: 13,
  x: 3,
  y: 4,
  stroke: "#6C726E",
  strokeWidth: 1.5,
  rx: 2
})), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#6C726E",
  d: "M9 17h6v3H9z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#6C726E",
  strokeLinecap: "round",
  strokeWidth: 1.5,
  d: "M10 9h7M10 12h7"
})), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 7,
  cy: 9,
  r: 1,
  fill: "#6C726E"
})), _circle2 || (_circle2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 7,
  cy: 12,
  r: 1,
  fill: "#6C726E"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgManageSites);

/***/ }),

/***/ "./svg/icons/nav-content-icon.svg":
/*!****************************************!*\
  !*** ./svg/icons/nav-content-icon.svg ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavContentIcon = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 18 18"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  fillRule: "evenodd",
  d: "M18 16V2c0-1.1-1-2-2.222-2H2.222C1 0 0 .9 0 2v14c0 1.1 1 2 2.222 2h13.556C17 18 18 17.1 18 16M9 7h5V5H9zm7-5H2v14h14zM4 4h4v4H4zm10 7H9v2h5zM4 10h4v4H4z",
  clipRule: "evenodd"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavContentIcon);

/***/ }),

/***/ "./svg/icons/nav-key-metrics-icon.svg":
/*!********************************************!*\
  !*** ./svg/icons/nav-key-metrics-icon.svg ***!
  \********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _rect, _rect2, _rect3, _rect4;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavKeyMetricsIcon = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 13 12"
}, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5,
  height: 5,
  x: 0.5,
  fill: "currentColor",
  rx: 1
})), _rect2 || (_rect2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5,
  height: 5,
  x: 7.5,
  fill: "currentColor",
  rx: 1
})), _rect3 || (_rect3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5,
  height: 5,
  x: 0.5,
  y: 7,
  fill: "currentColor",
  rx: 1
})), _rect4 || (_rect4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5,
  height: 5,
  x: 7.5,
  y: 7,
  fill: "currentColor",
  rx: 1
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavKeyMetricsIcon);

/***/ }),

/***/ "./svg/icons/nav-monetization-icon.svg":
/*!*********************************************!*\
  !*** ./svg/icons/nav-monetization-icon.svg ***!
  \*********************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavMonetizationIcon = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 23 12"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M16.1 0v2h2.967l-5.946 5.17-4.6-4L0 10.59 1.622 12l6.9-6 4.6 4L20.7 3.42V6H23V0z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavMonetizationIcon);

/***/ }),

/***/ "./svg/icons/nav-speed-icon.svg":
/*!**************************************!*\
  !*** ./svg/icons/nav-speed-icon.svg ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavSpeedIcon = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 20 16"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "m18.378 4.543-1.232 1.854a8.02 8.02 0 0 1-.22 7.598H3.043A8.02 8.02 0 0 1 4.154 4.49 8.01 8.01 0 0 1 13.57 2.82l1.853-1.233A10.01 10.01 0 0 0 3.117 2.758a10.026 10.026 0 0 0-1.797 12.24A2 2 0 0 0 3.043 16h13.873a2 2 0 0 0 1.742-1.002 10.03 10.03 0 0 0-.27-10.465z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M8.572 11.399a2.003 2.003 0 0 0 2.835 0l5.669-8.51-8.504 5.673a2.005 2.005 0 0 0 0 2.837"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavSpeedIcon);

/***/ }),

/***/ "./svg/icons/nav-traffic-icon.svg":
/*!****************************************!*\
  !*** ./svg/icons/nav-traffic-icon.svg ***!
  \****************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgNavTrafficIcon = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 18 16"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  fillRule: "evenodd",
  d: "M7 0h3.971v16H7zM0 8h4v8H0zm18-3h-4v11h4z",
  clipRule: "evenodd"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavTrafficIcon);

/***/ }),

/***/ "./svg/icons/pencil-alt.svg":
/*!**********************************!*\
  !*** ./svg/icons/pencil-alt.svg ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgPencilAlt = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "currentColor",
  viewBox: "0 0 22 22"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fillRule: "evenodd",
  d: "m12.149 7.96-5.166 5.166a.34.34 0 0 0-.094.176l-.35 1.755a.344.344 0 0 0 .404.404l1.755-.35a.34.34 0 0 0 .175-.095l5.166-5.165zm2.301-1.814a1.03 1.03 0 0 0-1.458 0L6.497 12.64a1.03 1.03 0 0 0-.282.527l-.35 1.755a1.03 1.03 0 0 0 1.213 1.213l1.754-.35c.2-.04.383-.139.527-.283l6.495-6.494a1.03 1.03 0 0 0 0-1.459z",
  clipRule: "evenodd"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "m12.149 7.96.117-.116a.165.165 0 0 0-.234 0zm-5.166 5.166-.116-.116zm-.094.176.162.033zm-.35 1.755.161.032zm.404.404.032.162zm1.755-.35.032.161zm.175-.095.117.117zm5.166-5.165.116.116a.165.165 0 0 0 0-.233zm-1.047-3.705.116.116zm1.458 0-.116.116zM6.497 12.64l.117.117zm-.282.527-.162-.032zm-.35 1.755.161.032zm1.213 1.213-.033-.162zm1.754-.35.033.161zm.527-.283.117.117zm6.495-6.494-.117-.117zm0-1.459.117-.116zm-3.822.295L6.867 13.01l.233.233 5.166-5.165zM6.867 13.01a.5.5 0 0 0-.14.26l.324.065a.2.2 0 0 1 .05-.092zm-.14.26-.35 1.754.323.065.351-1.755zm-.35 1.754a.51.51 0 0 0 .598.599l-.064-.324a.18.18 0 0 1-.21-.21zm.598.599 1.755-.35-.065-.325-1.754.351zm1.755-.35a.5.5 0 0 0 .26-.14l-.233-.233a.2.2 0 0 1-.092.048zm.26-.14 5.165-5.166-.233-.233L8.757 14.9zm3.042-7.055 1.89 1.89.233-.234-1.89-1.89zm1.076-1.816a.866.866 0 0 1 1.226 0l.233-.233a1.196 1.196 0 0 0-1.692 0zm-6.494 6.495 6.494-6.495-.233-.233-6.494 6.495zm-.237.443a.87.87 0 0 1 .237-.443l-.233-.233c-.167.167-.281.38-.328.61zm-.35 1.754.35-1.754-.324-.065-.35 1.755zm1.018 1.02a.866.866 0 0 1-1.019-1.02l-.323-.065a1.196 1.196 0 0 0 1.407 1.408zm1.755-.351-1.755.35.065.324 1.755-.35zm.443-.237a.87.87 0 0 1-.443.237l.065.323c.231-.046.444-.16.611-.327zm6.494-6.495-6.494 6.495.233.233 6.495-6.494zm0-1.225a.866.866 0 0 1 0 1.225l.234.234a1.196 1.196 0 0 0 0-1.692zm-1.403-1.404 1.403 1.404.234-.233-1.404-1.404z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgPencilAlt);

/***/ }),

/***/ "./svg/icons/star-fill.svg":
/*!*********************************!*\
  !*** ./svg/icons/star-fill.svg ***!
  \*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgStarFill = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "m5.825 22 2.325-7.6L2 10h7.6L12 2l2.4 8H22l-6.15 4.4 2.325 7.6L12 17.3z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgStarFill);

/***/ }),

/***/ "./svg/icons/support.svg":
/*!*******************************!*\
  !*** ./svg/icons/support.svg ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _mask, _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgSupport = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _mask || (_mask = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "support_svg__a",
  fill: "#fff"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M12 2a9 9 0 0 1 2.128 17.745C10.508 21.823 5 23 5 23c.023-.017 2.69-2.024 3.053-3.911A9 9 0 0 1 3 11a9 9 0 0 1 9-9"
}))), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#6C726E",
  d: "M12 2V.5zm9.001 9h1.5zm-2.25 5.953 1.125.993zm-1.802 1.566.826 1.252zm-2.3 1.086.441 1.433zm-.521.14-.354-1.458-.207.05-.186.107zM5 23l-.901-1.2-5.441 4.089 6.655-1.422zm3.053-3.911 1.473.284.217-1.128-1.031-.504zm-1.001-.57-.826 1.252zm-1.704-1.457-1.109 1.01zM3 11H1.5zm9-9v1.5a7.5 7.5 0 0 1 7.501 7.5h3C22.501 5.2 17.799.5 12 .5zm9.001 9h-1.5a7.47 7.47 0 0 1-1.875 4.96l1.125.993 1.125.993A10.47 10.47 0 0 0 22.5 11zm-2.25 5.953-1.125-.992a7.6 7.6 0 0 1-1.503 1.305l.826 1.253.826 1.252a10.6 10.6 0 0 0 2.1-1.825zm-1.802 1.566-.826-1.253a7.5 7.5 0 0 1-1.915.905l.441 1.434.441 1.433a10.5 10.5 0 0 0 2.685-1.267zm-2.3 1.086-.44-1.434c-.131.04-.273.077-.434.116l.353 1.458.353 1.458c.19-.046.397-.1.61-.165zm-.521.14-.747-1.3c-1.661.953-3.814 1.728-5.609 2.271a47 47 0 0 1-2.864.767l-.17.039-.04.009-.01.002h-.002L5 23l.314 1.467h.002l.004-.002.015-.003.052-.011.193-.044a49.75 49.75 0 0 0 3.062-.82c1.864-.564 4.275-1.417 6.233-2.541zM5 23l.901 1.2c.041-.032.783-.592 1.576-1.412.735-.76 1.777-2.007 2.049-3.415l-1.473-.284-1.473-.284c-.092.478-.564 1.178-1.26 1.898-.637.659-1.239 1.111-1.221 1.098zm3.053-3.911.659-1.348q-.438-.213-.834-.475l-.826 1.253-.826 1.252q.565.37 1.168.665zm-1.001-.57.826-1.253c-.523-.344-1.001-.753-1.422-1.215l-1.108 1.01-1.109 1.011a10.5 10.5 0 0 0 1.987 1.699zm-1.704-1.457 1.108-1.011A7.47 7.47 0 0 1 4.5 11h-3c0 2.723 1.039 5.207 2.74 7.072zM3 11h1.5A7.5 7.5 0 0 1 12 3.5v-3C6.2.5 1.5 5.2 1.5 11z",
  mask: "url(#support_svg__a)"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#6C726E",
  d: "M11.796 16q.487 0 .818-.312.332-.31.332-.767 0-.456-.332-.767a1.15 1.15 0 0 0-.818-.312q-.486 0-.817.312a1 1 0 0 0-.332.768q0 .457.332.766.33.312.817.312m.11-8.527q.62 0 1.006.311.387.312.387.788 0 .333-.243.706-.243.374-.685.726-.707.58-1.028 1.069-.32.486-.32.965 0 .31.221.518a.8.8 0 0 0 .574.208q.333 0 .586-.208a.9.9 0 0 0 .32-.56q.066-.332.299-.633.231-.3.762-.778.707-.622.961-1.11T15 8.407q0-1.08-.839-1.743Q13.321 6 11.951 6q-.928 0-1.624.343-.696.342-1.204 1.026a.53.53 0 0 0-.1.498q.078.27.32.456a.8.8 0 0 0 .652.136q.365-.073.608-.385.243-.29.564-.445t.74-.156"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgSupport);

/***/ }),

/***/ "./svg/icons/tick.svg":
/*!****************************!*\
  !*** ./svg/icons/tick.svg ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgTick = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 11 9"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeWidth: 1.5,
  d: "M1 3.838 4.106 7 10 1"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgTick);

/***/ }),

/***/ "./svg/icons/view.svg":
/*!****************************!*\
  !*** ./svg/icons/view.svg ***!
  \****************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgView = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 16 10"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M8 1.333c2.756 0 5.214 1.42 6.415 3.667-1.2 2.247-3.659 3.667-6.415 3.667S2.785 7.247 1.585 5C2.785 2.753 5.244 1.333 8 1.333M8 0C4.364 0 1.258 2.073 0 5c1.258 2.927 4.364 5 8 5s6.742-2.073 8-5c-1.258-2.927-4.364-5-8-5m0 3.333c1.004 0 1.818.747 1.818 1.667S9.004 6.667 8 6.667 6.182 5.92 6.182 5 6.996 3.333 8 3.333M8 2C6.196 2 4.727 3.347 4.727 5S6.197 8 8 8s3.273-1.347 3.273-3S9.803 2 8 2"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgView);

/***/ }),

/***/ "./svg/icons/warning-notice.svg":
/*!**************************************!*\
  !*** ./svg/icons/warning-notice.svg ***!
  \**************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgWarningNotice = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1m0 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m-1-2h2V6h-2z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgWarningNotice);

/***/ }),

/***/ "./svg/icons/warning-v2.svg":
/*!**********************************!*\
  !*** ./svg/icons/warning-v2.svg ***!
  \**********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgWarningV2 = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 22 19"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M0 19h22L11 0zm12-3h-2v-2h2zm0-4h-2V8h2z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgWarningV2);

/***/ }),

/***/ "./svg/icons/warning.svg":
/*!*******************************!*\
  !*** ./svg/icons/warning.svg ***!
  \*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
var _path, _path2;
function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }

const SvgWarning = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "currentColor",
  "aria-labelledby": "warning-title warning-desc",
  viewBox: "0 0 24 24"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "none",
  d: "M0 0h24v24H0z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-2h2zm0-4h-2V7h2z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgWarning);

/***/ }),

/***/ "@wordpress/i18n":
/*!*****************************************!*\
  !*** external ["googlesitekit","i18n"] ***!
  \*****************************************/
/***/ ((module) => {

"use strict";
module.exports = googlesitekit.i18n;

/***/ }),

/***/ "googlesitekit-api":
/*!****************************************!*\
  !*** external ["googlesitekit","api"] ***!
  \****************************************/
/***/ ((module) => {

"use strict";
module.exports = googlesitekit.api;

/***/ }),

/***/ "googlesitekit-components":
/*!***********************************************!*\
  !*** external ["googlesitekit","components"] ***!
  \***********************************************/
/***/ ((module) => {

"use strict";
module.exports = googlesitekit.components;

/***/ }),

/***/ "googlesitekit-data":
/*!*****************************************!*\
  !*** external ["googlesitekit","data"] ***!
  \*****************************************/
/***/ ((module) => {

"use strict";
module.exports = googlesitekit.data;

/***/ }),

/***/ "googlesitekit-modules":
/*!********************************************!*\
  !*** external ["googlesitekit","modules"] ***!
  \********************************************/
/***/ ((module) => {

"use strict";
module.exports = googlesitekit.modules;

/***/ }),

/***/ "googlesitekit-notifications":
/*!**************************************************!*\
  !*** external ["googlesitekit","notifications"] ***!
  \**************************************************/
/***/ ((module) => {

"use strict";
module.exports = googlesitekit.notifications;

/***/ }),

/***/ "googlesitekit-widgets":
/*!********************************************!*\
  !*** external ["googlesitekit","widgets"] ***!
  \********************************************/
/***/ ((module) => {

"use strict";
module.exports = googlesitekit.widgets;

/***/ })

},
/******/ __webpack_require__ => { // webpackRuntimeModules
/******/ var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
/******/ __webpack_require__.O(0, ["googlesitekit-vendor"], () => (__webpack_exec__("./js/googlesitekit-modules-adsense.js")));
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);
//# sourceMappingURL=googlesitekit-modules-adsense.js.map