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

/***/ "./svg/graphics/analytics-audience-segmentation-tile-error.svg"
/*!*********************************************************************!*\
  !*** ./svg/graphics/analytics-audience-segmentation-tile-error.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, _path4, _path5, _path6, _path7, _path8, _path9, _path0, _path1, _path10;
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 SvgAnalyticsAudienceSegmentationTileError = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 190 142"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#F3F5F7",
  d: "M11.7551 110.799C13.1667 112.284 14.6557 113.651 16.2125 114.894C31.17 126.859 43.5277 126.84 60.6364 124.656C76.498 122.631 78.498 113.733 95.998 113.733C113.498 113.733 121.663 120.113 141.998 118.733C162.333 117.353 180.079 94.9718 186.755 76.9588C196.588 50.4306 182.236 19.3627 161.935 10.8627C143.236 2.3627 130.498 10.8736 110.498 7.23291C84.998 2.59098 79.998 -4.05119 60.6364 4C40.1061 12.7013 40.1809 27.5328 27.937 42.6669C18.9738 53.7472 4.95559 56.3117 0.733668 76.9587C-1.93883 90.0285 3.81121 102.426 11.7551 110.799Z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#161B18",
  d: "M96.0703 141.772C135.835 141.772 168.07 139.758 168.07 137.272C168.07 134.787 135.835 132.772 96.0703 132.772C56.3058 132.772 24.0703 134.787 24.0703 137.272C24.0703 139.758 56.3058 141.772 96.0703 141.772Z",
  opacity: 0.1,
  style: {
    mixBlendMode: "multiply"
  }
}), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M96.0703 141.772C135.835 141.772 168.07 139.758 168.07 137.272C168.07 134.787 135.835 132.772 96.0703 132.772C56.3058 132.772 24.0703 134.787 24.0703 137.272C24.0703 139.758 56.3058 141.772 96.0703 141.772Z"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.7,
  d: "M72.6571 62.8262C74.7978 70.7659 82.2467 76.3791 90.1449 78.6734C98.0431 80.9678 106.44 80.5192 114.655 80.1084C118.538 79.9157 122.51 79.7451 126.231 80.8718C129.951 81.9985 133.433 84.693 134.422 88.4516C134.99 90.6121 134.569 92.9421 133.463 94.8763"
})), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.705,
  d: "M57.3061 76.3477C56.0693 95.9303 49.2531 113.498 53.8094 135.572H48.6211M63.171 135.572H57.9805L67.1543 76.3477"
})), _path5 || (_path5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.7,
  d: "M40.7539 70.1738C36.3252 72.1738 27.8247 76.629 27.8252 85.6738"
})), _path6 || (_path6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M76.8038 102.64L73.2024 102.967L51.2262 104.955L38.3806 106.115L37.1619 77.4985L35.043 27.6989L75.135 26.2393L75.9444 63.327L76.0535 68.3195L76.7992 102.524L76.8038 102.64Z"
})), _path7 || (_path7 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#999F9B",
  d: "M73.2033 102.967L75.27 102.779L76.8069 102.64L75.1359 26.2368L72.8328 26.342L74.0723 98.7725L38.2109 102.165L38.336 105.017L38.3837 106.112L51.2294 104.953L73.2056 102.964L73.2033 102.967Z"
})), _path8 || (_path8 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.7,
  d: "M27.8271 85.674C27.8274 90.9383 33.8165 94.7336 38.0886 92.8773"
})), _path9 || (_path9 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#7B807D",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 4.393,
  d: "M145.07 26.7725L117.07 135.272"
})), _path0 || (_path0 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E77D5B",
  d: "M143.121 18.3742L101.519 60.2198C100.975 60.7668 100.585 61.4472 100.388 62.1927C100.191 62.9382 100.194 63.7225 100.395 64.4667C100.597 65.2109 100.992 65.8889 101.539 66.4324C102.086 66.976 102.766 67.3661 103.511 67.5634L160.549 82.6682C161.295 82.8659 162.08 82.8636 162.825 82.6615C163.57 82.4594 164.248 82.0647 164.792 81.5171C165.336 80.9695 165.726 80.2883 165.923 79.5421C166.12 78.7959 166.117 78.011 165.914 77.2664L150.475 20.3227C150.273 19.5786 149.879 18.9008 149.332 18.3572C148.786 17.8137 148.105 17.4236 147.36 17.2261C146.615 17.0287 145.831 17.0308 145.087 17.2323C144.342 17.4339 143.664 17.8277 143.121 18.3742Z"
})), _path1 || (_path1 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#962C0A",
  d: "M138.137 42.5559L140.577 33.3397L145.333 34.5992L142.893 43.8154L139.392 54.9778L135.612 53.977L138.137 42.5559ZM134.836 64.6336C133.93 64.3937 133.234 63.8761 132.748 63.0807C132.297 62.2646 132.192 61.4035 132.432 60.4974C132.672 59.5914 133.185 58.9094 133.973 58.4514C134.789 58.0009 135.651 57.8956 136.557 58.1355C137.463 58.3754 138.145 58.8893 138.603 59.6771C139.061 60.4649 139.17 61.3119 138.93 62.2179C138.69 63.124 138.172 63.8202 137.377 64.3065C136.589 64.7644 135.742 64.8735 134.836 64.6336Z"
})), _path10 || (_path10 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.7,
  d: "M133.461 94.8757C132.452 96.6496 130.828 97.9923 128.896 98.6498C124.833 100.04 119.883 97.8308 118.202 93.8802"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAnalyticsAudienceSegmentationTileError);

/***/ },

/***/ "./svg/graphics/analytics.svg"
/*!************************************!*\
  !*** ./svg/graphics/analytics.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 SvgAnalytics = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 48 53"
}, props), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  fill: "none",
  fillRule: "evenodd"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#F9AB00",
  d: "M47.9999331,46.3763718 C48.0083927,48.2665575 47.2147506,50.0695235 45.8204959,51.327534 C44.4262413,52.5855445 42.5654651,53.1776117 40.71058,52.9534218 C37.3709977,52.4580673 34.9214534,49.5195774 35.0019264,46.1052822 L35.0019264,6.89113315 C34.9250484,3.47484623 37.3789498,0.537328292 40.7208844,0.0450788354 C42.5739684,-0.175185101 44.4315035,0.418591722 45.8232095,1.67608025 C47.2149155,2.93356878 48.0073661,4.73421041 47.9999331,6.62212888 L47.9999331,46.3763718 Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E37400",
  fillRule: "nonzero",
  d: "M6.5 40.0020671C8.22262448 40.0004241 9.87531633 40.6843861 11.0943622 41.9034315 12.3134081 43.1224768 12.9989074 44.7767048 13 46.5020641 12.998361 48.2270657 12.3126206 49.8807634 11.093634 51.0993624 9.87464738 52.3179614 8.22226769 53.0016402 6.5 52.999997 4.77773231 53.0016402 3.12535262 52.3179614 1.90636599 51.0993624.687379359 49.8807634.00163895381 48.2270657 0 46.5020641.000546023892 44.7763471.685804082 43.1215887 1.90490926 41.9020969 3.12401445 40.6826052 4.77701861 39.9983598 6.5 40.000003L6.5 40.0020671ZM24.3477157 20.0020863C20.7288351 20.1994611 17.9193407 23.2577067 18.0017681 26.909901L18.0017681 44.5539325C18.0017681 49.3441295 20.0943164 52.2503771 23.1617314 52.8679286 25.0861227 53.2621882 27.0843982 52.763442 28.6039437 51.5096161 30.1234892 50.2557902 31.0032715 48.379758 30.9999909 46.4003281L30.9999909 26.6052978C31.0021879 24.8549545 30.3142028 23.1754818 29.0875007 21.9366278 27.8607986 20.6977738 26.1959501 20.0011057 24.4594839 20L24.3477157 20.0020863Z"
}))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAnalytics);

/***/ },

/***/ "./svg/graphics/audience-connect-analytics-cta-graphic-tablet.svg"
/*!************************************************************************!*\
  !*** ./svg/graphics/audience-connect-analytics-cta-graphic-tablet.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, _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 SvgAudienceConnectAnalyticsCtaGraphicTablet = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 553 146"
}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#audience-connect-analytics-cta-graphic-tablet_svg__a)"
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M67.7277 34.5897C70.0426 32.2029 72.4844 30.0036 75.0372 28.0063C99.5652 8.76588 119.83 8.79677 147.886 12.3084C166.852 14.6816 177.933 23.7121 203.791 22.2919C229.65 20.8716 234.5 10.1167 271 14.3084C307.5 18.5 322.5 -1.5 360.5 1.5C398.5 4.5 412.5 33.5 432.5 43.5C452.5 53.5 469.5 52 482.5 78.5C495.5 105 486.5 162 446.5 184.5C406.5 207 347.145 209.886 324.061 212.053C296.123 214.677 273.066 183.736 244.867 190.902C227.496 195.317 217.193 213.836 203.791 226.057C188.155 240.315 154.472 239.419 136.164 231.809C118.716 224.559 101.744 210.187 96.0457 189.021C91.7077 172.902 90.5249 153.688 78.379 138.965C63.6807 121.149 54.7004 113.202 49.6542 89.004C45.2716 67.9885 54.701 48.0534 67.7277 34.5897Z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "audience-connect-analytics-cta-graphic-tablet_svg__b",
  width: 441,
  height: 237,
  x: 48,
  y: 1,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M67.7277 34.5897C70.0426 32.2029 72.4844 30.0036 75.0372 28.0063C99.5652 8.76588 119.83 8.79677 147.886 12.3084C166.852 14.6816 177.933 23.7121 203.791 22.2919C229.65 20.8716 234.5 10.1167 271 14.3084C307.5 18.5 322.5 -1.5 360.5 1.5C398.5 4.5 412.5 33.5 432.5 43.5C452.5 53.5 469.5 52 482.5 78.5C495.5 105 486.5 162 446.5 184.5C406.5 207 347.145 209.886 324.061 212.053C296.123 214.677 273.066 183.736 244.867 190.902C227.496 195.317 217.193 213.836 203.791 226.057C188.155 240.315 154.472 239.419 136.164 231.809C118.716 224.559 101.744 210.187 96.0457 189.021C91.7077 172.902 90.5249 153.688 78.379 138.965C63.6807 121.149 54.7004 113.202 49.6542 89.004C45.2716 67.9885 54.701 48.0534 67.7277 34.5897Z"
}))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#audience-connect-analytics-cta-graphic-tablet_svg__c)",
  mask: "url(#audience-connect-analytics-cta-graphic-tablet_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 112.625,
  height: 153.111,
  x: 93,
  y: 29.181,
  fill: "#fff",
  rx: 8.097
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 39.025,
  height: 7.005,
  x: 107.008,
  y: 92.222,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 14.009,
  height: 7.005,
  x: 107.008,
  y: 81.214,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 14.009,
  height: 7.005,
  x: 107.008,
  y: 117.295,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M170.051 90.7205C170.051 87.1284 172.963 84.2163 176.555 84.2163H186.562C190.154 84.2163 193.066 87.1284 193.066 90.7205C193.066 94.3127 190.154 97.2248 186.562 97.2248H176.555C172.963 97.2248 170.051 94.3127 170.051 90.7205Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 26.5,
  height: 6.625,
  x: 106.984,
  y: 44.639,
  fill: "#EBEEF0",
  rx: 3.313
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M170.051 126.802C170.051 123.209 172.963 120.297 176.555 120.297H186.562C190.154 120.297 193.066 123.209 193.066 126.802C193.066 130.394 190.154 133.306 186.562 133.306H176.555C172.963 133.306 170.051 130.394 170.051 126.802Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 41.027,
  height: 7.005,
  x: 106.008,
  y: 128.303,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.472,
  d: "M205.625 64.8818L93.7361 64.8818"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 112.625,
  height: 153.111,
  x: 220.348,
  y: 29.181,
  fill: "#fff",
  rx: 8.097
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 38.871,
  height: 7.005,
  x: 234.301,
  y: 92.222,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 13.954,
  height: 7.005,
  x: 234.301,
  y: 81.214,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 13.954,
  height: 7.005,
  x: 234.301,
  y: 117.295,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M297.094 90.7205C297.094 87.1284 300.006 84.2163 303.598 84.2163H313.513C317.105 84.2163 320.017 87.1284 320.017 90.7205C320.017 94.3127 317.105 97.2248 313.513 97.2248H303.598C300.006 97.2248 297.094 94.3127 297.094 90.7205Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 26.5,
  height: 6.625,
  x: 234.332,
  y: 44.639,
  fill: "#EBEEF0",
  rx: 3.313
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.472,
  d: "M325.613 64.8818L220.349 64.8818"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M297.094 126.802C297.094 123.209 300.006 120.297 303.598 120.297H313.513C317.105 120.297 320.017 123.209 320.017 126.802C320.017 130.394 317.105 133.306 313.513 133.306H303.598C300.006 133.306 297.094 130.394 297.094 126.802Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 40.864,
  height: 7.005,
  x: 233.305,
  y: 128.303,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 112.625,
  height: 153.111,
  x: 347.695,
  y: 29.181,
  fill: "#fff",
  rx: 8.097
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 38.871,
  height: 7.005,
  x: 361.648,
  y: 92.222,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 13.954,
  height: 7.005,
  x: 361.648,
  y: 81.214,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 13.954,
  height: 7.005,
  x: 361.648,
  y: 117.295,
  fill: "#EBEEF0",
  rx: 3.502
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M424.441 90.7205C424.441 87.1284 427.353 84.2163 430.946 84.2163H440.861C444.453 84.2163 447.365 87.1284 447.365 90.7205C447.365 94.3127 444.453 97.2248 440.861 97.2248H430.946C427.353 97.2248 424.441 94.3127 424.441 90.7205Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 26.5,
  height: 6.625,
  x: 361.68,
  y: 44.639,
  fill: "#EBEEF0",
  rx: 3.313
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.472,
  d: "M452.961 64.8818L347.697 64.8818"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M424.441 126.802C424.441 123.209 427.353 120.297 430.946 120.297H440.861C444.453 120.297 447.365 123.209 447.365 126.802C447.365 130.394 444.453 133.306 440.861 133.306H430.946C427.353 133.306 424.441 130.394 424.441 126.802Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 40.864,
  height: 7.005,
  x: 360.652,
  y: 128.303,
  fill: "#EBEEF0",
  rx: 3.502
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "audience-connect-analytics-cta-graphic-tablet_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 0H553V158H0z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "audience-connect-analytics-cta-graphic-tablet_svg__c",
  width: 399.32,
  height: 185.111,
  x: 77,
  y: 17.181,
  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_2898_16714"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_2898_16714",
  result: "shape"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceConnectAnalyticsCtaGraphicTablet);

/***/ },

/***/ "./svg/graphics/audience-connect-analytics-cta-graphic.svg"
/*!*****************************************************************!*\
  !*** ./svg/graphics/audience-connect-analytics-cta-graphic.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 _defs, _path, _path2, _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 SvgAudienceConnectAnalyticsCtaGraphic = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "-3 1 333.666 149.252"
}, props), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "audience-connect-analytics-cta-graphic_svg__c",
  width: 144.59,
  height: 185.064,
  x: 109.551,
  y: 18.171,
  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_1731_24094"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_1731_24094",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "audience-connect-analytics-cta-graphic_svg__d",
  width: 144.59,
  height: 185.064,
  x: 236.859,
  y: 18.171,
  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_1731_24094"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_1731_24094",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "audience-connect-analytics-cta-graphic_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 0H480V150H0z"
})))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#audience-connect-analytics-cta-graphic_svg__a)",
  transform: "translate(-73)"
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M91.7217 36.5786C94.0359 34.1925 96.4769 31.9939 99.029 29.9973C123.55 10.7626 143.808 10.7935 171.855 14.304C190.816 16.6765 201.893 25.7043 227.744 24.2845C253.595 22.8647 260.218 16.2921 291.861 18.3974C316.909 20.0639 328.146 25.0091 350.415 36.5786C371.025 47.286 389.739 66.0979 399.143 90.9763C415.263 133.62 386.521 210.369 347.977 213.988C320.047 216.611 296.998 185.68 268.808 192.843C251.442 197.257 241.142 215.77 227.744 227.987C212.113 242.242 178.44 241.346 160.137 233.738C142.695 226.49 125.728 212.123 120.031 190.963C115.694 174.849 114.512 155.641 102.37 140.923C87.6759 123.112 78.6984 115.167 73.6538 90.9763C69.2725 69.9672 78.6989 50.0382 91.7217 36.5786Z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "audience-connect-analytics-cta-graphic_svg__b",
  width: 332,
  height: 228,
  x: 72,
  y: 12,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M91.7217 36.5786C94.0359 34.1925 96.4769 31.9939 99.029 29.9973C123.55 10.7626 143.808 10.7935 171.855 14.304C190.816 16.6765 201.893 25.7043 227.744 24.2845C253.595 22.8647 260.218 16.2921 291.861 18.3974C316.909 20.0639 328.146 25.0091 350.415 36.5786C371.025 47.286 389.739 66.0979 399.143 90.9763C415.263 133.62 386.521 210.369 347.977 213.988C320.047 216.611 296.998 185.68 268.808 192.843C251.442 197.257 241.142 215.77 227.744 227.987C212.113 242.242 178.44 241.346 160.137 233.738C142.695 226.49 125.728 212.123 120.031 190.963C115.694 174.849 114.512 155.641 102.37 140.923C87.6759 123.112 78.6984 115.167 73.6538 90.9763C69.2725 69.9672 78.6989 50.0382 91.7217 36.5786Z"
}))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#audience-connect-analytics-cta-graphic_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#audience-connect-analytics-cta-graphic_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 112.591,
  height: 153.065,
  x: 125.551,
  y: 30.171,
  fill: "#fff",
  rx: 8.095
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 39.014,
  height: 7.002,
  x: 139.555,
  y: 93.193,
  fill: "#EBEEF0",
  rx: 3.501
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 14.005,
  height: 7.002,
  x: 139.555,
  y: 82.189,
  fill: "#EBEEF0",
  rx: 3.501
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 14.005,
  height: 7.002,
  x: 139.555,
  y: 118.259,
  fill: "#EBEEF0",
  rx: 3.501
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M202.578 91.6927C202.578 88.1016 205.489 85.1904 209.08 85.1904H219.084C222.675 85.1904 225.586 88.1016 225.586 91.6927C225.586 95.2838 222.675 98.1949 219.084 98.1949H209.08C205.489 98.1949 202.578 95.2838 202.578 91.6927Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 26.492,
  height: 6.623,
  x: 139.535,
  y: 45.625,
  fill: "#EBEEF0",
  rx: 3.311
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M202.578 127.763C202.578 124.172 205.489 121.261 209.08 121.261H219.084C222.675 121.261 225.586 124.172 225.586 127.763C225.586 131.354 222.675 134.265 219.084 134.265H209.08C205.489 134.265 202.578 131.354 202.578 127.763Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 41.014,
  height: 7.002,
  x: 138.555,
  y: 129.263,
  fill: "#EBEEF0",
  rx: 3.501
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.472,
  d: "M238.141 65.8618L126.286 65.8618"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#audience-connect-analytics-cta-graphic_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 112.591,
  height: 153.065,
  x: 252.859,
  y: 30.171,
  fill: "#fff",
  rx: 8.095
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 38.859,
  height: 7.002,
  x: 266.809,
  y: 93.193,
  fill: "#EBEEF0",
  rx: 3.501
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 13.949,
  height: 7.002,
  x: 266.809,
  y: 82.189,
  fill: "#EBEEF0",
  rx: 3.501
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 13.949,
  height: 7.002,
  x: 266.805,
  y: 118.259,
  fill: "#EBEEF0",
  rx: 3.501
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M329.582 91.6927C329.582 88.1016 332.493 85.1904 336.084 85.1904H345.996C349.588 85.1904 352.499 88.1016 352.499 91.6927C352.499 95.2838 349.588 98.1949 345.996 98.1949H336.084C332.493 98.1949 329.582 95.2838 329.582 91.6927Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 26.492,
  height: 6.623,
  x: 266.844,
  y: 45.625,
  fill: "#EBEEF0",
  rx: 3.311
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.472,
  d: "M358.094 65.8618L252.862 65.8618"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M329.582 127.763C329.582 124.172 332.493 121.261 336.084 121.261H345.996C349.588 121.261 352.499 124.172 352.499 127.763C352.499 131.354 349.588 134.265 345.996 134.265H336.084C332.493 134.265 329.582 131.354 329.582 127.763Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 40.852,
  height: 7.002,
  x: 265.812,
  y: 129.263,
  fill: "#EBEEF0",
  rx: 3.501
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceConnectAnalyticsCtaGraphic);

/***/ },

/***/ "./svg/graphics/audience-segmentation-collecting-data.svg"
/*!****************************************************************!*\
  !*** ./svg/graphics/audience-segmentation-collecting-data.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, _path4, _path5, _path6, _path7, _path8, _path9, _path0;
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 SvgAudienceSegmentationCollectingData = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 109 94"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M54.3233 93.5289C76.2308 93.5289 93.9903 75.7693 93.9903 53.8618C93.9903 31.9544 76.2308 14.1948 54.3233 14.1948C32.4158 14.1948 14.6562 31.9544 14.6562 53.8618C14.6562 75.7693 32.4158 93.5289 54.3233 93.5289Z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 2.578,
  d: "M37.7168 38.4689L89.8789 56.9141C91.4829 57.4815 93.183 57.7274 94.8821 57.6377C96.5811 57.548 98.2459 57.1244 99.7812 56.3912C101.317 55.658 102.692 54.6295 103.83 53.3644C104.968 52.0994 105.845 50.6226 106.412 49.0184V49.0184C106.98 47.4137 107.226 45.713 107.136 44.0133C107.046 42.3136 106.622 40.6482 105.888 39.1125C105.154 37.5767 104.125 36.2006 102.859 35.0627C101.593 33.9249 100.116 33.0477 98.5105 32.4812L87.0229 28.4193L87.009 28.4609C87.3091 26.5843 87.3325 24.6739 87.0784 22.7905"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 2.578,
  d: "M70.9468 38.4689L18.7847 56.9141C17.1807 57.4815 15.4806 57.7274 13.7815 57.6377C12.0825 57.548 10.4177 57.1244 8.8824 56.3912C7.34707 55.6579 5.97124 54.6294 4.83348 53.3644C3.69573 52.0993 2.81834 50.6225 2.25144 49.0183V49.0183C1.6838 47.4137 1.43793 45.7129 1.52786 44.0132C1.6178 42.3135 2.04179 40.6482 2.7756 39.1124C3.50941 37.5767 4.53866 36.2005 5.80453 35.0627C7.0704 33.9249 8.54808 33.0477 10.1531 32.4811L21.6387 28.4192L21.6546 28.4609C21.3545 26.585 21.3311 24.6752 21.5852 22.7925"
})), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#70B2F5",
  d: "M27.6094 0.509636L28.1072 83.6358C35.5513 90.2037 45.1895 93.7382 55.1148 93.5398C65.0402 93.3415 74.5295 89.4248 81.7053 82.5648L82.8953 0.454102L27.6094 0.509636Z"
})), _path5 || (_path5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#77AD8C",
  d: "M27.6094 0.509636L28.1072 83.6358C35.5513 90.2037 45.1895 93.7382 55.1148 93.5398C65.0402 93.3415 74.5295 89.4248 81.7053 82.5648L82.8953 0.454102L27.6094 0.509636Z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#77AD8C",
  d: "M82.6482 17.1123L82.8881 0.452148H77.0353L76.002 87.0849C78.037 85.7537 79.9457 84.2387 81.7041 82.5589L82.6482 17.1123Z",
  opacity: 0.2,
  style: {
    mixBlendMode: "multiply"
  }
}), _path6 || (_path6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.785,
  d: "M44.7227 46.3765C49.6394 50.3233 56.591 51.2694 63.9413 46.6502"
})), _path7 || (_path7 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#7B807D",
  d: "M80.3802 24.9924C80.3802 15.4286 68.9343 7.93555 54.321 7.93555C39.7076 7.93555 28.2617 15.4267 28.2617 24.9924H80.3802Z"
})), _path8 || (_path8 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  stroke: "#464B48",
  strokeLinejoin: "round",
  strokeWidth: 4.363,
  d: "M39.588 39.7365C47.731 39.7365 54.3322 33.1353 54.3322 24.9923C54.3322 16.8493 47.731 10.248 39.588 10.248C31.445 10.248 24.8438 16.8493 24.8438 24.9923C24.8438 33.1353 31.445 39.7365 39.588 39.7365Z"
})), _path9 || (_path9 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  stroke: "#464B48",
  strokeLinejoin: "round",
  strokeWidth: 4.363,
  d: "M69.0763 39.7365C77.2193 39.7365 83.8205 33.1353 83.8205 24.9923C83.8205 16.8493 77.2193 10.248 69.0763 10.248C60.9333 10.248 54.332 16.8493 54.332 24.9923C54.332 33.1353 60.9333 39.7365 69.0763 39.7365Z"
})), _path0 || (_path0 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#B8BDB9",
  strokeLinejoin: "round",
  strokeWidth: 3.173,
  d: "M30.8594 24.9924C30.8625 22.6789 31.783 20.461 33.4189 18.8251 35.0548 17.1892 37.2726 16.2688 39.5861 16.2656M60.3477 24.9924C60.3508 22.6789 61.2712 20.461 62.9071 18.8251 64.543 17.1892 66.7609 16.2688 69.0744 16.2656"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceSegmentationCollectingData);

/***/ },

/***/ "./svg/graphics/audience-segmentation-error-full-width.svg"
/*!*****************************************************************!*\
  !*** ./svg/graphics/audience-segmentation-error-full-width.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, _path4, _path5, _path6, _path7, _path8, _path9, _path0, _path1, _path10;
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 SvgAudienceSegmentationErrorFullWidth = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 233 117"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#F3F5F7",
  d: "M2.95559 80.0142C4.45014 83.5827 6.57805 86.8584 9.23893 89.6868C19.6975 100.702 35.1501 101.636 49.3223 98.8798C63.6716 96.0705 77.1998 90.1138 88.9096 81.449C95.6479 76.4553 102.304 70.2581 111.226 69.9819C114.576 69.8791 118.04 70.802 120.571 72.9798C125.83 77.4767 125.736 85.1664 129.84 90.4963C135.298 97.5842 143.148 99.7791 151.71 100.597C175.901 102.906 204.716 95.3315 221.356 76.9028C236.213 60.4506 237.996 34.2723 220.013 19.2741C211.797 12.4217 200.53 9.28248 189.896 10.8821C181.769 12.1048 173.518 15.8244 165.105 16.8587C155.197 18.0792 149.072 13.9164 141.055 9.06834C127.086 0.642027 108.62 -2.59573 92.8074 2.29303C77.671 6.97193 66.777 19.7474 52.048 25.3599C39.321 30.2123 24.2865 29.4735 13.2278 37.3773C0.143251 46.7266 -3.14575 65.6028 2.95559 80.0142Z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#161B18",
  d: "M118.945 116.194C151.587 116.194 178.049 114.54 178.049 112.5C178.049 110.46 151.587 108.806 118.945 108.806C86.3019 108.806 59.8398 110.46 59.8398 112.5C59.8398 114.54 86.3019 116.194 118.945 116.194Z",
  opacity: 0.1,
  style: {
    mixBlendMode: "multiply"
  }
}), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M118.945 116.194C151.587 116.194 178.049 114.54 178.049 112.5C178.049 110.46 151.587 108.806 118.945 108.806C86.3019 108.806 59.8398 110.46 59.8398 112.5C59.8398 114.54 86.3019 116.194 118.945 116.194Z"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.396,
  d: "M99.7254 51.3871C101.483 57.9048 107.597 62.5126 114.081 64.3961C120.565 66.2795 127.458 65.9113 134.201 65.574C137.389 65.4158 140.65 65.2758 143.704 66.2007C146.758 67.1256 149.616 69.3375 150.428 72.4229C150.894 74.1965 150.549 76.1092 149.641 77.697"
})), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.4,
  d: "M87.114 62.4871C86.0987 78.5624 80.5032 92.9838 84.2435 111.105H79.9844M91.9289 111.105H87.668L95.1989 62.4871"
})), _path5 || (_path5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.396,
  d: "M73.5273 57.4189C69.8918 59.0607 62.9136 62.718 62.914 70.1429"
})), _path6 || (_path6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M103.118 84.0703L100.161 84.3386L82.1209 85.9706L71.5758 86.9226L70.5754 63.4316L68.8359 22.5513L101.748 21.353L102.412 51.7983L102.502 55.8966L103.114 83.9747L103.118 84.0703Z"
})), _path7 || (_path7 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#999F9B",
  d: "M100.163 84.3385L101.86 84.1841L103.121 84.0702L101.75 21.3511L99.8589 21.4375L100.876 80.8955L71.4375 83.6806L71.5401 86.0219L71.5793 86.9206L82.1245 85.9687L100.165 84.3367L100.163 84.3385Z"
})), _path8 || (_path8 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.396,
  d: "M62.9122 70.1429C62.9124 74.4643 67.8289 77.5799 71.336 76.056"
})), _path9 || (_path9 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#7B807D",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 3.607,
  d: "M159.169 21.7905L136.184 110.858"
})), _path0 || (_path0 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E77D5B",
  d: "M157.57 14.8965L123.419 49.2474C122.973 49.6965 122.653 50.2551 122.491 50.867C122.329 51.479 122.331 52.1228 122.497 52.7337C122.663 53.3446 122.986 53.9012 123.435 54.3474C123.884 54.7936 124.443 55.1138 125.055 55.2758L171.877 67.6753C172.49 67.8376 173.134 67.8357 173.745 67.6698C174.357 67.5039 174.914 67.1799 175.36 66.7304C175.807 66.2809 176.127 65.7217 176.288 65.1091C176.45 64.4966 176.447 63.8522 176.281 63.241L163.607 16.496C163.442 15.8852 163.118 15.3287 162.669 14.8825C162.22 14.4363 161.662 14.1161 161.05 13.954C160.438 13.7919 159.795 13.7937 159.184 13.9591C158.573 14.1246 158.016 14.4479 157.57 14.8965Z"
})), _path1 || (_path1 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#962C0A",
  d: "M153.345 35.2519L155.348 27.6863L159.253 28.7202L157.25 36.2858L154.376 45.449L151.273 44.6274L153.345 35.2519ZM150.636 53.3754C149.892 53.1785 149.32 52.7536 148.921 52.1007C148.551 51.4307 148.465 50.7238 148.662 49.98C148.859 49.2363 149.281 48.6764 149.927 48.3004C150.597 47.9306 151.304 47.8442 152.048 48.0411C152.792 48.2381 153.352 48.6599 153.728 49.3066C154.103 49.9534 154.193 50.6486 153.996 51.3924C153.799 52.1362 153.374 52.7077 152.721 53.1069C152.075 53.4828 151.379 53.5723 150.636 53.3754Z"
})), _path10 || (_path10 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.396,
  d: "M149.639 77.6966C148.811 79.1528 147.478 80.255 145.892 80.7947C142.557 81.9359 138.493 80.1224 137.114 76.8794"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceSegmentationErrorFullWidth);

/***/ },

/***/ "./svg/graphics/audience-segmentation-introductory-graphic-desktop.svg"
/*!*****************************************************************************!*\
  !*** ./svg/graphics/audience-segmentation-introductory-graphic-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 SvgAudienceSegmentationIntroductoryGraphicDesktop = 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(#audience-segmentation-introductory-graphic-desktop_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M0 16C0 7.16344 7.16344 0 16 0H280C288.837 0 296 7.16344 296 16V163H0V16Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#audience-segmentation-introductory-graphic-desktop_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 153,
  height: 174,
  x: -10,
  y: 25,
  fill: "#fff",
  rx: 11
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 53.016,
  height: 9.516,
  x: 9.031,
  y: 110.641,
  fill: "#EBEEF0",
  rx: 4.758
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 19.031,
  height: 9.516,
  x: 9.031,
  y: 95.688,
  fill: "#EBEEF0",
  rx: 4.758
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 19.031,
  height: 9.516,
  x: 9.031,
  y: 148.703,
  fill: "#EBEEF0",
  rx: 4.758
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M94.6719 108.602C94.6719 103.722 98.6279 99.7656 103.508 99.7656H117.102C121.982 99.7656 125.938 103.722 125.938 108.602C125.938 113.482 121.982 117.438 117.102 117.438H103.508C98.6279 117.438 94.6719 113.482 94.6719 108.602Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 36,
  height: 9,
  x: 9,
  y: 46,
  fill: "#EBEEF0",
  rx: 4.5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M94.6719 161.617C94.6719 156.737 98.6279 152.781 103.508 152.781H117.102C121.982 152.781 125.938 156.737 125.938 161.617C125.938 166.497 121.982 170.453 117.102 170.453H103.508C98.6279 170.453 94.6719 166.497 94.6719 161.617Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#audience-segmentation-introductory-graphic-desktop_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 153,
  height: 174,
  x: 152,
  y: 25,
  fill: "#fff",
  rx: 11
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.805,
  height: 9.516,
  x: 170.955,
  y: 110.641,
  fill: "#EBEEF0",
  rx: 4.758
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 18.956,
  height: 9.516,
  x: 170.955,
  y: 95.688,
  fill: "#EBEEF0",
  rx: 4.758
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 18.956,
  height: 9.516,
  x: 170.955,
  y: 148.703,
  fill: "#EBEEF0",
  rx: 4.758
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M256.256 108.602C256.256 103.722 260.212 99.7656 265.092 99.7656H278.562C283.441 99.7656 287.397 103.722 287.397 108.602C287.397 113.482 283.441 117.438 278.562 117.438H265.092C260.212 117.438 256.256 113.482 256.256 108.602Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 36,
  height: 9,
  x: 171,
  y: 46,
  fill: "#EBEEF0",
  rx: 4.5
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 2,
  d: "M295 73.5L152 73.5"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M256.256 161.617C256.256 156.737 260.212 152.781 265.092 152.781H278.562C283.441 152.781 287.397 156.737 287.397 161.617C287.397 166.497 283.441 170.453 278.562 170.453H265.092C260.212 170.453 256.256 166.497 256.256 161.617Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 2,
  d: "M143 73.5L6.10352e-05 73.5"
}))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "audience-segmentation-introductory-graphic-desktop_svg__b",
  width: 185,
  height: 206,
  x: -26,
  y: 13,
  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_1395_20972"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_1395_20972",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "audience-segmentation-introductory-graphic-desktop_svg__c",
  width: 185,
  height: 206,
  x: 136,
  y: 13,
  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_1395_20972"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_1395_20972",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "audience-segmentation-introductory-graphic-desktop_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 16C0 7.16344 7.16344 0 16 0H280C288.837 0 296 7.16344 296 16V163H0V16Z"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceSegmentationIntroductoryGraphicDesktop);

/***/ },

/***/ "./svg/graphics/audience-segmentation-introductory-graphic-mobile.svg"
/*!****************************************************************************!*\
  !*** ./svg/graphics/audience-segmentation-introductory-graphic-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 _path, _path2, _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 SvgAudienceSegmentationIntroductoryGraphicMobile = 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), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#audience-segmentation-introductory-graphic-mobile_svg__a)"
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M41.0643 27.1464C43.1258 25.0187 45.3004 23.0582 47.5739 21.2776C69.4177 4.1255 87.4649 4.15303 112.45 7.28349C129.341 9.39912 139.209 17.4495 162.238 16.1834C185.267 14.9173 191.167 9.05635 219.355 10.9337C241.67 12.4198 251.679 16.8296 271.518 27.1464C289.878 36.6946 306.549 53.4698 314.926 75.6548C329.287 113.681 303.683 182.121 269.346 185.348C244.465 187.687 223.932 160.105 198.819 166.493C183.349 170.429 174.173 186.937 162.238 197.832C148.313 210.543 118.316 209.744 102.011 202.961C86.4729 196.497 71.358 183.685 66.2833 164.816C62.4201 150.447 61.3667 133.318 50.55 120.194C37.4601 104.311 29.4626 97.226 24.9687 75.6548C21.0656 56.9202 29.4631 39.1488 41.0643 27.1464Z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "audience-segmentation-introductory-graphic-mobile_svg__b",
  width: 295,
  height: 203,
  x: 24,
  y: 5,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M41.0643 27.1464C43.1258 25.0187 45.3004 23.0582 47.5739 21.2776C69.4177 4.1255 87.4649 4.15303 112.45 7.28349C129.341 9.39912 139.209 17.4495 162.238 16.1834C185.267 14.9173 191.167 9.05635 219.355 10.9337C241.67 12.4198 251.679 16.8296 271.518 27.1464C289.878 36.6946 306.549 53.4698 314.926 75.6548C329.287 113.681 303.683 182.121 269.346 185.348C244.465 187.687 223.932 160.105 198.819 166.493C183.349 170.429 174.173 186.937 162.238 197.832C148.313 210.543 118.316 209.744 102.011 202.961C86.4729 196.497 71.358 183.685 66.2833 164.816C62.4201 150.447 61.3667 133.318 50.55 120.194C37.4601 104.311 29.4626 97.226 24.9687 75.6548C21.0656 56.9202 29.4631 39.1488 41.0643 27.1464Z"
}))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#audience-segmentation-introductory-graphic-mobile_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#audience-segmentation-introductory-graphic-mobile_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 100.401,
  height: 136.493,
  x: 71.449,
  y: 21.433,
  fill: "#fff",
  rx: 7.218
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 34.79,
  height: 6.244,
  x: 83.941,
  y: 77.631,
  fill: "#EBEEF0",
  rx: 3.122
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 12.489,
  height: 6.244,
  x: 83.941,
  y: 67.819,
  fill: "#EBEEF0",
  rx: 3.122
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 12.489,
  height: 6.244,
  x: 83.941,
  y: 99.983,
  fill: "#EBEEF0",
  rx: 3.122
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M140.133 76.2929C140.133 73.0906 142.729 70.4946 145.931 70.4946H154.852C158.054 70.4946 160.65 73.0906 160.65 76.2929C160.65 79.4952 158.054 82.0912 154.852 82.0912H145.931C142.729 82.0912 140.133 79.4952 140.133 76.2929Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 23.624,
  height: 5.906,
  x: 83.926,
  y: 35.213,
  fill: "#EBEEF0",
  rx: 2.953
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M140.133 108.458C140.133 105.256 142.729 102.66 145.931 102.66H154.852C158.054 102.66 160.65 105.256 160.65 108.458C160.65 111.661 158.054 114.257 154.852 114.257H145.931C142.729 114.257 140.133 111.661 140.133 108.458Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 36.574,
  height: 6.244,
  x: 83.043,
  y: 109.796,
  fill: "#EBEEF0",
  rx: 3.122
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.312,
  d: "M171.848 53.2588L72.1029 53.2588"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#audience-segmentation-introductory-graphic-mobile_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 100.401,
  height: 136.493,
  x: 184.973,
  y: 21.433,
  fill: "#fff",
  rx: 7.218
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 34.652,
  height: 6.244,
  x: 197.414,
  y: 77.631,
  fill: "#EBEEF0",
  rx: 3.122
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 12.439,
  height: 6.244,
  x: 197.414,
  y: 67.819,
  fill: "#EBEEF0",
  rx: 3.122
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 12.439,
  height: 6.244,
  x: 197.41,
  y: 99.983,
  fill: "#EBEEF0",
  rx: 3.122
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M253.391 76.2929C253.391 73.0906 255.987 70.4946 259.189 70.4946H268.028C271.23 70.4946 273.826 73.0906 273.826 76.2929C273.826 79.4952 271.23 82.0912 268.028 82.0912H259.189C255.987 82.0912 253.391 79.4952 253.391 76.2929Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 23.624,
  height: 5.906,
  x: 197.449,
  y: 35.213,
  fill: "#EBEEF0",
  rx: 2.953
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#EBEEF0",
  strokeWidth: 1.312,
  d: "M278.82 53.2588L184.982 53.2588"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#FFDED3",
  d: "M253.391 108.458C253.391 105.256 255.987 102.66 259.189 102.66H268.028C271.23 102.66 273.826 105.256 273.826 108.458C273.826 111.661 271.23 114.257 268.028 114.257H259.189C255.987 114.257 253.391 111.661 253.391 108.458Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 36.429,
  height: 6.244,
  x: 196.523,
  y: 109.796,
  fill: "#EBEEF0",
  rx: 3.122
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "audience-segmentation-introductory-graphic-mobile_svg__c",
  width: 132.402,
  height: 168.493,
  x: 55.449,
  y: 9.433,
  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_2898_16651"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_2898_16651",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "audience-segmentation-introductory-graphic-mobile_svg__d",
  width: 132.402,
  height: 168.493,
  x: 168.973,
  y: 9.433,
  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_2898_16651"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_2898_16651",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "audience-segmentation-introductory-graphic-mobile_svg__a"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  d: "M0 0H343V128H0z"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceSegmentationIntroductoryGraphicMobile);

/***/ },

/***/ "./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.2377 58.5712C57.1024 78.749 63.51 87.6695 79.7183 111.787C95.9266 135.905 50.6264 174.701 85.1932 213.055C119.02 250.587 154.612 213.064 196.507 208.5C225.95 205.292 254.326 221.48 287.367 214.4C320.407 207.32 333.752 171.801 330.52 146.341C324.93 102.3 304.28 97.2342 295.627 79.8799C286.973 62.5257 298.529 26.8826 265.34 6.71968C232.15 -13.4432 188.63 21.1392 152.837 19.0899C132.186 17.9076 111.905 14.0951 93.5734 19.9495C75.0428 25.8675 60.9112 42.521 59.2377 58.5712Z"
})), _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.1982L260.839 98.2422M260.839 98.2422L262.251 93.2563M260.839 98.2422L255.816 96.9716"
})), _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.1518 111.318L56.1958 115.963M56.1958 115.963L54.9253 110.939M56.1958 115.963L51.2099 117.374"
})), _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.0364L157.904 77.4685M157.904 77.4685L152.722 77.3955M157.904 77.4685L157.977 82.6498"
})), _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.2368 58.5712C57.1015 78.749 63.5091 87.6695 79.7173 111.787C95.9256 135.905 50.6255 174.701 85.1922 213.055C119.019 250.587 154.611 213.064 196.506 208.5C225.95 205.292 254.326 221.48 287.366 214.4C320.406 207.32 333.751 171.801 330.519 146.341C324.929 102.3 304.279 97.2342 295.626 79.8799C286.972 62.5257 298.528 26.8826 265.339 6.71968C232.149 -13.4432 188.629 21.1392 152.836 19.0899C132.185 17.9076 111.904 14.0951 93.5724 19.9495C75.0418 25.8675 60.9102 42.521 59.2368 58.5712Z"
}))), _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 238.986 100.555M218.925 98.8521 221.793 86.172M205.623 102.87 200.248 89.8334"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#3C7251",
  strokeLinejoin: "round",
  strokeWidth: 9.44,
  d: "M63.9531 190.487C80.0798 202.68 102.669 200.836 119.288 195.649C135.906 190.462 150.395 181.039 164.602 171.858C171.319 167.521 178.219 163.12 186.098 160.739C193.976 158.358 203.155 158.349 209.056 162.397C212.448 164.725 214.261 168.32 214.416 172.099"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#CBD0D3",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 9.44,
  d: "M215.831 109.67L196.662 181.4"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeMiterlimit: 10,
  strokeWidth: 9.44,
  d: "M213.975 116.472L194.806 188.203"
}))), _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 _path, _g, _g2, _g3, _g4, _g5, _g6, _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 SvgLogoG = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 25 25"
}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "logo-g_svg__a",
  width: 24,
  height: 25,
  x: 0,
  y: 0,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E94FFF",
  d: "M23.496 9.86411H12.146V14.5218H18.6265C18.3477 16.0283 17.5047 17.3132 16.2245 18.1711C15.1478 18.8949 13.7638 19.3164 12.146 19.3164C9.01307 19.3164 6.35559 17.201 5.406 14.348C5.16553 13.6228 5.03299 12.8525 5.03299 12.0548C5.03299 11.257 5.16553 10.4853 5.406 9.76149C6.35559 6.90994 9.01307 4.79317 12.146 4.79317C13.9154 4.79317 15.5003 5.40344 16.7505 6.5966L20.2005 3.14163C18.1155 1.19453 15.3938 0 12.146 0C7.44181 0 3.36882 2.7024 1.38766 6.64038C0.569237 8.27004 0.107422 10.1077 0.107422 12.0561C0.107422 14.0046 0.569237 15.8422 1.38766 17.4719C3.36882 21.4126 7.44181 24.1136 12.146 24.1136C15.3951 24.1136 18.1305 23.045 20.124 21.2033C22.3989 19.1043 23.7064 15.9996 23.7064 12.3312C23.7064 11.476 23.634 10.6523 23.496 9.86548V9.86411Z"
}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#logo-g_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-g_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#logo-g_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("foreignObject", {
  width: 3314.49,
  height: 3314.49,
  x: -1657.24,
  y: -1657.24,
  transform: "matrix(.0097 -.0097 .0097 .0097 11.78 11.807)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
  xmlns: "http://www.w3.org/1999/xhtml",
  style: {
    background: "conic-gradient(from 90deg,#ff4641 0deg,#ff4641 4.14555deg,#3186ff 39.154deg,#3186ff 72.0044deg,#00a5b7 96.7463deg,#0ebc5f 120.897deg,#0ebc5f 154.722deg,#6cc400 179.136deg,#fc0 203.588deg,#ffd314 226.915deg,#fc0 251.688deg,#ff6a2b 273.129deg,#fd4641 289.305deg,#ff4641 359.593deg,#ff4641 360deg)",
    height: "100%",
    width: "100%",
    opacity: 1
  }
})))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-g_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 12.223,
  cy: 12.348,
  fill: "#3186FF",
  rx: 6.506,
  ry: 3.419,
  transform: "rotate(24.447 12.223 12.348)"
}))), _g2 || (_g2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-g_svg__e)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 28.264,
  cy: 9.905,
  fill: "#3186FF",
  rx: 8.969,
  ry: 3.73
}))), _g3 || (_g3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-g_svg__f)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 18.524,
  cy: 7.499,
  fill: "#FF4641",
  rx: 8.932,
  ry: 2.867
}))), _g4 || (_g4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-g_svg__g)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 23.669,
  cy: 3.529,
  fill: "#FF5B8B",
  rx: 8.932,
  ry: 2.867
}))), _g5 || (_g5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-g_svg__h)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 17.568,
  cy: 11.91,
  fill: "#3186FF",
  rx: 10.256,
  ry: 3.749
}))), _g6 || (_g6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-g_svg__i)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 18.415,
  cy: 4.846,
  fill: "#FF4641",
  rx: 5.472,
  ry: 2.867,
  transform: "rotate(-28.66 18.415 4.846)"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-g_svg__b",
  width: 36.681,
  height: 36.722,
  x: -6.022,
  y: -6.554,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1533",
  stdDeviation: 1.412
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-g_svg__d",
  width: 13.505,
  height: 9.554,
  x: 5.471,
  y: 7.571,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1533",
  stdDeviation: 0.331
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-g_svg__e",
  width: 35.584,
  height: 25.104,
  x: 10.473,
  y: -2.647,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1533",
  stdDeviation: 4.411
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-g_svg__f",
  width: 205.334,
  height: 193.203,
  x: -84.143,
  y: -89.103,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1533",
  stdDeviation: 46.867
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-g_svg__g",
  width: 35.509,
  height: 23.378,
  x: 5.914,
  y: -8.16,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1533",
  stdDeviation: 4.411
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-g_svg__h",
  width: 22.475,
  height: 9.462,
  x: 6.331,
  y: 7.179,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1533",
  stdDeviation: 0.491
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-g_svg__i",
  width: 197.461,
  height: 194.74,
  x: -80.314,
  y: -92.524,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1533",
  stdDeviation: 46.867
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "logo-g_svg__c"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M-3.198 11.8068C-3.198 3.2263 3.74875 -3.72958 12.318 -3.72958C20.8872 -3.72958 27.834 3.22631 27.834 11.8068C27.834 20.3873 20.8872 27.3432 12.318 27.3432C3.74875 27.3432 -3.198 20.3873 -3.198 11.8068Z"
})))));
/* 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, _g, _g2, _g3, _g4, _g5, _g6, _path2, _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 SvgLogoSitekit = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 100 29"
}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "logo-sitekit_svg__a",
  width: 24,
  height: 26,
  x: 0,
  y: 1,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#E94FFF",
  d: "M23.496 11.8492H12.146V16.5069H18.6265C18.3477 18.0134 17.5047 19.2982 16.2245 20.1561C15.1478 20.88 13.7638 21.3014 12.146 21.3014C9.01307 21.3014 6.35559 19.186 5.406 16.3331C5.16553 15.6079 5.03299 14.8375 5.03299 14.0398C5.03299 13.2421 5.16553 12.4704 5.406 11.7465C6.35559 8.895 9.01307 6.77823 12.146 6.77823C13.9154 6.77823 15.5003 7.38849 16.7505 8.58166L20.2005 5.12669C18.1155 3.17959 15.3938 1.98506 12.146 1.98506C7.44181 1.98506 3.36882 4.68746 1.38766 8.62544C0.569237 10.2551 0.107422 12.0927 0.107422 14.0412C0.107422 15.9897 0.569237 17.8273 1.38766 19.4569C3.36882 23.3977 7.44181 26.0987 12.146 26.0987C15.3951 26.0987 18.1305 25.0301 20.124 23.1883C22.3989 21.0893 23.7064 17.9846 23.7064 14.3162C23.7064 13.461 23.634 12.6373 23.496 11.8505V11.8492Z"
}))), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#logo-sitekit_svg__a)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-sitekit_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  clipPath: "url(#logo-sitekit_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("foreignObject", {
  width: 3314.49,
  height: 3314.49,
  x: -1657.24,
  y: -1657.24,
  transform: "matrix(.0097 -.0097 .0097 .0097 11.78 13.792)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("div", {
  xmlns: "http://www.w3.org/1999/xhtml",
  style: {
    background: "conic-gradient(from 90deg,#ff4641 0deg,#ff4641 4.14555deg,#3186ff 39.154deg,#3186ff 72.0044deg,#00a5b7 96.7463deg,#0ebc5f 120.897deg,#0ebc5f 154.722deg,#6cc400 179.136deg,#fc0 203.588deg,#ffd314 226.915deg,#fc0 251.688deg,#ff6a2b 273.129deg,#fd4641 289.305deg,#ff4641 359.593deg,#ff4641 360deg)",
    height: "100%",
    width: "100%",
    opacity: 1
  }
})))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-sitekit_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 12.223,
  cy: 14.333,
  fill: "#3186FF",
  rx: 6.506,
  ry: 3.419,
  transform: "rotate(24.447 12.223 14.333)"
}))), _g2 || (_g2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-sitekit_svg__e)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 28.264,
  cy: 11.89,
  fill: "#3186FF",
  rx: 8.969,
  ry: 3.73
}))), _g3 || (_g3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-sitekit_svg__f)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 18.524,
  cy: 9.484,
  fill: "#FF4641",
  rx: 8.932,
  ry: 2.867
}))), _g4 || (_g4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-sitekit_svg__g)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 23.669,
  cy: 5.514,
  fill: "#FF5B8B",
  rx: 8.932,
  ry: 2.867
}))), _g5 || (_g5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-sitekit_svg__h)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 17.568,
  cy: 13.895,
  fill: "#3186FF",
  rx: 10.256,
  ry: 3.749
}))), _g6 || (_g6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#logo-sitekit_svg__i)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("ellipse", {
  cx: 18.415,
  cy: 6.831,
  fill: "#FF4641",
  rx: 5.472,
  ry: 2.867,
  transform: "rotate(-28.66 18.415 6.831)"
})))), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M37.5079 21.3541C36.7112 21.3541 35.9366 21.1918 35.1842 20.8672C34.4465 20.5279 33.7899 20.041 33.2145 19.4066C32.6538 18.7574 32.2481 17.9754 31.9973 17.0607L33.7899 16.3303C34.0407 17.2746 34.5055 18.0492 35.1842 18.6541C35.8628 19.259 36.6522 19.5615 37.5522 19.5615C38.4817 19.5615 39.2637 19.318 39.8981 18.8311C40.5325 18.3295 40.8497 17.6508 40.8497 16.7951C40.8497 16.0574 40.5768 15.4525 40.0309 14.9803C39.4997 14.4934 38.6219 14.0434 37.3973 13.6303L36.4014 13.2762C35.2801 12.8779 34.3653 12.3541 33.6571 11.7049C32.9489 11.0557 32.5948 10.1557 32.5948 9.00492C32.5948 8.25246 32.8014 7.55901 33.2145 6.92459C33.6276 6.27541 34.1956 5.75901 34.9186 5.37541C35.6563 4.9918 36.4825 4.8 37.3973 4.8C38.312 4.8 39.1087 4.96967 39.7874 5.30901C40.4809 5.64836 41.0268 6.06147 41.4251 6.54836C41.8383 7.03524 42.1186 7.51475 42.2661 7.98688L40.5178 8.73934C40.3555 8.17869 40.0161 7.68442 39.4997 7.25656C38.9833 6.81393 38.2973 6.59262 37.4415 6.59262C36.6301 6.59262 35.9366 6.82131 35.3612 7.27869C34.7858 7.73606 34.4981 8.31147 34.4981 9.00492C34.4981 9.62459 34.7415 10.1336 35.2284 10.532C35.7153 10.9156 36.453 11.277 37.4415 11.6164L38.4596 11.9705C39.8022 12.4574 40.8497 13.0697 41.6022 13.8074C42.3694 14.5303 42.753 15.5189 42.753 16.773C42.753 17.791 42.4874 18.6467 41.9563 19.3402C41.4399 20.0336 40.7833 20.5426 39.9866 20.8672C39.1899 21.1918 38.3637 21.3541 37.5079 21.3541ZM46.1965 7.72131C45.8276 7.72131 45.5104 7.58852 45.2448 7.32295C44.9793 7.05738 44.8465 6.74016 44.8465 6.37131C44.8465 6.00246 44.9793 5.68524 45.2448 5.41967C45.5104 5.1541 45.8276 5.02131 46.1965 5.02131C46.5653 5.02131 46.8825 5.1541 47.1481 5.41967C47.4137 5.68524 47.5465 6.00246 47.5465 6.37131C47.5465 6.74016 47.4137 7.05738 47.1481 7.32295C46.8973 7.58852 46.5801 7.72131 46.1965 7.72131ZM45.267 10.0229H47.126V21H45.267V10.0229ZM54.1582 21.177C53.7155 21.177 53.3024 21.1033 52.9188 20.9557C52.55 20.8082 52.2328 20.609 51.9672 20.3582C51.6721 20.0779 51.4508 19.7533 51.3032 19.3844C51.1705 19.0008 51.1041 18.5508 51.1041 18.0344V11.727H49.1565V10.0229H51.1041V6.74754H52.9631V10.0229H55.6631V11.727H52.9631V17.5697C52.9631 18.1893 53.0885 18.6467 53.3393 18.9418C53.5901 19.2664 53.9737 19.4287 54.4901 19.4287C54.9475 19.4287 55.3459 19.3254 55.6852 19.1189V20.9336C55.4491 21.0221 55.2205 21.0811 54.9991 21.1107C54.7926 21.1549 54.5123 21.177 54.1582 21.177ZM62.2568 21.3541C61.1945 21.3541 60.2428 21.1033 59.4019 20.6016C58.5756 20.1 57.9264 19.4066 57.4543 18.5213C56.9822 17.6361 56.7461 16.6328 56.7461 15.5115C56.7461 14.4492 56.9674 13.4754 57.4101 12.5902C57.8527 11.6902 58.4797 10.982 59.2912 10.4656C60.1174 9.93442 61.0617 9.66885 62.124 9.66885C63.1863 9.66885 64.1158 9.91229 64.9125 10.3992C65.724 10.8713 66.3437 11.5426 66.7715 12.4131C67.1994 13.2836 67.4133 14.2869 67.4133 15.423C67.4133 15.6295 67.3986 15.777 67.3691 15.8656H58.6494C58.6789 16.6918 58.8781 17.3926 59.2469 17.968C59.6158 18.5287 60.0732 18.9492 60.6191 19.2295C61.1797 19.5098 61.7551 19.65 62.3453 19.65C63.7322 19.65 64.8019 18.9713 65.5543 17.6139L67.2142 18.4107C66.742 19.2959 66.0855 20.0115 65.2445 20.5574C64.4183 21.0885 63.4224 21.3541 62.2568 21.3541ZM65.4215 14.2943C65.392 13.8516 65.2666 13.409 65.0453 12.9664C64.824 12.5238 64.4625 12.1475 63.9609 11.8377C63.474 11.5279 62.8469 11.3729 62.0797 11.3729C61.2535 11.3729 60.5379 11.6385 59.933 12.1697C59.3281 12.7008 58.9445 13.409 58.7822 14.2943H65.4215ZM75.0536 5.1541H76.9347V13.4975H77.0233L84.1716 5.1541H86.5618V5.24262L80.7192 12.0148L87.0044 20.9115V21H84.7028L79.4356 13.4533L76.9347 16.3525V21H75.0536V5.1541ZM89.5943 7.72131C89.2254 7.72131 88.9082 7.58852 88.6426 7.32295C88.3771 7.05738 88.2443 6.74016 88.2443 6.37131C88.2443 6.00246 88.3771 5.68524 88.6426 5.41967C88.9082 5.1541 89.2254 5.02131 89.5943 5.02131C89.9631 5.02131 90.2803 5.1541 90.5459 5.41967C90.8115 5.68524 90.9443 6.00246 90.9443 6.37131C90.9443 6.74016 90.8115 7.05738 90.5459 7.32295C90.2951 7.58852 89.9779 7.72131 89.5943 7.72131ZM88.6648 10.0229H90.5238V21H88.6648V10.0229ZM97.556 21.177C97.1133 21.177 96.7002 21.1033 96.3166 20.9557C95.9478 20.8082 95.6306 20.609 95.365 20.3582C95.0699 20.0779 94.8486 19.7533 94.701 19.3844C94.5683 19.0008 94.5019 18.5508 94.5019 18.0344V11.727H92.5543V10.0229H94.5019V6.74754H96.3609V10.0229H99.0609V11.727H96.3609V17.5697C96.3609 18.1893 96.4863 18.6467 96.7371 18.9418C96.9879 19.2664 97.3715 19.4287 97.8879 19.4287C98.3453 19.4287 98.7437 19.3254 99.083 19.1189V20.9336C98.8469 21.0221 98.6183 21.0811 98.3969 21.1107C98.1904 21.1549 97.9101 21.177 97.556 21.177Z"
})), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-sitekit_svg__b",
  width: 36.681,
  height: 36.722,
  x: -6.022,
  y: -4.569,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1531",
  stdDeviation: 1.412
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-sitekit_svg__d",
  width: 13.505,
  height: 9.554,
  x: 5.471,
  y: 9.556,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1531",
  stdDeviation: 0.331
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-sitekit_svg__e",
  width: 35.584,
  height: 25.104,
  x: 10.473,
  y: -0.662,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1531",
  stdDeviation: 4.411
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-sitekit_svg__f",
  width: 205.334,
  height: 193.203,
  x: -84.143,
  y: -87.118,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1531",
  stdDeviation: 46.867
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-sitekit_svg__g",
  width: 35.509,
  height: 23.378,
  x: 5.914,
  y: -6.175,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1531",
  stdDeviation: 4.411
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-sitekit_svg__h",
  width: 22.475,
  height: 9.462,
  x: 6.331,
  y: 9.164,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1531",
  stdDeviation: 0.491
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "logo-sitekit_svg__i",
  width: 197.461,
  height: 194.74,
  x: -80.314,
  y: -90.539,
  colorInterpolationFilters: "sRGB",
  filterUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feFlood", {
  floodOpacity: 0,
  result: "BackgroundImageFix"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "BackgroundImageFix",
  result: "shape"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  result: "effect1_foregroundBlur_4313_1531",
  stdDeviation: 46.867
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("clipPath", {
  id: "logo-sitekit_svg__c"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M-3.198 13.7919C-3.198 5.21136 3.74875 -1.74452 12.318 -1.74452C20.8872 -1.74452 27.834 5.21136 27.834 13.7919C27.834 22.3724 20.8872 29.3283 12.318 29.3283C3.74875 29.3283 -3.198 22.3724 -3.198 13.7919Z"
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgLogoSitekit);

/***/ },

/***/ "./svg/graphics/no-audience-banner-graphic.svg"
/*!*****************************************************!*\
  !*** ./svg/graphics/no-audience-banner-graphic.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, _path4, _path5, _path6, _path7, _path8, _path9, _path0, _path1, _path10, _path11, _path12, _path13, _path14, _path15, _path16, _path17, _path18, _path19, _path20, _path21, _path22, _path23, _path24, _path25, _path26, _path27, _path28, _path29, _path30, _path31, _path32, _path33, _path34, _path35, _path36, _path37, _path38, _path39, _path40, _path41, _path42, _path43, _path44, _path45, _path46, _path47, _path48, _path49, _path50, _path51, _path52, _path53, _path54, _path55, _path56, _path57, _path58, _path59, _path60, _path61, _path62, _path63, _path64, _path65, _path66, _path67, _path68;
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 SvgNoAudienceBannerGraphic = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 211 109"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8E6CA",
  d: "M2.67451 72.3093C4.02515 75.5342 5.94816 78.4945 8.35281 81.0505C17.8042 91.0051 31.7689 91.8488 44.5764 89.3582C57.5439 86.8195 69.7695 81.4364 80.3516 73.6059C86.4411 69.0931 92.4562 63.4927 100.519 63.2431C103.546 63.1502 106.677 63.9842 108.964 65.9523C113.717 70.0162 113.632 76.9654 117.341 81.782C122.273 88.1874 129.367 90.171 137.105 90.9102C158.967 92.9963 185.007 86.1516 200.044 69.4975C213.47 54.6296 215.082 30.9721 198.83 17.4181C191.405 11.2256 181.224 8.38863 171.614 9.8342C164.269 10.9392 156.813 14.3006 149.21 15.2353C140.256 16.3383 134.72 12.5763 127.476 8.19511C114.852 0.580204 98.1638 -2.34578 83.8741 2.07222C70.1953 6.30058 60.3503 17.8458 47.0396 22.9179C35.5381 27.303 21.9513 26.6354 11.9575 33.7781C0.132987 42.2271 -2.83931 59.2856 2.67451 72.3093Z"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#161B18",
  d: "M108.273 109C162.885 109 207.156 107.265 207.156 105.126C207.156 102.986 162.885 101.251 108.273 101.251C53.6619 101.251 9.39062 102.986 9.39062 105.126C9.39062 107.265 53.6619 109 108.273 109Z",
  opacity: 0.1,
  style: {
    mixBlendMode: "multiply"
  }
}), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M108.273 109C162.885 109 207.156 107.265 207.156 105.126C207.156 102.986 162.885 101.251 108.273 101.251C53.6619 101.251 9.39062 102.986 9.39062 105.126C9.39062 107.265 53.6619 109 108.273 109Z"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.472,
  d: "M134.765 53.2251C133.7 70.1521 127.829 85.3374 131.753 104.418H127.285M139.814 104.418H135.344L143.244 53.2251"
})), _path4 || (_path4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M120.504 36.6514C116.69 38.3801 109.369 42.2311 109.369 50.0493M147.266 35.7871C150.759 37.5742 158.326 43.4645 159.243 49.0116"
})), _path5 || (_path5 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#77AD8C",
  d: "M151.555 75.9518L148.453 76.2344L129.527 77.9528L118.464 78.9552L117.415 54.2198L115.59 11.1738L150.118 9.91211L150.815 41.9702L150.909 46.2856L151.551 75.8512L151.555 75.9518Z"
})), _path6 || (_path6 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#5C9271",
  d: "M148.453 76.2343L150.233 76.0718L151.556 75.9518L150.117 9.91016L148.134 10.0011L149.415 73.2005L124.439 75.3284L125.301 56.1772L117.457 55.1042L118.317 75.5416L118.424 78.007L118.465 78.9533L129.528 77.9509L148.455 76.2324L148.453 76.2343Z"
})), _path7 || (_path7 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M135.891 70.7522C135.923 71.6679 135.499 50.5552 135.262 43.7083C128.634 40.7005 121.465 40.1491 114.592 42.4801L115.22 69.523C122.094 67.1929 129.263 67.7444 135.891 70.7522Z"
})), _path8 || (_path8 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M135.926 70.7517C135.936 71.6679 135.379 50.5583 135.297 43.7079C141.778 40.4023 148.914 39.5259 155.889 41.5424L156.518 68.5853C149.543 66.5698 142.407 67.4461 135.926 70.7517Z"
})), _path9 || (_path9 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M133.233 60.7961C133.15 56.8886 133.031 51.4978 132.9 45.8352L133.096 45.8307C133.228 51.4935 133.346 56.8844 133.43 60.792 133.472 62.7459 133.505 64.3289 133.526 65.3896 133.537 65.92 133.544 66.3199 133.549 66.5703 133.551 66.6954 133.553 66.7835 133.553 66.8318 133.554 66.8544 133.554 66.8715 133.553 66.8783 133.553 66.8791 133.553 66.8806 133.553 66.8816 133.553 66.8831 133.553 66.8871 133.552 66.8898 133.551 66.8973 133.515 66.9532 133.459 66.9731 133.4 66.9565 133.36 66.9014 133.359 66.8939 133.358 66.8912 133.358 66.8871 133.357 66.8857 133.357 66.8847 133.357 66.8832 133.357 66.8824 133.357 66.8813 133.357 66.8803 133.357 66.8794L133.357 66.8783C133.357 66.874 133.356 66.8672 133.356 66.8588L133.357 66.8588C133.357 66.8524 133.357 66.8443 133.357 66.8342 133.356 66.7865 133.355 66.6989 133.353 66.5738 133.348 66.3236 133.34 65.9239 133.33 65.3935 133.308 64.3328 133.275 62.7499 133.233 60.7961ZM133.359 66.8587C133.366 66.8444 133.401 66.797 133.452 66.779 133.502 66.7933 133.539 66.8361 133.549 66.8524L133.359 66.8587ZM133.553 66.8694C133.553 66.8694 133.553 66.869 133.553 66.8678 133.553 66.8688 133.553 66.8693 133.553 66.8694ZM130.917 60.0069C130.833 56.0946 130.714 50.7169 130.583 45.096L130.78 45.0916C130.91 50.7125 131.029 56.0903 131.114 60.0028 131.156 61.959 131.19 63.549 131.212 64.6198 131.223 65.1552 131.231 65.5609 131.236 65.8177 131.238 65.9461 131.24 66.0374 131.24 66.0892 131.241 66.1144 131.241 66.1317 131.241 66.1389 131.241 66.1399 131.241 66.1414 131.241 66.143 131.241 66.1439 131.241 66.146 131.241 66.1473 131.24 66.1499 131.239 66.1602 131.237 66.1679 131.183 66.229 131.067 66.2025 131.048 66.1651 131.046 66.1599 131.045 66.1526 131.045 66.1505 131.045 66.1478 131.044 66.1454 131.044 66.1446L131.044 66.1446C131.044 66.1407 131.044 66.1345 131.044 66.1273L131.044 66.1272C131.044 66.1197 131.044 66.108 131.044 66.092 131.043 66.0407 131.042 65.9497 131.039 65.8213 131.034 65.5647 131.026 65.1591 131.015 64.6237 130.993 63.553 130.96 61.9631 130.917 60.0069ZM131.046 66.1272 131.239 66.1209C131.238 66.119 131.238 66.1171 131.238 66.1154 131.218 66.0781 131.103 66.0516 131.048 66.1126 131.047 66.1173 131.046 66.123 131.046 66.1272ZM128.613 59.4011C128.527 55.4784 128.407 50.1163 128.278 44.5668L128.475 44.5624C128.604 50.1119 128.724 55.4742 128.809 59.3969 128.852 61.3583 128.887 62.9598 128.909 64.045 128.921 64.5875 128.929 65.0011 128.934 65.266 128.937 65.3984 128.938 65.4938 128.939 65.5496 128.94 65.5772 128.94 65.5959 128.94 65.6046L128.94 65.6046C128.94 65.6062 128.94 65.6096 128.94 65.6126 128.94 65.6139 128.94 65.6171 128.939 65.6193 128.939 65.6254 128.904 65.6842 128.845 65.706 128.784 65.6873 128.746 65.6296 128.745 65.6235 128.744 65.6213 128.744 65.618 128.744 65.6168 128.743 65.6123 128.743 65.6053 128.743 65.6001L128.743 65.6001 128.744 65.6C128.744 65.5915 128.743 65.5758 128.743 65.5526 128.742 65.4972 128.74 65.4021 128.738 65.2697 128.733 65.0049 128.724 64.5915 128.713 64.049 128.69 62.9639 128.656 61.3624 128.613 59.4011ZM128.744 65.6 128.939 65.5934C128.935 65.5847 128.898 65.5299 128.839 65.5118 128.78 65.5335 128.745 65.5922 128.744 65.5982 128.744 65.5988 128.744 65.5994 128.744 65.6ZM126.303 58.9765C126.216 55.0392 126.096 49.6931 125.969 44.233L126.165 44.2285C126.292 49.6887 126.413 55.0349 126.5 58.9723 126.543 60.941 126.579 62.5575 126.602 63.66 126.614 64.2113 126.623 64.6341 126.628 64.9081 126.631 65.0451 126.633 65.145 126.634 65.2053 126.635 65.2353 126.635 65.2558 126.635 65.2662 126.635 65.2688 126.635 65.2712 126.635 65.2731 126.635 65.2738 126.635 65.2757 126.635 65.2777 126.635 65.2791 126.635 65.2837 126.634 65.287 126.629 65.3069 126.525 65.3706 126.443 65.3039 126.441 65.296 126.439 65.2857 126.439 65.2834 126.439 65.2823 126.439 65.2806 126.439 65.2798 126.439 65.2792 126.439 65.2786 126.439 65.278 126.439 65.2773 126.439 65.2767 126.439 65.2763 126.439 65.2743 126.438 65.2718 126.438 65.2689L126.439 65.2689 126.439 65.2679C126.439 65.2585 126.438 65.2388 126.438 65.2087 126.437 65.1487 126.435 65.049 126.432 64.912 126.426 64.6381 126.418 64.2154 126.406 63.6641 126.382 62.5617 126.347 60.9452 126.303 58.9765ZM126.439 65.2689 126.634 65.2623C126.634 65.2584 126.632 65.2507 126.63 65.2443 126.549 65.1777 126.444 65.2414 126.44 65.2612 126.439 65.2638 126.439 65.2671 126.439 65.2689ZM126.635 65.2674 126.635 65.2671C126.635 65.2677 126.635 65.2679 126.635 65.2674ZM124.002 58.7305C123.914 54.7718 123.793 49.4378 123.668 44.0773L123.864 44.0728C123.989 49.4335 124.11 54.7675 124.198 58.7262 124.243 60.7056 124.279 62.3412 124.303 63.4644 124.316 64.026 124.325 64.4595 124.331 64.7438 124.334 64.886 124.336 64.991 124.337 65.056 124.338 65.0884 124.338 65.1112 124.339 65.1236L124.339 65.1243C124.339 65.1288 124.339 65.1351 124.339 65.1387 124.338 65.1404 124.338 65.1477 124.337 65.1534 124.257 65.2315 124.147 65.1672 124.143 65.1492 124.143 65.1466 124.142 65.1431 124.142 65.142L124.142 65.1398C124.142 65.138 124.142 65.1357 124.142 65.1335L124.338 65.127C124.338 65.1256 124.338 65.1237 124.338 65.1222 124.333 65.1042 124.224 65.04 124.144 65.118 124.143 65.1236 124.142 65.1308 124.142 65.1323 124.142 65.1329 124.142 65.1334 124.142 65.1334 124.142 65.1334 124.142 65.1315 124.142 65.1263 124.142 65.1144 124.142 65.0922 124.141 65.0597 124.14 64.9948 124.138 64.89 124.135 64.7479 124.129 64.4636 124.119 64.0301 124.107 63.4685 124.082 62.3454 124.046 60.7099 124.002 58.7305ZM121.709 58.6977C121.619 54.7278 121.498 49.417 121.376 44.1574L121.572 44.153C121.695 49.4126 121.816 54.7235 121.905 58.6934 121.95 60.6783 121.987 62.3281 122.012 63.4685 122.025 64.0387 122.034 64.4816 122.041 64.7754 122.044 64.9224 122.046 65.0321 122.047 65.1018 122.048 65.1366 122.049 65.1616 122.049 65.1763 122.049 65.1833 122.049 65.1888 122.049 65.1919 122.049 65.1921 122.049 65.1945 122.049 65.1971 122.049 65.1999 122.042 65.2296 122.028 65.2535 121.927 65.2873 121.854 65.2072 121.853 65.2026 121.853 65.2012 121.853 65.1991 121.853 65.1983L121.853 65.1965 121.852 65.1935 122.049 65.1864C122.049 65.1855 122.049 65.1843 122.048 65.1831 122.048 65.1786 121.974 65.0986 121.874 65.1324 121.86 65.1563 121.853 65.1859 121.853 65.1885 121.853 65.1908 121.853 65.1924 121.853 65.1917 121.853 65.1906 121.853 65.1869 121.852 65.1794 121.852 65.1651 121.852 65.1404 121.851 65.1056 121.85 65.036 121.847 64.9264 121.844 64.7795 121.838 64.4858 121.828 64.0429 121.816 63.4727 121.79 62.3323 121.754 60.6826 121.709 58.6977ZM119.414 58.8545C119.323 54.8685 119.202 49.5749 119.082 44.4149L119.278 44.4104C119.398 49.5704 119.52 54.8641 119.611 58.8501 119.656 60.8431 119.694 62.5092 119.72 63.6683 119.733 64.2478 119.743 64.7006 119.75 65.0041 119.753 65.1558 119.756 65.2703 119.758 65.3446 119.758 65.3817 119.759 65.4089 119.759 65.4257L119.76 65.4432 119.76 65.4434C119.76 65.4443 119.76 65.4469 119.76 65.4488 119.76 65.4528 119.662 65.5448 119.564 65.458 119.564 65.4554 119.563 65.4522 119.563 65.4515L119.563 65.4492 119.76 65.4434C119.76 65.4428 119.759 65.4398 119.759 65.4373 119.661 65.3505 119.563 65.4425 119.563 65.4464 119.563 65.4473 119.563 65.4481 119.563 65.4481L119.563 65.4466 119.563 65.4296C119.563 65.413 119.562 65.3859 119.561 65.3488 119.56 65.2745 119.557 65.1601 119.554 65.0084 119.547 64.7049 119.537 64.2521 119.524 63.6726 119.498 62.5136 119.46 60.8475 119.414 58.8545ZM116.797 44.873 116.993 44.8686 117.482 65.9024C117.479 65.9024 117.476 65.9025 117.472 65.9026 117.446 65.9032 117.372 65.9049 117.296 65.9066 117.293 65.9067 117.289 65.9068 117.286 65.9068L116.797 44.873Z",
  clipRule: "evenodd"
})), _path0 || (_path0 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M133.317 67.2208C128.164 65.3593 122.754 64.9828 117.467 66.2812 117.257 66.3328 117.044 66.2058 116.992 65.9974 116.94 65.7891 117.068 65.5784 117.279 65.5268 122.726 64.1888 128.295 64.5795 133.585 66.4905 133.788 66.5639 133.893 66.787 133.819 66.9887 133.745 67.1903 133.52 67.2942 133.317 67.2208ZM133.267 64.2221C128.108 62.355 122.693 61.9767 117.401 63.2762 117.191 63.3278 116.978 63.2007 116.926 62.9924 116.874 62.7841 117.002 62.5734 117.212 62.5218 122.666 61.1827 128.239 61.5752 133.535 63.492 133.739 63.5656 133.843 63.7887 133.769 63.9903 133.695 64.1919 133.47 64.2957 133.267 64.2221ZM133.204 61.2166C128.042 59.3504 122.628 58.9722 117.338 60.2707 117.128 60.3223 116.916 60.1952 116.863 59.9868 116.811 59.7785 116.94 59.5678 117.15 59.5162 122.6 58.1782 128.173 58.5707 133.473 60.4864 133.676 60.5599 133.781 60.7829 133.707 60.9846 133.633 61.1862 133.408 61.2901 133.204 61.2166ZM133.134 58.2117C127.971 56.3456 122.558 55.9673 117.268 57.2658 117.058 57.3174 116.845 57.1903 116.793 56.982 116.741 56.7736 116.869 56.5629 117.079 56.5113 122.53 55.1733 128.103 55.5659 133.402 57.4815 133.606 57.555 133.711 57.778 133.636 57.9797 133.562 58.1813 133.337 58.2852 133.134 58.2117ZM133.071 55.213C127.908 53.3412 122.487 52.9611 117.19 54.2627 116.98 54.3143 116.767 54.1873 116.715 53.9789 116.663 53.7706 116.791 53.5599 117.001 53.5083 122.46 52.1671 128.039 52.5615 133.34 54.483 133.544 54.5567 133.648 54.7799 133.574 54.9814 133.5 55.183 133.275 55.2867 133.071 55.213ZM133.001 52.2084C127.837 50.3375 122.417 49.9565 117.119 51.2581 116.909 51.3097 116.697 51.1826 116.645 50.9743 116.593 50.766 116.721 50.5553 116.931 50.5036 122.389 49.1625 127.969 49.5578 133.27 51.4784 133.473 51.552 133.578 51.7752 133.504 51.9768 133.429 52.1783 133.204 52.2821 133.001 52.2084Z",
  clipRule: "evenodd"
})), _path1 || (_path1 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  d: "M116.886 44.8706C122.264 43.5492 127.764 43.9364 132.996 45.8331L133.05 48.8319C127.823 46.9409 122.329 46.5555 116.956 47.8748L116.886 44.8706Z"
})), _path10 || (_path10 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M117.284 45.1755L117.335 47.3862C122.453 46.225 127.666 46.5799 132.647 48.2791L132.608 46.1086C127.619 44.35 122.398 43.9822 117.284 45.1755ZM116.79 44.4941C122.249 43.1529 127.828 43.5473 133.129 45.4689L133.382 45.5604L133.451 49.3917L132.915 49.1977C127.756 47.3315 122.341 46.9532 117.049 48.2528L116.574 48.3694L116.485 44.569L116.79 44.4941Z",
  clipRule: "evenodd"
})), _path11 || (_path11 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  fillRule: "evenodd",
  d: "M137.87 60.6916C137.771 56.7843 137.639 51.3937 137.508 45.731L137.704 45.7265C137.836 51.3891 137.968 56.7796 138.066 60.6868 138.115 62.6404 138.156 64.2232 138.184 65.2837 138.198 65.8139 138.209 66.2136 138.216 66.4637 138.219 66.5889 138.222 66.6764 138.224 66.7241 138.224 66.7341 138.224 66.7423 138.224 66.7487L138.225 66.7486C138.226 66.757 138.226 66.7638 138.226 66.7681 138.226 66.7693 138.226 66.7707 138.225 66.7722L138.225 66.7734C138.225 66.7741 138.225 66.7749 138.225 66.7755 138.225 66.777 138.225 66.7811 138.225 66.7838 138.223 66.7914 138.186 66.8482 138.128 66.8675 138.071 66.8501 138.032 66.7959 138.031 66.7885 138.03 66.7858 138.03 66.7818 138.029 66.7803 138.029 66.7794 138.029 66.7778 138.029 66.7771 138.029 66.7703 138.028 66.7531 138.027 66.7306 138.026 66.6823 138.023 66.5943 138.019 66.4692 138.012 66.2188 138.001 65.819 137.987 65.2887 137.959 64.2281 137.919 62.6453 137.87 60.6916ZM138.222 66.7487C138.214 66.7347 138.178 66.689 138.126 66.6732 138.076 66.6899 138.042 66.7342 138.033 66.751L138.222 66.7487ZM138.029 66.7666C138.029 66.7677 138.029 66.7682 138.029 66.7681 138.029 66.7681 138.029 66.7675 138.029 66.7666ZM140.148 59.7979C140.05 55.8857 139.92 50.5082 139.789 44.8872L139.985 44.8827C140.116 50.5036 140.247 55.881 140.344 59.7931 140.393 61.7492 140.433 63.3389 140.461 64.4095 140.474 64.9448 140.485 65.3503 140.492 65.6069 140.496 65.7353 140.498 65.8262 140.5 65.8775 140.501 65.8935 140.501 65.9051 140.501 65.9127L140.502 65.9127C140.502 65.9199 140.502 65.9262 140.502 65.93 140.502 65.9307 140.502 65.9332 140.502 65.936 140.502 65.938 140.501 65.9453 140.5 65.9506 140.482 65.9887 140.368 66.0206 140.311 65.9619 140.309 65.9543 140.307 65.9441 140.306 65.9416 140.306 65.9403 140.306 65.9382 140.306 65.9373 140.306 65.9357 140.306 65.9342 140.306 65.9332 140.305 65.9261 140.305 65.9088 140.304 65.8836 140.302 65.8318 140.299 65.7405 140.296 65.6122 140.289 65.3554 140.278 64.9498 140.264 64.4144 140.237 63.3437 140.196 61.754 140.148 59.7979ZM140.5 65.9127C140.499 65.9086 140.498 65.9031 140.497 65.8985 140.44 65.8398 140.325 65.8717 140.308 65.9098 140.307 65.9115 140.307 65.9134 140.307 65.9152L140.5 65.9127ZM142.426 59.0875C142.329 55.165 142.199 49.803 142.07 44.2534L142.267 44.249C142.396 49.7984 142.525 55.1603 142.622 59.0828 142.67 61.044 142.711 62.6453 142.738 63.7303 142.752 64.2728 142.763 64.6861 142.77 64.9508 142.774 65.0832 142.776 65.1783 142.778 65.2337 142.779 65.2569 142.779 65.2725 142.78 65.2811L142.78 65.2811 142.78 65.2811C142.78 65.2863 142.78 65.2934 142.78 65.2979 142.78 65.2991 142.78 65.3024 142.78 65.3045 142.779 65.3107 142.744 65.3701 142.684 65.3915 142.624 65.3725 142.586 65.3153 142.585 65.3092 142.585 65.307 142.584 65.3038 142.584 65.3026 142.584 65.2995 142.584 65.2961 142.584 65.2946L142.584 65.2945C142.583 65.2859 142.583 65.2671 142.582 65.2396 142.58 65.1838 142.577 65.0884 142.574 64.956 142.567 64.6912 142.556 64.2777 142.542 63.7352 142.514 62.6501 142.474 61.0487 142.426 59.0875ZM142.779 65.2811C142.779 65.2805 142.779 65.2798 142.779 65.2793 142.778 65.2734 142.74 65.2163 142.68 65.1972 142.622 65.218 142.587 65.2744 142.585 65.2833L142.779 65.2811ZM144.711 58.5588C144.615 54.6216 144.486 49.2756 144.359 43.8154L144.556 43.811C144.683 49.2711 144.811 54.617 144.907 58.5541 144.955 60.5227 144.995 62.1391 145.022 63.2415 145.036 63.7927 145.047 64.2153 145.054 64.4892 145.058 64.6262 145.061 64.7259 145.062 64.7858 145.063 64.816 145.064 64.8356 145.064 64.845L145.064 64.8461 145.065 64.8461C145.065 64.8489 145.065 64.8514 145.065 64.8534 145.065 64.8539 145.065 64.8545 145.065 64.8551 145.065 64.8557 145.065 64.8563 145.065 64.857 145.065 64.8577 145.064 64.8595 145.064 64.8606 145.064 64.8629 145.063 64.8732 145.061 64.8813 144.983 64.9515 144.875 64.8927 144.87 64.873 144.869 64.8697 144.869 64.8652 144.868 64.8637 144.868 64.8617 144.868 64.8599 144.868 64.8592 144.868 64.8573 144.868 64.8548 144.868 64.8523 144.867 64.8419 144.867 64.8213 144.866 64.7914 144.864 64.7311 144.862 64.6312 144.858 64.4942 144.851 64.2202 144.84 63.7975 144.826 63.2463 144.798 62.1439 144.759 60.5274 144.711 58.5588ZM145.064 64.8461C145.064 64.8443 145.063 64.8409 145.063 64.8384 145.057 64.8188 144.95 64.76 144.872 64.8302 144.87 64.8366 144.869 64.8444 144.868 64.8484L145.064 64.8461ZM144.868 64.8535C144.868 64.854 144.868 64.8538 144.868 64.8532L144.868 64.8535Z",
  clipRule: "evenodd"
})), _path12 || (_path12 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M137.979 66.3912C143.174 64.2421 148.719 63.599 154.223 64.6882 154.436 64.7302 154.573 64.9349 154.531 65.1453 154.489 65.3558 154.282 65.4924 154.07 65.4504 148.728 64.3933 143.342 65.0151 138.281 67.1086 138.081 67.1912 137.852 67.0976 137.768 66.8995 137.685 66.7014 137.779 66.4739 137.979 66.3912ZM137.889 63.3931C143.09 61.2379 148.64 60.5928 154.15 61.6828 154.362 61.7248 154.5 61.9295 154.458 62.1399 154.415 62.3504 154.209 62.487 153.997 62.445 148.649 61.3871 143.258 62.0109 138.191 64.1103 137.992 64.193 137.762 64.0996 137.679 63.9015 137.595 63.7035 137.689 63.4759 137.889 63.3931ZM137.823 60.3885C143.023 58.2344 148.572 57.5892 154.079 58.6783 154.291 58.7203 154.429 58.925 154.386 59.1355 154.344 59.3459 154.138 59.4825 153.926 59.4406 148.581 58.3836 143.191 59.0073 138.125 61.1057 137.925 61.1884 137.696 61.095 137.612 60.8969 137.529 60.6989 137.623 60.4713 137.823 60.3885ZM137.749 57.3832C142.949 55.229 148.497 54.5838 154.005 55.673 154.217 55.7149 154.355 55.9196 154.312 56.1301 154.27 56.3406 154.064 56.4772 153.851 56.4352 148.507 55.3782 143.116 56.0019 138.051 58.1003 137.851 58.1831 137.622 58.0896 137.538 57.8915 137.455 57.6935 137.549 57.4659 137.749 57.3832ZM137.663 54.385C142.869 52.2248 148.424 51.5775 153.939 52.6694 154.152 52.7114 154.289 52.9161 154.247 53.1266 154.205 53.3371 153.998 53.4736 153.786 53.4316 148.434 52.3719 143.036 52.9977 137.965 55.102 137.766 55.1849 137.536 55.0915 137.452 54.8935 137.369 54.6955 137.463 54.4679 137.663 54.385ZM137.596 51.3799C142.802 49.2207 148.358 48.5724 153.873 49.6643 154.085 49.7063 154.223 49.911 154.181 50.1215 154.138 50.332 153.932 50.4685 153.719 50.4265 148.367 49.3668 142.97 49.9936 137.899 52.0969 137.699 52.1797 137.469 52.0864 137.386 51.8883 137.302 51.6903 137.397 51.4627 137.596 51.3799ZM137.542 48.3682C142.743 46.2141 148.293 45.5689 153.802 46.6589 154.015 46.7009 154.152 46.9056 154.11 47.1161 154.068 47.3266 153.861 47.4631 153.649 47.4211 148.303 46.3632 142.91 46.987 137.844 49.0855 137.644 49.1682 137.414 49.0747 137.331 48.8766 137.248 48.6786 137.342 48.451 137.542 48.3682ZM137.456 45.3699C142.662 43.2097 148.217 42.5624 153.732 43.6543 153.944 43.6963 154.082 43.901 154.04 44.1115 153.998 44.3219 153.791 44.4585 153.579 44.4165 148.226 43.3568 142.829 43.9826 137.758 46.0869 137.559 46.1697 137.329 46.0764 137.245 45.8784 137.162 45.6804 137.256 45.4527 137.456 45.3699Z",
  clipRule: "evenodd"
})), _path13 || (_path13 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M137.608 45.7287C142.747 43.5964 148.226 42.9608 153.657 44.0357L153.867 53.0503C148.433 51.9745 142.957 52.6111 137.818 54.7433L137.608 45.7287Z"
})), _path14 || (_path14 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M138.005 45.9859L138.195 54.1703C143.096 52.2421 148.292 51.6494 153.462 52.5784L153.271 44.3575C148.109 43.3984 142.907 44.0023 138.005 45.9859ZM137.455 45.3699C142.661 43.2097 148.22 42.5634 153.732 43.6543C153.912 43.69 154.043 43.8446 154.047 44.0265L154.257 53.0412C154.26 53.1591 154.208 53.2719 154.117 53.3477C154.026 53.4236 153.905 53.4543 153.788 53.4312C148.436 52.3715 143.039 52.9973 137.968 55.1016C137.848 55.1512 137.712 55.139 137.603 55.069C137.494 54.9991 137.428 54.8804 137.425 54.752L137.215 45.7373C137.211 45.5775 137.307 45.4317 137.455 45.3699Z",
  clipRule: "evenodd"
})), _path15 || (_path15 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M159.24 49.0112C160.001 53.6144 155.123 56.517 151.754 55.4448M109.37 50.0498C109.371 54.6001 114.529 57.8807 118.208 56.2761"
})), _path16 || (_path16 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.472,
  d: "M31.7574 63.3262L26.5823 77.0659C26.3839 77.5923 26.2057 78.1231 26.0477 78.6585C24.3619 84.377 25.1294 90.5308 27.9098 95.8139L32.5876 104.412H28.1154"
})), _path17 || (_path17 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 1.472,
  d: "M39.9883 67.1963L40.7558 104.417"
})), _path18 || (_path18 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#1967D2",
  strokeLinejoin: "round",
  strokeWidth: 2.748,
  d: "M31.7571 63.3262C30.8943 64.9946 30.2048 66.7452 29.6992 68.5511"
})), _path19 || (_path19 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M47.8008 52.6421C52.5375 54.8031 57.5104 57.1715 58.5656 63.8791M13.7812 61.7183C11.2237 65.3372 6.79478 70.9427 8.74196 76.4382"
})), _path20 || (_path20 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#70B2F5",
  d: "M1.53516 51.3145L54.3394 35.3164C54.3394 35.3164 59.4459 64.731 32.2998 70.2656C32.29 70.2656 13.7376 74.4514 1.53516 51.3145Z"
})), _path21 || (_path21 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#77AD8C",
  d: "M1.53516 51.3145L54.3394 35.3164C54.3394 35.3164 59.4459 64.731 32.2998 70.2656C32.29 70.2656 13.7376 74.4514 1.53516 51.3145Z"
})), _path22 || (_path22 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#5C9271",
  d: "M33.8564 67.5568C33.8564 67.5568 16.3535 71.5026 4.16284 50.5195L1.53516 51.3149C13.7376 74.4518 32.29 70.266 32.29 70.266C42.6186 68.1606 48.2754 62.5969 51.3221 56.5128C48.0247 61.4881 42.6264 65.7687 33.8564 67.5568Z"
})), _path23 || (_path23 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.472,
  d: "M45.2202 104.418H40.75"
})), _path24 || (_path24 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M38.0953 85.8018C38.2672 86.6632 34.6014 66.753 33.3188 60.3111C26.5829 58.4665 19.7152 59.0275 13.5727 62.271L18.349 87.7607C24.4917 84.5182 31.3594 83.9572 38.0953 85.8018Z"
})), _path25 || (_path25 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M38.129 85.7956C38.2806 86.6608 34.4892 66.7736 33.3525 60.3049C38.9734 56.1987 45.5889 54.2919 52.4993 55.1462L57.2755 80.636C50.3653 79.7825 43.7498 81.6893 38.129 85.7956Z"
})), _path26 || (_path26 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M34.0424 76.7843C33.3592 73.1 32.4134 68.0178 31.4133 62.6805L31.5979 62.6467C32.5981 67.9842 33.5439 73.0665 34.2271 76.7508 34.5687 78.593 34.8446 80.0856 35.0289 81.086 35.121 81.5861 35.1902 81.9633 35.2332 82.1995 35.2547 82.3175 35.2696 82.4006 35.2777 82.4463 35.2814 82.4675 35.2842 82.4838 35.2851 82.4902 35.2852 82.4909 35.2853 82.4924 35.2854 82.4933 35.2856 82.4947 35.2858 82.4986 35.2859 82.5012 35.2857 82.5085 35.2603 82.5668 35.2103 82.5942 35.1524 82.5872 35.1064 82.5412 35.1036 82.5343 35.1028 82.5318 35.1016 82.5281 35.1012 82.5267 35.101 82.5258 35.1006 82.5244 35.1004 82.5236 35.1002 82.5227 35.1 82.5217 35.0998 82.5209L35.0995 82.5198C35.0986 82.5157 35.0973 82.5094 35.0958 82.5015L35.0967 82.5013C35.0957 82.4953 35.0944 82.4876 35.0927 82.4781 35.0847 82.433 35.0698 82.3504 35.0483 82.2324 35.0054 81.9963 34.9362 81.6193 34.8441 81.1192 34.6599 80.119 34.384 78.6264 34.0424 76.7843ZM35.0989 82.5009C35.1034 82.4863 35.1285 82.4363 35.1737 82.4115 35.2235 82.4175 35.2645 82.4525 35.2767 82.4664L35.0989 82.5009ZM35.2834 82.4818C35.2834 82.4819 35.2833 82.4814 35.283 82.4804 35.2833 82.4812 35.2834 82.4818 35.2834 82.4818ZM31.7306 76.3865C31.0457 72.6978 30.1015 67.6281 29.1088 62.3301L29.2935 62.2963C30.2862 67.5944 31.2304 72.6642 31.9153 76.353 32.2577 78.1973 32.5353 79.6964 32.7217 80.7062 32.8149 81.2111 32.8853 81.5937 32.9296 81.8359 32.9517 81.957 32.9674 82.0432 32.9761 82.092 32.9804 82.1159 32.9832 82.1322 32.9843 82.139 32.9844 82.1399 32.9846 82.1414 32.9848 82.1429 32.9849 82.1438 32.9852 82.1457 32.9853 82.147 32.9855 82.1495 32.9855 82.1595 32.9849 82.167 32.9433 82.233 32.8301 82.2253 32.8059 82.1929 32.8039 82.1882 32.8017 82.1815 32.8011 82.1795 32.8004 82.177 32.7999 82.1747 32.7997 82.174L32.7997 82.1739C32.7989 82.1704 32.7977 82.1645 32.7964 82.1577L32.7971 82.1576C32.7958 82.1504 32.7939 82.1394 32.7912 82.1243 32.7825 82.0758 32.767 81.99 32.7448 81.8689 32.7005 81.6268 32.6301 81.2444 32.537 80.7395 32.3506 79.7298 32.073 78.2308 31.7306 76.3865ZM32.798 82.1574 32.9794 82.1223C32.9788 82.1206 32.9781 82.1188 32.9774 82.1173 32.9533 82.0849 32.8401 82.0773 32.7986 82.1431 32.7982 82.1478 32.798 82.1533 32.798 82.1574ZM29.4535 76.1623C28.7659 72.464 27.8235 67.4091 26.8434 62.1784L27.028 62.1446C28.0082 67.3754 28.9506 72.4304 29.6382 76.1287 29.982 77.9779 30.2621 79.4878 30.4514 80.5111 30.546 81.0227 30.6179 81.4126 30.6638 81.6624 30.6867 81.7873 30.7031 81.8773 30.7125 81.93 30.7172 81.956 30.7203 81.9737 30.7217 81.9819L30.7217 81.9819C30.7219 81.9834 30.7225 81.9866 30.7228 81.9896 30.7229 81.9907 30.7232 81.9938 30.7233 81.9959 30.7235 82.0018 30.6997 82.0627 30.6473 82.0922 30.587 82.0837 30.5422 82.0348 30.5402 82.0292 30.5395 82.0272 30.5387 82.0242 30.5384 82.0231 30.5373 82.0189 30.536 82.0122 30.535 82.0073L30.535 82.0073 30.5356 82.0072C30.5342 81.9991 30.5316 81.9843 30.5276 81.9624 30.5182 81.9101 30.5019 81.8204 30.479 81.6955 30.4332 81.4459 30.3613 81.056 30.2666 80.5444 30.0774 79.5213 29.7973 78.0114 29.4535 76.1623ZM30.5359 82.0071 30.7186 81.9715C30.7142 81.9638 30.6703 81.9176 30.6118 81.9093 30.5594 81.9388 30.5357 81.9996 30.5358 82.0054 30.5358 82.0059 30.5359 82.0065 30.5359 82.0071ZM27.2044 76.1095C26.5131 72.3976 25.5726 67.358 24.6083 62.2115L24.793 62.1777C25.7573 67.3243 26.6978 72.364 27.389 76.0759 27.7347 77.9319 28.018 79.4559 28.2108 80.4954 28.3072 81.0152 28.381 81.4138 28.4286 81.6723 28.4524 81.8014 28.4697 81.8957 28.4801 81.9525 28.4852 81.9808 28.4887 82.0002 28.4904 82.01 28.4908 82.0124 28.4912 82.0147 28.4915 82.0166 28.4916 82.0172 28.4918 82.019 28.4921 82.0209 28.4922 82.0223 28.4926 82.0267 28.4927 82.0298 28.4912 82.0494 28.4025 82.1254 28.3152 82.0746 28.3119 82.0674 28.3086 82.0579 28.308 82.0558 28.3077 82.0548 28.3073 82.0532 28.3072 82.0525 28.307 82.0519 28.3069 82.0513 28.3068 82.0508 28.3067 82.0501 28.3065 82.0496 28.3064 82.0491 28.3061 82.0473 28.3056 82.0449 28.305 82.0422L28.3054 82.0422 28.3052 82.0412C28.3037 82.0323 28.3004 82.0137 28.2952 81.9853 28.2849 81.9287 28.2677 81.8347 28.2439 81.7055 28.1962 81.4472 28.1225 81.0486 28.0261 80.5289 27.8333 79.4894 27.55 77.9655 27.2044 76.1095ZM28.3055 82.0421 28.489 82.0065C28.4877 82.0029 28.4851 81.9958 28.4825 81.99 28.3952 81.9393 28.3065 82.0152 28.305 82.0348 28.3051 82.0372 28.3054 82.0404 28.3055 82.0421ZM28.4903 82.0112 28.4902 82.0109C28.4903 82.0115 28.4904 82.0117 28.4903 82.0112ZM24.9909 76.224C24.2951 72.4921 23.3561 67.4641 22.4093 62.4114L22.5939 62.3776C23.5407 67.4303 24.4798 72.4584 25.1756 76.1904 25.5235 78.0563 25.8106 79.5983 26.0074 80.6572 26.1059 81.1867 26.1817 81.5954 26.2314 81.8635 26.2562 81.9976 26.2744 82.0965 26.2857 82.1579 26.2913 82.1885 26.2952 82.2099 26.2973 82.2217L26.2974 82.2223C26.2982 82.2265 26.2992 82.2325 26.2997 82.2359 26.2999 82.2375 26.3004 82.2445 26.3004 82.2501 26.237 82.336 26.1237 82.2917 26.1168 82.2753 26.1161 82.2729 26.1152 82.2696 26.115 82.2686L26.1145 82.2665C26.1142 82.2648 26.1137 82.2627 26.1133 82.2606L26.2975 82.225C26.2971 82.2236 26.2966 82.2219 26.2962 82.2204 26.2893 82.2041 26.1761 82.1598 26.1127 82.2457 26.1127 82.2511 26.1132 82.258 26.1134 82.2594 26.1135 82.26 26.1135 82.2604 26.1135 82.2604 26.1135 82.2604 26.1132 82.2587 26.1123 82.2538 26.1103 82.2426 26.1065 82.2216 26.1009 82.191 26.0897 82.1298 26.0715 82.031 26.0466 81.8969 25.997 81.6289 25.9212 81.2202 25.8228 80.6907 25.6259 79.6318 25.3388 78.09 24.9909 76.224ZM22.8133 76.5397C22.1149 72.7974 21.1792 67.7912 20.2503 62.8337L20.4349 62.7999C21.3639 67.7575 22.2995 72.7637 22.998 76.5061 23.3472 78.3772 23.6372 79.9324 23.8373 81.0075 23.9374 81.5451 24.0151 81.9627 24.0664 82.2397 24.0921 82.3782 24.1113 82.4817 24.1233 82.5474 24.1294 82.5803 24.1337 82.6038 24.1362 82.6177 24.1374 82.6243 24.1383 82.6296 24.1388 82.6324 24.1388 82.6327 24.1392 82.6349 24.1395 82.6373 24.1398 82.64 24.1377 82.6692 24.1281 82.694 24.0388 82.741 23.9567 82.6764 23.9555 82.6721 23.9551 82.6708 23.9546 82.6688 23.9545 82.6681L23.9541 82.6663 23.9535 82.6636 24.1377 82.6273C24.1375 82.6264 24.1372 82.6253 24.1369 82.6242 24.1357 82.6201 24.0536 82.5554 23.9644 82.6025 23.9547 82.6273 23.9527 82.6563 23.9529 82.6588 23.9532 82.661 23.9535 82.6625 23.9534 82.6618 23.9532 82.6608 23.9526 82.6573 23.9513 82.6502 23.9489 82.6367 23.9446 82.6135 23.9386 82.5806 23.9265 82.515 23.9074 82.4117 23.8817 82.2732 23.8304 81.9962 23.7527 81.5787 23.6527 81.0411 23.4525 79.966 23.1626 78.4109 22.8133 76.5397ZM20.6676 77.0343C19.9653 73.2769 19.032 68.2871 18.1207 63.4235L18.3053 63.3897C19.2167 68.2533 20.15 73.2432 20.8522 77.0006 21.2034 78.8793 21.4967 80.4498 21.7007 81.5424 21.8027 82.0887 21.8823 82.5156 21.9356 82.8017 21.9623 82.9447 21.9824 83.0526 21.9954 83.1227 22.0019 83.1577 22.0067 83.1833 22.0096 83.1991L22.0127 83.2157 22.0127 83.2159C22.0128 83.2167 22.0133 83.2191 22.0136 83.2209 22.0141 83.2247 21.9363 83.3265 21.8301 83.2591 21.8295 83.2567 21.8288 83.2537 21.8287 83.253L21.8282 83.2509 22.0126 83.2158C22.0125 83.2153 22.0119 83.2125 22.0113 83.2101 21.9051 83.1428 21.8273 83.2446 21.8278 83.2483 21.828 83.2491 21.8281 83.2498 21.8281 83.2498L21.8278 83.2484 21.8249 83.2324C21.822 83.2167 21.8172 83.1912 21.8107 83.1562 21.7977 83.0862 21.7776 82.9783 21.751 82.8353 21.6976 82.5492 21.618 82.1224 21.516 81.5761 21.312 80.4835 21.0187 78.913 20.6676 77.0343ZM16.0234 64.2017 16.2081 64.1679 19.923 83.9936C19.9198 83.9942 19.9167 83.9948 19.9135 83.9953 19.8888 83.9999 19.8193 84.0126 19.7478 84.0257 19.7446 84.0263 19.7415 84.0268 19.7383 84.0274L16.0234 64.2017Z",
  clipRule: "evenodd"
})), _path27 || (_path27 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M35.1119 82.8502C29.9491 81.8673 24.7729 82.3281 19.9717 84.355 19.781 84.4356 19.5603 84.3475 19.4788 84.1582 19.3973 83.969 19.4859 83.7503 19.6767 83.6697 24.6238 81.5812 29.9526 81.1097 35.2527 82.1188 35.4565 82.1576 35.5902 82.3528 35.5513 82.5548 35.5124 82.7567 35.3157 82.889 35.1119 82.8502ZM34.6012 80.0206C29.4319 79.0332 24.2508 79.4931 19.4444 81.5219 19.2536 81.6025 19.0329 81.5143 18.9514 81.3251 18.87 81.1358 18.9586 80.9171 19.1494 80.8366 24.1019 78.7461 29.4358 78.2757 34.7425 79.2893 34.9462 79.3282 35.0798 79.5234 35.0408 79.7254 35.0018 79.9273 34.805 80.0595 34.6012 80.0206ZM34.0778 77.187C28.9048 76.2012 23.7246 76.6609 18.9208 78.6883 18.73 78.7688 18.5093 78.6807 18.4279 78.4914 18.3464 78.3022 18.435 78.0835 18.6258 78.003 23.5758 75.9139 28.9087 75.4436 34.2188 76.4556 34.4225 76.4944 34.5562 76.6896 34.5172 76.8916 34.4783 77.0936 34.2816 77.2258 34.0778 77.187ZM33.5466 74.3545C28.3736 73.3686 23.1933 73.8284 18.3895 75.8558 18.1987 75.9363 17.978 75.8482 17.8966 75.6589 17.8152 75.4697 17.9038 75.251 18.0946 75.1704 23.0445 73.0814 28.3774 72.6111 33.6875 73.6231 33.8913 73.6619 34.0249 73.8571 33.986 74.0591 33.9471 74.261 33.7503 74.3933 33.5466 74.3545ZM33.023 71.5269C27.8483 70.5359 22.6614 70.9949 17.8508 73.0264 17.66 73.107 17.4393 73.0189 17.3578 72.8296 17.2763 72.6404 17.3649 72.4217 17.5557 72.3411 22.5126 70.2479 27.8524 69.7783 33.1647 70.7957 33.3684 70.8347 33.5018 71.03 33.4627 71.2319 33.4236 71.4339 33.2267 71.5659 33.023 71.5269ZM32.4918 68.6947C27.3171 67.7045 22.13 68.1627 17.3195 70.1941 17.1287 70.2747 16.908 70.1866 16.8265 69.9974 16.745 69.8082 16.8336 69.5894 17.0244 69.5089 21.9813 67.4156 27.3213 66.947 32.6333 67.9634 32.837 68.0024 32.9705 68.1977 32.9314 68.3996 32.8924 68.6016 32.6955 68.7337 32.4918 68.6947Z",
  clipRule: "evenodd"
})), _path28 || (_path28 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  d: "M16.109 64.1869C20.9927 62.1246 26.2561 61.6603 31.4996 62.6644L32.0144 65.4933C26.7765 64.4938 21.519 64.9589 16.6396 67.0186L16.109 64.1869Z"
})), _path29 || (_path29 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M16.5379 64.4143L16.9283 66.4979C21.5907 64.6265 26.5778 64.1748 31.5528 65.0302L31.1802 62.9826C26.1887 62.0723 21.1917 62.5129 16.5379 64.4143ZM15.9658 63.8441C20.9226 61.7508 26.2625 61.2813 31.5747 62.2986L31.8278 62.3471L32.4855 65.9614L31.9481 65.8588C26.779 64.8724 21.5978 65.3322 16.7914 67.3611L16.3602 67.5431L15.689 63.9609L15.9658 63.8441Z",
  clipRule: "evenodd"
})), _path30 || (_path30 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  fillRule: "evenodd",
  d: "M38.4094 75.9851C37.7124 72.3033 36.754 67.2233 35.7539 61.8857L35.9386 61.8519C36.9387 67.1893 37.897 72.2692 38.594 75.9509 38.9425 77.7918 39.2257 79.283 39.4161 80.2821 39.5113 80.7817 39.5834 81.1582 39.6288 81.3938 39.6515 81.5116 39.6675 81.594 39.6764 81.6389 39.6783 81.6484 39.6798 81.656 39.681 81.662L39.682 81.6618C39.6834 81.6698 39.6845 81.6761 39.6851 81.6803 39.6853 81.6813 39.6855 81.6827 39.6857 81.6841L39.6858 81.6853C39.6859 81.686 39.686 81.6867 39.686 81.6873 39.6862 81.6887 39.6865 81.6926 39.6865 81.6952 39.6864 81.7026 39.6602 81.7619 39.6086 81.7889 39.552 81.7811 39.5071 81.7356 39.5044 81.7289 39.5035 81.7264 39.5023 81.7227 39.5019 81.7213 39.5017 81.7204 39.5013 81.719 39.5011 81.7183 39.4996 81.712 39.4963 81.6958 39.4921 81.6746 39.4831 81.6292 39.467 81.5463 39.4443 81.4285 39.3988 81.1927 39.3268 80.8161 39.2316 80.3165 39.0411 79.3173 38.7579 77.8259 38.4094 75.9851ZM39.6789 81.6624C39.6694 81.6503 39.6278 81.6125 39.5766 81.6054 39.5323 81.6287 39.5067 81.6758 39.5003 81.6931L39.6789 81.6624ZM39.4995 81.7084C39.4997 81.7095 39.4997 81.7099 39.4997 81.7099 39.4997 81.7098 39.4996 81.7093 39.4995 81.7084ZM40.4259 74.7957C39.7291 71.1091 38.774 66.0413 37.7812 60.7432L37.9659 60.7094C38.9586 66.0074 39.9137 71.0751 40.6105 74.7616 40.959 76.6048 41.2428 78.1027 41.4346 79.1114 41.5304 79.6158 41.6033 79.9978 41.6496 80.2395 41.6728 80.3604 41.6893 80.4461 41.6988 80.4944 41.7018 80.5094 41.7039 80.5204 41.7054 80.5275L41.7061 80.5274C41.7073 80.5342 41.7083 80.5401 41.7088 80.5437 41.7089 80.5444 41.7093 80.5467 41.7096 80.5494 41.7097 80.5514 41.71 80.5584 41.7099 80.5635 41.6992 80.6022 41.5962 80.6497 41.5334 80.6026 41.53 80.5958 41.5265 80.5865 41.5258 80.5842 41.5254 80.583 41.5249 80.5811 41.5247 80.5802 41.5244 80.5787 41.524 80.5773 41.5238 80.5764 41.5223 80.5697 41.5191 80.5534 41.5144 80.5297 41.5049 80.481 41.4883 80.395 41.4651 80.2741 41.4187 80.0322 41.3459 79.6501 41.25 79.1457 41.0583 78.1369 40.7744 76.6389 40.4259 74.7957ZM41.7044 80.5277C41.7029 80.5239 41.7008 80.5189 41.6988 80.5148 41.636 80.4678 41.5331 80.5152 41.5223 80.5539 41.5223 80.5555 41.5223 80.5573 41.5223 80.5591L41.7044 80.5277ZM42.4735 73.7798C41.7755 70.0835 40.8239 65.0302 39.8438 59.7993L40.0284 59.7655C41.0085 64.9963 41.9602 70.0495 42.6581 73.7458 43.0071 75.594 43.2927 77.1029 43.4867 78.1252 43.5837 78.6363 43.6578 79.0257 43.7055 79.2751 43.7294 79.3998 43.7466 79.4893 43.7568 79.5415 43.761 79.5633 43.764 79.5781 43.7656 79.5861L43.7662 79.586 43.7662 79.586C43.767 79.5909 43.7682 79.5976 43.7687 79.6019 43.7689 79.603 43.7692 79.6062 43.7693 79.6083 43.7694 79.6142 43.7453 79.6757 43.6921 79.705 43.6325 79.696 43.5882 79.6476 43.5862 79.642 43.5856 79.64 43.5847 79.637 43.5844 79.6359 43.5837 79.633 43.583 79.6299 43.5827 79.6284L43.5827 79.6283C43.5809 79.6202 43.5774 79.6026 43.5724 79.5766 43.5621 79.5241 43.5449 79.4343 43.521 79.3096 43.4733 79.0601 43.3991 78.6705 43.3021 78.1594 43.1081 77.137 42.8225 75.628 42.4735 73.7798ZM43.7653 79.5862C43.7651 79.5856 43.7649 79.585 43.7647 79.5845 43.7628 79.5791 43.7186 79.5307 43.6589 79.5217 43.6073 79.5501 43.5831 79.6088 43.5818 79.6175L43.7653 79.5862ZM44.5532 72.9344C43.8537 69.224 42.9058 64.1857 41.9414 59.0391L42.1261 59.0053C43.0904 64.1518 44.0383 69.1901 44.7378 72.9004 45.0876 74.7556 45.3753 76.2788 45.5719 77.3176 45.6702 77.8369 45.7457 78.2352 45.7948 78.4932 45.8194 78.6223 45.8374 78.7162 45.8483 78.7727 45.8537 78.801 45.8574 78.8195 45.8591 78.8283L45.8594 78.8294 45.8597 78.8293C45.8602 78.832 45.8606 78.8343 45.8609 78.8362 45.861 78.8367 45.8611 78.8372 45.8612 78.8379 45.8613 78.8384 45.8613 78.839 45.8614 78.8396 45.8615 78.8403 45.8617 78.842 45.8619 78.843 45.8621 78.8452 45.8624 78.8552 45.8619 78.8631 45.7988 78.9414 45.6885 78.9019 45.6799 78.8841 45.6789 78.8811 45.6777 78.8769 45.6774 78.8755 45.6769 78.8737 45.6765 78.8719 45.6764 78.8713 45.676 78.8695 45.6755 78.8672 45.675 78.8648 45.673 78.855 45.6693 78.8357 45.6638 78.8075 45.6529 78.7507 45.6349 78.6566 45.6103 78.5276 45.5611 78.2694 45.4856 77.8711 45.3873 77.3517 45.1907 76.3129 44.903 74.7896 44.5532 72.9344ZM45.8592 78.8294C45.8587 78.8277 45.8578 78.8246 45.857 78.8223 45.8485 78.8046 45.7382 78.7651 45.6751 78.8433 45.6747 78.8496 45.6749 78.8572 45.675 78.861L45.8592 78.8294ZM45.6755 78.8659C45.6756 78.8664 45.6756 78.8662 45.6755 78.8656L45.6755 78.8659Z",
  clipRule: "evenodd"
})), _path31 || (_path31 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M39.3975 81.3602C43.9805 78.5423 49.1268 77.0965 54.5025 77.2957 54.7098 77.3034 54.8718 77.4762 54.8643 77.6817 54.8568 77.8872 54.6827 78.0476 54.4754 78.0399 49.2582 77.8466 44.2583 79.2483 39.794 81.9933 39.6178 82.1016 39.3862 82.0477 39.2767 81.8729 39.1672 81.6981 39.2213 81.4685 39.3975 81.3602ZM38.8477 78.5375C43.4353 75.713 48.5859 74.2645 53.9674 74.4636 54.1747 74.4713 54.3367 74.6441 54.3292 74.8496 54.3217 75.0551 54.1476 75.2155 53.9403 75.2078 48.7175 75.0146 43.7134 76.419 39.2446 79.1703 39.0685 79.2788 38.8368 79.225 38.7272 79.0503 38.6176 78.8755 38.6716 78.646 38.8477 78.5375ZM38.3164 75.7048C42.9031 72.8814 48.0528 71.4331 53.4314 71.6318 53.6387 71.6394 53.8007 71.8122 53.7932 72.0178 53.7858 72.2233 53.6116 72.3837 53.4043 72.376 48.1845 72.1832 43.1812 73.5874 38.7132 76.3377 38.5371 76.4461 38.3054 76.3924 38.1958 76.2176 38.0863 76.0428 38.1402 75.8133 38.3164 75.7048ZM37.789 72.8728C42.3758 70.0494 47.5255 68.6011 52.904 68.7997 53.1114 68.8074 53.2734 68.9802 53.2659 69.1857 53.2584 69.3913 53.0843 69.5517 52.877 69.544 47.6571 69.3512 42.6539 70.7554 38.1859 73.5057 38.0097 73.6141 37.7781 73.5603 37.6685 73.3856 37.5589 73.2108 37.6129 72.9812 37.789 72.8728ZM37.2431 70.0491C41.8344 67.2191 46.9903 65.7677 52.3769 65.9678 52.5842 65.9755 52.7462 66.1484 52.7386 66.3539 52.7311 66.5594 52.557 66.7198 52.3496 66.7121 47.122 66.5179 42.1127 67.925 37.6403 70.6818 37.4642 70.7903 37.2325 70.7367 37.1228 70.562 37.0132 70.3873 37.067 70.1577 37.2431 70.0491ZM36.7118 67.2164C41.3032 64.3873 46.4589 62.935 51.8456 63.1351 52.0529 63.1428 52.2149 63.3156 52.2073 63.5212 52.1998 63.7267 52.0257 63.887 51.8183 63.8793 46.5908 63.6852 41.5816 65.0932 37.1089 67.8491 36.9328 67.9576 36.7012 67.9039 36.5915 67.7292 36.4819 67.5545 36.5357 67.3249 36.7118 67.2164ZM36.1953 64.3755C40.7829 61.5519 45.9345 60.1032 51.3151 60.3025 51.5224 60.3102 51.6844 60.483 51.6769 60.6885 51.6694 60.8941 51.4952 61.0544 51.2879 61.0468 46.0661 60.8534 41.061 62.2579 36.592 65.0084 36.4159 65.1168 36.1843 65.063 36.0747 64.8882 35.9651 64.7135 36.0191 64.4839 36.1953 64.3755ZM35.6493 61.5521C40.2406 58.7221 45.3965 57.2707 50.7831 57.4708 50.9904 57.4785 51.1524 57.6513 51.1449 57.8568 51.1374 58.0624 50.9632 58.2227 50.7559 58.215 45.5283 58.0208 40.519 59.428 36.0465 62.1847 35.8704 62.2932 35.6388 62.2396 35.5291 62.0649 35.4194 61.8902 35.4732 61.6606 35.6493 61.5521Z",
  clipRule: "evenodd"
})), _path32 || (_path32 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M35.8512 61.8682C40.3831 59.0748 45.4686 57.646 50.7728 57.8427L52.3649 66.3396C47.0578 66.1425 41.9753 67.5717 37.4433 70.3651L35.8512 61.8682Z"
})), _path33 || (_path33 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M36.268 62.0514L37.7135 69.7658C42.0517 67.2015 46.8759 65.856 51.9112 65.954L50.4592 58.2052C45.4273 58.0775 40.599 59.4345 36.268 62.0514ZM35.653 61.5517C40.2444 58.7217 45.4032 57.2707 50.7868 57.4704C50.9626 57.4769 51.1104 57.6034 51.1425 57.7749L52.7347 66.2718C52.7555 66.383 52.7243 66.4974 52.6498 66.5829C52.5753 66.6685 52.4657 66.7158 52.3517 66.7115C47.1241 66.5173 42.1149 67.9245 37.6424 70.6812C37.537 70.7462 37.4059 70.7553 37.2923 70.7055C37.1787 70.6557 37.0971 70.5535 37.0745 70.4325L35.4823 61.9356C35.4541 61.7849 35.5218 61.6325 35.653 61.5517Z",
  clipRule: "evenodd"
})), _path34 || (_path34 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M58.5653 63.8789C59.4409 69.4451 53.8286 72.955 49.9531 71.6584M8.73839 76.438C10.3542 80.9983 16.361 82.8957 22.3896 76.438"
})), _path35 || (_path35 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 1.472,
  d: "M160.68 68.3555C161.614 75.0318 162.211 82.7648 160.68 89.3521M171.536 72.5684 167.755 104.417H163.285"
})), _path36 || (_path36 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.472,
  d: "M187.455 104.418H182.984C183.621 94.2386 184.801 79.748 184.801 79.748"
})), _path37 || (_path37 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M199.766 66.9043C202.116 70.5486 206.161 79.9206 204.147 84.5945M161.004 59.9897C157.348 62.7243 151.154 68.326 151.1 75.1165"
})), _path38 || (_path38 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M161.004 59.9897C157.348 62.7243 151.154 68.326 151.1 75.1165C151.055 80.7514 155.45 85.9213 163.201 82.0316"
})), _path39 || (_path39 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#77AD8C",
  d: "M188.416 36.6902C193.74 38.6254 198.342 42.2229 200.866 47.3743C206.452 58.7763 201.061 74.5519 189.486 80.0884C178.987 85.1198 164.987 81.2398 158.656 71.5562C152.326 61.8726 154.499 47.6742 163.448 40.2703C170.148 34.7318 180.154 33.6965 188.416 36.6902Z"
})), _path40 || (_path40 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#5C9271",
  d: "M200.868 47.3742C199.856 45.3231 198.493 43.4604 196.838 41.8687C197.476 42.7541 198.038 43.6907 198.518 44.6688C204.105 56.0709 198.714 71.8464 187.138 77.383C178.057 81.7332 166.36 79.411 159.27 72.4444C165.854 81.4739 179.314 84.9611 189.488 80.0922C201.056 74.5518 206.454 58.7763 200.868 47.3742Z"
})), _path41 || (_path41 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 1.105,
  d: "M182.034 67.7803C179.244 71.49 174.047 72.7053 170.09 68.2854"
})), _path42 || (_path42 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M175.979 96.185C175.89 97.1307 178.282 75.3669 178.956 68.2959C172.543 64.336 165.246 62.8309 157.866 64.3283L154.89 92.2164C162.27 90.72 169.567 92.225 175.979 96.185Z"
})), _path43 || (_path43 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M176.015 96.1885C175.903 97.1319 178.157 75.3538 178.991 68.2995C186.098 65.7487 193.552 65.7813 200.454 68.7673L197.478 96.6554C190.576 93.6704 183.122 93.6378 176.015 96.1885Z"
})), _path44 || (_path44 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M174.58 85.6005C175.017 81.5717 175.617 76.0131 176.24 70.1734L176.443 70.1945C175.82 76.0344 175.22 81.5931 174.782 85.622 174.563 87.6364 174.385 89.2684 174.265 90.3619 174.205 90.9087 174.159 91.3209 174.13 91.5789 174.116 91.7079 174.106 91.7986 174.1 91.8484 174.097 91.8716 174.095 91.8893 174.094 91.8962 174.094 91.897 174.093 91.8986 174.093 91.8996 174.093 91.9011 174.092 91.9052 174.091 91.9079 174.089 91.9154 174.044 91.9682 173.984 91.9814 173.926 91.9565 173.892 91.8947 173.891 91.8868 173.891 91.884 173.891 91.8797 173.891 91.8781 173.891 91.8771 173.891 91.8755 173.891 91.8747 173.891 91.8737 173.892 91.8726 173.892 91.8717L173.892 91.8705C173.892 91.866 173.893 91.859 173.894 91.8504L173.895 91.8505C173.895 91.844 173.896 91.8355 173.898 91.8252 173.903 91.776 173.914 91.6858 173.928 91.5568 173.957 91.299 174.002 90.8869 174.063 90.3402 174.183 89.2468 174.361 87.6149 174.58 85.6005ZM173.897 91.8507C173.906 91.8369 173.948 91.7927 174.003 91.7808 174.053 91.8022 174.084 91.8509 174.093 91.869L173.897 91.8507ZM174.095 91.887C174.095 91.8871 174.095 91.8866 174.095 91.8854 174.095 91.8864 174.095 91.887 174.095 91.887ZM172.305 84.4862C172.743 80.4523 173.34 74.9071 173.959 69.1105L174.162 69.1316C173.543 74.9284 172.945 80.4736 172.508 84.5076 172.289 86.5246 172.111 88.1638 171.99 89.2677 171.93 89.8197 171.884 90.2379 171.854 90.5026 171.839 90.6349 171.829 90.7291 171.823 90.7824 171.82 90.8084 171.818 90.8262 171.817 90.8336 171.816 90.8346 171.816 90.8361 171.816 90.8378 171.816 90.8387 171.815 90.8408 171.815 90.8422 171.814 90.8448 171.811 90.8552 171.808 90.8629 171.745 90.9186 171.629 90.8762 171.614 90.8353 171.614 90.8297 171.613 90.8221 171.613 90.8199 171.614 90.817 171.614 90.8145 171.614 90.8137L171.614 90.8137C171.614 90.8097 171.615 90.8033 171.615 90.7958L171.616 90.7959C171.617 90.7881 171.618 90.7761 171.62 90.7596 171.626 90.7067 171.637 90.613 171.652 90.4807 171.681 90.2161 171.727 89.798 171.787 89.2461 171.908 88.1422 172.087 86.5031 172.305 84.4862ZM171.617 90.796 171.817 90.8148C171.817 90.8128 171.816 90.8108 171.816 90.809 171.801 90.7681 171.686 90.7257 171.622 90.7814 171.62 90.7861 171.618 90.7918 171.617 90.796ZM170.011 83.5613C170.448 79.5166 171.044 73.9874 171.654 68.2644L171.857 68.2855C171.246 74.0086 170.651 79.5379 170.213 83.5827 169.995 85.605 169.816 87.2563 169.694 88.375 169.633 88.9344 169.586 89.3607 169.556 89.6337 169.541 89.7702 169.53 89.8685 169.523 89.9261 169.52 89.9545 169.517 89.9738 169.516 89.9827L169.516 89.9827C169.516 89.9844 169.516 89.9878 169.515 89.991 169.515 89.9922 169.514 89.9955 169.514 89.9977 169.512 90.0039 169.468 90.0599 169.405 90.0745 169.345 90.0473 169.313 89.983 169.313 89.9765 169.313 89.9743 169.313 89.9709 169.313 89.9696 169.313 89.965 169.314 89.9577 169.314 89.9523L169.314 89.9523 169.315 89.9523C169.316 89.9435 169.318 89.9274 169.321 89.9035 169.327 89.8464 169.338 89.7484 169.353 89.6119 169.383 89.339 169.43 88.9128 169.491 88.3535 169.613 87.2348 169.792 85.5836 170.011 83.5613ZM169.315 89.9524 169.516 89.971C169.514 89.9616 169.483 89.9004 169.425 89.874 169.361 89.8886 169.317 89.9445 169.316 89.9505 169.316 89.9511 169.315 89.9517 169.315 89.9524ZM167.698 82.8229C168.136 78.763 168.728 73.2502 169.329 67.6193L169.531 67.6404C168.93 73.2714 168.338 78.7843 167.9 82.8443 167.681 84.8743 167.501 86.541 167.378 87.6778 167.316 88.2461 167.268 88.682 167.237 88.9645 167.222 89.1058 167.211 89.2088 167.204 89.2709 167.2 89.3018 167.198 89.323 167.196 89.3337 167.196 89.3363 167.196 89.3388 167.195 89.3408 167.195 89.3415 167.195 89.3434 167.195 89.3454 167.195 89.3469 167.194 89.3516 167.193 89.3549 167.185 89.3748 167.069 89.4266 166.994 89.3474 166.993 89.3389 166.992 89.3281 166.993 89.3257 166.993 89.3245 166.993 89.3228 166.993 89.322 166.993 89.3213 166.993 89.3207 166.993 89.3201 166.993 89.3194 166.993 89.3188 166.993 89.3183 166.993 89.3162 166.993 89.3136 166.994 89.3107L166.994 89.3107 166.994 89.3096C166.995 89.3 166.998 89.2797 167.001 89.2487 167.008 89.1869 167.019 89.0841 167.035 88.9429 167.066 88.6605 167.113 88.2247 167.175 87.6563 167.299 86.5196 167.479 84.8529 167.698 82.8229ZM166.994 89.3108 167.196 89.3295C167.196 89.3255 167.195 89.3173 167.194 89.3105 167.12 89.2314 167.004 89.2831 166.996 89.3029 166.995 89.3055 166.995 89.3089 166.994 89.3108ZM167.196 89.3349 167.196 89.3345C167.196 89.3352 167.196 89.3354 167.196 89.3349ZM165.365 82.2686C165.805 78.1865 166.395 72.6862 166.985 67.1579L167.187 67.179C166.598 72.7074 166.007 78.2078 165.568 82.2899 165.348 84.3309 165.166 86.0174 165.041 87.1756 164.978 87.7546 164.93 88.2016 164.898 88.4948 164.882 88.6414 164.87 88.7495 164.863 88.8166 164.859 88.85 164.856 88.8734 164.855 88.8863L164.855 88.887C164.854 88.8916 164.854 88.8981 164.853 88.9018 164.853 88.9035 164.851 88.9109 164.849 88.9167 164.757 88.9865 164.653 88.9061 164.651 88.887 164.651 88.8843 164.651 88.8806 164.651 88.8795L164.651 88.8772C164.651 88.8753 164.651 88.873 164.652 88.8707L164.854 88.8897C164.854 88.8883 164.854 88.8863 164.854 88.8847 164.852 88.8656 164.748 88.7852 164.656 88.855 164.654 88.8607 164.652 88.868 164.652 88.8695 164.652 88.8702 164.652 88.8706 164.652 88.8706 164.652 88.8706 164.652 88.8687 164.653 88.8634 164.654 88.8511 164.657 88.8282 164.66 88.7947 164.668 88.7278 164.68 88.6198 164.696 88.4732 164.728 88.1801 164.776 87.7332 164.839 87.1542 164.964 85.9961 165.146 84.3096 165.365 82.2686ZM163.009 81.9342C163.449 77.8406 164.036 72.3639 164.615 66.9398L164.817 66.961C164.238 72.3851 163.651 77.8618 163.212 81.9555 162.992 84.0023 162.809 85.7035 162.682 86.8794 162.618 87.4674 162.569 87.924 162.536 88.227 162.52 88.3785 162.507 88.4916 162.499 88.5634 162.495 88.5993 162.493 88.6251 162.491 88.6402 162.49 88.6475 162.489 88.6532 162.489 88.6563 162.489 88.6565 162.489 88.659 162.488 88.6616 162.488 88.6645 162.476 88.6941 162.459 88.7169 162.351 88.7385 162.286 88.6465 162.286 88.6417 162.286 88.6402 162.286 88.638 162.286 88.6372L162.286 88.6353 162.287 88.6323 162.489 88.6506C162.489 88.6497 162.49 88.6485 162.49 88.6472 162.49 88.6425 162.424 88.5505 162.317 88.5722 162.299 88.595 162.288 88.6245 162.287 88.6272 162.287 88.6294 162.287 88.6312 162.287 88.6304 162.287 88.6293 162.288 88.6254 162.288 88.6177 162.29 88.603 162.293 88.5776 162.297 88.5417 162.305 88.47 162.317 88.357 162.334 88.2055 162.367 87.9026 162.416 87.446 162.479 86.8581 162.606 85.6822 162.789 83.9811 163.009 81.9342ZM160.626 81.7955C161.067 77.685 161.651 72.2261 162.219 66.9047L162.422 66.9258C161.854 72.2472 161.269 77.7062 160.829 81.8167 160.609 83.8719 160.424 85.59 160.296 86.7852 160.232 87.3828 160.181 87.8497 160.148 88.1626 160.131 88.3191 160.118 88.4371 160.11 88.5137 160.106 88.552 160.103 88.58 160.101 88.5973L160.099 88.6154 160.099 88.6157C160.099 88.6166 160.098 88.6192 160.098 88.6212 160.098 88.6253 159.985 88.7072 159.896 88.605 159.896 88.6023 159.896 88.599 159.896 88.5982L159.896 88.5959 160.099 88.6156C160.099 88.6151 160.099 88.6119 160.099 88.6093 160.01 88.5072 159.897 88.589 159.897 88.593 159.896 88.594 159.896 88.5947 159.896 88.5947L159.897 88.5932 159.898 88.5757C159.9 88.5585 159.903 88.5306 159.907 88.4924 159.916 88.4158 159.928 88.2978 159.945 88.1414 159.979 87.8284 160.029 87.3616 160.093 86.764 160.222 85.5688 160.406 83.8507 160.626 81.7955ZM159.809 67.0767 160.011 67.0978 157.696 88.7894C157.693 88.7891 157.689 88.7887 157.686 88.7884 157.659 88.7856 157.583 88.7776 157.504 88.7694 157.501 88.7691 157.497 88.7687 157.494 88.7684L159.809 67.0767Z",
  clipRule: "evenodd"
})), _path45 || (_path45 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M173.801 92.2168C168.752 89.6285 163.241 88.5336 157.63 89.1769 157.408 89.2025 157.206 89.044 157.18 88.823 157.155 88.602 157.315 88.4021 157.538 88.3765 163.318 87.7136 168.992 88.8439 174.175 91.501 174.374 91.6031 174.452 91.8462 174.349 92.0438 174.246 92.2415 174.001 92.3189 173.801 92.2168ZM174.149 89.1262C169.095 86.5314 163.579 85.4339 157.962 86.0776 157.74 86.1032 157.538 85.9447 157.512 85.7237 157.487 85.5027 157.647 85.3028 157.87 85.2772 163.657 84.614 169.335 85.7469 174.524 88.4106 174.723 88.5129 174.8 88.756 174.697 88.9536 174.594 89.1512 174.349 89.2285 174.149 89.1262ZM174.49 86.0284C169.431 83.4341 163.915 82.3368 158.302 82.9798 158.079 83.0053 157.878 82.8469 157.852 82.6258 157.827 82.4048 157.987 82.2049 158.21 82.1794 163.993 81.5168 169.671 82.6496 174.863 85.3127 175.063 85.4149 175.14 85.6579 175.037 85.8556 174.934 86.0532 174.689 86.1306 174.49 86.0284ZM174.822 82.9298C169.763 80.3355 164.247 79.2381 158.634 79.8812 158.411 79.9067 158.21 79.7482 158.184 79.5272 158.159 79.3062 158.319 79.1063 158.542 79.0807 164.325 78.4182 170.003 79.551 175.195 82.2141 175.395 82.3162 175.472 82.5593 175.369 82.757 175.266 82.9546 175.021 83.032 174.822 82.9298ZM175.157 79.838C170.098 77.2378 164.576 76.1377 158.955 76.7829 158.732 76.8085 158.53 76.65 158.505 76.429 158.479 76.208 158.639 76.0081 158.862 75.9825 164.654 75.3177 170.338 76.4533 175.531 79.1227 175.731 79.225 175.808 79.4682 175.705 79.6657 175.601 79.8633 175.356 79.9404 175.157 79.838ZM175.485 76.7387C170.426 74.1394 164.904 73.0384 159.283 73.6835 159.06 73.7091 158.858 73.5507 158.833 73.3296 158.807 73.1086 158.967 72.9087 159.19 72.8831 164.982 72.2183 170.666 73.3549 175.86 76.0233 176.059 76.1256 176.136 76.3687 176.033 76.5663 175.93 76.7639 175.684 76.841 175.485 76.7387Z",
  clipRule: "evenodd"
})), _path46 || (_path46 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  d: "M159.902 67.0859C165.609 66.4309 171.212 67.5487 176.338 70.1836L175.992 73.274C170.871 70.6457 165.273 69.5305 159.572 70.184L159.902 67.0859Z"
})), _path47 || (_path47 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M160.27 67.4513L160.027 69.731C165.444 69.2068 170.757 70.2538 175.651 72.6526L175.902 70.4158C171.008 67.9549 165.688 66.8935 160.27 67.4513ZM159.854 66.6861C165.646 66.0213 171.33 67.1569 176.524 69.8263L176.771 69.9534L176.329 73.9019L175.803 73.6322C170.749 71.0384 165.232 69.9409 159.616 70.5846L159.112 70.6424L159.531 66.7232L159.854 66.6861Z",
  clipRule: "evenodd"
})), _path48 || (_path48 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  fillRule: "evenodd",
  d: "M179.36 86.0994C179.783 82.0689 180.369 76.5088 180.992 70.6689L181.195 70.6901C180.572 76.5298 179.985 82.0898 179.563 86.1201 179.352 88.1353 179.181 89.7681 179.068 90.8622 179.011 91.4093 178.969 91.8216 178.943 92.0798 178.93 92.2089 178.921 92.2992 178.916 92.3485 178.915 92.3589 178.914 92.3673 178.914 92.3739L178.915 92.374C178.914 92.3826 178.913 92.3896 178.912 92.3941 178.912 92.3952 178.912 92.3967 178.911 92.3982L178.911 92.3995C178.911 92.4002 178.911 92.401 178.911 92.4016 178.911 92.4031 178.91 92.4073 178.909 92.41 178.906 92.4176 178.861 92.4712 178.799 92.4835 178.742 92.4581 178.71 92.3973 178.709 92.3895 178.709 92.3867 178.709 92.3825 178.709 92.3809 178.709 92.3799 178.709 92.3783 178.709 92.3775 178.709 92.3705 178.711 92.3528 178.713 92.3295 178.718 92.2796 178.727 92.1888 178.74 92.0597 178.766 91.8013 178.809 91.3888 178.865 90.8417 178.979 89.7475 179.149 88.1146 179.36 86.0994ZM178.911 92.3736C178.905 92.3582 178.874 92.3064 178.823 92.2834 178.769 92.2941 178.728 92.3352 178.716 92.3511L178.911 92.3736ZM178.71 92.3667C178.71 92.3679 178.71 92.3684 178.71 92.3684 178.71 92.3683 178.71 92.3677 178.71 92.3667ZM181.821 85.4782C182.245 81.4429 182.831 75.8964 183.449 70.0996L183.652 70.1207C183.033 75.9174 182.447 81.4637 182.023 85.499 181.811 87.5167 181.64 89.1565 181.525 90.261 181.467 90.8132 181.424 91.2316 181.397 91.4964 181.383 91.6288 181.374 91.7227 181.368 91.7756 181.367 91.7922 181.366 91.8042 181.365 91.812L181.366 91.8121C181.365 91.8195 181.364 91.8259 181.363 91.8299 181.363 91.8306 181.363 91.8331 181.362 91.836 181.362 91.8381 181.36 91.8454 181.358 91.8507 181.335 91.8876 181.213 91.9055 181.163 91.8376 181.161 91.8295 181.161 91.8188 181.161 91.8162 181.161 91.8148 181.161 91.8127 181.161 91.8117 181.161 91.8101 181.161 91.8085 181.161 91.8075 181.162 91.8001 181.163 91.7822 181.166 91.7562 181.171 91.7028 181.181 91.6085 181.194 91.4761 181.221 91.2111 181.265 90.7927 181.322 90.2404 181.437 89.1358 181.609 87.4959 181.821 85.4782ZM181.364 91.8119C181.364 91.8075 181.363 91.8017 181.362 91.7968 181.311 91.729 181.19 91.7468 181.166 91.7837 181.166 91.7853 181.165 91.7872 181.165 91.7891L181.364 91.8119ZM184.261 85.0465C184.687 81.0006 185.272 75.4702 185.883 69.7471L186.085 69.7682C185.475 75.4912 184.89 81.0215 184.464 85.0673 184.251 87.0903 184.077 88.7421 183.961 89.8613 183.902 90.4209 183.858 90.8474 183.83 91.1205 183.816 91.257 183.806 91.3551 183.8 91.4123 183.798 91.4363 183.796 91.4525 183.795 91.4613L183.796 91.4614 183.796 91.4614C183.795 91.4667 183.795 91.474 183.794 91.4786 183.794 91.4799 183.793 91.4832 183.792 91.4854 183.791 91.4916 183.746 91.5481 183.682 91.5623 183.623 91.5348 183.592 91.4711 183.591 91.4647 183.591 91.4625 183.591 91.4591 183.592 91.4578 183.592 91.4546 183.592 91.4511 183.592 91.4495L183.592 91.4495C183.593 91.4405 183.595 91.4212 183.597 91.3927 183.603 91.3351 183.613 91.2367 183.627 91.1001 183.655 90.8269 183.7 90.4003 183.758 89.8406 183.875 88.7213 184.048 87.0695 184.261 85.0465ZM183.795 91.4613C183.795 91.4606 183.795 91.4599 183.795 91.4594 183.795 91.4531 183.764 91.3895 183.705 91.3621 183.642 91.3759 183.599 91.4293 183.595 91.438L183.795 91.4613ZM186.679 84.8014C187.108 80.7404 187.692 75.2267 188.293 69.5957L188.495 69.6168C187.895 75.2477 187.31 80.7614 186.882 84.8222 186.667 86.8527 186.492 88.5199 186.373 89.657 186.313 90.2256 186.267 90.6616 186.238 90.9442 186.223 91.0855 186.213 91.1883 186.207 91.2502 186.203 91.2813 186.201 91.3016 186.2 91.3113L186.2 91.3124 186.201 91.3124C186.2 91.3153 186.2 91.3179 186.2 91.32 186.2 91.3205 186.2 91.3211 186.2 91.3218 186.2 91.3224 186.199 91.323 186.199 91.3237 186.199 91.3244 186.199 91.3262 186.199 91.3273 186.198 91.3297 186.196 91.3402 186.193 91.3482 186.103 91.4102 186 91.3356 185.997 91.3146 185.997 91.3112 185.997 91.3064 185.997 91.3049 185.997 91.3028 185.997 91.301 185.997 91.3002 185.997 91.2982 185.997 91.2957 185.998 91.2931 185.999 91.2824 186.001 91.2611 186.004 91.2302 186.01 91.1681 186.021 91.065 186.035 90.9236 186.065 90.6409 186.11 90.2049 186.17 89.6363 186.289 88.4991 186.465 86.8318 186.679 84.8014ZM186.2 91.3124C186.2 91.3105 186.2 91.307 186.2 91.3044 186.197 91.2834 186.094 91.2089 186.005 91.2709 186.002 91.2773 186 91.2852 185.999 91.2891L186.2 91.3124ZM185.998 91.2944C185.998 91.2949 185.998 91.2947 185.998 91.2941L185.998 91.2944Z",
  clipRule: "evenodd"
})), _path49 || (_path49 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M178.707 91.9734C184.337 90.4434 190.124 90.5077 195.638 92.3478 195.85 92.4188 195.965 92.6473 195.893 92.8581 195.821 93.069 195.591 93.1824 195.378 93.1115 190.027 91.3257 184.405 91.2601 178.921 92.7505 178.705 92.8093 178.482 92.6831 178.422 92.4685 178.363 92.2539 178.491 92.0323 178.707 91.9734ZM179.019 88.8793C184.655 87.3439 190.448 87.4066 195.967 89.2484 196.18 89.3193 196.294 89.5478 196.223 89.7587 196.151 89.9696 195.92 90.083 195.708 90.0121 190.351 88.2246 184.724 88.1606 179.233 89.6562 179.017 89.7152 178.793 89.5891 178.734 89.3745 178.675 89.16 178.802 88.9383 179.019 88.8793ZM179.351 85.7805C184.986 84.2459 190.778 84.3086 196.294 86.149 196.507 86.22 196.621 86.4484 196.55 86.6593 196.478 86.8702 196.247 86.9837 196.035 86.9127 190.681 85.1266 185.055 85.0626 179.565 86.5574 179.349 86.6164 179.126 86.4902 179.066 86.2756 179.007 86.0611 179.134 85.8394 179.351 85.7805ZM179.683 82.6818C185.318 81.1473 191.11 81.21 196.626 83.0504 196.839 83.1213 196.953 83.3498 196.882 83.5607 196.81 83.7716 196.579 83.885 196.367 83.8141 191.013 82.028 185.387 81.964 179.898 83.4588 179.681 83.5177 179.458 83.3916 179.398 83.177 179.339 82.9625 179.466 82.7408 179.683 82.6818ZM179.994 79.5877C185.637 78.0477 191.436 78.1091 196.96 79.9534 197.173 80.0244 197.287 80.2529 197.215 80.4637 197.143 80.6746 196.913 80.788 196.7 80.717 191.339 78.9271 185.706 78.8644 180.21 80.3645 179.993 80.4236 179.77 80.2975 179.71 80.083 179.651 79.8685 179.778 79.6467 179.994 79.5877ZM180.323 76.4888C185.965 74.9498 191.764 75.0102 197.288 76.8545 197.501 76.9255 197.615 77.154 197.543 77.3649 197.472 77.5757 197.241 77.6891 197.028 77.6181 191.667 75.8283 186.034 75.7665 180.538 77.2656 180.321 77.3247 180.098 77.1986 180.038 76.9841 179.979 76.7695 180.106 76.5478 180.323 76.4888ZM180.671 73.3852C186.308 71.8508 192.101 71.9136 197.62 73.7553 197.832 73.8262 197.947 74.0547 197.875 74.2656 197.803 74.4765 197.573 74.5899 197.36 74.5189 192.004 72.7316 186.376 72.6674 180.886 74.1621 180.669 74.2211 180.446 74.0949 180.387 73.8803 180.327 73.6658 180.455 73.4441 180.671 73.3852ZM180.987 70.2913C186.629 68.7513 192.428 68.8127 197.952 70.657 198.165 70.728 198.279 70.9565 198.207 71.1674 198.136 71.3782 197.905 71.4916 197.693 71.4206 192.331 69.6307 186.698 69.568 181.202 71.0681 180.985 71.1272 180.762 71.0011 180.702 70.7866 180.643 70.5721 180.77 70.3503 180.987 70.2913Z",
  clipRule: "evenodd"
})), _path50 || (_path50 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M181.096 70.6793C186.665 69.1593 192.384 69.2227 197.824 71.0385L196.832 80.3348C191.389 78.5177 185.673 78.4556 180.104 79.9757L181.096 70.6793Z"
})), _path51 || (_path51 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M181.469 70.9965L180.568 79.4367C185.865 78.0954 191.287 78.1658 196.479 79.7975L197.384 71.3197C192.205 69.6581 186.775 69.5984 181.469 70.9965ZM180.987 70.2913C186.629 68.7513 192.431 68.814 197.952 70.657C198.132 70.7172 198.246 70.8934 198.226 71.081L197.234 80.3773C197.221 80.499 197.153 80.6082 197.05 80.6742C196.946 80.7403 196.817 80.7561 196.7 80.717C191.339 78.9271 185.706 78.8644 180.21 80.3645C180.08 80.3999 179.941 80.3695 179.839 80.2833C179.737 80.1972 179.684 80.0664 179.698 79.934L180.69 70.6376C180.708 70.4727 180.825 70.3353 180.987 70.2913Z",
  clipRule: "evenodd"
})), _path52 || (_path52 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M204.146 84.5949C202.475 88.4735 196.395 87.3359 193.792 84.2983M151.096 75.1164C151.051 80.7513 155.445 85.9212 163.196 82.0315"
})), _path53 || (_path53 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeLinejoin: "round",
  strokeWidth: 1.472,
  d: "M91.4286 81.6177C90.7002 89.8189 90.9724 97.5829 93.4043 104.414H97.8745M80.2265 81.2383C79.4668 89.4163 79.9818 97.2035 82.3804 104.416H77.9023"
})), _path54 || (_path54 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M118.418 79.0063C125.738 82.8962 128.618 87.451 127.891 91.341M60.7188 71.2266C53.2099 74.5402 49.0923 77.6002 49.0923 84.6246"
})), _path55 || (_path55 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#77AD8C",
  d: "M57.8405 49.7627L54.4609 83.7482L122.802 90.0511L124.245 57.2402L57.8405 49.7627Z"
})), _path56 || (_path56 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#5C9271",
  d: "M57.4763 82.2678L60.1138 50.0181L57.8405 49.7627L54.4609 83.7482L122.802 90.0511L122.929 87.1754L57.4763 82.2678Z"
})), _path57 || (_path57 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#161B18",
  strokeLinecap: "round",
  strokeMiterlimit: 10,
  strokeWidth: 1.105,
  d: "M80.625 72.7485C84.4569 77.4704 91.9816 79.4849 98.0926 74.645"
})), _path58 || (_path58 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M86.7404 98.2362C86.6395 99.1808 89.2899 77.4463 90.0478 70.3836C83.683 66.3494 76.4041 64.7598 69.007 66.1714L65.6997 94.0229C73.0966 92.6123 80.3756 94.202 86.7404 98.2362Z"
})), _path59 || (_path59 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  d: "M86.7762 98.2403C86.6531 99.1824 89.1663 77.4319 90.0836 70.3877C97.2206 67.9197 104.674 68.0388 111.539 71.1048L108.232 98.9563C101.367 95.8914 93.9131 95.7722 86.7762 98.2403Z"
})), _path60 || (_path60 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M85.4666 87.6368C85.952 83.6133 86.6182 78.0621 87.3107 72.2299L87.5129 72.2534C86.8204 78.0857 86.1542 83.637 85.6688 87.6606 85.426 89.6724 85.2284 91.3022 85.0953 92.3943 85.0287 92.9403 84.9783 93.3519 84.9463 93.6096 84.9303 93.7384 84.919 93.829 84.9125 93.8787 84.9095 93.9019 84.9072 93.9196 84.9059 93.9265 84.9058 93.9273 84.9055 93.9288 84.9053 93.9298 84.905 93.9313 84.904 93.9354 84.9032 93.9381 84.9007 93.9456 84.8555 93.9978 84.7948 94.0103 84.7371 93.9848 84.7044 93.9227 84.7037 93.9147 84.7036 93.9118 84.7036 93.9076 84.7036 93.906 84.7037 93.905 84.7038 93.9034 84.7038 93.9026 84.7039 93.9016 84.704 93.9005 84.704 93.8996L84.7041 93.8984C84.7045 93.8939 84.7053 93.887 84.7062 93.8783L84.7072 93.8784C84.7081 93.8719 84.7092 93.8635 84.7106 93.8531 84.7169 93.804 84.7282 93.714 84.7442 93.5852 84.7761 93.3276 84.8266 92.9162 84.8931 92.3702 85.0263 91.2783 85.2238 89.6485 85.4666 87.6368ZM84.7096 93.8787C84.719 93.865 84.7612 93.8213 84.816 93.81 84.8657 93.8319 84.8969 93.881 84.905 93.8992L84.7096 93.8787ZM84.9069 93.9173C84.9069 93.9173 84.9069 93.9168 84.907 93.9156 84.907 93.9166 84.9069 93.9172 84.9069 93.9173ZM83.2047 86.4961C83.6898 82.4675 84.3536 76.9297 85.041 71.1406L85.2433 71.1641C84.5558 76.9533 83.892 82.4912 83.4068 86.5199 83.1643 88.5342 82.9663 90.1713 82.8324 91.2737 82.7654 91.825 82.7144 92.2426 82.6819 92.507 82.6656 92.6391 82.6539 92.7331 82.6471 92.7864 82.6438 92.8123 82.6415 92.8301 82.6403 92.8375 82.6402 92.8385 82.64 92.84 82.6397 92.8417 82.6395 92.8426 82.6391 92.8447 82.6388 92.846 82.6382 92.8487 82.635 92.859 82.6319 92.8666 82.5675 92.9216 82.4527 92.8779 82.4381 92.8368 82.4376 92.8313 82.4374 92.8236 82.4375 92.8214 82.4375 92.8186 82.4377 92.8161 82.4378 92.8153L82.4378 92.8152C82.4381 92.8112 82.4388 92.8048 82.4396 92.7974L82.4404 92.7975C82.4414 92.7897 82.443 92.7777 82.4451 92.7612 82.4518 92.7084 82.4635 92.6148 82.4797 92.4826 82.5123 92.2184 82.5632 91.8009 82.6302 91.2497 82.7641 90.1474 82.9621 88.5104 83.2047 86.4961ZM82.4415 92.7976 82.6407 92.8187C82.6406 92.8167 82.6405 92.8146 82.6403 92.8128 82.6258 92.7718 82.511 92.7281 82.4466 92.783 82.4447 92.7877 82.4428 92.7933 82.4415 92.7976ZM80.9268 85.544C81.4123 81.5046 82.0731 75.9827 82.7518 70.2671L82.9541 70.2905C82.2753 76.0063 81.6145 81.5283 81.129 85.5677 80.8863 87.5874 80.6875 89.2364 80.5521 90.3537 80.4845 90.9124 80.4327 91.3381 80.3993 91.6108 80.3826 91.7471 80.3704 91.8452 80.3632 91.9027 80.3596 91.931 80.3571 91.9503 80.3558 91.9592L80.3558 91.9593C80.3556 91.9609 80.3551 91.9644 80.3545 91.9675 80.3543 91.9687 80.3535 91.9721 80.353 91.9742 80.3512 91.9804 80.3069 92.0358 80.243 92.0497 80.1833 92.0218 80.1527 91.9572 80.1525 91.9507 80.1525 91.9485 80.1525 91.9451 80.1526 91.9438 80.1529 91.9391 80.1536 91.9319 80.1542 91.9265L80.1542 91.9265 80.1548 91.9265C80.156 91.9177 80.1581 91.9016 80.1611 91.8777 80.1683 91.8207 80.1804 91.7228 80.1971 91.5866 80.2305 91.314 80.2823 90.8884 80.35 90.3298 80.4853 89.2126 80.6841 87.5636 80.9268 85.544ZM80.1552 91.9266 80.356 91.9475C80.3539 91.9381 80.3235 91.8765 80.2655 91.8495 80.2017 91.8634 80.1574 91.9187 80.1556 91.9247 80.1555 91.9253 80.1554 91.9259 80.1552 91.9266ZM78.6186 84.7788C79.1047 80.7243 79.7626 75.2187 80.4304 69.5951L80.6326 69.6186C79.9648 75.2422 79.3069 80.7479 78.8208 84.8025 78.5778 86.8299 78.3777 88.4944 78.2408 89.6297 78.1723 90.1973 78.1196 90.6326 78.0853 90.9147 78.0681 91.0558 78.0555 91.1586 78.0478 91.2206 78.044 91.2515 78.0413 91.2727 78.0399 91.2833 78.0395 91.286 78.0392 91.2884 78.0389 91.2904 78.0388 91.2912 78.0385 91.293 78.0381 91.2951 78.0378 91.2966 78.0368 91.3012 78.0359 91.3045 78.028 91.3243 77.9115 91.3748 77.8375 91.2947 77.8364 91.2862 77.836 91.2754 77.8361 91.273 77.8362 91.2719 77.8363 91.2701 77.8363 91.2693 77.8364 91.2686 77.8364 91.268 77.8365 91.2674 77.8366 91.2667 77.8366 91.2661 77.8367 91.2656 77.8369 91.2635 77.8371 91.261 77.8374 91.258L77.8378 91.2581 77.838 91.257C77.8393 91.2474 77.8418 91.2271 77.8457 91.1961 77.8534 91.1344 77.866 91.0317 77.8831 90.8907 77.9175 90.6087 77.9701 90.1734 78.0386 89.6059 78.1755 88.4707 78.3756 86.8061 78.6186 84.7788ZM77.838 91.2581 78.0396 91.2792C78.0395 91.2751 78.039 91.2669 78.0382 91.2602 77.9642 91.1802 77.8478 91.2306 77.8398 91.2503 77.8392 91.2529 77.8384 91.2562 77.838 91.2581ZM78.0394 91.2846 78.0394 91.2842C78.0394 91.2848 78.0393 91.2851 78.0394 91.2846ZM76.2952 84.1978C76.7831 80.1211 77.4387 74.6279 78.0943 69.1069L78.2965 69.1303C77.6409 74.6514 76.9853 80.1446 76.4974 84.2214 76.2535 86.2598 76.0516 87.944 75.9125 89.1006 75.843 89.6789 75.7893 90.1253 75.7538 90.4181 75.7361 90.5645 75.723 90.6725 75.7148 90.7395 75.7107 90.7729 75.7078 90.7963 75.7061 90.8091L75.706 90.8098C75.7054 90.8144 75.7046 90.8209 75.704 90.8246 75.7037 90.8263 75.7019 90.8337 75.7002 90.8394 75.6066 90.9082 75.5036 90.8266 75.5018 90.8074 75.5018 90.8048 75.502 90.8011 75.5021 90.7999L75.5023 90.7976C75.5024 90.7958 75.5027 90.7934 75.5029 90.7912L75.7053 90.8125C75.7053 90.8111 75.7054 90.8091 75.7054 90.8075 75.7036 90.7884 75.6006 90.7068 75.5071 90.7755 75.5054 90.7812 75.5037 90.7885 75.5034 90.7899 75.5033 90.7906 75.5032 90.7911 75.5032 90.7911 75.5032 90.791 75.5034 90.7892 75.5041 90.7838 75.5057 90.7716 75.5085 90.7487 75.5126 90.7152 75.5208 90.6485 75.5339 90.5406 75.5517 90.3942 75.5871 90.1015 75.6408 89.6552 75.7104 89.0769 75.8494 87.9204 76.0513 86.2361 76.2952 84.1978ZM73.9403 83.8362C74.4288 79.7479 75.0808 74.2784 75.7241 68.8614L75.9263 68.8848C75.283 74.3019 74.631 79.7714 74.1425 83.8598 73.8983 85.904 73.695 87.6028 73.5542 88.7772 73.4838 89.3644 73.4289 89.8205 73.3924 90.1231 73.3742 90.2743 73.3605 90.3873 73.3517 90.459 73.3474 90.4949 73.3442 90.5206 73.3423 90.5357 73.3414 90.543 73.3406 90.5487 73.3402 90.5518 73.3402 90.552 73.3398 90.5544 73.3393 90.5571 73.3387 90.5599 73.3272 90.5894 73.3091 90.612 73.2015 90.6324 73.1374 90.5396 73.1375 90.5348 73.1375 90.5334 73.1377 90.5312 73.1377 90.5303L73.1379 90.5284 73.1382 90.5254 73.3407 90.5461C73.3408 90.5452 73.3409 90.5439 73.3409 90.5426 73.341 90.538 73.2769 90.4453 73.1692 90.4657 73.1512 90.4882 73.1397 90.5176 73.1391 90.5203 73.1387 90.5226 73.1385 90.5243 73.1386 90.5235 73.1387 90.5224 73.1393 90.5186 73.1402 90.5109 73.1421 90.4962 73.1452 90.4708 73.1496 90.4349 73.1583 90.3633 73.172 90.2505 73.1902 90.0992 73.2267 89.7967 73.2815 89.3407 73.352 88.7535 73.4928 87.5792 73.6961 85.8804 73.9403 83.8362ZM71.5626 83.6697C72.052 79.5646 72.7012 74.1128 73.3323 68.7983L73.5345 68.8218C72.9034 74.1363 72.2543 79.5881 71.7649 83.6932 71.5202 85.7458 71.3154 87.4616 71.1729 88.6553 71.1016 89.2521 71.0458 89.7184 71.0084 90.0309 70.9897 90.1872 70.9756 90.305 70.9664 90.3815 70.9618 90.4198 70.9584 90.4477 70.9564 90.465L70.9541 90.4831 70.9541 90.4833C70.954 90.4842 70.9537 90.4869 70.9534 90.4888 70.9527 90.4929 70.8392 90.5735 70.751 90.4703 70.7511 90.4676 70.7514 90.4643 70.7514 90.4635L70.7517 90.4612 70.9541 90.4833C70.9541 90.4827 70.9544 90.4796 70.9545 90.477 70.8663 90.3738 70.7528 90.4544 70.7521 90.4583 70.752 90.4593 70.7519 90.46 70.7519 90.46L70.7521 90.4585 70.7542 90.4411C70.7563 90.4239 70.7596 90.396 70.7642 90.3578 70.7734 90.2813 70.7875 90.1635 70.8062 90.0073 70.8436 89.6947 70.8994 89.2285 70.9706 88.6317 71.1132 87.438 71.3179 85.7222 71.5626 83.6697ZM70.918 68.9419 71.1202 68.9654 68.5477 90.6288C68.5443 90.6284 68.5408 90.628 68.5374 90.6276 68.5103 90.6245 68.4341 90.6157 68.3558 90.6065 68.3524 90.6061 68.3489 90.6057 68.3455 90.6053L70.918 68.9419Z",
  clipRule: "evenodd"
})), _path61 || (_path61 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M84.6133 94.2431C79.5956 91.5964 74.0971 90.4375 68.4798 91.0157 68.2566 91.0386 68.057 90.8779 68.034 90.6566 68.011 90.4352 68.1733 90.2372 68.3965 90.2142 74.1846 89.6185 79.8442 90.8147 84.9954 93.5317 85.1934 93.6362 85.2684 93.8801 85.1629 94.0766 85.0574 94.273 84.8113 94.3476 84.6133 94.2431ZM84.9966 91.1572C79.9736 88.5038 74.4704 87.3424 68.847 87.9208 68.6237 87.9438 68.4242 87.783 68.4012 87.5617 68.3782 87.3404 68.5405 87.1423 68.7637 87.1194 74.558 86.5234 80.2226 87.7221 85.3791 90.446 85.5771 90.5506 85.6519 90.7945 85.5463 90.9909 85.4407 91.1873 85.1946 91.2617 84.9966 91.1572ZM85.3718 88.0633C80.3445 85.4104 74.8422 84.2491 69.222 84.8269 68.9988 84.8498 68.7992 84.689 68.7763 84.4677 68.7533 84.2464 68.9156 84.0484 69.1388 84.0254 74.93 83.4301 80.5935 84.6287 85.754 87.352 85.9521 87.4565 86.027 87.7004 85.9215 87.8968 85.8159 88.0933 85.5698 88.1678 85.3718 88.0633ZM85.739 84.9686C80.7117 82.3157 75.2094 81.1544 69.5892 81.7321 69.366 81.7551 69.1664 81.5943 69.1434 81.373 69.1205 81.1517 69.2828 80.9537 69.506 80.9307 75.2972 80.3353 80.9607 81.534 86.1212 84.2572 86.3192 84.3617 86.3942 84.6057 86.2887 84.8021 86.1831 84.9985 85.937 85.0731 85.739 84.9686ZM86.1134 81.8804C81.086 79.2216 75.5771 78.0575 69.9485 78.6373 69.7253 78.6603 69.5257 78.4995 69.5027 78.2782 69.4796 78.0569 69.6419 77.8589 69.8651 77.8359 75.6649 77.2384 81.3353 78.4399 86.4963 81.1694 86.6942 81.2741 86.769 81.5181 86.6633 81.7145 86.5575 81.9108 86.3114 81.9851 86.1134 81.8804ZM86.4768 78.786C81.4492 76.1281 75.9403 74.963 70.3118 75.5428 70.0886 75.5658 69.889 75.405 69.866 75.1837 69.843 74.9624 70.0052 74.7644 70.2285 74.7414 76.0282 74.1439 81.6985 75.3465 86.8596 78.0749 87.0575 78.1796 87.1323 78.4236 87.0266 78.6199 86.9209 78.8163 86.6748 78.8906 86.4768 78.786Z",
  clipRule: "evenodd"
})), _path62 || (_path62 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  d: "M71.0117 68.9532C76.7258 68.3646 82.3155 69.5474 87.4097 72.2415L87.0269 75.3277C81.937 72.6401 76.3531 71.46 70.6443 72.0473L71.0117 68.9532Z"
})), _path63 || (_path63 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#B8BDB9",
  fillRule: "evenodd",
  d: "M71.3774 69.3222L71.1071 71.5989C76.5307 71.1376 81.8307 72.2462 86.6957 74.7018L86.9728 72.468C82.1086 69.9504 76.8019 68.8273 71.3774 69.3222ZM70.9705 68.5522C76.7703 67.9547 82.4407 69.1562 87.6017 71.8857L87.8476 72.0158L87.3584 75.9588L86.8362 75.683C81.8131 73.0307 76.3098 71.8692 70.6864 72.4477L70.182 72.4995L70.6468 68.5855L70.9705 68.5522Z",
  clipRule: "evenodd"
})), _path64 || (_path64 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  fillRule: "evenodd",
  d: "M90.2432 88.1913C90.7135 84.166 91.366 78.613 92.0586 72.7808L92.2608 72.8042C91.5683 78.6363 90.9158 84.1892 90.4455 88.2144 90.2104 90.227 90.0207 91.8577 89.8944 92.9504 89.8313 93.4968 89.784 93.9086 89.7547 94.1664 89.7401 94.2954 89.73 94.3856 89.7247 94.4348 89.7235 94.4452 89.7226 94.4536 89.722 94.4602L89.723 94.4603C89.7219 94.4689 89.721 94.4759 89.7203 94.4803 89.7201 94.4815 89.7199 94.483 89.7196 94.4845L89.7194 94.4858C89.7193 94.4865 89.7191 94.4873 89.719 94.4879 89.7187 94.4894 89.7177 94.4935 89.7169 94.4963 89.7144 94.5039 89.668 94.5569 89.6059 94.5685 89.5498 94.5424 89.518 94.4813 89.5173 94.4734 89.5172 94.4706 89.5172 94.4664 89.5172 94.4649 89.5173 94.4639 89.5174 94.4623 89.5174 94.4615 89.5178 94.4545 89.5197 94.4367 89.5222 94.4135 89.5276 94.3637 89.5377 94.2729 89.5524 94.144 89.5817 93.886 89.629 93.474 89.6921 92.9276 89.8185 91.8347 90.0081 90.2039 90.2432 88.1913ZM89.7196 94.4599C89.7137 94.4444 89.6829 94.3922 89.6322 94.3687 89.5787 94.3787 89.5369 94.4193 89.5247 94.4352L89.7196 94.4599ZM89.5189 94.4507C89.5187 94.4519 89.5186 94.4524 89.5186 94.4523 89.5186 94.4522 89.5187 94.4516 89.5189 94.4507ZM92.712 87.598C93.1841 83.5678 93.836 78.0285 94.5234 72.2393L94.7257 72.2627C94.0382 78.0518 93.3863 83.591 92.9143 87.6211 92.6783 89.6362 92.4872 91.2739 92.3592 92.377 92.2952 92.9285 92.2469 93.3464 92.2166 93.6108 92.2015 93.7431 92.1909 93.8368 92.185 93.8897 92.1832 93.9063 92.1819 93.9182 92.1811 93.9261L92.1819 93.9262C92.1809 93.9336 92.1801 93.94 92.1794 93.9439 92.1793 93.9446 92.1789 93.9472 92.1784 93.95 92.1779 93.9521 92.1759 93.9595 92.1741 93.9647 92.1505 94.0014 92.0284 94.0178 91.9786 93.9493 91.9773 93.9413 91.9767 93.9305 91.9767 93.9279 91.9768 93.9265 91.9768 93.9244 91.9769 93.9234 91.977 93.9218 91.9771 93.9202 91.9772 93.9192 91.9778 93.9118 91.9797 93.894 91.9826 93.868 91.9885 93.8146 91.9992 93.7205 92.0143 93.5882 92.0446 93.3236 92.0929 92.9056 92.1569 92.3541 92.285 91.2509 92.476 89.6131 92.712 87.598ZM92.18 93.9259C92.1797 93.9216 92.1792 93.9157 92.1785 93.9108 92.1286 93.8424 92.0066 93.8589 91.983 93.8954 91.9824 93.8971 91.9818 93.899 91.9812 93.9009L92.18 93.9259ZM95.1535 87.1947C95.6276 83.154 96.2783 77.6307 96.957 71.915L97.1593 71.9385C96.4805 77.6541 95.8298 83.1772 95.3558 87.2178 95.1187 89.2382 94.9259 90.8879 94.7958 92.0057 94.7307 92.5646 94.6814 92.9905 94.65 93.2632 94.6344 93.3996 94.6232 93.4976 94.6169 93.5548 94.6142 93.5787 94.6125 93.5948 94.6116 93.6037L94.6122 93.6037 94.6122 93.6038C94.6115 93.6091 94.6105 93.6164 94.6097 93.621 94.6094 93.6222 94.6087 93.6255 94.6082 93.6277 94.6064 93.6339 94.5615 93.6899 94.4969 93.7033 94.438 93.6752 94.4079 93.6111 94.4076 93.6047 94.4076 93.6025 94.4077 93.5991 94.4077 93.5978 94.4079 93.5946 94.4082 93.5911 94.4084 93.5895L94.4084 93.5895C94.4092 93.5805 94.4113 93.5612 94.4145 93.5328 94.4209 93.4752 94.4321 93.3769 94.4477 93.2405 94.4791 92.9676 94.5284 92.5416 94.5935 91.9827 94.7236 90.8648 94.9165 89.215 95.1535 87.1947ZM94.6112 93.6036C94.6112 93.6029 94.6112 93.6023 94.6112 93.6017 94.6109 93.5955 94.5808 93.5315 94.5219 93.5034 94.4592 93.5164 94.4151 93.5694 94.411 93.5781L94.6112 93.6036ZM97.5765 86.9779C98.0535 82.9222 98.7033 77.4157 99.3711 71.792L99.5733 71.8154C98.9055 77.439 98.2557 82.9455 97.7788 87.0012 97.5403 89.029 97.345 90.6941 97.2122 91.8298 97.1459 92.3976 97.0951 92.833 97.0625 93.1152 97.0461 93.2564 97.0343 93.3591 97.0273 93.4209 97.0238 93.452 97.0215 93.4722 97.0205 93.4819L97.0204 93.483 97.0208 93.4831C97.0205 93.486 97.0201 93.4885 97.0198 93.4906 97.0197 93.4911 97.0197 93.4917 97.0196 93.4924 97.0195 93.493 97.0194 93.4936 97.0193 93.4943 97.0191 93.495 97.0188 93.4968 97.0186 93.4979 97.0181 93.5003 97.0152 93.5107 97.0122 93.5187 96.9214 93.5797 96.82 93.5039 96.8169 93.4829 96.8168 93.4795 96.8169 93.4747 96.8169 93.4732 96.8171 93.4711 96.8172 93.4692 96.8173 93.4685 96.8175 93.4665 96.8177 93.464 96.818 93.4614 96.8191 93.4506 96.8215 93.4294 96.825 93.3985 96.832 93.3365 96.8438 93.2335 96.8602 93.0924 96.8928 92.81 96.9436 92.3745 97.01 91.8067 97.1427 90.6709 97.338 89.0058 97.5765 86.9779ZM97.0203 93.483C97.0203 93.4811 97.0204 93.4776 97.0203 93.475 97.0172 93.454 96.9158 93.3783 96.8251 93.4392 96.8226 93.4456 96.8203 93.4535 96.8193 93.4574L97.0203 93.483ZM96.8182 93.4626C96.8181 93.4632 96.8181 93.4629 96.8182 93.4623L96.8182 93.4626Z",
  clipRule: "evenodd"
})), _path65 || (_path65 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M89.5223 94.0568C95.17 92.5922 100.956 92.7237 106.447 94.6277 106.659 94.7012 106.771 94.931 106.696 95.141 106.622 95.351 106.39 95.4618 106.179 95.3883 100.849 93.5405 95.2288 93.4097 89.7274 94.8363 89.5102 94.8926 89.2883 94.7637 89.2317 94.5485 89.1751 94.3332 89.3052 94.1131 89.5223 94.0568ZM89.865 90.9665C95.5196 89.4967 101.311 89.6267 106.808 91.5324 107.02 91.6058 107.132 91.8356 107.057 92.0457 106.983 92.2557 106.751 92.3665 106.54 92.293 101.204 90.4435 95.5786 90.3141 90.0705 91.7459 89.8534 91.8023 89.6314 91.6736 89.5747 91.4584 89.5179 91.2432 89.6479 91.023 89.865 90.9665ZM90.2363 87.8716C95.8896 86.4026 101.68 86.5325 107.174 88.4369 107.386 88.5103 107.498 88.7401 107.423 88.9501 107.349 89.1602 107.117 89.2709 106.906 89.1975 101.573 87.3494 95.9487 87.22 90.4417 88.651 90.2246 88.7074 90.0026 88.5787 89.9459 88.3634 89.8891 88.1482 90.0191 87.928 90.2363 87.8716ZM90.6034 84.7764C96.2568 83.3074 102.047 83.4373 107.542 85.3417 107.753 85.4151 107.865 85.6449 107.791 85.8549 107.716 86.065 107.485 86.1757 107.273 86.1023 101.941 84.2541 96.3159 84.1248 90.8089 85.5558 90.5918 85.6122 90.3698 85.4834 90.313 85.2682 90.2563 85.053 90.3863 84.8328 90.6034 84.7764ZM90.954 81.6871C96.6142 80.2127 102.412 80.3415 107.914 82.2498 108.126 82.3233 108.237 82.5531 108.163 82.7631 108.089 82.9731 107.857 83.0838 107.645 83.0104 102.306 81.1583 96.6736 81.0302 91.1599 82.4664 90.9428 82.5229 90.7208 82.3943 90.6639 82.1791 90.6071 81.9639 90.7369 81.7436 90.954 81.6871ZM91.3174 78.5921C96.9774 77.1188 102.775 77.2465 108.278 79.1549 108.489 79.2283 108.601 79.4581 108.527 79.6681 108.452 79.8781 108.22 79.9889 108.009 79.9154 102.669 78.0634 97.0368 77.9362 91.5232 79.3714 91.3061 79.4279 91.084 79.2993 91.0272 79.0841 90.9704 78.8689 91.1003 78.6486 91.3174 78.5921ZM91.7051 75.4919C97.3594 74.0231 103.152 74.1532 108.648 76.0589 108.86 76.1323 108.971 76.3621 108.897 76.5721 108.823 76.7821 108.591 76.8929 108.379 76.8194 103.045 74.9701 97.4185 74.8405 91.9104 76.2713 91.6933 76.3277 91.4713 76.199 91.4146 75.9837 91.3579 75.7685 91.4879 75.5483 91.7051 75.4919ZM92.0556 72.4024C97.7158 70.9281 103.514 71.0568 109.016 72.9652 109.228 73.0386 109.339 73.2684 109.265 73.4784 109.191 73.6885 108.959 73.7992 108.747 73.7257 103.407 71.8737 97.7752 71.7455 92.2615 73.1817 92.0444 73.2382 91.8223 73.1096 91.7655 72.8944 91.7086 72.6792 91.8385 72.4589 92.0556 72.4024Z",
  clipRule: "evenodd"
})), _path66 || (_path66 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  d: "M92.1579 72.7919C97.7449 71.3366 103.463 71.4664 108.881 73.3453L107.778 82.6295C102.357 80.7493 96.6424 80.6208 91.0555 82.0761L92.1579 72.7919Z"
})), _path67 || (_path67 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#CBD0D3",
  fillRule: "evenodd",
  d: "M92.5294 73.1132L91.5285 81.5424C96.8412 80.2626 102.262 80.396 107.434 82.0879L108.439 73.6212C103.28 71.8996 97.8517 71.7768 92.5294 73.1132ZM92.0555 72.4024C97.7158 70.9281 103.516 71.0582 109.016 72.9652C109.195 73.0274 109.307 73.2049 109.285 73.3923L108.182 82.6765C108.168 82.7979 108.099 82.9064 107.994 82.9712C107.889 83.0361 107.761 83.0503 107.644 83.01C102.305 81.1579 96.6726 81.0297 91.1589 82.4659C91.029 82.4998 90.8907 82.4678 90.7893 82.3804C90.688 82.2931 90.6368 82.1617 90.6525 82.0295L91.755 72.7453C91.7745 72.5806 91.8938 72.4446 92.0555 72.4024Z",
  clipRule: "evenodd"
})), _path68 || (_path68 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#000",
  strokeLinecap: "round",
  strokeWidth: 1.468,
  d: "M127.892 91.3405C126.563 98.4547 114.974 100.183 103.636 91.3404M49.0877 84.6246C49.0877 90.6753 58.2695 95.706 73.6327 88.0823"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNoAudienceBannerGraphic);

/***/ },

/***/ "./svg/graphics/site-goals-intro-modal-ecommerce.svg"
/*!***********************************************************!*\
  !*** ./svg/graphics/site-goals-intro-modal-ecommerce.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, _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 SvgSiteGoalsIntroModalEcommerce = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 491 179"
}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "site-goals-intro-modal-ecommerce_svg__b",
  width: 491,
  height: 180,
  x: 0,
  y: -1,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "url(#site-goals-intro-modal-ecommerce_svg__a)",
  d: "M0-1H491V179H0z"
}))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#site-goals-intro-modal-ecommerce_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#93C9A8",
  d: "M298.136 -96.5565C320.451 -86.3952 332.619 -64.8841 345.686 -46.1242C357.819 -28.7044 351.217 -1.9078 353.953 19.1222C357.021 42.7081 367.437 64.2218 359.319 89.8576C354.086 101.35 347.41 111.729 339.602 120.878C317.543 146.728 289.951 135.267 256.88 138.846C234.15 141.306 213.197 170.395 162.233 152.598C111.269 134.801 107.227 67.6591 126.641 27.2119C146.055 -13.2353 110.461 -31.841 142.819 -79.5686C175.177 -127.296 255.1 -116.153 298.136 -96.5565Z",
  opacity: 0.15
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#site-goals-intro-modal-ecommerce_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  fillRule: "evenodd",
  d: "M319.125 51.0205C325.866 51.0205 331.331 56.4849 331.331 63.2256V191.34C331.331 198.081 325.866 203.545 319.125 203.545H170.615C163.875 203.545 158.41 198.081 158.41 191.34V63.2256C158.41 56.485 163.875 51.0207 170.615 51.0205H319.125Z",
  clipRule: "evenodd"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  fillRule: "evenodd",
  d: "M314.481 74.4385C316.44 74.4386 318.028 76.0265 318.028 77.9854V111.683C318.028 113.642 316.44 115.23 314.481 115.23H175.258C173.299 115.23 171.711 113.642 171.711 111.683V77.9854C171.711 76.0265 173.299 74.4386 175.258 74.4385H314.481Z",
  clipRule: "evenodd"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 47.886,
  height: 12.415,
  x: 234.672,
  y: 124.623,
  fill: "#EBEEF0",
  rx: 6.207
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 83.357,
  height: 4.434,
  x: 234.672,
  y: 144.132,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 144.132,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 134.377,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 153.886,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 124.623,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 83.357,
  height: 4.434,
  x: 234.672,
  y: 153.886,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#site-goals-intro-modal-ecommerce_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 329.826,
  cy: 55.734,
  r: 23.174,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#446199",
  d: "M330.142 59.0276C330.799 59.0276 331.362 58.7935 331.83 58.3252C332.297 57.8578 332.531 57.2956 332.531 56.6386C332.531 55.9816 332.297 55.419 331.83 54.9508C331.362 54.4833 330.799 54.2496 330.142 54.2496C329.485 54.2496 328.923 54.4833 328.455 54.9508C327.987 55.419 327.753 55.9816 327.753 56.6386C327.753 57.2956 327.987 57.8578 328.455 58.3252C328.923 58.7935 329.485 59.0276 330.142 59.0276ZM336.831 65.0001L332.561 60.7298C332.222 60.9488 331.849 61.118 331.442 61.2374C331.033 61.3569 330.6 61.4166 330.142 61.4166C328.828 61.4166 327.703 60.9488 326.768 60.0131C325.832 59.0774 325.364 57.9526 325.364 56.6386C325.364 55.3246 325.832 54.1998 326.768 53.2641C327.703 52.3284 328.828 51.8606 330.142 51.8606C331.456 51.8606 332.581 52.3284 333.516 53.2641C334.452 54.1998 334.92 55.3246 334.92 56.6386C334.92 57.0965 334.86 57.5245 334.741 57.9227C334.621 58.3209 334.452 58.6892 334.233 59.0276L337.309 62.1035V51.5321L332.591 45.888H322.975V65.0001H336.831ZM322.975 67.3892C322.318 67.3892 321.756 67.1554 321.288 66.688C320.82 66.2197 320.586 65.6571 320.586 65.0001V45.888C320.586 45.2311 320.82 44.6684 321.288 44.2002C321.756 43.7327 322.318 43.499 322.975 43.499H333.726L339.698 50.6661V65.0001C339.698 65.6571 339.464 66.2197 338.997 66.688C338.529 67.1554 337.966 67.3892 337.309 67.3892H322.975Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 198.763,
  cy: 121.37,
  r: 12.153,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 198.764,
  cy: 121.37,
  r: 5.966,
  stroke: "#446199",
  strokeWidth: 1.326
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#446199",
  strokeLinecap: "round",
  strokeWidth: 1.326,
  d: "M200.658 123.264 196.87 119.476M196.869 123.264 200.657 119.476"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 162.989,
  cy: 85.013,
  r: 21.989,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#446199",
  d: "M158.033 96.0965C157.484 96.0965 157.014 95.9013 156.624 95.5107C156.233 95.1195 156.037 94.6494 156.037 94.1005C156.037 93.5515 156.233 93.0815 156.624 92.6902C157.014 92.2997 157.484 92.1044 158.033 92.1044C158.582 92.1044 159.052 92.2997 159.442 92.6902C159.834 93.0815 160.029 93.5515 160.029 94.1005C160.029 94.6494 159.834 95.1195 159.442 95.5107C159.052 95.9013 158.582 96.0965 158.033 96.0965ZM168.014 96.0965C167.465 96.0965 166.995 95.9013 166.604 95.5107C166.213 95.1195 166.017 94.6494 166.017 94.1005C166.017 93.5515 166.213 93.0815 166.604 92.6902C166.995 92.2997 167.465 92.1044 168.014 92.1044C168.562 92.1044 169.033 92.2997 169.424 92.6902C169.814 93.0815 170.01 93.5515 170.01 94.1005C170.01 94.6494 169.814 95.1195 169.424 95.5107C169.033 95.9013 168.562 96.0965 168.014 96.0965ZM157.185 80.1279L159.58 85.1181H166.566L169.311 80.1279H157.185ZM156.237 78.1318H170.958C171.407 78.1318 171.715 78.2982 171.881 78.6308C172.047 78.9635 172.039 79.3128 171.856 79.6788L168.313 86.0662C168.13 86.3989 167.889 86.6567 167.589 86.8397C167.29 87.0227 166.949 87.1142 166.566 87.1142H159.131L158.033 89.1103H170.01V91.1063H158.033C157.285 91.1063 156.719 90.7777 156.336 90.1203C155.954 89.4636 155.937 88.8109 156.287 88.1621L157.634 85.7169L154.041 78.1318H152.045V76.1357H155.289L156.237 78.1318Z"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "site-goals-intro-modal-ecommerce_svg__c",
  width: 201.299,
  height: 180.901,
  x: 144.222,
  y: 40.379,
  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.547
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.094
}), /*#__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_4811_26525"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_4811_26525",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "site-goals-intro-modal-ecommerce_svg__d",
  width: 240.377,
  height: 129.34,
  x: 126.812,
  y: 21.919,
  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.547
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.094
}), /*#__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_4811_26525"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_4811_26525",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("linearGradient", {
  id: "site-goals-intro-modal-ecommerce_svg__a",
  x1: 245.5,
  x2: 245.5,
  y1: -1,
  y2: 179,
  gradientUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("stop", {
  offset: 0.7
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("stop", {
  offset: 0.95,
  stopOpacity: 0
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgSiteGoalsIntroModalEcommerce);

/***/ },

/***/ "./svg/graphics/site-goals-intro-modal-lead.svg"
/*!******************************************************!*\
  !*** ./svg/graphics/site-goals-intro-modal-lead.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, _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 SvgSiteGoalsIntroModalLead = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 491 179"
}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "site-goals-intro-modal-lead_svg__b",
  width: 491,
  height: 180,
  x: 0,
  y: -1,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "url(#site-goals-intro-modal-lead_svg__a)",
  d: "M0-1H491V179H0z"
}))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#site-goals-intro-modal-lead_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#93C9A8",
  d: "M298.136 -96.5565C320.451 -86.3952 332.619 -64.8841 345.686 -46.1242C357.819 -28.7044 351.217 -1.9078 353.953 19.1222C357.021 42.7081 367.437 64.2218 359.319 89.8576C354.086 101.35 347.41 111.729 339.602 120.878C317.543 146.728 289.951 135.267 256.88 138.846C234.15 141.306 213.197 170.395 162.233 152.598C111.269 134.801 107.227 67.6591 126.641 27.2119C146.055 -13.2353 110.461 -31.841 142.819 -79.5686C175.177 -127.296 255.1 -116.153 298.136 -96.5565Z",
  opacity: 0.15
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#site-goals-intro-modal-lead_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  fillRule: "evenodd",
  d: "M319.125 51.0215C325.866 51.0215 331.331 56.4859 331.331 63.2266V191.341C331.331 198.082 325.866 203.546 319.125 203.546H170.615C163.875 203.546 158.41 198.082 158.41 191.341V63.2266C158.41 56.486 163.875 51.0217 170.615 51.0215H319.125Z",
  clipRule: "evenodd"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  fillRule: "evenodd",
  d: "M314.481 74.4395C316.44 74.4396 318.028 76.0275 318.028 77.9863V111.684C318.028 113.643 316.44 115.231 314.481 115.231H175.258C173.299 115.231 171.711 113.643 171.711 111.684V77.9863C171.711 76.0275 173.299 74.4396 175.258 74.4395H314.481Z",
  clipRule: "evenodd"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 47.886,
  height: 12.415,
  x: 234.672,
  y: 124.624,
  fill: "#EBEEF0",
  rx: 6.207
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 83.357,
  height: 4.434,
  x: 234.672,
  y: 144.133,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 144.133,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 134.378,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 153.887,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 124.624,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 83.357,
  height: 4.434,
  x: 234.672,
  y: 153.887,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#site-goals-intro-modal-lead_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 329.826,
  cy: 55.735,
  r: 23.174,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#446199",
  d: "M330.142 59.0286C330.799 59.0286 331.362 58.7945 331.83 58.3262C332.297 57.8588 332.531 57.2965 332.531 56.6396C332.531 55.9826 332.297 55.42 331.83 54.9517C331.362 54.4843 330.799 54.2506 330.142 54.2506C329.485 54.2506 328.923 54.4843 328.455 54.9517C327.987 55.42 327.753 55.9826 327.753 56.6396C327.753 57.2965 327.987 57.8588 328.455 58.3262C328.923 58.7945 329.485 59.0286 330.142 59.0286ZM336.831 65.0011L332.561 60.7308C332.222 60.9497 331.849 61.119 331.442 61.2384C331.033 61.3579 330.6 61.4176 330.142 61.4176C328.828 61.4176 327.703 60.9497 326.768 60.0141C325.832 59.0784 325.364 57.9535 325.364 56.6396C325.364 55.3256 325.832 54.2008 326.768 53.2651C327.703 52.3294 328.828 51.8615 330.142 51.8615C331.456 51.8615 332.581 52.3294 333.516 53.2651C334.452 54.2008 334.92 55.3256 334.92 56.6396C334.92 57.0975 334.86 57.5255 334.741 57.9237C334.621 58.3218 334.452 58.6901 334.233 59.0286L337.309 62.1044V51.5331L332.591 45.889H322.975V65.0011H336.831ZM322.975 67.3901C322.318 67.3901 321.756 67.1564 321.288 66.689C320.82 66.2207 320.586 65.6581 320.586 65.0011V45.889C320.586 45.232 320.82 44.6694 321.288 44.2012C321.756 43.7337 322.318 43.5 322.975 43.5H333.726L339.698 50.667V65.0011C339.698 65.6581 339.464 66.2207 338.997 66.689C338.529 67.1564 337.966 67.3901 337.309 67.3901H322.975Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 198.763,
  cy: 121.371,
  r: 12.153,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 198.764,
  cy: 121.371,
  r: 5.966,
  stroke: "#446199",
  strokeWidth: 1.326
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#446199",
  strokeLinecap: "round",
  strokeWidth: 1.326,
  d: "M200.658 123.265 196.87 119.477M196.869 123.265 200.657 119.477"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 162.989,
  cy: 85.014,
  r: 21.989,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#446199",
  strokeWidth: 2,
  d: "M153.349 89.2769L160.412 98H167.824C170.365 98 171 95.8462 171 94.7692V87.2308C171 86.7447 170.551 85.9602 169.842 85.6154C169.398 85.3994 168.853 85.5825 168.252 85.4174C167.817 85.2977 167.824 85.0071 167.029 84.849C166.384 84.7204 165.919 84.9197 165.441 84.849C164.939 84.7746 164.96 84.3591 164.118 84.2692C163.161 84.1672 162.957 84.5656 162.529 84.5385V78.6154C162.529 78.0769 162.212 77 160.941 77C159.671 77 159.353 78.0769 159.353 78.6154V90.1923C158.294 89.6538 155.541 87.7692 155.118 87.7692C154.779 87.7692 154.08 88.1132 153.452 88.5262C153.199 88.693 153.158 89.0411 153.349 89.2769Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#446199",
  fillRule: "evenodd",
  d: "M161 72C164.314 72 167 74.6863 167 78C167 79.7766 166.227 81.3721 165 82.4707V78C165 75.7909 163.209 74 161 74C158.791 74 157 75.7909 157 78V82.4707C155.773 81.3721 155 79.7766 155 78C155 74.6863 157.686 72 161 72Z",
  clipRule: "evenodd"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "site-goals-intro-modal-lead_svg__c",
  width: 201.299,
  height: 180.901,
  x: 144.222,
  y: 40.38,
  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.547
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.094
}), /*#__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_4811_26843"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_4811_26843",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "site-goals-intro-modal-lead_svg__d",
  width: 240.377,
  height: 129.34,
  x: 126.812,
  y: 21.92,
  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.547
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.094
}), /*#__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_4811_26843"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_4811_26843",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("linearGradient", {
  id: "site-goals-intro-modal-lead_svg__a",
  x1: 245.5,
  x2: 245.5,
  y1: -1,
  y2: 179,
  gradientUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("stop", {
  offset: 0.7
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("stop", {
  offset: 0.95,
  stopOpacity: 0
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgSiteGoalsIntroModalLead);

/***/ },

/***/ "./svg/graphics/site-goals-intro-modal.svg"
/*!*************************************************!*\
  !*** ./svg/graphics/site-goals-intro-modal.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, _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 SvgSiteGoalsIntroModal = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 491 179"
}, props), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("mask", {
  id: "site-goals-intro-modal_svg__b",
  width: 491,
  height: 180,
  x: 0,
  y: -1,
  maskUnits: "userSpaceOnUse",
  style: {
    maskType: "alpha"
  }
}, _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "url(#site-goals-intro-modal_svg__a)",
  d: "M0-1H491V179H0z"
}))), _g || (_g = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  mask: "url(#site-goals-intro-modal_svg__b)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#93C9A8",
  d: "M298.136 -96.5574C320.451 -86.3962 332.619 -64.8851 345.686 -46.1252C357.819 -28.7053 351.217 -1.90878 353.953 19.1212C357.021 42.7071 367.437 64.2208 359.319 89.8566C354.086 101.349 347.41 111.728 339.602 120.877C317.543 146.727 289.951 135.266 256.88 138.845C234.15 141.305 213.197 170.394 162.233 152.597C111.269 134.8 107.227 67.6582 126.641 27.211C146.055 -13.2362 110.461 -31.8419 142.819 -79.5696C175.177 -127.297 255.1 -116.154 298.136 -96.5574Z",
  opacity: 0.15
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#site-goals-intro-modal_svg__c)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#fff",
  fillRule: "evenodd",
  d: "M319.125 51.0215C325.866 51.0215 331.331 56.4859 331.331 63.2266V191.341C331.331 198.082 325.866 203.546 319.125 203.546H170.615C163.875 203.546 158.41 198.082 158.41 191.341V63.2266C158.41 56.486 163.875 51.0217 170.615 51.0215H319.125Z",
  clipRule: "evenodd"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#EBEEF0",
  fillRule: "evenodd",
  d: "M314.481 74.4395C316.44 74.4396 318.028 76.0275 318.028 77.9863V111.684C318.028 113.643 316.44 115.231 314.481 115.231H175.258C173.299 115.231 171.711 113.643 171.711 111.684V77.9863C171.711 76.0275 173.299 74.4396 175.258 74.4395H314.481Z",
  clipRule: "evenodd"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 47.886,
  height: 12.415,
  x: 234.672,
  y: 124.624,
  fill: "#EBEEF0",
  rx: 6.207
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 83.357,
  height: 4.434,
  x: 234.672,
  y: 144.133,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 144.133,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 134.378,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 153.887,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 52.319,
  height: 4.434,
  x: 171.711,
  y: 124.624,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 83.357,
  height: 4.434,
  x: 234.672,
  y: 153.887,
  fill: "#EBEEF0",
  rx: 2.217
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("g", {
  filter: "url(#site-goals-intro-modal_svg__d)"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 198.763,
  cy: 121.371,
  r: 12.153,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 198.764,
  cy: 121.371,
  r: 5.966,
  stroke: "#446199",
  strokeWidth: 1.326
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#446199",
  strokeLinecap: "round",
  strokeWidth: 1.326,
  d: "M200.658 123.265 196.87 119.477M196.869 123.265 200.657 119.477"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 162.989,
  cy: 85.014,
  r: 21.989,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#446199",
  d: "M158.033 96.0975C157.484 96.0975 157.014 95.9022 156.624 95.5117C156.233 95.1204 156.037 94.6504 156.037 94.1014C156.037 93.5525 156.233 93.0824 156.624 92.6912C157.014 92.3006 157.484 92.1054 158.033 92.1054C158.582 92.1054 159.052 92.3006 159.442 92.6912C159.834 93.0824 160.029 93.5525 160.029 94.1014C160.029 94.6504 159.834 95.1204 159.442 95.5117C159.052 95.9022 158.582 96.0975 158.033 96.0975ZM168.014 96.0975C167.465 96.0975 166.995 95.9022 166.604 95.5117C166.213 95.1204 166.017 94.6504 166.017 94.1014C166.017 93.5525 166.213 93.0824 166.604 92.6912C166.995 92.3006 167.465 92.1054 168.014 92.1054C168.562 92.1054 169.033 92.3006 169.424 92.6912C169.814 93.0824 170.01 93.5525 170.01 94.1014C170.01 94.6504 169.814 95.1204 169.424 95.5117C169.033 95.9022 168.562 96.0975 168.014 96.0975ZM157.185 80.1289L159.58 85.1191H166.566L169.311 80.1289H157.185ZM156.237 78.1328H170.958C171.407 78.1328 171.715 78.2991 171.881 78.6318C172.047 78.9645 172.039 79.3138 171.856 79.6798L168.313 86.0672C168.13 86.3999 167.889 86.6577 167.589 86.8407C167.29 87.0237 166.949 87.1152 166.566 87.1152H159.131L158.033 89.1112H170.01V91.1073H158.033C157.285 91.1073 156.719 90.7786 156.336 90.1213C155.954 89.4645 155.937 88.8118 156.287 88.1631L157.634 85.7179L154.041 78.1328H152.045V76.1367H155.289L156.237 78.1328Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 330.047,
  cy: 56.07,
  r: 22.954,
  fill: "#BED4FF"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "#446199",
  strokeWidth: 2.088,
  d: "M319.983 60.5195L327.356 69.6252H335.093C337.745 69.6252 338.409 67.3768 338.409 66.2527V58.3836C338.409 57.8762 337.94 57.0572 337.2 56.6974C336.737 56.4719 336.167 56.6631 335.54 56.4907C335.086 56.3657 335.093 56.0624 334.264 55.8973C333.59 55.7632 333.105 55.9712 332.606 55.8973C332.081 55.8197 332.103 55.3859 331.224 55.2922C330.226 55.1857 330.013 55.6016 329.567 55.5732V49.3903C329.567 48.8283 329.235 47.7041 327.909 47.7041C326.582 47.7041 326.251 48.8283 326.251 49.3903V61.475C325.145 60.9129 322.272 58.9457 321.83 58.9457C321.476 58.9457 320.746 59.3047 320.091 59.7358C319.827 59.91 319.784 60.2733 319.983 60.5195Z"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "#446199",
  fillRule: "evenodd",
  d: "M327.969 42.4854C331.428 42.4856 334.231 45.2902 334.231 48.749C334.231 50.6044 333.424 52.2702 332.142 53.417V48.835C332.142 48.8064 332.144 48.7777 332.144 48.749C332.143 46.4432 330.275 44.5735 327.969 44.5732C325.663 44.5734 323.793 46.4432 323.793 48.749H323.791V53.4131C322.512 52.2664 321.705 50.6022 321.705 48.749C321.705 45.2902 324.51 42.4855 327.969 42.4854Z",
  clipRule: "evenodd"
})))), _defs || (_defs = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("defs", null, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "site-goals-intro-modal_svg__c",
  width: 201.299,
  height: 180.901,
  x: 144.222,
  y: 40.38,
  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.547
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.094
}), /*#__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_4821_56934"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_4821_56934",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("filter", {
  id: "site-goals-intro-modal_svg__d",
  width: 240.377,
  height: 128.785,
  x: 126.812,
  y: 22.475,
  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.547
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feGaussianBlur", {
  stdDeviation: 7.094
}), /*#__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_4821_56934"
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("feBlend", {
  in: "SourceGraphic",
  in2: "effect1_dropShadow_4821_56934",
  result: "shape"
})), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("linearGradient", {
  id: "site-goals-intro-modal_svg__a",
  x1: 245.5,
  x2: 245.5,
  y1: -1,
  y2: 179,
  gradientUnits: "userSpaceOnUse"
}, /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("stop", {
  offset: 0.7
}), /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("stop", {
  offset: 0.95,
  stopOpacity: 0
})))));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgSiteGoalsIntroModal);

/***/ },

/***/ "./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: "currentColor",
  strokeWidth: 1.5,
  d: "M15.2441 10.5898C15.8489 9.56973 17.1698 9.23052 18.1934 9.83496H18.1943C19.215 10.4374 19.5534 11.7497 18.9541 12.7695L15.915 17.792 15.9111 17.7979C15.5096 18.4755 14.7937 18.8535 14.0547 18.8535 13.683 18.8535 13.3059 18.7576 12.9609 18.5537V18.5527C11.9381 17.9491 11.5997 16.633 12.2041 15.6123L12.2031 15.6113 15.2402 10.5967 15.2441 10.5898ZM8.85352 5.63477C9.45822 4.6142 10.7789 4.27444 11.8037 4.87891 12.8264 5.48282 13.1646 6.79923 12.5605 7.81836L12.5566 7.82422 6.75684 17.8008C6.35612 18.4775 5.6401 18.8564 4.90039 18.8564 4.52789 18.8564 4.15095 18.7601 3.80664 18.5566 2.78335 17.952 2.44586 16.6357 3.0498 15.6162L3.05273 15.6104 8.85352 5.63477Z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  stroke: "currentColor",
  strokeWidth: 1.5,
  d: "M4.88672 14.5947C6.06776 14.595 7.02246 15.5504 7.02246 16.7256C7.02231 17.9006 6.06766 18.8552 4.88672 18.8555C3.70557 18.8555 2.75016 17.9007 2.75 16.7256C2.75 15.5503 3.70548 14.5947 4.88672 14.5947Z"
})));
/* 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.459.459 0 0 0 .325-.135l3.037-3.038a.459.459 0 0 0 0-.65L7.015 3.135a.46.46 0 0 0-.65.65L8.61 6.039H3.461a.462.462 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.459.459 0 0 0 .325-.135l3.037-3.038a.459.459 0 0 0 0-.65L7.015 3.135a.46.46 0 0 0-.65.65L8.61 6.039H3.461a.462.462 0 0 0-.461.46c0 .254.207.462.461.462z"
}), ".")));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgArrow);

/***/ },

/***/ "./svg/icons/audience-metric-icon-cities.svg"
/*!***************************************************!*\
  !*** ./svg/icons/audience-metric-icon-cities.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 SvgAudienceMetricIconCities = 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: "M10.0003 18.3332C9.80588 18.3332 9.63921 18.2776 9.50033 18.1665C9.36144 18.0554 9.25727 17.9096 9.18783 17.729C8.92394 16.9512 8.5906 16.2221 8.18783 15.5415C7.79894 14.8609 7.25033 14.0623 6.54199 13.1457C5.83366 12.229 5.25727 11.354 4.81283 10.5207C4.38227 9.68734 4.16699 8.68039 4.16699 7.49984C4.16699 5.87484 4.72949 4.49984 5.85449 3.37484C6.99338 2.23595 8.37533 1.6665 10.0003 1.6665C11.6253 1.6665 13.0003 2.23595 14.1253 3.37484C15.2642 4.49984 15.8337 5.87484 15.8337 7.49984C15.8337 8.76373 15.5906 9.81928 15.1045 10.6665C14.6323 11.4998 14.0837 12.3262 13.4587 13.1457C12.7087 14.1457 12.1392 14.979 11.7503 15.6457C11.3753 16.2984 11.0628 16.9929 10.8128 17.729C10.7434 17.9234 10.6323 18.0762 10.4795 18.1873C10.3406 18.2846 10.1809 18.3332 10.0003 18.3332ZM10.0003 15.354C10.2364 14.8818 10.5003 14.4165 10.792 13.9582C11.0975 13.4998 11.542 12.8887 12.1253 12.1248C12.7225 11.3471 13.2087 10.6318 13.5837 9.979C13.9725 9.31234 14.167 8.48595 14.167 7.49984C14.167 6.34706 13.7573 5.36789 12.9378 4.56234C12.1323 3.74289 11.1531 3.33317 10.0003 3.33317C8.84755 3.33317 7.86144 3.74289 7.04199 4.56234C6.23644 5.36789 5.83366 6.34706 5.83366 7.49984C5.83366 8.48595 6.02116 9.31234 6.39616 9.979C6.78505 10.6318 7.2781 11.3471 7.87533 12.1248C8.45866 12.8887 8.89616 13.4998 9.18783 13.9582C9.49338 14.4165 9.76421 14.8818 10.0003 15.354ZM10.0003 9.58317C10.5837 9.58317 11.0767 9.38178 11.4795 8.979C11.8823 8.57623 12.0837 8.08317 12.0837 7.49984C12.0837 6.9165 11.8823 6.42345 11.4795 6.02067C11.0767 5.61789 10.5837 5.4165 10.0003 5.4165C9.41699 5.4165 8.92394 5.61789 8.52116 6.02067C8.11838 6.42345 7.91699 6.9165 7.91699 7.49984C7.91699 8.08317 8.11838 8.57623 8.52116 8.979C8.92394 9.38178 9.41699 9.58317 10.0003 9.58317Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconCities);

/***/ },

/***/ "./svg/icons/audience-metric-icon-pages-per-visit.svg"
/*!************************************************************!*\
  !*** ./svg/icons/audience-metric-icon-pages-per-visit.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 SvgAudienceMetricIconPagesPerVisit = 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: "M13.1253 16.6668H3.33366C2.87533 16.6668 2.47949 16.5071 2.14616 16.1877C1.82671 15.8543 1.66699 15.4585 1.66699 15.0002V5.00016C1.66699 4.54183 1.82671 4.15294 2.14616 3.8335C2.47949 3.50016 2.87533 3.3335 3.33366 3.3335H16.667C17.1253 3.3335 17.5142 3.50016 17.8337 3.8335C18.167 4.15294 18.3337 4.54183 18.3337 5.00016V15.0002C18.3337 15.4585 18.167 15.8543 17.8337 16.1877C17.5142 16.5071 17.1253 16.6668 16.667 16.6668H15.5003L11.5837 12.7502C11.292 12.9446 10.9725 13.0904 10.6253 13.1877C10.292 13.2849 9.94477 13.3335 9.58366 13.3335C8.54199 13.3335 7.6531 12.9724 6.91699 12.2502C6.19477 11.5141 5.83366 10.6252 5.83366 9.5835C5.83366 8.54183 6.19477 7.65988 6.91699 6.93766C7.6531 6.20155 8.54199 5.8335 9.58366 5.8335C10.6253 5.8335 11.5073 6.20155 12.2295 6.93766C12.9656 7.65988 13.3337 8.54183 13.3337 9.5835C13.3337 9.9585 13.285 10.3127 13.1878 10.646C13.0906 10.9793 12.9448 11.2918 12.7503 11.5835L16.167 15.0002H16.667V5.00016H3.33366V15.0002H11.4587L13.1253 16.6668ZM9.58366 11.6668C10.167 11.6668 10.66 11.4654 11.0628 11.0627C11.4656 10.6599 11.667 10.1668 11.667 9.5835C11.667 9.00016 11.4656 8.50711 11.0628 8.10433C10.66 7.70155 10.167 7.50016 9.58366 7.50016C9.00033 7.50016 8.50727 7.70155 8.10449 8.10433C7.70171 8.50711 7.50033 9.00016 7.50033 9.5835C7.50033 10.1668 7.70171 10.6599 8.10449 11.0627C8.50727 11.4654 9.00033 11.6668 9.58366 11.6668ZM3.33366 15.0002V5.00016V15.0002Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconPagesPerVisit);

/***/ },

/***/ "./svg/icons/audience-metric-icon-pageviews.svg"
/*!******************************************************!*\
  !*** ./svg/icons/audience-metric-icon-pageviews.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 SvgAudienceMetricIconPageviews = 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: "M4.16667 17.5C3.70833 17.5 3.3125 17.3403 2.97917 17.0208C2.65972 16.6875 2.5 16.2917 2.5 15.8333V4.16667C2.5 3.70833 2.65972 3.31945 2.97917 3C3.3125 2.66667 3.70833 2.5 4.16667 2.5H15.8333C16.2917 2.5 16.6806 2.66667 17 3C17.3333 3.31945 17.5 3.70833 17.5 4.16667V15.8333C17.5 16.2917 17.3333 16.6875 17 17.0208C16.6806 17.3403 16.2917 17.5 15.8333 17.5H4.16667ZM4.16667 15.8333H15.8333V5.83333H4.16667V15.8333ZM10 14.1667C8.86111 14.1667 7.84028 13.8611 6.9375 13.25C6.04861 12.625 5.40278 11.8194 5 10.8333C5.40278 9.84722 6.04861 9.04861 6.9375 8.4375C7.84028 7.8125 8.86111 7.5 10 7.5C11.1389 7.5 12.1528 7.8125 13.0417 8.4375C13.9444 9.04861 14.5972 9.84722 15 10.8333C14.5972 11.8194 13.9444 12.625 13.0417 13.25C12.1528 13.8611 11.1389 14.1667 10 14.1667ZM10 12.9167C10.7778 12.9167 11.4861 12.7361 12.125 12.375C12.7639 12 13.2639 11.4861 13.625 10.8333C13.2639 10.1806 12.7639 9.67361 12.125 9.3125C11.4861 8.9375 10.7778 8.75 10 8.75C9.22222 8.75 8.51389 8.9375 7.875 9.3125C7.23611 9.67361 6.73611 10.1806 6.375 10.8333C6.73611 11.4861 7.23611 12 7.875 12.375C8.51389 12.7361 9.22222 12.9167 10 12.9167ZM10 12.0833C9.65278 12.0833 9.35417 11.9653 9.10417 11.7292C8.86806 11.4792 8.75 11.1806 8.75 10.8333C8.75 10.4861 8.86806 10.1944 9.10417 9.95833C9.35417 9.70833 9.65278 9.58333 10 9.58333C10.3472 9.58333 10.6389 9.70833 10.875 9.95833C11.125 10.1944 11.25 10.4861 11.25 10.8333C11.25 11.1806 11.125 11.4792 10.875 11.7292C10.6389 11.9653 10.3472 12.0833 10 12.0833Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconPageviews);

/***/ },

/***/ "./svg/icons/audience-metric-icon-top-content.svg"
/*!********************************************************!*\
  !*** ./svg/icons/audience-metric-icon-top-content.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 SvgAudienceMetricIconTopContent = 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: "M3.33366 16.6668C2.87533 16.6668 2.47949 16.5071 2.14616 16.1877C1.82671 15.8543 1.66699 15.4585 1.66699 15.0002V5.00016C1.66699 4.54183 1.82671 4.15294 2.14616 3.8335C2.47949 3.50016 2.87533 3.3335 3.33366 3.3335H16.667C17.1253 3.3335 17.5142 3.50016 17.8337 3.8335C18.167 4.15294 18.3337 4.54183 18.3337 5.00016V15.0002C18.3337 15.4585 18.167 15.8543 17.8337 16.1877C17.5142 16.5071 17.1253 16.6668 16.667 16.6668H3.33366ZM3.33366 15.0002H12.0837V12.0835H3.33366V15.0002ZM13.7503 15.0002H16.667V7.50016H13.7503V15.0002ZM3.33366 10.4168H12.0837V7.50016H3.33366V10.4168Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconTopContent);

/***/ },

/***/ "./svg/icons/audience-metric-icon-visitors.svg"
/*!*****************************************************!*\
  !*** ./svg/icons/audience-metric-icon-visitors.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 SvgAudienceMetricIconVisitors = 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: "M0.833008 16.6668V14.3335C0.833008 13.8613 0.951063 13.4307 1.18717 13.0418C1.43717 12.6391 1.76356 12.3335 2.16634 12.1252C3.02745 11.6946 3.90245 11.3752 4.79134 11.1668C5.68023 10.9446 6.58301 10.8335 7.49967 10.8335C8.41634 10.8335 9.31912 10.9446 10.208 11.1668C11.0969 11.3752 11.9719 11.6946 12.833 12.1252C13.2358 12.3335 13.5552 12.6391 13.7913 13.0418C14.0413 13.4307 14.1663 13.8613 14.1663 14.3335V16.6668H0.833008ZM15.833 16.6668V14.1668C15.833 13.5557 15.6594 12.9724 15.3122 12.4168C14.9788 11.8474 14.4997 11.3613 13.8747 10.9585C14.583 11.0418 15.2497 11.1877 15.8747 11.396C16.4997 11.5904 17.083 11.8335 17.6247 12.1252C18.1247 12.4029 18.5066 12.7154 18.7705 13.0627C19.0344 13.396 19.1663 13.7641 19.1663 14.1668V16.6668H15.833ZM7.49967 10.0002C6.58301 10.0002 5.79829 9.67377 5.14551 9.021C4.49273 8.36822 4.16634 7.5835 4.16634 6.66683C4.16634 5.75016 4.49273 4.96544 5.14551 4.31266C5.79829 3.65989 6.58301 3.3335 7.49967 3.3335C8.41634 3.3335 9.20106 3.65989 9.85384 4.31266C10.5066 4.96544 10.833 5.75016 10.833 6.66683C10.833 7.5835 10.5066 8.36822 9.85384 9.021C9.20106 9.67377 8.41634 10.0002 7.49967 10.0002ZM15.833 6.66683C15.833 7.5835 15.5066 8.36822 14.8538 9.021C14.2011 9.67377 13.4163 10.0002 12.4997 10.0002C12.3469 10.0002 12.1525 9.98627 11.9163 9.9585C11.6802 9.91683 11.4858 9.87516 11.333 9.8335C11.708 9.38905 11.9927 8.896 12.1872 8.35433C12.3955 7.81266 12.4997 7.25016 12.4997 6.66683C12.4997 6.0835 12.3955 5.521 12.1872 4.97933C11.9927 4.43766 11.708 3.94461 11.333 3.50016C11.5275 3.43072 11.7219 3.38905 11.9163 3.37516C12.1108 3.34738 12.3052 3.3335 12.4997 3.3335C13.4163 3.3335 14.2011 3.65989 14.8538 4.31266C15.5066 4.96544 15.833 5.75016 15.833 6.66683ZM2.49967 15.0002H12.4997V14.3335C12.4997 14.1807 12.458 14.0418 12.3747 13.9168C12.3052 13.7918 12.208 13.6946 12.083 13.6252C11.333 13.2502 10.5761 12.9724 9.81217 12.7918C9.04829 12.5974 8.27745 12.5002 7.49967 12.5002C6.7219 12.5002 5.95106 12.5974 5.18717 12.7918C4.42329 12.9724 3.66634 13.2502 2.91634 13.6252C2.79134 13.6946 2.68717 13.7918 2.60384 13.9168C2.5344 14.0418 2.49967 14.1807 2.49967 14.3335V15.0002ZM7.49967 8.3335C7.95801 8.3335 8.3469 8.17377 8.66634 7.85433C8.99967 7.521 9.16634 7.12516 9.16634 6.66683C9.16634 6.2085 8.99967 5.81961 8.66634 5.50016C8.3469 5.16683 7.95801 5.00016 7.49967 5.00016C7.04134 5.00016 6.64551 5.16683 6.31217 5.50016C5.99273 5.81961 5.83301 6.2085 5.83301 6.66683C5.83301 7.12516 5.99273 7.521 6.31217 7.85433C6.64551 8.17377 7.04134 8.3335 7.49967 8.3335Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconVisitors);

/***/ },

/***/ "./svg/icons/audience-metric-icon-visits-per-visitor.svg"
/*!***************************************************************!*\
  !*** ./svg/icons/audience-metric-icon-visits-per-visitor.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 SvgAudienceMetricIconVisitsPerVisitor = 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: "M10 17.5C8.95833 17.5 7.97917 17.3056 7.0625 16.9167C6.15972 16.5139 5.36806 15.9792 4.6875 15.3125C4.02083 14.6319 3.48611 13.8403 3.08333 12.9375C2.69444 12.0208 2.5 11.0417 2.5 10C2.5 8.95833 2.69444 7.98611 3.08333 7.08333C3.48611 6.16667 4.02083 5.375 4.6875 4.70833C5.36806 4.02778 6.15972 3.49306 7.0625 3.10417C7.97917 2.70139 8.95833 2.5 10 2.5C11.1389 2.5 12.2153 2.74306 13.2292 3.22917C14.2569 3.71528 15.125 4.40278 15.8333 5.29167V3.33333H17.5V8.33333H12.5V6.66667H14.7917C14.2222 5.88889 13.5208 5.27778 12.6875 4.83333C11.8542 4.38889 10.9583 4.16667 10 4.16667C8.375 4.16667 6.99306 4.73611 5.85417 5.875C4.72917 7 4.16667 8.375 4.16667 10C4.16667 11.625 4.72917 13.0069 5.85417 14.1458C6.99306 15.2708 8.375 15.8333 10 15.8333C11.4583 15.8333 12.7292 15.3611 13.8125 14.4167C14.9097 13.4722 15.5556 12.2778 15.75 10.8333H17.4583C17.25 12.7361 16.4306 14.3264 15 15.6042C13.5833 16.8681 11.9167 17.5 10 17.5ZM12.3333 13.5L9.16667 10.3333V5.83333H10.8333V9.66667L13.5 12.3333L12.3333 13.5Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgAudienceMetricIconVisitsPerVisitor);

/***/ },

/***/ "./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 20L4 12L12 4L13.425 5.4L7.825 11H20V13H7.825L13.425 18.6L12 20Z"
})));
/* 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.30866L3.47402 7.44916C4.16347 8.45034 5.4204 8.45035 6.10984 7.44916L10 1.80005"
})));
/* 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.92487 1 1 5.92487 1 12C1 18.0751 5.92487 23 12 23C18.0751 23 23 18.0751 23 12C23 5.92487 18.0751 1 12 1ZM16.8059 9.592L17.3979 8.78606L15.7861 7.60206L15.1941 8.408L11.3039 13.704C11.1378 13.9302 10.944 14 10.7919 14C10.6399 14 10.4461 13.9302 10.28 13.704L8.80594 11.6973L8.21394 10.8914L6.60206 12.0754L7.19406 12.8813L8.66808 14.888C9.19137 15.6004 9.9708 16 10.7919 16C11.6131 16 12.3925 15.6005 12.9158 14.888L16.8059 9.592Z",
  clipRule: "evenodd"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgCheckFill);

/***/ },

/***/ "./svg/icons/chevron-down-v2.svg"
/*!***************************************!*\
  !*** ./svg/icons/chevron-down-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 SvgChevronDownV2 = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  viewBox: "0 0 12 8"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  fillRule: "evenodd",
  d: "M10.6.6L12 2 6 8 0 2 1.4.6 6 5.2z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgChevronDownV2);

/***/ },

/***/ "./svg/icons/chevron-left-outlined.svg"
/*!*********************************************!*\
  !*** ./svg/icons/chevron-left-outlined.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 SvgChevronLeftOutlined = 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", {
  stroke: "currentColor",
  strokeLinecap: "square",
  strokeWidth: 2,
  d: "m11.667 4.167-5 5.833 5 5.834"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgChevronLeftOutlined);

/***/ },

/***/ "./svg/icons/chevron-right-outlined.svg"
/*!**********************************************!*\
  !*** ./svg/icons/chevron-right-outlined.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 SvgChevronRightOutlined = 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", {
  stroke: "currentColor",
  strokeLinecap: "square",
  strokeWidth: 2,
  d: "m8.333 4.167 5 5.833-5 5.834"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgChevronRightOutlined);

/***/ },

/***/ "./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.41L12.59 0L7 5.59L1.41 0L0 1.41L5.59 7L0 12.59L1.41 14L7 8.41L12.59 14L14 12.59L8.41 7L14 1.41Z"
})));
/* 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: "currentColor",
  strokeWidth: 1.5
})), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M10 9L17 6L14.0468 13.0468L7 16L10 9Z"
})), _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/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: "currentColor",
  strokeLinecap: "round",
  strokeWidth: 1.7,
  d: "M11.7749 5.70139L12.355 5.12126C14.1306 3.34566 17.0094 3.34566 18.785 5.12126V5.12126C20.5606 6.89685 20.5606 9.77566 18.785 11.5513L18.1866 12.1497M5.68314 11.7931L5.12125 12.355C3.34566 14.1306 3.34565 17.0094 5.12125 18.785V18.785C6.89685 20.5606 9.77566 20.5606 11.5513 18.785L12.1314 18.2048"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeLinecap: "round",
  strokeWidth: 1.5,
  d: "M8.54297 15.3632 9.66133 14.2448M15.3447 8.56146 14.2263 9.67982M5.10742 5.13412 18.7712 18.7979"
})));
/* 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: "currentColor",
  strokeWidth: 1.5,
  d: "M19 8L19 19C19 20.1046 18.1046 21 17 21L7 21C5.89543 21 5 20.1046 5 19L5 5C5 3.89543 5.89543 3 7 3L14 3L19 8Z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M13.5 9V3L19 9H13.5Z"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeWidth: 1.5,
  d: "M8.5 11.5H15.5M8.5 14.5H15.5M8.5 17.5H13"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgDocumentation);

/***/ },

/***/ "./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 21C4.45 21 3.975 20.8083 3.575 20.425C3.19167 20.025 3 19.55 3 19V5C3 4.45 3.19167 3.98333 3.575 3.6C3.975 3.2 4.45 3 5 3H12V5H5V19H19V12H21V19C21 19.55 20.8 20.025 20.4 20.425C20.0167 20.8083 19.55 21 19 21H5ZM9.7 15.7L8.3 14.3L17.6 5H14V3H21V10H19V6.4L9.7 15.7Z"
})));
/* 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: "currentColor",
  strokeWidth: 1.5,
  d: "M5 5.75H19C19.6904 5.75 20.25 6.30964 20.25 7V16.1611C20.25 16.8515 19.6904 17.4111 19 17.4111H6.63281L6.41406 17.624L3.75 20.2207V7C3.75 6.30964 4.30964 5.75 5 5.75Z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M11.5 8.5H13V12.5H11.5zM11.5 13.5H13V15H11.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 16H11V14H9V16ZM10 0C4.48 0 0 4.48 0 10C0 15.52 4.48 20 10 20C15.52 20 20 15.52 20 10C20 4.48 15.52 0 10 0ZM10 18C5.59 18 2 14.41 2 10C2 5.59 5.59 2 10 2C14.41 2 18 5.59 18 10C18 14.41 14.41 18 10 18ZM10 4C7.79 4 6 5.79 6 8H8C8 6.9 8.9 6 10 6C11.1 6 12 6.9 12 8C12 10 9 9.75 9 13H11C11 10.75 14 10.5 14 8C14 5.79 12.21 4 10 4Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgHelp);

/***/ },

/***/ "./svg/icons/info-circle.svg"
/*!***********************************!*\
  !*** ./svg/icons/info-circle.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 SvgInfoCircle = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 23 22"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  fillRule: "evenodd",
  d: "M11.5 22C9.97833 22 8.54833 21.7158 7.21 21.1475C5.87167 20.5608 4.7075 19.7725 3.7175 18.7825C2.7275 17.7925 1.93917 16.6283 1.3525 15.29C0.784167 13.9517 0.5 12.5217 0.5 11C0.5 9.47833 0.784167 8.04833 1.3525 6.71C1.93917 5.37167 2.7275 4.2075 3.7175 3.2175C4.7075 2.2275 5.87167 1.44833 7.21 0.879999C8.54833 0.293333 9.97833 0 11.5 0C13.0217 0 14.4517 0.293333 15.79 0.879999C17.1283 1.44833 18.2925 2.2275 19.2825 3.2175C20.2725 4.2075 21.0517 5.37167 21.62 6.71C22.2067 8.04833 22.5 9.47833 22.5 11C22.5 12.5217 22.2067 13.9517 21.62 15.29C21.0517 16.6283 20.2725 17.7925 19.2825 18.7825C18.2925 19.7725 17.1283 20.5608 15.79 21.1475C14.4517 21.7158 13.0217 22 11.5 22ZM11.5004 7.7C11.8121 7.7 12.0687 7.59917 12.2704 7.3975C12.4904 7.1775 12.6004 6.91167 12.6004 6.6C12.6004 6.28833 12.4904 6.03167 12.2704 5.83C12.0687 5.61 11.8121 5.5 11.5004 5.5C11.1887 5.5 10.9229 5.61 10.7029 5.83C10.5012 6.03167 10.4004 6.28833 10.4004 6.6C10.4004 6.91167 10.5012 7.1775 10.7029 7.3975C10.9229 7.59917 11.1887 7.7 11.5004 7.7ZM10.4004 16.5V9.9H12.6004V16.5H10.4004Z",
  clipRule: "evenodd"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgInfoCircle);

/***/ },

/***/ "./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.33398 11.333H8.66732V7.33301H7.33398V11.333ZM8.00065 5.99967C8.18954 5.99967 8.3451 5.93856 8.46732 5.81634C8.60065 5.68301 8.66732 5.5219 8.66732 5.33301C8.66732 5.14412 8.60065 4.98856 8.46732 4.86634C8.3451 4.73301 8.18954 4.66634 8.00065 4.66634C7.81176 4.66634 7.65065 4.73301 7.51732 4.86634C7.3951 4.98856 7.33398 5.14412 7.33398 5.33301C7.33398 5.5219 7.3951 5.68301 7.51732 5.81634C7.65065 5.93856 7.81176 5.99967 8.00065 5.99967ZM8.00065 14.6663C7.07843 14.6663 6.21176 14.4941 5.40065 14.1497C4.58954 13.7941 3.88398 13.3163 3.28398 12.7163C2.68398 12.1163 2.20621 11.4108 1.85065 10.5997C1.50621 9.78856 1.33398 8.9219 1.33398 7.99967C1.33398 7.07745 1.50621 6.21078 1.85065 5.39967C2.20621 4.58856 2.68398 3.88301 3.28398 3.28301C3.88398 2.68301 4.58954 2.21078 5.40065 1.86634C6.21176 1.51079 7.07843 1.33301 8.00065 1.33301C8.92287 1.33301 9.78954 1.51079 10.6007 1.86634C11.4118 2.21078 12.1173 2.68301 12.7173 3.28301C13.3173 3.88301 13.7895 4.58856 14.134 5.39967C14.4895 6.21078 14.6673 7.07745 14.6673 7.99967C14.6673 8.9219 14.4895 9.78856 14.134 10.5997C13.7895 11.4108 13.3173 12.1163 12.7173 12.7163C12.1173 13.3163 11.4118 13.7941 10.6007 14.1497C9.78954 14.4941 8.92287 14.6663 8.00065 14.6663ZM8.00065 13.333C9.48954 13.333 10.7507 12.8163 11.784 11.783C12.8173 10.7497 13.334 9.48856 13.334 7.99967C13.334 6.51079 12.8173 5.24967 11.784 4.21634C10.7507 3.18301 9.48954 2.66634 8.00065 2.66634C6.51176 2.66634 5.25065 3.18301 4.21732 4.21634C3.18398 5.24967 2.66732 6.51079 2.66732 7.99967C2.66732 9.48856 3.18398 10.7497 4.21732 11.783C5.25065 12.8163 6.51176 13.333 8.00065 13.333Z"
})));
/* 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/lightbulb.svg"
/*!*********************************!*\
  !*** ./svg/icons/lightbulb.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 SvgLightbulb = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M10 18.333c-.458 0-.854-.16-1.188-.479-.319-.333-.479-.73-.479-1.188h3.334c0 .459-.167.855-.5 1.188-.32.32-.709.48-1.167.48Zm-3.333-2.5v-1.667h6.666v1.667H6.667Zm.208-2.5a6.47 6.47 0 0 1-2.292-2.292c-.555-.958-.833-2-.833-3.125 0-1.736.604-3.208 1.813-4.416C6.784 2.278 8.262 1.667 10 1.667c1.736 0 3.208.61 4.417 1.833 1.222 1.208 1.833 2.68 1.833 4.417a6.008 6.008 0 0 1-.854 3.124 6.303 6.303 0 0 1-2.271 2.292h-6.25Zm.5-1.667h5.25a4.528 4.528 0 0 0 1.438-1.645c.347-.653.52-1.355.52-2.105 0-1.277-.444-2.36-1.333-3.25-.889-.888-1.972-1.333-3.25-1.333s-2.361.445-3.25 1.333c-.889.89-1.333 1.973-1.333 3.25 0 .75.166 1.452.5 2.105a4.722 4.722 0 0 0 1.458 1.645Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgLightbulb);

/***/ },

/***/ "./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.56625 7.49997L10.652 14.5858C11.4331 15.3668 12.6994 15.3668 13.4805 14.5858L20.5 7.56625"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeLinecap: "round",
  strokeWidth: 1.5,
  d: "M20.2461 17.5 15.5 12.7539M4 17.5 8.74607 12.7539"
})));
/* 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: "currentColor",
  strokeWidth: 1.5,
  rx: 2
})), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M9 17H15V20H9z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  stroke: "currentColor",
  strokeLinecap: "round",
  strokeWidth: 1.5,
  d: "M10 9H17M10 12H17"
})), _circle || (_circle = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 7,
  cy: 9,
  r: 1,
  fill: "currentColor"
})), _circle2 || (_circle2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("circle", {
  cx: 7,
  cy: 12,
  r: 1,
  fill: "currentColor"
})));
/* 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: "currentColor",
  viewBox: "0 0 20 20"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M10.953 8.464h2.12c.22 0 .41-.081.573-.243a.785.785 0 0 0 .243-.574.782.782 0 0 0-.243-.573.782.782 0 0 0-.574-.244h-2.12a.785.785 0 0 0-.573.244.784.784 0 0 0-.243.573c0 .22.081.412.243.574a.787.787 0 0 0 .574.243Zm0 4.706h2.12c.22 0 .41-.082.573-.244a.782.782 0 0 0 .243-.573.785.785 0 0 0-.243-.574.784.784 0 0 0-.574-.243h-2.12c-.22 0-.41.081-.573.243a.787.787 0 0 0-.243.574c0 .22.081.411.243.573a.785.785 0 0 0 .574.244ZM6.79 9.32h1.712c.22 0 .411-.082.573-.244a.782.782 0 0 0 .244-.573V6.79a.782.782 0 0 0-.244-.573.784.784 0 0 0-.573-.243H6.79a.784.784 0 0 0-.573.243.784.784 0 0 0-.243.573v1.712c0 .22.081.411.243.573a.782.782 0 0 0 .573.244Zm0 4.704h1.712c.22 0 .411-.08.573-.242a.782.782 0 0 0 .244-.573v-1.712a.782.782 0 0 0-.244-.573.782.782 0 0 0-.573-.244H6.79a.782.782 0 0 0-.573.244.784.784 0 0 0-.243.573v1.712c0 .22.081.411.243.573a.784.784 0 0 0 .573.242ZM4.633 17c-.453 0-.839-.159-1.157-.476A1.577 1.577 0 0 1 3 15.367V4.633c0-.453.159-.839.476-1.157A1.577 1.577 0 0 1 4.633 3h10.734c.453 0 .839.159 1.157.476.317.318.476.704.476 1.157v10.734c0 .453-.159.839-.476 1.157a1.578 1.578 0 0 1-1.157.476H4.633Zm0-1.633h10.734V4.633H4.633v10.734Z"
})));
/* 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: "currentColor",
  viewBox: "0 0 20 20"
}, props), _rect || (_rect = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5.833,
  height: 5.833,
  x: 3,
  y: 3,
  rx: 1.167
})), _rect2 || (_rect2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5.833,
  height: 5.833,
  x: 11.167,
  y: 3,
  rx: 1.167
})), _rect3 || (_rect3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5.833,
  height: 5.833,
  x: 3,
  y: 11.167,
  rx: 1.167
})), _rect4 || (_rect4 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("rect", {
  width: 5.833,
  height: 5.833,
  x: 11.167,
  y: 11.167,
  rx: 1.167
})));
/* 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: "currentColor",
  viewBox: "0 0 20 20"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M2.313 14.375a.836.836 0 0 1-.25-.615c0-.243.083-.447.25-.614l3.75-3.75c.5-.5 1.1-.75 1.803-.75.7 0 1.295.25 1.78.75l.958.958a.777.777 0 0 0 .574.229c.229 0 .42-.076.572-.229l3.604-3.604h-1.228a.843.843 0 0 1-.615-.26.843.843 0 0 1-.26-.615.84.84 0 0 1 .26-.615.843.843 0 0 1 .615-.26h3.333c.236 0 .44.087.614.26a.84.84 0 0 1 .26.615v3.333a.843.843 0 0 1-.26.615.843.843 0 0 1-.614.26.84.84 0 0 1-.614-.26.841.841 0 0 1-.261-.615V7.979l-3.625 3.604c-.5.5-1.101.75-1.803.75-.7 0-1.295-.25-1.78-.75l-.98-.979a.752.752 0 0 0-.552-.229.748.748 0 0 0-.551.229L3.52 14.375a.823.823 0 0 1-.603.25.824.824 0 0 1-.606-.25Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavMonetizationIcon);

/***/ },

/***/ "./svg/icons/nav-site-goals-icon.svg"
/*!*******************************************!*\
  !*** ./svg/icons/nav-site-goals-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, _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 SvgNavSiteGoalsIcon = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "currentColor",
  viewBox: "0 0 20 20"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M10 3c1.023 0 1.994.22 2.87.615l-.13.135-.053.322-.146.877-.71.758a4.667 4.667 0 1 0 2.316 2.156l.677-.676.963-.19.368-.333A7 7 0 1 1 10 3Z"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M12 10a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z"
})), _path3 || (_path3 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "m15.76 3.856 2.042-.07-2.5 2.243-.992.199-4.563 4.563-.642-.642 4.412-4.715.198-1.19L15.895 2l-.135 1.856Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgNavSiteGoalsIcon);

/***/ },

/***/ "./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;
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: "currentColor",
  viewBox: "0 0 20 20"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M8.668 12.938c.333.32.774.482 1.323.489.548.007.954-.19 1.218-.594l3.417-5.125c.139-.208.118-.402-.063-.583-.18-.18-.374-.202-.583-.063l-5.167 3.396c-.403.25-.61.642-.624 1.177-.014.535.146.97.479 1.303Zm-4.334 3.729c-.32 0-.618-.07-.895-.209a1.473 1.473 0 0 1-.646-.625 8.493 8.493 0 0 1-.834-1.989 8.207 8.207 0 0 1-.291-2.198c0-1.139.219-2.212.656-3.219a8.486 8.486 0 0 1 1.792-2.646A8.447 8.447 0 0 1 6.772 3.99a8.056 8.056 0 0 1 3.229-.657c.625 0 1.23.063 1.812.188a7.328 7.328 0 0 1 1.688.583.762.762 0 0 1 .458.604c.042.278-.041.535-.25.771a.821.821 0 0 1-.489.261.952.952 0 0 1-.573-.073 6.361 6.361 0 0 0-2.646-.584c-1.82 0-3.371.642-4.656 1.927-1.285 1.285-1.927 2.83-1.927 4.636 0 .57.083 1.135.25 1.698a7.43 7.43 0 0 0 .666 1.573h11.334a6.07 6.07 0 0 0 .687-1.615 6.768 6.768 0 0 0 .229-1.74c0-.43-.052-.87-.156-1.322a5.414 5.414 0 0 0-.469-1.282.82.82 0 0 1-.073-.583.874.874 0 0 1 .303-.479c.236-.18.486-.243.75-.188.263.056.458.216.583.48a9.51 9.51 0 0 1 .594 1.604 6.57 6.57 0 0 1 .218 1.708 8.518 8.518 0 0 1-.26 2.281 7.92 7.92 0 0 1-.844 2.052 1.451 1.451 0 0 1-.667.625c-.291.14-.59.209-.895.209H4.334Z"
})));
/* 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: "currentColor",
  viewBox: "0 0 20 20"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M4.94 17a1.39 1.39 0 0 1-1.02-.418 1.39 1.39 0 0 1-.418-1.022V8.226c0-.403.14-.743.418-1.022a1.388 1.388 0 0 1 1.02-.418c.403 0 .744.14 1.022.418.279.279.418.62.418 1.022v7.334c0 .403-.14.744-.418 1.022A1.39 1.39 0 0 1 4.94 17Zm5.077-.002a1.39 1.39 0 0 1-1.022-.417 1.39 1.39 0 0 1-.418-1.022l-.016-11.12c0-.402.14-.743.418-1.021A1.39 1.39 0 0 1 10.001 3c.403 0 .743.14 1.022.418.278.278.418.619.418 1.02l.015 11.12c0 .403-.14.744-.418 1.023a1.39 1.39 0 0 1-1.021.418Zm5.045.002a1.39 1.39 0 0 1-1.022-.418 1.39 1.39 0 0 1-.418-1.022v-3.62c0-.403.14-.744.418-1.022a1.39 1.39 0 0 1 1.022-.418c.402 0 .742.14 1.02.418.279.278.418.619.418 1.021v3.621c0 .403-.14.744-.418 1.022a1.388 1.388 0 0 1-1.02.418Z"
})));
/* 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.1489 7.96092L6.98342 13.1264C6.93544 13.1744 6.90273 13.2356 6.88942 13.3021L6.5385 15.0567C6.49039 15.2972 6.70246 15.5093 6.94299 15.4612L8.69758 15.1103C8.76413 15.097 8.82525 15.0642 8.87324 15.0163L14.0388 9.85073L12.1489 7.96092ZM14.4502 6.1458C14.0475 5.74307 13.3945 5.74307 12.9918 6.1458L6.49729 12.6403C6.35333 12.7843 6.2552 12.9676 6.21527 13.1673L5.86435 14.9219C5.72003 15.6435 6.35623 16.2796 7.07782 16.1353L8.83241 15.7844C9.03205 15.7445 9.21541 15.6464 9.35937 15.5024L15.8539 9.00788C16.2566 8.60515 16.2566 7.9522 15.8539 7.54947L14.4502 6.1458Z",
  clipRule: "evenodd"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  d: "M12.1489 7.96092L12.2656 7.84425C12.2012 7.77981 12.0967 7.77981 12.0323 7.84425L12.1489 7.96092ZM6.98342 13.1264L6.86675 13.0098H6.86675L6.98342 13.1264ZM6.88942 13.3021L7.05121 13.3345L6.88942 13.3021ZM6.5385 15.0567L6.70029 15.0891L6.5385 15.0567ZM6.94299 15.4612L6.97535 15.623H6.97535L6.94299 15.4612ZM8.69758 15.1103L8.72994 15.2721H8.72994L8.69758 15.1103ZM8.87324 15.0163L8.98991 15.1329L8.98991 15.1329L8.87324 15.0163ZM14.0388 9.85073L14.1554 9.96741C14.2199 9.90297 14.2199 9.7985 14.1554 9.73406L14.0388 9.85073ZM12.9918 6.1458L13.1085 6.26247V6.26247L12.9918 6.1458ZM14.4502 6.1458L14.3335 6.26247L14.4502 6.1458ZM6.49729 12.6403L6.61396 12.757H6.61396L6.49729 12.6403ZM6.21527 13.1673L6.05347 13.1349H6.05347L6.21527 13.1673ZM5.86435 14.9219L6.02615 14.9542H6.02615L5.86435 14.9219ZM7.07782 16.1353L7.04546 15.9735H7.04546L7.07782 16.1353ZM8.83241 15.7844L8.86477 15.9462H8.86477L8.83241 15.7844ZM9.35937 15.5024L9.47604 15.6191L9.35937 15.5024ZM15.8539 9.00788L15.7372 8.89121V8.89121L15.8539 9.00788ZM15.8539 7.54947L15.9706 7.4328V7.4328L15.8539 7.54947ZM12.0323 7.84425L6.86675 13.0098L7.1001 13.2431L12.2656 8.0776L12.0323 7.84425ZM6.86675 13.0098C6.79573 13.0808 6.74732 13.1713 6.72762 13.2697L7.05121 13.3345C7.05813 13.2999 7.07514 13.2681 7.1001 13.2431L6.86675 13.0098ZM6.72762 13.2697L6.3767 15.0243L6.70029 15.0891L7.05121 13.3345L6.72762 13.2697ZM6.3767 15.0243C6.30551 15.3803 6.61936 15.6942 6.97535 15.623L6.91063 15.2994C6.78555 15.3244 6.67528 15.2141 6.70029 15.0891L6.3767 15.0243ZM6.97535 15.623L8.72994 15.2721L8.66522 14.9485L6.91063 15.2994L6.97535 15.623ZM8.72994 15.2721C8.82843 15.2524 8.91889 15.204 8.98991 15.1329L8.75656 14.8996C8.73161 14.9245 8.69983 14.9415 8.66522 14.9485L8.72994 15.2721ZM8.98991 15.1329L14.1554 9.96741L13.9221 9.73406L8.75656 14.8996L8.98991 15.1329ZM12.0323 8.0776L13.9221 9.96741L14.1554 9.73406L12.2656 7.84425L12.0323 8.0776ZM13.1085 6.26247C13.4468 5.92418 13.9952 5.92418 14.3335 6.26247L14.5669 6.02912C14.0997 5.56196 13.3423 5.56196 12.8751 6.02912L13.1085 6.26247ZM6.61396 12.757L13.1085 6.26247L12.8751 6.02912L6.38062 12.5236L6.61396 12.757ZM6.37706 13.1996C6.4106 13.0319 6.49303 12.8779 6.61396 12.757L6.38062 12.5236C6.21362 12.6906 6.09979 12.9033 6.05347 13.1349L6.37706 13.1996ZM6.02615 14.9542L6.37706 13.1996L6.05347 13.1349L5.70255 14.8895L6.02615 14.9542ZM7.04546 15.9735C6.43933 16.0948 5.90492 15.5604 6.02615 14.9542L5.70255 14.8895C5.53515 15.7265 6.27314 16.4645 7.11018 16.2971L7.04546 15.9735ZM8.80005 15.6226L7.04546 15.9735L7.11018 16.2971L8.86477 15.9462L8.80005 15.6226ZM9.2427 15.3857C9.12177 15.5066 8.96775 15.5891 8.80005 15.6226L8.86477 15.9462C9.09635 15.8999 9.30905 15.7861 9.47604 15.6191L9.2427 15.3857ZM15.7372 8.89121L9.2427 15.3857L9.47604 15.6191L15.9706 9.12455L15.7372 8.89121ZM15.7372 7.66614C16.0755 8.00444 16.0755 8.55292 15.7372 8.89121L15.9706 9.12455C16.4377 8.65739 16.4377 7.89996 15.9706 7.4328L15.7372 7.66614ZM14.3335 6.26247L15.7372 7.66614L15.9706 7.4328L14.5669 6.02912L14.3335 6.26247Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgPencilAlt);

/***/ },

/***/ "./svg/icons/pie-chart-zero-data.svg"
/*!*******************************************!*\
  !*** ./svg/icons/pie-chart-zero-data.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 SvgPieChartZeroData = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 238 238"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  fillRule: "evenodd",
  d: "M119 238C184.722 238 238 184.722 238 119C238 53.2781 184.722 0 119 0C53.2781 0 0 53.2781 0 119C0 184.722 53.2781 238 119 238ZM119 196C161.526 196 196 161.526 196 119C196 76.4741 161.526 42 119 42C76.4741 42 42 76.4741 42 119C42 161.526 76.4741 196 119 196Z",
  clipRule: "evenodd"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgPieChartZeroData);

/***/ },

/***/ "./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 22L8.15 14.4L2 10H9.6L12 2L14.4 10H22L15.85 14.4L18.175 22L12 17.3L5.825 22Z"
})));
/* 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 2C16.9707 2 21.001 6.02927 21.001 11C21.001 13.2824 20.1512 15.3666 18.751 16.9531C18.2234 17.5509 17.6171 18.078 16.9492 18.5186C16.2454 18.9827 15.4726 19.3514 14.6494 19.6045C14.478 19.6572 14.3035 19.7026 14.1279 19.7451C10.5087 21.8231 5 23 5 23C5.02317 22.9826 7.68924 20.9755 8.05273 19.0889C7.70616 18.9194 7.37158 18.7295 7.05176 18.5186C6.42449 18.1049 5.85202 17.6147 5.34766 17.0615C3.88944 15.462 3.00001 13.335 3 11C3 6.02937 7.02941 2.00017 12 2Z"
}))), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M12 2V0.5H11.9999L12 2ZM21.001 11L22.501 11V11H21.001ZM18.751 16.9531L19.8756 17.9457L19.8756 17.9457L18.751 16.9531ZM16.9492 18.5186L17.7751 19.7707L17.7751 19.7707L16.9492 18.5186ZM14.6494 19.6045L15.0902 21.0383L15.0903 21.0382L14.6494 19.6045ZM14.1279 19.7451L13.7745 18.2873L13.5666 18.3378L13.3811 18.4443L14.1279 19.7451ZM5 23L4.09897 21.8008L-1.34207 25.8888L5.3134 24.4669L5 23ZM8.05273 19.0889L9.52565 19.3726L9.74281 18.2455L8.7116 17.7413L8.05273 19.0889ZM7.05176 18.5186L6.22592 19.7707L6.22593 19.7708L7.05176 18.5186ZM5.34766 17.0615L4.23917 18.0721L4.23918 18.0721L5.34766 17.0615ZM3 11H1.5V11L3 11ZM12 2V3.5C16.1425 3.5 19.501 6.85791 19.501 11H21.001H22.501C22.501 5.20063 17.7989 0.5 12 0.5V2ZM21.001 11L19.501 11C19.501 12.903 18.794 14.6375 17.6263 15.9606L18.751 16.9531L19.8756 17.9457C21.5084 16.0957 22.501 13.6619 22.501 11L21.001 11ZM18.751 16.9531L17.6264 15.9605C17.1864 16.459 16.6806 16.8989 16.1233 17.2664L16.9492 18.5186L17.7751 19.7707C18.5537 19.2572 19.2604 18.6427 19.8756 17.9457L18.751 16.9531ZM16.9492 18.5186L16.1234 17.2664C15.5361 17.6537 14.8926 17.9604 14.2085 18.1707L14.6494 19.6045L15.0903 21.0382C16.0525 20.7423 16.9547 20.3118 17.7751 19.7707L16.9492 18.5186ZM14.6494 19.6045L14.2086 18.1707C14.0778 18.2109 13.9358 18.2482 13.7745 18.2873L14.1279 19.7451L14.4813 21.2029C14.6712 21.1569 14.8782 21.1034 15.0902 21.0383L14.6494 19.6045ZM14.1279 19.7451L13.3811 18.4443C11.72 19.398 9.56684 20.1727 7.77207 20.7162C6.88585 20.9845 6.10875 21.19 5.55454 21.3282C5.27775 21.3971 5.0574 21.4491 4.90781 21.4835C4.83304 21.5007 4.77602 21.5134 4.73853 21.5217C4.71979 21.5259 4.70594 21.5289 4.69721 21.5308C4.69285 21.5318 4.68976 21.5324 4.68798 21.5328C4.68709 21.533 4.68653 21.5331 4.6863 21.5332C4.68618 21.5332 4.68615 21.5332 4.6862 21.5332C4.68622 21.5332 4.68632 21.5332 4.68633 21.5332C4.68645 21.5331 4.6866 21.5331 5 23C5.3134 24.4669 5.31359 24.4669 5.31379 24.4668C5.31389 24.4668 5.31411 24.4667 5.31431 24.4667C5.31469 24.4666 5.31516 24.4665 5.31571 24.4664C5.31682 24.4662 5.31826 24.4659 5.32003 24.4655C5.32358 24.4647 5.32845 24.4637 5.33461 24.4623C5.34695 24.4596 5.36447 24.4558 5.38697 24.4508C5.43194 24.4409 5.4968 24.4263 5.57973 24.4073C5.74554 24.3692 5.98383 24.3129 6.28004 24.2391C6.87181 24.0916 7.69809 23.8731 8.64146 23.5874C10.5058 23.0229 12.9167 22.1702 14.8748 21.046L14.1279 19.7451ZM5 23L5.90103 24.1992C5.94203 24.1684 6.68443 23.6084 7.47742 22.7877C8.21163 22.0279 9.25427 20.7812 9.52565 19.3726L8.05273 19.0889L6.57982 18.8051C6.48771 19.2832 6.01557 19.9833 5.32007 20.7031C4.68337 21.362 4.08114 21.8142 4.09897 21.8008L5 23ZM8.05273 19.0889L8.7116 17.7413C8.42011 17.5988 8.14153 17.4404 7.87759 17.2664L7.05176 18.5186L6.22593 19.7708C6.60163 20.0185 6.99221 20.24 7.39386 20.4364L8.05273 19.0889ZM7.05176 18.5186L7.8776 17.2664C7.35464 16.9215 6.87703 16.5126 6.45613 16.0509L5.34766 17.0615L4.23918 18.0721C4.82701 18.7169 5.49434 19.2883 6.22592 19.7707L7.05176 18.5186ZM5.34766 17.0615L6.45614 16.0509C5.23983 14.7168 4.50001 12.9465 4.5 11L3 11L1.5 11C1.50002 13.7234 2.53905 16.2073 4.23917 18.0721L5.34766 17.0615ZM3 11H4.5C4.5 6.85785 7.8578 3.50014 12.0001 3.5L12 2L11.9999 0.5C6.20102 0.500195 1.5 5.20089 1.5 11H3Z",
  mask: "url(#support_svg__a)"
})), _path2 || (_path2 = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M11.7959 16C12.1205 16 12.3931 15.8961 12.6137 15.6883C12.835 15.4812 12.9456 15.2256 12.9456 14.9215C12.9456 14.6168 12.835 14.3609 12.6137 14.1537C12.3931 13.9459 12.1205 13.8421 11.7959 13.8421C11.4721 13.8421 11.1999 13.9459 10.9793 14.1537C10.758 14.3609 10.6473 14.6168 10.6473 14.9215C10.6473 15.2256 10.758 15.4812 10.9793 15.6883C11.1999 15.8961 11.4721 16 11.7959 16ZM11.9062 7.4728C12.3192 7.4728 12.6543 7.5767 12.9117 7.78449C13.1698 7.99162 13.2988 8.25419 13.2988 8.57218C13.2988 8.79392 13.2178 9.02926 13.0559 9.27822C12.894 9.52717 12.6656 9.76916 12.3708 10.0042C11.8992 10.3912 11.5566 10.7474 11.3431 11.0727C11.1295 11.3973 11.0228 11.719 11.0228 12.0376C11.0228 12.2448 11.0967 12.4174 11.2444 12.5555C11.3915 12.6942 11.5828 12.7636 11.8182 12.7636C12.0395 12.7636 12.2347 12.6942 12.4037 12.5555C12.5734 12.4174 12.6801 12.2308 12.724 11.9958C12.7685 11.7747 12.8682 11.564 13.023 11.3635C13.1772 11.1623 13.431 10.9027 13.7846 10.5847C14.2562 10.1698 14.5768 9.80003 14.7465 9.47539C14.9155 9.15009 15 8.79392 15 8.40688C15 7.68723 14.7203 7.10634 14.1611 6.6642C13.6011 6.22139 12.8643 5.99999 11.9508 5.99999C11.3321 5.99999 10.7908 6.11417 10.327 6.34255C9.86318 6.57092 9.46192 6.91315 9.12324 7.36924C9.00516 7.52127 8.97193 7.68723 9.02354 7.86715C9.07516 8.04706 9.18192 8.19908 9.34384 8.32323C9.53546 8.46198 9.75252 8.50712 9.99505 8.45866C10.2383 8.4102 10.4408 8.28207 10.6028 8.07427C10.7647 7.88109 10.9528 7.73271 11.167 7.62914C11.3805 7.52492 11.6269 7.4728 11.9062 7.4728Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgSupport);

/***/ },

/***/ "./svg/icons/thumb-down.svg"
/*!**********************************!*\
  !*** ./svg/icons/thumb-down.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 SvgThumbDown = 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: "M2.50065 13.3333C2.05621 13.3333 1.66732 13.1667 1.33398 12.8333C1.00065 12.5 0.833984 12.1111 0.833984 11.6667V10C0.833984 9.90278 0.847873 9.79861 0.875651 9.6875C0.903429 9.57639 0.931207 9.47222 0.958984 9.375L3.45898 3.5C3.58398 3.22222 3.79232 2.98611 4.08398 2.79167C4.37565 2.59722 4.68121 2.5 5.00065 2.5H14.1673V13.3333L8.33398 19.1667L7.29232 18.125C7.1951 18.0278 7.11176 17.8958 7.04232 17.7292C6.98676 17.5625 6.95898 17.4028 6.95898 17.25V16.9583L7.87565 13.3333H2.50065ZM12.5007 4.16667H5.00065L2.50065 10V11.6667H10.0007L8.87565 16.25L12.5007 12.625V4.16667ZM12.5007 12.625V11.6667V10V4.16667V12.625ZM14.1673 13.3333V11.6667H16.6673V4.16667H14.1673V2.5H18.334V13.3333H14.1673Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgThumbDown);

/***/ },

/***/ "./svg/icons/thumb-up.svg"
/*!********************************!*\
  !*** ./svg/icons/thumb-up.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 SvgThumbUp = 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: "M14.9994 17.4997H5.83268V6.66634L11.666 0.833008L12.7077 1.87467C12.8049 1.9719 12.8813 2.10384 12.9368 2.27051C13.0063 2.43717 13.041 2.5969 13.041 2.74967V3.04134L12.1243 6.66634H17.4994C17.9438 6.66634 18.3327 6.83301 18.666 7.16634C18.9993 7.49967 19.166 7.88856 19.166 8.33301V9.99967C19.166 10.0969 19.1521 10.2011 19.1243 10.3122C19.0966 10.4233 19.0688 10.5275 19.041 10.6247L16.541 16.4997C16.416 16.7775 16.2077 17.0136 15.916 17.208C15.6243 17.4025 15.3188 17.4997 14.9994 17.4997ZM7.49935 15.833H14.9994L17.4994 9.99967V8.33301H9.99935L11.1243 3.74967L7.49935 7.37467V15.833ZM7.49935 7.37467V8.33301V9.99967V15.833V7.37467ZM5.83268 6.66634V8.33301H3.33268V15.833H5.83268V17.4997H1.66602V6.66634H5.83268Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgThumbUp);

/***/ },

/***/ "./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.83836L4.10586 7L10 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.33333C10.7564 1.33333 13.2145 2.75333 14.4145 5C13.2145 7.24667 10.7564 8.66667 8 8.66667C5.24364 8.66667 2.78545 7.24667 1.58545 5C2.78545 2.75333 5.24364 1.33333 8 1.33333ZM8 0C4.36364 0 1.25818 2.07333 0 5C1.25818 7.92667 4.36364 10 8 10C11.6364 10 14.7418 7.92667 16 5C14.7418 2.07333 11.6364 0 8 0ZM8 3.33333C9.00364 3.33333 9.81818 4.08 9.81818 5C9.81818 5.92 9.00364 6.66667 8 6.66667C6.99636 6.66667 6.18182 5.92 6.18182 5C6.18182 4.08 6.99636 3.33333 8 3.33333ZM8 2C6.19636 2 4.72727 3.34667 4.72727 5C4.72727 6.65333 6.19636 8 8 8C9.80364 8 11.2727 6.65333 11.2727 5C11.2727 3.34667 9.80364 2 8 2Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgView);

/***/ },

/***/ "./svg/icons/visibility.svg"
/*!**********************************!*\
  !*** ./svg/icons/visibility.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 SvgVisibility = props => /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("svg", _extends({
  xmlns: "http://www.w3.org/2000/svg",
  fill: "none",
  viewBox: "0 0 19 19"
}, props), _path || (_path = /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0__.createElement("path", {
  fill: "currentColor",
  d: "M12.907 10.5229L11.8195 9.43545C11.932 8.84795 11.7633 8.29795 11.3133 7.78545C10.8633 7.27295 10.282 7.07295 9.56953 7.18545L8.48203 6.09795C8.69453 5.99795 8.90703 5.92295 9.11953 5.87295C9.34453 5.82295 9.58203 5.79795 9.83203 5.79795C10.7695 5.79795 11.5633 6.1292 12.2133 6.7917C12.8758 7.4417 13.207 8.23545 13.207 9.17295C13.207 9.42295 13.182 9.66045 13.132 9.88545C13.082 10.098 13.007 10.3105 12.907 10.5229ZM15.307 12.8854L14.2195 11.8355C14.6945 11.4729 15.1133 11.0792 15.4758 10.6542C15.8508 10.2167 16.1695 9.72295 16.432 9.17295C15.807 7.91045 14.907 6.91045 13.732 6.17295C12.5695 5.42295 11.2695 5.04795 9.83203 5.04795C9.46953 5.04795 9.11328 5.07295 8.76328 5.12295C8.41328 5.17295 8.06953 5.24795 7.73203 5.34795L6.56953 4.18545C7.08203 3.97295 7.60703 3.8167 8.14453 3.7167C8.68203 3.6042 9.24453 3.54795 9.83203 3.54795C11.7195 3.54795 13.4008 4.07295 14.8758 5.12295C16.3508 6.16045 17.4195 7.51045 18.082 9.17295C17.7945 9.91045 17.4133 10.598 16.9383 11.2355C16.4758 11.8605 15.932 12.4104 15.307 12.8854ZM15.682 17.498L12.532 14.3854C12.0945 14.523 11.6508 14.6292 11.2008 14.7042C10.7633 14.7667 10.307 14.798 9.83203 14.798C7.94453 14.798 6.26328 14.2792 4.78828 13.2417C3.31328 12.1917 2.24453 10.8355 1.58203 9.17295C1.84453 8.51045 2.17578 7.89795 2.57578 7.33545C2.97578 6.76045 3.43203 6.24795 3.94453 5.79795L1.88203 3.69795L2.93203 2.64795L16.732 16.448L15.682 17.498ZM4.99453 6.84795C4.63203 7.17295 4.30078 7.5292 4.00078 7.9167C3.70078 8.3042 3.44453 8.72295 3.23203 9.17295C3.85703 10.4355 4.75078 11.4417 5.91328 12.1917C7.08828 12.9292 8.39453 13.298 9.83203 13.298C10.082 13.298 10.3258 13.2854 10.5633 13.2604C10.8008 13.2229 11.0445 13.1854 11.2945 13.148L10.6195 12.4355C10.482 12.473 10.3508 12.5042 10.2258 12.5292C10.1008 12.5417 9.96953 12.548 9.83203 12.548C8.89453 12.548 8.09453 12.223 7.43203 11.573C6.78203 10.9105 6.45703 10.1105 6.45703 9.17295C6.45703 9.03545 6.46328 8.9042 6.47578 8.7792C6.50078 8.6542 6.53203 8.52295 6.56953 8.38545L4.99453 6.84795Z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgVisibility);

/***/ },

/***/ "./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 1C18.0751 1 23 5.92487 23 12C23 18.0751 18.0751 23 12 23C5.92487 23 1 18.0751 1 12C1 5.92487 5.92487 1 12 1ZM12 15C11.1716 15 10.5 15.6716 10.5 16.5C10.5 17.3284 11.1716 18 12 18C12.8284 18 13.5 17.3284 13.5 16.5C13.5 15.6716 12.8284 15 12 15ZM11 13H13V6H11V13Z"
})));
/* 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 0 0 19zm12-3h-2v-2h2v2zm0-4h-2V8h2v4z"
})));
/* 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 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"
})));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SvgWarning);

/***/ },

/***/ "./js/api-fetch-shim.ts"
/*!******************************!*\
  !*** ./js/api-fetch-shim.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 */ });
/* 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.cjs");
/* 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 _js_googlesitekit_api_middleware_deduplication__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/api/middleware/deduplication */ "./js/googlesitekit/api/middleware/deduplication.ts");
/* harmony import */ var _googlesitekit_api_middleware_preloading_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./googlesitekit/api/middleware/preloading.js */ "./js/googlesitekit/api/middleware/preloading.js");
/* 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
} = globalThis._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_1__["default"])({
  onDuplicate: _js_googlesitekit_api_middleware_deduplication__WEBPACK_IMPORTED_MODULE_1__.logDuplicate
});
(_wordpress_api_fetch_non_shim__WEBPACK_IMPORTED_MODULE_0___default().preloadingMiddleware) = (0,_googlesitekit_api_middleware_preloading_js__WEBPACK_IMPORTED_MODULE_2__["default"])(preloadedData); // @TODO Remove this when `createPreloadingMiddleware` is properly typed.

_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/Banner/CTAButton.tsx"
/*!********************************************!*\
  !*** ./js/components/Banner/CTAButton.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": () => (/* binding */ CTAButton)
/* harmony export */ });
/* 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");
/* 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
 */

/**
 * Internal dependencies
 */



// eslint-disable-next-line sitekit/acronym-case

function CTAButton({
  ariaLabel,
  disabled = false,
  external = false,
  hideExternalIndicator = false,
  href,
  inProgress = false,
  label,
  onClick = () => {}
}) {
  if (!label || !onClick && !href) {
    return null;
  }
  let trailingIconToUse;
  if (external && !hideExternalIndicator) {
    trailingIconToUse = /*#__PURE__*/React.createElement(_svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_1__["default"], {
      width: 14,
      height: 14
    });
  }
  return (
    /*#__PURE__*/
    // @ts-expect-error `SpinnerButton` component is not yet typed.
    React.createElement(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
    }, label)
  );
}

/***/ },

/***/ "./js/components/Banner/DismissButton.tsx"
/*!************************************************!*\
  !*** ./js/components/Banner/DismissButton.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": () => (/* binding */ DismissButton)
/* 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_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__);
/* 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
 */

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__*/
    // @ts-expect-error `Button` component is not yet typed.
    React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
      className: className,
      onClick: onClick,
      disabled: disabled,
      tertiary: tertiary
    }, label)
  );
}

/***/ },

/***/ "./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_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__);
/* 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_Link__WEBPACK_IMPORTED_MODULE_2__ = __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_1__.__)('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__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
    href: href,
    className: className,
    onClick: onClick,
    external: external
  }, label);
};
LearnMoreLink.propTypes = {
  href: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LearnMoreLink);

/***/ },

/***/ "./js/components/Banner/index.tsx"
/*!****************************************!*\
  !*** ./js/components/Banner/index.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 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_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _CTAButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CTAButton */ "./js/components/Banner/CTAButton.tsx");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Description */ "./js/components/Banner/Description.js");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./DismissButton */ "./js/components/Banner/DismissButton.tsx");
/* harmony import */ var _Footer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Footer */ "./js/components/Banner/Footer.js");
/* harmony import */ var _HelpText__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./HelpText */ "./js/components/Banner/HelpText.js");
/* harmony import */ var _Title__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Title */ "./js/components/Banner/Title.js");
/* harmony import */ var _TitleIcon__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./TitleIcon */ "./js/components/Banner/TitleIcon.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
 */










function getSVGDataByBreakpoint(breakpoint, svg) {
  const isMobile = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_SMALL;
  const isTablet = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_TABLET;
  if (isTablet && svg?.tablet) {
    return svg.tablet;
  }
  if ((isMobile || isTablet) && svg?.mobile) {
    return svg.mobile;
  }
  if (!isMobile && !isTablet && svg?.desktop) {
    return svg.desktop;
  }
  return null;
}
const Banner = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.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_4__.useBreakpoint)();
  const SVGData = getSVGDataByBreakpoint(breakpoint, svg);
  const svgMode = svg?.verticalPosition ? svg.verticalPosition : 'center';
  return /*#__PURE__*/React.createElement("div", {
    ref: ref,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner', className)
  }, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-banner__content"
  }, titleIcon && /*#__PURE__*/React.createElement(_TitleIcon__WEBPACK_IMPORTED_MODULE_11__["default"], null, titleIcon), /*#__PURE__*/React.createElement(_Title__WEBPACK_IMPORTED_MODULE_10__["default"], null, title), /*#__PURE__*/React.createElement(_Description__WEBPACK_IMPORTED_MODULE_6__["default"], {
    description: description,
    learnMoreLink: learnMoreLink,
    additionalDescription: additionalDescription
  }), helpText && /*#__PURE__*/React.createElement(_HelpText__WEBPACK_IMPORTED_MODULE_9__["default"], null, helpText), errorText && /*#__PURE__*/React.createElement(_js_components_Notice__WEBPACK_IMPORTED_MODULE_2__["default"], {
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_3__.NOTICE_TYPES.ERROR,
    description: errorText
  }), /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-notice__action"
  }, ctaButton && /*#__PURE__*/React.createElement(_CTAButton__WEBPACK_IMPORTED_MODULE_5__["default"], ctaButton), dismissButton?.onClick && /*#__PURE__*/React.createElement(_DismissButton__WEBPACK_IMPORTED_MODULE_7__["default"], dismissButton))), SVGData && /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__svg-wrapper', {
      [`googlesitekit-banner__svg-wrapper--${svgMode}`]: svgMode
    }),
    style: {
      backgroundImage: `url(${SVGData})`
    }
  }), footer && /*#__PURE__*/React.createElement(_Footer__WEBPACK_IMPORTED_MODULE_8__["default"], null, footer));
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Banner);

/***/ },

/***/ "./js/components/BannerModal/GraphicContainer.tsx"
/*!********************************************************!*\
  !*** ./js/components/BannerModal/GraphicContainer.tsx ***!
  \********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   GraphicContainerWithIntersectionObserver: () => (/* binding */ GraphicContainerWithIntersectionObserver),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * GraphicContainer 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
 */

const GraphicContainer = /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({
  children,
  className
}, ref) => /*#__PURE__*/React.createElement("div", {
  ref: ref,
  className: className
}, children));
const GraphicContainerWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_1__["default"])(GraphicContainer);
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GraphicContainer);

/***/ },

/***/ "./js/components/BannerModal/index.tsx"
/*!*********************************************!*\
  !*** ./js/components/BannerModal/index.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 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_1__ = __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_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_NewBadge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/NewBadge */ "./js/components/NewBadge.js");
/* 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 _js_material_components__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/icons/close.svg */ "./svg/icons/close.svg");
/* harmony import */ var _GraphicContainer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./GraphicContainer */ "./js/components/BannerModal/GraphicContainer.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * BannerModal 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
 */







/**
 * Renders a modal with a graphic, title, description, and optional buttons.
 *
 * Mainly used for new feature or setup complete announcements, but can be used for other purposes as well.
 *
 * @since 1.179.0
 *
 * @param props               Component props.
 * @param props.className     Additional CSS class name(s) to apply to the root Dialog element.
 * @param props.Graphic       SVG graphic component to render in the modal header.
 * @param props.onView        Callback invoked when the modal content scrolls into view, used for tracking purposes.
 * @param props.onClose       Callback invoked when the modal is closed.
 * @param props.title         Modal title text.
 * @param props.description   Modal description content (string or element).
 * @param props.newBadge      Whether to display a "New" badge in the modal.
 * @param props.ctaButton     Configuration object for the primary CTA button.
 * @param props.dismissButton Configuration object for the dismiss button.
 * @return                    BannerModal component.
 */
const BannerModal = ({
  className,
  Graphic,
  newBadge = false,
  onView,
  onClose,
  title,
  description,
  ctaButton,
  dismissButton
}) => {
  return /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_7__.Dialog, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-dialog', 'googlesitekit-dialog--with-mobile-margins', 'googlesitekit-banner-modal', className),
    onClose: onClose,
    open: true
  }, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_7__.DialogContent, {
    className: "googlesitekit-banner-modal__content"
  }, /*#__PURE__*/React.createElement(_GraphicContainer__WEBPACK_IMPORTED_MODULE_9__.GraphicContainerWithIntersectionObserver, {
    onInView: onView,
    className: "googlesitekit-banner-modal__graphic"
  }, /*#__PURE__*/React.createElement(Graphic, null), /*#__PURE__*/React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button
  // @ts-expect-error - The `Button` component is not typed yet.
  , {
    className: "googlesitekit-banner-modal__close-button",
    icon: /*#__PURE__*/React.createElement(_svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_8__["default"], {
      width: 10,
      height: 10
    }),
    onClick: onClose,
    "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close', 'google-site-kit'),
    hideTooltipTitle: true
  })), /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-banner-modal__text"
  }, newBadge && /*#__PURE__*/React.createElement(_js_components_NewBadge__WEBPACK_IMPORTED_MODULE_4__["default"], {
    hasNoSpacing: true
  }), /*#__PURE__*/React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    as: "h1",
    className: "googlesitekit-banner-modal__title",
    size: "large",
    type: "headline"
  }, title), /*#__PURE__*/React.createElement(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
    type: "body",
    size: "medium",
    className: "googlesitekit-banner-modal__description"
  }, description))), /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_7__.DialogFooter, {
    className: "googlesitekit-banner-modal__footer"
  }, /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, dismissButton &&
  /*#__PURE__*/
  // @ts-expect-error - The `Button` component is not typed yet.
  React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
    onClick: dismissButton.onClick,
    tertiary: true
  }, dismissButton.label || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Maybe later', 'google-site-kit')), ctaButton &&
  /*#__PURE__*/
  // @ts-expect-error - The `Button` component is not typed yet.
  React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
    onClick: ctaButton.onClick
  }, ctaButton.label))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BannerModal);

/***/ },

/***/ "./js/components/ChangeBadge.tsx"
/*!***************************************!*\
  !*** ./js/components/ChangeBadge.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 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");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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
 */

const ChangeBadge = ({
  previousValue,
  currentValue,
  isAbsolute = false,
  zeroChangeLabel
}) => {
  const change = isAbsolute ? currentValue - previousValue : (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.calculateChange)(previousValue, currentValue);

  // Do not display the change badge if the change value can't be calculated.
  if (change === null) {
    return null;
  }
  const isNegative = change < 0;
  const isZero = change === 0;
  const formattedChange = (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.numFmt)(change, {
    style: 'percent',
    signDisplay: 'exceptZero',
    maximumFractionDigits: 1
  });
  return /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-change-badge', {
      'googlesitekit-change-badge--negative': isNegative,
      'googlesitekit-change-badge--zero': isZero
    })
  }, isZero && zeroChangeLabel ? zeroChangeLabel : formattedChange);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChangeBadge);

/***/ },

/***/ "./js/components/ErrorNotice.tsx"
/*!***************************************!*\
  !*** ./js/components/ErrorNotice.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/is-url.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 _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _Notice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Notice */ "./js/components/Notice/index.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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
 */





const ErrorNotice = ({
  className,
  error = {},
  hasButton = false,
  storeName,
  message = error?.message,
  title,
  noPrefix = false,
  skipRetryMessage,
  hideIcon = false
}) => {
  const dispatch = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)();
  const selectorData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!storeName) {
      return null;
    }
    return select(storeName).getSelectorDataForError(error);
  }, [error, storeName]);
  const handleRetry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    if (!selectorData) {
      return;
    }
    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_6__.isPermissionScopeError)(error)) {
    return null;
  }
  const shouldDisplayRetry = hasButton && (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_6__.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_1__.sprintf)(/* translators: %s: Error message from Google API. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s (Please try again.)', 'google-site-kit'), errorMessageWithModifications);
  }
  if (!noPrefix) {
    errorMessageWithModifications = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: $%s: Error message */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Error: %s', 'google-site-kit'), errorMessageWithModifications);
  }
  const reconnectURL = error.data?.reconnectURL;
  if (reconnectURL && (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.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_1__.sprintf)(/* translators: 1: Original error message 2: Reconnect URL */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%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__*/React.createElement(_Notice__WEBPACK_IMPORTED_MODULE_7__["default"], {
    className: className,
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.ERROR,
    title: title,
    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.
    React.createElement("span", {
      dangerouslySetInnerHTML: (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.sanitizeHTML)(errorMessageWithModifications, sanitizeArgs)
    }),
    ctaButton: shouldDisplayRetry ? {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Retry', 'google-site-kit'),
      onClick: handleRetry
    } : undefined,
    hideIcon: hideIcon
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ErrorNotice);

/***/ },

/***/ "./js/components/GoogleChart/constants.ts"
/*!************************************************!*\
  !*** ./js/components/GoogleChart/constants.ts ***!
  \************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CHART_VERSION: () => (/* binding */ CHART_VERSION)
/* 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.
 */

const CHART_VERSION = '49';

/***/ },

/***/ "./js/components/InfoTooltip.tsx"
/*!***************************************!*\
  !*** ./js/components/InfoTooltip.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 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_info_green_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/info-green.svg */ "./svg/icons/info-green.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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
 */


const InfoTooltip = ({
  onOpen,
  title,
  tooltipClassName
}) => {
  if (!title) {
    return null;
  }
  return (
    /*#__PURE__*/
    // @ts-expect-error `Tooltip` is not typed.
    React.createElement(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
    }, /*#__PURE__*/React.createElement("span", {
      tabIndex: 0,
      role: "tooltip"
    }, /*#__PURE__*/React.createElement(_svg_icons_info_green_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
      width: "16",
      height: "16"
    })))
  );
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InfoTooltip);

/***/ },

/***/ "./js/components/KeyMetrics/KeyMetricsBackNotice.tsx"
/*!***********************************************************!*\
  !*** ./js/components/KeyMetrics/KeyMetricsBackNotice.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": () => (/* binding */ KeyMetricsBackNotice)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_Notice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_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_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./constants */ "./js/components/KeyMetrics/constants.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Key Metrics KeyMetricsBackNotice 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
 */









const NoticeWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_components_Notice__WEBPACK_IMPORTED_MODULE_3__["default"]);
function KeyMetricsBackNotice({
  Widget
}) {
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const trackEventCategory = `${viewContext}_kmw-reshown`;
  const onDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(trackEventCategory, 'dismiss_notice');
    dismissItem(_constants__WEBPACK_IMPORTED_MODULE_10__.KEY_METRICS_BACK_NOTICE_SLUG);
  }, [dismissItem, trackEventCategory]);
  const onInView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(trackEventCategory, 'view_notice');
  }, [trackEventCategory]);
  const onSelectMetrics = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(trackEventCategory, 'confirm_notice');
    dismissItem(_constants__WEBPACK_IMPORTED_MODULE_10__.KEY_METRICS_BACK_NOTICE_SLUG);
    setValue(_constants__WEBPACK_IMPORTED_MODULE_10__.KEY_METRICS_SELECTION_PANEL_OPENED_KEY, true);
  }, [dismissItem, trackEventCategory, setValue]);
  return /*#__PURE__*/React.createElement(Widget, {
    noPadding: true
  }, /*#__PURE__*/React.createElement(NoticeWithIntersectionObserver, {
    className: "googlesitekit-key-metrics-back-notice",
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.INFO_CIRCLE,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Key metrics are back on your dashboard', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This section is now an integral part of the dashboard. You can customize which metrics are shown to focus on the ones most relevant to you.', 'google-site-kit'),
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select metrics', 'google-site-kit'),
      onClick: onSelectMetrics
    },
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Got it', 'google-site-kit'),
      onClick: onDismiss
    },
    onInView: onInView
  }));
}

/***/ },

/***/ "./js/components/KeyMetrics/MetricTileTable.tsx"
/*!******************************************************!*\
  !*** ./js/components/KeyMetrics/MetricTileTable.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 _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* 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 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 _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/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.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */

const MetricTileTable = ({
  rows = [],
  columns = [],
  limit,
  ZeroState,
  ...props
}) => {
  let tileBody = null;
  if (rows.length > 0) {
    tileBody = rows.slice(0, limit || rows.length).map((row, rowIndex) => /*#__PURE__*/React.createElement("div", {
      key: rowIndex,
      className: "googlesitekit-table__body-row"
    }, columns.map(({
      Component,
      field,
      className
    }, colIndex) => {
      const fieldValue = field !== undefined ? (0,lodash__WEBPACK_IMPORTED_MODULE_2__.get)(row, field) : undefined;
      return /*#__PURE__*/React.createElement("div", {
        key: colIndex,
        className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-table__body-item', className)
      }, Component && /*#__PURE__*/React.createElement(Component, {
        row: row,
        fieldValue: fieldValue
      }), !Component && fieldValue);
    })));
  } else if (ZeroState) {
    tileBody = /*#__PURE__*/React.createElement("div", {
      className: "googlesitekit-table__body-row googlesitekit-table__body-row--no-data"
    }, /*#__PURE__*/React.createElement("div", {
      className: "googlesitekit-table__body-zero-data"
    }, /*#__PURE__*/React.createElement(ZeroState, null)));
  }
  return (
    /*#__PURE__*/
    // @ts-expect-error - The `MetricTileWrapper` component is not typed yet.
    React.createElement(_MetricTileWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
      className: "googlesitekit-km-widget-tile--table"
    }, props), /*#__PURE__*/React.createElement("div", {
      className: "googlesitekit-km-widget-tile__table"
    }, tileBody))
  );
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MetricTileTable);

/***/ },

/***/ "./js/components/Notice/Description.tsx"
/*!**********************************************!*\
  !*** ./js/components/Notice/Description.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 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__);
/* 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
 */

const Description = ({
  as = 'p',
  className,
  children
}) => {
  const Component = as;
  return /*#__PURE__*/React.createElement(Component, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice__description', className)
  }, children);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Description);

/***/ },

/***/ "./js/components/Notice/DismissButton.tsx"
/*!************************************************!*\
  !*** ./js/components/Notice/DismissButton.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 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 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__);
/* 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
 */

const DismissButton = ({
  label = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Got it', 'google-site-kit'),
  onClick,
  disabled,
  href,
  external = false,
  variant = 'text',
  icon,
  ariaLabel
}) => {
  return (
    /*#__PURE__*/
    // @ts-expect-error - `Button` component typing is incomplete.
    React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
        'googlesitekit-notice__dismiss': variant === 'icon',
        'googlesitekit-notice__dismiss--icon': variant === 'icon'
      }),
      onClick: onClick,
      disabled: disabled,
      href: href,
      target: external ? '_blank' : undefined,
      tertiary: variant !== 'icon',
      icon: variant === 'icon' ? icon : undefined,
      "aria-label": variant === 'icon' ? ariaLabel : undefined,
      hideTooltipTitle: variant === 'icon'
    }, variant !== 'icon' ? label : undefined)
  );
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DismissButton);

/***/ },

/***/ "./js/components/Notice/Title.tsx"
/*!****************************************!*\
  !*** ./js/components/Notice/Title.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 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__);
/* 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
 */

const Title = ({
  className,
  children
}) => {
  return /*#__PURE__*/React.createElement("p", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice__title', className)
  }, children);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Title);

/***/ },

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   NOTICE_TYPES: () => (/* binding */ NOTICE_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.
 */

/**
 * Notice types that inform how a `<Notice />` component is styled.
 */
let NOTICE_TYPES = /*#__PURE__*/function (NOTICE_TYPES) {
  NOTICE_TYPES["NEW"] = "new";
  NOTICE_TYPES["SUCCESS"] = "success";
  NOTICE_TYPES["WARNING"] = "warning";
  /**
   * Grey background, the default for `'info'` notices.
   */
  NOTICE_TYPES["INFO"] = "info";
  /**
   * White background alternative for `'info'` notices, using the info-circle
   * icon in place of the default warning icon.
   */
  NOTICE_TYPES["INFO_CIRCLE"] = "info-circle";
  /**
   * White background alternative for `'info'` notices.
   */
  NOTICE_TYPES["INFO_ALT"] = "info-alt";
  /**
   * Black background alternative for `'info'` notices.
   */
  NOTICE_TYPES["INFO_ALT_2"] = "info-alt-2";
  NOTICE_TYPES["ERROR"] = "error";
  return NOTICE_TYPES;
}({});

/***/ },

/***/ "./js/components/Notice/index.tsx"
/*!****************************************!*\
  !*** ./js/components/Notice/index.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 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_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _CTAButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CTAButton */ "./js/components/Notice/CTAButton.js");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Description */ "./js/components/Notice/Description.tsx");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DismissButton */ "./js/components/Notice/DismissButton.tsx");
/* harmony import */ var _Icon__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Icon */ "./js/components/Notice/Icon.js");
/* harmony import */ var _Title__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Title */ "./js/components/Notice/Title.tsx");
/* 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
 */






function hasDismissButtonAction(dismissButton) {
  if (dismissButton?.variant === 'icon') {
    return !!dismissButton.icon && !!dismissButton.ariaLabel && (dismissButton.onClick || dismissButton.href);
  }
  return !!dismissButton?.label || !!dismissButton?.onClick || !!dismissButton?.href;
}
const Notice = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({
  actionContent,
  className,
  title,
  description,
  dismissButton,
  ctaButton,
  type = _constants__WEBPACK_IMPORTED_MODULE_2__.NOTICE_TYPES.INFO,
  children,
  hideIcon
}, ref) => {
  const hasDismissAction = hasDismissButtonAction(dismissButton);
  const hasCTAAction = !!ctaButton?.label && (ctaButton?.onClick || ctaButton?.href);
  const hasActionContent = !!actionContent || hasDismissAction || hasCTAAction;
  return /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-notice-container",
    ref: ref
  }, /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-notice', `googlesitekit-notice--${type}`, className),
    role: "status"
  }, !hideIcon && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-notice__icon"
  }, /*#__PURE__*/React.createElement(_Icon__WEBPACK_IMPORTED_MODULE_6__["default"], {
    type: type
  })), /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-notice__content"
  }, title && /*#__PURE__*/React.createElement(_Title__WEBPACK_IMPORTED_MODULE_7__["default"], null, title), description && /*#__PURE__*/React.createElement(_Description__WEBPACK_IMPORTED_MODULE_4__["default"], null, description), children), hasActionContent && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-notice__action"
  }, actionContent, hasDismissAction && /*#__PURE__*/React.createElement(_DismissButton__WEBPACK_IMPORTED_MODULE_5__["default"], dismissButton || {}), hasCTAAction && /*#__PURE__*/React.createElement(_CTAButton__WEBPACK_IMPORTED_MODULE_3__["default"]
  // @ts-expect-error `CTAButton` component is not yet typed.
  , {
    label: ctaButton.label
    // @ts-expect-error `CTAButton` component is not yet typed.
    ,
    onClick: ctaButton.onClick
    // @ts-expect-error `CTAButton` component is not yet typed.
    ,
    inProgress: ctaButton.inProgress
    // @ts-expect-error `CTAButton` component is not yet typed.
    ,
    disabled: ctaButton.disabled
    // @ts-expect-error `CTAButton` component is not yet typed.
    ,
    href: ctaButton.href
    // @ts-expect-error `CTAButton` component is not yet typed.
    ,
    external: ctaButton.external
    // @ts-expect-error `CTAButton` component is not yet typed.
    ,
    hideExternalIndicator: ctaButton.hideExternalIndicator
    // @ts-expect-error `CTAButton` component is not yet typed.
    ,
    tertiary: ctaButton.tertiary
  }))));
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Notice);

/***/ },

/***/ "./js/components/ScrollableTabs.tsx"
/*!******************************************!*\
  !*** ./js/components/ScrollableTabs.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 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_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _svg_icons_chevron_left_outlined_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/chevron-left-outlined.svg */ "./svg/icons/chevron-left-outlined.svg");
/* harmony import */ var _svg_icons_chevron_right_outlined_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/chevron-right-outlined.svg */ "./svg/icons/chevron-right-outlined.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * ScrollableTabs 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
 */




/**
 * Pixels of hidden content a direction needs before its arrow turns active.
 *
 * Anything at or under this counts as the end of the bar. The subpixel
 * rounding a browser reports then never leaves an active arrow that scrolls
 * nowhere.
 */
const SCROLL_EDGE_THRESHOLD = 1;

/**
 * Fraction of the visible width to scroll per arrow activation, keeping a
 * little of the previous view for context.
 */
const SCROLL_PAGE_FACTOR = 0.8;
const ScrollableTabs = ({
  children,
  className,
  scrollTargetSelector = '.mdc-tab-scroller__scroll-area'
}) => {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.useBreakpoint)();
  const isDesktop = breakpoint !== _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_SMALL && breakpoint !== _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_TABLET;
  const containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  const scrollNodeRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  const [canScrollLeft, setCanScrollLeft] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [canScrollRight, setCanScrollRight] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const updateScrollState = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    const scrollNode = scrollNodeRef.current;
    if (!scrollNode) {
      return;
    }
    const {
      scrollLeft,
      clientWidth,
      scrollWidth
    } = scrollNode;
    setCanScrollLeft(scrollLeft > SCROLL_EDGE_THRESHOLD);
    setCanScrollRight(scrollLeft + clientWidth < scrollWidth - SCROLL_EDGE_THRESHOLD);
  }, []);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const container = containerRef.current;
    if (!isDesktop || !container) {
      return () => {};
    }

    // MDC's tab bar scrolls an inner element rather than its wrapper, so
    // resolve the scrolling element within the container. When nothing
    // matches the selector, the container itself scrolls. The lookup runs
    // only when this effect does, so a tab bar that reaches the DOM later
    // leaves the arrows reading the container instead.
    const scrollNode = container.querySelector(scrollTargetSelector) || container;
    scrollNodeRef.current = scrollNode;
    updateScrollState();

    // Scroll fires far more often than the arrows can change, so each event
    // replaces the frame the one before it asked for. That leaves one read
    // of the scroll metrics per frame, and it never reads a handle that
    // requestAnimationFrame has yet to hand back.
    let animationFrameID = null;
    function onScroll() {
      if (animationFrameID !== null) {
        window.cancelAnimationFrame(animationFrameID);
      }
      animationFrameID = window.requestAnimationFrame(() => {
        animationFrameID = null;
        updateScrollState();
      });
    }
    scrollNode.addEventListener('scroll', onScroll, {
      passive: true
    });

    // The scroll node's own size follows the container, while its first
    // element child holds the full tab set. Observing both covers window
    // resizes and changes to the tab set.
    const observer = new ResizeObserver(updateScrollState);
    observer.observe(scrollNode);
    if (scrollNode.firstElementChild) {
      observer.observe(scrollNode.firstElementChild);
    }
    return () => {
      scrollNode.removeEventListener('scroll', onScroll);
      observer.disconnect();
      if (animationFrameID !== null) {
        window.cancelAnimationFrame(animationFrameID);
      }
      scrollNodeRef.current = null;
    };
  }, [isDesktop, scrollTargetSelector, updateScrollState]);
  function scrollByPage(direction) {
    const scrollNode = scrollNodeRef.current;
    if (!scrollNode) {
      return;
    }
    scrollNode.scrollBy({
      left: direction * scrollNode.clientWidth * SCROLL_PAGE_FACTOR,
      behavior: 'smooth'
    });
  }
  return /*#__PURE__*/React.createElement("div", {
    ref: containerRef,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-scrollable-tabs', className)
  }, isDesktop && /*#__PURE__*/React.createElement("button", {
    type: "button",
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-scrollable-tabs__arrow', 'googlesitekit-scrollable-tabs__arrow--left', {
      'googlesitekit-scrollable-tabs__arrow--inactive': !canScrollLeft
    }),
    "aria-hidden": "true",
    disabled: !canScrollLeft,
    tabIndex: -1,
    onClick: () => scrollByPage(-1)
  }, /*#__PURE__*/React.createElement(_svg_icons_chevron_left_outlined_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
    width: 20,
    height: 20
  })), children, isDesktop && /*#__PURE__*/React.createElement("button", {
    type: "button",
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-scrollable-tabs__arrow', 'googlesitekit-scrollable-tabs__arrow--right', {
      'googlesitekit-scrollable-tabs__arrow--inactive': !canScrollRight
    }),
    "aria-hidden": "true",
    disabled: !canScrollRight,
    tabIndex: -1,
    onClick: () => scrollByPage(1)
  }, /*#__PURE__*/React.createElement(_svg_icons_chevron_right_outlined_svg__WEBPACK_IMPORTED_MODULE_4__["default"], {
    width: 20,
    height: 20
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ScrollableTabs);

/***/ },

/***/ "./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 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_googlesitekit_widgets_hooks_useWidget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/widgets/hooks/useWidget */ "./js/googlesitekit/widgets/hooks/useWidget.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* 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_6__["default"])();
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const widget = (0,_js_googlesitekit_widgets_hooks_useWidget__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    if (!widget.slug || !viewContext) {
      return;
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.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_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)(/* translators: %s: source link */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Source: %s', 'google-site-kit'), `<a>${name}</a>`), {
    a: /*#__PURE__*/React.createElement(_Link__WEBPACK_IMPORTED_MODULE_9__["default"], {
      key: "link",
      href: href,
      external: external,
      onClick: handleClick
    })
  }));
}
SourceLink.propTypes = {
  name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SourceLink);

/***/ },

/***/ "./js/components/StoreErrorNotices.tsx"
/*!*********************************************!*\
  !*** ./js/components/StoreErrorNotices.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.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_errors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_util_insufficient_permissions_error_description__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/insufficient-permissions-error-description */ "./js/util/insufficient-permissions-error-description.js");
/* harmony import */ var _ErrorNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ErrorNotice */ "./js/components/ErrorNotice.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






const StoreErrorNotices = ({
  hasButton = false,
  moduleSlug,
  storeName
}) => {
  const setupFlowRefreshPhase4Enabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__.useFeature)('setupFlowRefreshPhase4');
  const errors = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(storeName).getErrors(), [storeName]);
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).getModule(moduleSlug), [moduleSlug]);
  const existingErrorMessages = [];
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, errors.filter(error => {
    if (!error?.message || existingErrorMessages.includes(error.message)) {
      return false;
    }
    existingErrorMessages.push(error.message);
    return true;
  }).map((error, key) => {
    const isInsufficientPermissions = (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_5__.isInsufficientPermissionsError)(error);
    const hasTitle = isInsufficientPermissions && setupFlowRefreshPhase4Enabled;
    const message = isInsufficientPermissions ? (0,_js_util_insufficient_permissions_error_description__WEBPACK_IMPORTED_MODULE_6__.getInsufficientPermissionsErrorDescription)(error.message, module) : error.message;
    const title = hasTitle ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Insufficient permissions', 'google-site-kit') : undefined;
    return /*#__PURE__*/React.createElement(_ErrorNotice__WEBPACK_IMPORTED_MODULE_7__["default"], {
      key: key,
      error: error,
      hasButton: hasButton,
      storeName: storeName,
      message: message,
      title: title,
      noPrefix: hasTitle,
      skipRetryMessage: hasTitle
    });
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (StoreErrorNotices);

/***/ },

/***/ "./js/components/ToastNotice.tsx"
/*!***************************************!*\
  !*** ./js/components/ToastNotice.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 react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useUnmount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _Notice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Notice/constants */ "./js/components/Notice/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * ToastNotice 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
 */


/**
 * Renders a notice that automatically disappears after a short period of time.
 *
 * @since 1.163.0
 *
 * @param props           Props for the component.
 * @param props.title     Title of the notice.
 * @param props.onDismiss Function to be called when the notice is dismissed/unmounted.
 * @return                The rendered component.
 */
const ToastNotice = ({
  title,
  onDismiss
}) => {
  const [isHidden, setIsHidden] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const timeout = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)();
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])(() => {
    timeout.current = setTimeout(() => {
      setIsHidden(true);
      onDismiss?.();
    }, 5500);
  });
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    onDismiss?.();
    clearTimeout(timeout.current);
  });
  if (isHidden) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_Notice__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-toast-notice",
    title: title,
    type: _Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.SUCCESS
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ToastNotice);

/***/ },

/***/ "./js/components/UserMenu/utils.ts"
/*!*****************************************!*\
  !*** ./js/components/UserMenu/utils.ts ***!
  \*****************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAccountLabel: () => (/* binding */ getAccountLabel)
/* 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__);
/**
 * UserMenu utilities.
 *
 * 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 the account label for the user menu.
 *
 * @since 1.179.0
 *
 * @param {string|undefined} userFullName User's full name.
 * @param {string|undefined} userEmail    User's email address.
 * @return {string|undefined} Localized account label.
 */
function getAccountLabel(userFullName, userEmail) {
  if (userFullName && userEmail) {
    return (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) {
    return (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) {
    return (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 undefined;
}

/***/ },

/***/ "./js/components/email-reporting/constants.ts"
/*!****************************************************!*\
  !*** ./js/components/email-reporting/constants.ts ***!
  \****************************************************/
(__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/pdf-export/ensure-google-charts-loaded.ts"
/*!*****************************************************************!*\
  !*** ./js/components/pdf-export/ensure-google-charts-loaded.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 */ ensureGoogleChartsLoaded)
/* harmony export */ });
/* harmony import */ var _js_components_GoogleChart_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/GoogleChart/constants */ "./js/components/GoogleChart/constants.ts");
/**
 * 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
 */

const GOOGLE_CHARTS_LOADER_SRC = 'https://www.gstatic.com/charts/loader.js';
/**
 * Reads the (untyped) `google` global as the narrow slice this loader needs.
 *
 * @since 1.182.0
 *
 * @return {Object|undefined} The `google` global, when present.
 */
function getGoogle() {
  return globalThis.google;
}

/**
 * Injects the Google Charts CDN loader script into the document head.
 *
 * @since 1.182.0
 *
 * @return {Promise<void>} Resolves on the script's `load` event, rejects on `error`.
 */
function injectLoaderScript() {
  return new Promise((resolve, reject) => {
    const script = globalThis.document.createElement('script');
    script.src = GOOGLE_CHARTS_LOADER_SRC;
    script.onload = () => resolve();
    script.onerror = () => reject(new Error('Site Kit: failed to load the Google Charts loader script.'));
    globalThis.document.head.appendChild(script);
  });
}

/**
 * Loads the CDN loader (if needed) and the `corechart` package.
 *
 * @since 1.182.0
 *
 * @return {Promise<void>} Resolves once Google Charts is ready to draw.
 */
async function loadGoogleCharts() {
  const google = getGoogle();

  // Another plugin may have loaded an incompatible build of Google Charts that
  // does not expose `charts.load`. Fail loudly rather than silently no-op.
  if (google?.charts && typeof google.charts.load !== 'function') {
    throw new Error('Site Kit: Google Charts is already present on the page but `google.charts.load` is not a function (possible version collision with another plugin).');
  }

  // Inject the CDN loader unless `google.charts.load` is already available.
  if (typeof google?.charts?.load !== 'function') {
    await injectLoaderScript();
  }
  const loadedGoogle = getGoogle();
  if (typeof loadedGoogle?.charts?.load !== 'function') {
    throw new Error('Site Kit: the Google Charts loader script did not expose `google.charts.load`.');
  }
  await loadedGoogle.charts.load(_js_components_GoogleChart_constants__WEBPACK_IMPORTED_MODULE_0__.CHART_VERSION, {
    packages: ['corechart']
  });
}
let loadPromise = null;

/**
 * Ensures the Google Charts library is loaded and ready to draw charts.
 *
 * `@react-pdf/renderer` runs without access to the dashboard's already-loaded
 * charts, so chart-bearing PDF widgets rasterise charts offscreen with Google
 * Charts. This loads the same CDN library the dashboard uses, memoising the
 * in-flight promise so repeat exports in the same session do not re-fetch the
 * loader script. A failed load resets the cache so a later attempt can retry.
 *
 * @since 1.182.0
 *
 * @return {Promise<void>} Resolves once `google.visualization` is ready.
 */
function ensureGoogleChartsLoaded() {
  if (getGoogle()?.visualization?.DataTable) {
    return Promise.resolve();
  }
  if (!loadPromise) {
    loadPromise = loadGoogleCharts().catch(error => {
      // Reset so a subsequent call can retry after a transient failure.
      loadPromise = null;
      throw error;
    });
  }
  return loadPromise;
}

/***/ },

/***/ "./js/components/pdf-export/lazy-with-preload.ts"
/*!*******************************************************!*\
  !*** ./js/components/pdf-export/lazy-with-preload.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 */ lazyWithPreload)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * Preload-capable `lazy` helper for PDF export widgets.
 *
 * 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
 */

/**
 * Wraps `lazy` with a `preload` method exposing the import factory.
 *
 * The PDF orchestrator awaits `preload()` to resolve the chunk before handing
 * the component to `@react-pdf`, whose renderer does not honour `Suspense`.
 * Registering a widget's `pdf.Component` with a plain `lazy()` makes the
 * orchestrator skip the resolution step and hand the Suspense wrapper straight
 * to `@react-pdf`, which throws while rendering and rejects the export.
 *
 * @since 1.183.0
 *
 * @param factory Dynamic import factory returning `{ default }`.
 * @return Lazy component with a `preload` method.
 */
function lazyWithPreload(factory) {
  const Component = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.lazy)(factory);
  Component.preload = factory;
  return Component;
}

/***/ },

/***/ "./js/components/pdf-export/pdf-theme.ts"
/*!***********************************************!*\
  !*** ./js/components/pdf-export/pdf-theme.ts ***!
  \***********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PDF_COLORS: () => (/* binding */ PDF_COLORS),
/* harmony export */   PDF_FONT_FAMILY_DISPLAY: () => (/* binding */ PDF_FONT_FAMILY_DISPLAY),
/* harmony export */   PDF_FONT_FAMILY_TEXT: () => (/* binding */ PDF_FONT_FAMILY_TEXT),
/* harmony export */   PDF_MEASURE_PAGE_HEIGHT: () => (/* binding */ PDF_MEASURE_PAGE_HEIGHT),
/* harmony export */   PIE_CHART_COLORS: () => (/* binding */ PIE_CHART_COLORS)
/* harmony export */ });
/**
 * Shared theme constants for the PDF export (@react-pdf/renderer).
 *
 * 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.
 */

/**
 * The `@react-pdf` family name for display and headline text.
 *
 * `registerPDFFonts()` registers Google Sans Display under it, at regular
 * 400 and medium 500.
 *
 * @since 1.182.0
 */
const PDF_FONT_FAMILY_DISPLAY = 'GoogleSansDisplay';

/**
 * The `@react-pdf` family name for title, body, and label text.
 *
 * `registerPDFFonts()` registers Google Sans Text under it, at regular 400
 * and medium 500.
 *
 * @since 1.182.0
 */
const PDF_FONT_FAMILY_TEXT = 'GoogleSansText';

/**
 * The page height, in points, for the measurement render pass.
 *
 * Tall enough to hold any report on one page without pagination, while
 * staying under the PDF specification's hard page-size limit.
 *
 * @since 1.185.0
 */
const PDF_MEASURE_PAGE_HEIGHT = 14400;

/**
 * Shared colors for the PDF report.
 *
 * `@react-pdf` builds the PDF from JavaScript values and can't read the
 * dashboard's CSS. So each color lives here as a copy: the key is a Sass
 * token name from `assets/sass/config/_variables-mui3.scss`, and the value
 * is that token's hex.
 *
 * @since 1.183.0
 */
const PDF_COLORS = {
  SURFACES_ON_SURFACE: '#161b18',
  // $c-surfaces-on-surface
  SURFACES_ON_SURFACE_VARIANT: '#6c726e',
  // $c-surfaces-on-surface-variant
  CONTENT_SECONDARY: '#108080',
  // $c-content-secondary
  SURFACES_SURFACE_1: '#ebeef0',
  // $c-surfaces-surface-1
  SURFACES_BACKGROUND: '#f3f5f7',
  // $c-surfaces-background
  SURFACES_SURFACE: '#ffffff',
  // $c-surfaces-surface
  GREEN_G_50: '#d8ffc0',
  // $c-green-g-50
  UTILITY_ON_SUCCESS_CONTAINER: '#1f4c04',
  // $c-utility-on-success-container
  UTILITY_ERROR_CONTAINER: '#ffded3',
  // $c-utility-error-container
  UTILITY_ON_ERROR_CONTAINER: '#7a1e00',
  // $c-utility-on-error-container
  SURFACES_INVERSE_ON_SURFACE: '#ebeef0',
  // $c-surfaces-inverse-on-surface
  NEUTRAL_N_700: '#333935',
  // $c-neutral-n-700
  VIOLET_V_50: '#e3d1ff',
  // $c-violet-v-50
  VIOLET_V_600: '#462083',
  // $c-violet-v-600
  YELLOW_Y_50: '#ffe4b1',
  // $c-yellow-y-50
  YELLOW_Y_500: '#895a00',
  // $c-yellow-y-500
  YELLOW_Y_600: '#684500',
  // $c-yellow-y-600
  UTILITY_WARNING_CONTAINER: '#ffe4b1',
  // $c-utility-warning-container
  BLUE_B_400: '#6380b8',
  // $c-blue-b-400
  TEAL_T_300: '#4bbbbb',
  // $c-teal-t-300
  SITE_KIT_SK_500: '#3c7251',
  // $c-site-kit-sk-500
  VIOLET_V_300: '#8e68cb',
  // $c-violet-v-300
  YELLOW_Y_100: '#fece72',
  // $c-yellow-y-100
  VIOLET_V_200: '#a983e6',
  // $c-violet-v-200
  BLUE_B_100: '#bed4ff',
  // $c-blue-b-100
  PINK_P_200: '#ee92da',
  // $c-pink-p-200
  RED_R_200: '#ff9b7a' // $c-red-r-200
};

/**
 * Donut chart colors for the PDF report, in slice order.
 *
 * Each slice and its legend row read the same color from this list, so they
 * always match. The list matches the dashboard's donut colors, so each donut
 * looks the same in the dashboard and the PDF.
 *
 * @since 1.184.0
 */
const PIE_CHART_COLORS = [PDF_COLORS.YELLOW_Y_100, PDF_COLORS.VIOLET_V_200, PDF_COLORS.BLUE_B_100, PDF_COLORS.PINK_P_200, PDF_COLORS.RED_R_200];

/***/ },

/***/ "./js/components/pdf-export/render-google-chart-to-data-uri.ts"
/*!*********************************************************************!*\
  !*** ./js/components/pdf-export/render-google-chart-to-data-uri.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 */ renderGoogleChartToDataURI),
/* harmony export */   getVisualization: () => (/* binding */ getVisualization)
/* 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.
 */

const JPEG_QUALITY = 0.92;
/**
 * Reads the (untyped) `google.visualization` global.
 *
 * @since 1.182.0
 *
 * @return {Object|undefined} The `google.visualization` namespace, when present.
 */
function getVisualization() {
  return globalThis.google?.visualization;
}

/**
 * Re-encodes a PNG data URI as a JPEG data URI via an offscreen canvas.
 *
 * `getImageURI()` only emits PNG; JPEG keeps the embedded PDF image small.
 *
 * @since 1.182.0
 *
 * @param {string} pngDataURI PNG data URI produced by `chart.getImageURI()`.
 * @return {Promise<string>} A `data:image/jpeg;base64,...` data URI.
 */
function convertPNGToJPEG(pngDataURI) {
  return new Promise((resolve, reject) => {
    const image = new globalThis.Image();
    image.onload = () => {
      const canvas = globalThis.document.createElement('canvas');
      canvas.width = image.naturalWidth || image.width;
      canvas.height = image.naturalHeight || image.height;
      const context = canvas.getContext('2d');
      if (!context) {
        reject(new Error('Site Kit: could not acquire a 2D canvas context to encode the chart image.'));
        return;
      }
      context.drawImage(image, 0, 0);
      resolve(canvas.toDataURL('image/jpeg', JPEG_QUALITY));
    };
    image.onerror = () => reject(new Error('Site Kit: failed to decode the chart PNG for JPEG conversion.'));
    image.src = pngDataURI;
  });
}

/**
 * Rasterises a Google Chart to a data URI for embedding in a PDF.
 *
 * `@react-pdf/renderer` has no DOM, so charts cannot be drawn inside the PDF.
 * This draws the chart into a hidden, oversized offscreen container using the
 * Google Charts library, captures it via `getImageURI()`, and (for JPEG)
 * re-encodes it through a canvas. The container is always removed, on both
 * success and failure, so repeated exports cannot leak detached nodes.
 *
 * @since 1.182.0
 *
 * @param {Object}      params                 Render parameters.
 * @param {string}      params.chartType       Google Charts class name to instantiate.
 * @param {Object}      params.dataTable       `google.visualization.DataTable` to draw.
 * @param {Object}      params.options         Google Charts options object.
 * @param {number}      params.width           Logical width, in PDF points.
 * @param {number}      params.height          Logical height, in PDF points.
 * @param {number}      [params.scaleFactor=2] Offscreen render multiplier.
 * @param {string}      [params.format=jpeg]   Output encoding (`jpeg` or `png`).
 * @param {AbortSignal} [params.signal]        Signal aborting before any work runs.
 * @return {Promise<string>} The rendered chart image as a data URI.
 */
async function renderGoogleChartToDataURI({
  chartType,
  dataTable,
  options,
  width,
  height,
  scaleFactor = 2,
  format = 'jpeg',
  signal
}) {
  if (signal?.aborted) {
    throw new DOMException('Aborted', 'AbortError');
  }
  const visualization = getVisualization();
  const ChartConstructor = visualization?.[chartType];
  const events = visualization?.events;
  if (typeof ChartConstructor !== 'function' || !events) {
    throw new Error(`Site Kit: Google Charts is not loaded or does not provide a "${chartType}".`);
  }
  const container = globalThis.document.createElement('div');
  container.style.position = 'absolute';
  container.style.left = '-10000px';
  container.style.top = '0';
  container.style.width = `${width * scaleFactor}px`;
  container.style.height = `${height * scaleFactor}px`;
  globalThis.document.body.appendChild(container);
  try {
    const chart = new ChartConstructor(container);
    const pngDataURI = await new Promise((resolve, reject) => {
      function cleanup() {
        signal?.removeEventListener('abort', onAbort);
      }
      function onAbort() {
        cleanup();
        reject(new DOMException('Aborted', 'AbortError'));
      }
      events.addListener(chart, 'ready', () => {
        cleanup();
        resolve(chart.getImageURI());
      });
      events.addListener(chart, 'error', () => {
        cleanup();
        reject(new Error('Site Kit: Google Charts failed to render the chart.'));
      });
      signal?.addEventListener('abort', onAbort, {
        once: true
      });
      chart.draw(dataTable, options);
    });
    if (format === 'png') {
      return pngDataURI;
    }
    return await convertPNGToJPEG(pngDataURI);
  } finally {
    container.remove();
  }
}

/***/ },

/***/ "./js/components/setup/DefaultModuleSetup.tsx"
/*!****************************************************!*\
  !*** ./js/components/setup/DefaultModuleSetup.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": () => (/* binding */ DefaultModuleSetup)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/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 _hooks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./hooks */ "./js/components/setup/hooks/index.ts");
/* harmony import */ var _SetupFooter__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SetupFooter */ "./js/components/setup/SetupFooter.tsx");
/* harmony import */ var _SetupHeader__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SetupHeader */ "./js/components/setup/SetupHeader.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DefaultModuleSetup 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.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function DefaultModuleSetup({
  moduleSlug
}) {
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).getModule(moduleSlug), [moduleSlug]);
  const finishSetup = (0,_hooks__WEBPACK_IMPORTED_MODULE_5__.useFinishSetup)(moduleSlug);
  const {
    trackCancel: onCancelButtonClick
  } = (0,_hooks__WEBPACK_IMPORTED_MODULE_5__.useModuleSetupTracking)(moduleSlug);
  if (!module?.SetupComponent) {
    return null;
  }
  const {
    SetupComponent
  } = module;
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_SetupHeader__WEBPACK_IMPORTED_MODULE_7__["default"], null), /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-setup"
  }, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Grid, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Row, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Cell, {
    size: 12
  }, /*#__PURE__*/React.createElement("section", {
    className: "googlesitekit-setup__wrapper"
  }, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Grid, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Row, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_4__.Cell, {
    size: 12
  }, /*#__PURE__*/React.createElement("p", {
    className: "googlesitekit-setup__intro-title"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Connect Service', 'google-site-kit')), /*#__PURE__*/React.createElement(SetupComponent, {
    module: module,
    finishSetup: finishSetup
  })))), /*#__PURE__*/React.createElement(_SetupFooter__WEBPACK_IMPORTED_MODULE_6__["default"], {
    moduleSlug: moduleSlug,
    finishSetup: finishSetup,
    onCancel: onCancelButtonClick
  })))))));
}

/***/ },

/***/ "./js/components/setup/SetupFooter.tsx"
/*!*********************************************!*\
  !*** ./js/components/setup/SetupFooter.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": () => (/* binding */ SetupFooter)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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 _ModuleSetupFooter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ModuleSetupFooter */ "./js/components/setup/ModuleSetupFooter.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Module setup SetupFooter 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.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function SetupFooter({
  moduleSlug,
  finishSetup,
  onCancel
}) {
  const registry = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useRegistry)();
  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), [moduleSlug]);
  const onCompleteSetup = module?.onCompleteSetup;
  const onCompleteSetupCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    return onCompleteSetup?.(registry, finishSetup);
  }, [onCompleteSetup, registry, finishSetup]);
  if (!module) {
    return null;
  }
  return /*#__PURE__*/React.createElement(_ModuleSetupFooter__WEBPACK_IMPORTED_MODULE_3__["default"], {
    module: module,
    onCancel: onCancel,
    onComplete: typeof onCompleteSetup === 'function' ? onCompleteSetupCallback : undefined
  });
}

/***/ },

/***/ "./js/components/setup/SetupHeader.tsx"
/*!*********************************************!*\
  !*** ./js/components/setup/SetupHeader.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": () => (/* binding */ SetupHeader)
/* harmony export */ });
/* 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");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Module setup SetupHeader 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 SetupHeader({
  children
}) {
  return /*#__PURE__*/React.createElement(_js_components_Header__WEBPACK_IMPORTED_MODULE_0__["default"], null, children, /*#__PURE__*/React.createElement(_js_components_help_HelpMenu__WEBPACK_IMPORTED_MODULE_1__["default"], null));
}

/***/ },

/***/ "./js/components/setup/hooks/index.ts"
/*!********************************************!*\
  !*** ./js/components/setup/hooks/index.ts ***!
  \********************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useFinishSetup: () => (/* reexport safe */ _useFinishSetup__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   useModuleSetupTracking: () => (/* reexport safe */ _useModuleSetupTracking__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _useFinishSetup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./useFinishSetup */ "./js/components/setup/hooks/useFinishSetup.ts");
/* harmony import */ var _useModuleSetupTracking__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./useModuleSetupTracking */ "./js/components/setup/hooks/useModuleSetupTracking.ts");
/**
 * Module setup hooks.
 *
 * 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/setup/hooks/useFinishSetup.ts"
/*!*****************************************************!*\
  !*** ./js/components/setup/hooks/useFinishSetup.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 */ useFinishSetup)
/* harmony export */ });
/* harmony import */ var use_memo_one__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! use-memo-one */ "../node_modules/use-memo-one/dist/use-memo-one.esm.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-args.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 _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.js");
/* 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 _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_useForwardableParams__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useForwardableParams */ "./js/hooks/useForwardableParams.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * `useFinishSetup` 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.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */






/**
 * Returns a callback to complete module setup.
 *
 * Clears the module setup cache, tracks a completion event, and redirects
 * the user to the Site Kit dashboard or an optional custom URL.
 *
 * @since 1.183.0
 *
 * @param moduleSlug                  Module slug.
 * @param options                     Hook options.
 * @param options.gaTrackingEventArgs Optional. GA tracking event args. Defaults to the standard `complete_module_setup` event for the module slug.
 * @return Async callback to finish module setup.
 */
function useFinishSetup(moduleSlug, {
  gaTrackingEventArgs
} = {}) {
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_LOCATION);
  const forwardableParams = (0,_js_hooks_useForwardableParams__WEBPACK_IMPORTED_MODULE_7__["default"])();

  // `@wordpress/data` types `useRegistry()` as returning `Function`, which
  // does not overlap with `Registry`. Casting through `unknown` tells
  // TypeScript to treat the runtime registry object as Site Kit's registry
  // shape instead.
  const registry = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useRegistry)();
  const defaultGATrackingEventArgs = {
    category: 'moduleSetup',
    action: 'complete_module_setup',
    label: moduleSlug
  };
  const {
    category,
    action,
    label,
    value
  } = gaTrackingEventArgs ?? defaultGATrackingEventArgs;
  return (0,use_memo_one__WEBPACK_IMPORTED_MODULE_0__.useCallbackOne)(async redirectURL => {
    await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_4__.deleteItem)('module_setup');
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(category, action, label, value);
    if (redirectURL) {
      navigateTo((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.addQueryArgs)(redirectURL, {
        ...forwardableParams,
        ...(0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.getQueryArgs)(redirectURL)
      }));
      return;
    }
    const {
      select,
      resolveSelect
    } = registry;
    await resolveSelect(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getSiteInfo();
    const adminURL = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getAdminURL('googlesitekit-dashboard', {
      ...forwardableParams,
      notification: 'authentication_success',
      slug: moduleSlug
    });
    navigateTo(adminURL);
  }, [category, action, label, value, forwardableParams, registry, navigateTo, moduleSlug]);
}

/***/ },

/***/ "./js/components/setup/hooks/useModuleSetupTracking.ts"
/*!*************************************************************!*\
  !*** ./js/components/setup/hooks/useModuleSetupTracking.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 */ useModuleSetupTracking)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * `useModuleSetupTracking` 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.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */

/**
 * Tracks module setup view and cancel events.
 *
 * Fires a view event on mount. Returns a `trackCancel` callback for setup
 * cancellation tracking.
 *
 * @since 1.183.0
 *
 * @param moduleSlug                        Module slug.
 * @param options                           Hook options.
 * @param options.viewGATrackingEventArgs   Optional. GA tracking event args for setup view. Defaults to the standard `view_module_setup` event for the module slug.
 * @param options.cancelGATrackingEventArgs Optional. GA tracking event args for setup cancel. Defaults to the standard `cancel_module_setup` event for the module slug.
 * @return Object with a callback to track setup cancellation.
 */
function useModuleSetupTracking(moduleSlug, {
  viewGATrackingEventArgs,
  cancelGATrackingEventArgs
} = {}) {
  const defaultViewGATrackingEventArgs = {
    category: 'moduleSetup',
    action: 'view_module_setup',
    label: moduleSlug
  };
  const defaultCancelGATrackingEventArgs = {
    category: 'moduleSetup',
    action: 'cancel_module_setup',
    label: moduleSlug
  };
  const resolvedViewGATrackingEventArgs = viewGATrackingEventArgs ?? defaultViewGATrackingEventArgs;
  const resolvedCancelGATrackingEventArgs = cancelGATrackingEventArgs ?? defaultCancelGATrackingEventArgs;
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])(() => {
    const {
      category,
      action,
      label,
      value
    } = resolvedViewGATrackingEventArgs;
    (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(category, action, label, value);
  });
  const {
    category,
    action,
    label,
    value
  } = resolvedCancelGATrackingEventArgs;
  const trackCancel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(category, action, label, value);
  }, [category, action, label, value]);
  return {
    trackCancel
  };
}

/***/ },

/***/ "./js/components/setup/index.ts"
/*!**************************************!*\
  !*** ./js/components/setup/index.ts ***!
  \**************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   DefaultModuleSetup: () => (/* reexport safe */ _DefaultModuleSetup__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   SetupFooter: () => (/* reexport safe */ _SetupFooter__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   SetupHeader: () => (/* reexport safe */ _SetupHeader__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   useFinishSetup: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_3__.useFinishSetup),
/* harmony export */   useModuleSetupTracking: () => (/* reexport safe */ _hooks__WEBPACK_IMPORTED_MODULE_3__.useModuleSetupTracking)
/* harmony export */ });
/* harmony import */ var _DefaultModuleSetup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./DefaultModuleSetup */ "./js/components/setup/DefaultModuleSetup.tsx");
/* harmony import */ var _SetupFooter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SetupFooter */ "./js/components/setup/SetupFooter.tsx");
/* harmony import */ var _SetupHeader__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SetupHeader */ "./js/components/setup/SetupHeader.tsx");
/* harmony import */ var _hooks__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./hooks */ "./js/components/setup/hooks/index.ts");
/**
 * Module setup components.
 *
 * 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/surveys/ThumbsSurveyTrigger.tsx"
/*!*******************************************************!*\
  !*** ./js/components/surveys/ThumbsSurveyTrigger.tsx ***!
  \*******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   VOTE_DIRECTION_DOWN: () => (/* binding */ VOTE_DIRECTION_DOWN),
/* harmony export */   VOTE_DIRECTION_UP: () => (/* binding */ VOTE_DIRECTION_UP),
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_googlesitekit_components_gm2_Popper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/components-gm2/Popper */ "./js/googlesitekit/components-gm2/Popper.tsx");
/* 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 _svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/icons/close.svg */ "./svg/icons/close.svg");
/* harmony import */ var _svg_icons_thumb_down_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/icons/thumb-down.svg */ "./svg/icons/thumb-down.svg");
/* harmony import */ var _svg_icons_thumb_up_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/svg/icons/thumb-up.svg */ "./svg/icons/thumb-up.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * ThumbsSurveyTrigger 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
 */








const VOTE_DIRECTION_UP = 'up';
const VOTE_DIRECTION_DOWN = 'down';
// Use a tighter gap for bottom-placed poppers. Top placement keeps the default (9px).
const BOTTOM_POPPER_OFFSET = 4;
/**
 * Renders thumbs-up and thumbs-down buttons that send a survey vote
 * and show a thank-you popper after the user votes.
 *
 * @since 1.182.0
 *
 * @param props                   Component props.
 * @param props.voteID            Identifier used to build the survey trigger string.
 * @param [props.onVote]          Optional callback run after the user votes.
 * @param [props.downvoteFormURL] Optional URL for the "Tell us more" link.
 * @param [props.ariaLabel]       Accessible label for the button group.
 * @param [props.popperPlacement] Popper position, defaults to `top-end`.
 * @return React element.
 */
const ThumbsSurveyTrigger = ({
  voteID,
  onVote,
  downvoteFormURL,
  ariaLabel,
  popperPlacement = 'top-end'
}) => {
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
  const [selectedDirection, setSelectedDirection] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  // eslint-disable-next-line sitekit/acronym-case
  const [anchorElement, setAnchorElement] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  const [voteCount, setVoteCount] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(0);
  function handleVote(direction) {
    return event => {
      triggerSurvey(`vote:${voteID}:${direction}`);
      setSelectedDirection(direction);
      setAnchorElement(
      // eslint-disable-next-line sitekit/acronym-case
      event.currentTarget.parentElement);
      setVoteCount(count => count + 1);
      onVote?.(direction);
    };
  }
  function handleClose() {
    setAnchorElement(null);
  }
  const isUpvote = selectedDirection === VOTE_DIRECTION_UP;
  const isDownvote = selectedDirection === VOTE_DIRECTION_DOWN;
  const popperOffset = popperPlacement.startsWith('bottom') ? BOTTOM_POPPER_OFFSET : undefined;
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-thumbs-survey-trigger', {
      'googlesitekit-thumbs-survey-trigger--voted': selectedDirection !== null
    }),
    role: "group",
    "aria-label": ariaLabel ?? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Is this section helpful?', 'google-site-kit')
  }, /*#__PURE__*/React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button
  // @ts-expect-error - The `Button` component is not typed yet.
  , {
    icon: /*#__PURE__*/React.createElement(_svg_icons_thumb_up_svg__WEBPACK_IMPORTED_MODULE_10__["default"], {
      width: 20,
      height: 20
    }),
    "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Yes, this was helpful', 'google-site-kit'),
    "aria-pressed": isUpvote,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-thumbs-survey-trigger__button', 'googlesitekit-thumbs-survey-trigger__button--up'),
    onClick: handleVote(VOTE_DIRECTION_UP),
    tertiary: true,
    hideTooltipTitle: true
  }), /*#__PURE__*/React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button
  // @ts-expect-error - The `Button` component is not typed yet.
  , {
    icon: /*#__PURE__*/React.createElement(_svg_icons_thumb_down_svg__WEBPACK_IMPORTED_MODULE_9__["default"], {
      width: 20,
      height: 20
    }),
    "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No, this was not helpful', 'google-site-kit'),
    "aria-pressed": isDownvote,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-thumbs-survey-trigger__button', 'googlesitekit-thumbs-survey-trigger__button--down'),
    onClick: handleVote(VOTE_DIRECTION_DOWN),
    tertiary: true,
    hideTooltipTitle: true
  })), /*#__PURE__*/React.createElement(_js_googlesitekit_components_gm2_Popper__WEBPACK_IMPORTED_MODULE_6__["default"], {
    anchorElement: anchorElement,
    onClose: handleClose,
    placement: popperPlacement,
    resetKey: voteCount,
    offset: popperOffset,
    className: "googlesitekit-thumbs-survey-trigger__popper"
  }, /*#__PURE__*/React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: "body",
    size: "small",
    role: "status",
    className: "googlesitekit-thumbs-survey-trigger__popper-text"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Thanks for the feedback!', 'google-site-kit'), isDownvote && !!downvoteFormURL && /*#__PURE__*/React.createElement("a", {
    href: downvoteFormURL,
    target: "_blank",
    rel: "noreferrer noopener"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Tell us more', 'google-site-kit'))), /*#__PURE__*/React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button
  // @ts-expect-error - The `Button` component is not typed yet.
  , {
    icon: /*#__PURE__*/React.createElement(_svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_8__["default"], {
      width: 11,
      height: 11
    }),
    "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Close feedback message', 'google-site-kit'),
    className: "googlesitekit-thumbs-survey-trigger__popper-close",
    onClick: handleClose,
    hideTooltipTitle: true
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ThumbsSurveyTrigger);

/***/ },

/***/ "./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_feature_tours_welcome__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/feature-tours/welcome */ "./js/feature-tours/welcome.ts");
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/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_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_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_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_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_10__ = __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_11__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.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_9__["default"])();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const canAuthenticate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.PERMISSION_AUTHENTICATE), []);
  const isAnalyticsViewable = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_10__.MODULE_SLUG_ANALYTICS_4) && select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).hasAccessToShareableModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_10__.MODULE_SLUG_ANALYTICS_4), []);
  const isActivateAnalyticsNotificationPresent = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (viewContext !== _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_2__.VIEW_CONTEXT_MAIN_DASHBOARD) {
      return false;
    }
    const queuedNotifications = select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_NOTIFICATIONS).getQueuedNotifications(_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_2__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_6__.NOTIFICATION_GROUPS.DEFAULT);
    return queuedNotifications?.[0]?.id === 'activate-analytics-notification';
  }, [viewContext]);
  const isKeyMetricsWidgetPresent = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => isAnalyticsViewable && !!select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).isKeyMetricsSetupCompleted() && !select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isKeyMetricsWidgetHidden(), [isAnalyticsViewable]);
  const isAudienceSegmentationWidgetPresent = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => isAnalyticsViewable && !!select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isAudienceSegmentationSetupCompleted() && !select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isAudienceSegmentationWidgetHidden(), [isAnalyticsViewable]);
  return (0,_js_feature_tours_welcome__WEBPACK_IMPORTED_MODULE_1__.getWelcomeTour)({
    isViewOnly,
    canAuthenticate,
    isAnalyticsConnected: !!isAnalyticsViewable,
    isActivateAnalyticsNotificationPresent,
    isKeyMetricsWidgetPresent,
    isAudienceSegmentationWidgetPresent
  });
}

/***/ },

/***/ "./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");
/* harmony import */ var _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/feature-tours/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',
        styles: {
          arrow: {
            margin: 8
          }
        }
      },
      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'
  };
}

/**
 * Returns the top search queries step.
 *
 * @since 1.180.0
 *
 * @return {Object} The top search queries step object.
 */
function getTopSearchQueriesStep() {
  return {
    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',
    isResponsive: true
  };
}

/**
 * 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 {boolean} params.isKeyMetricsWidgetPresent              Whether the key metrics widget is present.
 * @param {boolean} params.isAudienceSegmentationWidgetPresent    Whether audience segmentation widget is present.
 * @return {Object} The welcome tour configuration object.
 */
function getWelcomeTour({
  isViewOnly,
  canAuthenticate,
  isAnalyticsConnected,
  isActivateAnalyticsNotificationPresent,
  isKeyMetricsWidgetPresent,
  isAudienceSegmentationWidgetPresent
}) {
  if (!isAnalyticsConnected) {
    const steps = [{
      target: '.googlesitekit-widget--searchFunnelGA4',
      floaterProps: {
        target: '.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',
      isResponsive: true
    }, getTopSearchQueriesStep(), getDashboardSharingStep(isViewOnly, canAuthenticate, false)];

    // Add the Activate Analytics step for authenticated users only.
    if (!isViewOnly && isActivateAnalyticsNotificationPresent) {
      steps.push(getActivateAnalyticsStep());
    }
    return {
      slug: _constants__WEBPACK_IMPORTED_MODULE_3__.WELCOME_TOUR.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`,
      // Preload the widget areas that contain the targets referenced
      // in the tour steps so they are visible immediately when the
      // step is triggered, instead of waiting to be scrolled into view.
      preloadWidgetAreas: [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_CONTENT_PRIMARY],
      steps
    };
  }
  return {
    slug: _constants__WEBPACK_IMPORTED_MODULE_3__.WELCOME_TOUR.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`,
    // Preload the widget areas that contain the targets referenced
    // in the tour steps so they are visible immediately when the
    // step is triggered, instead of waiting to be scrolled into view.
    preloadWidgetAreas: [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_CONTENT_PRIMARY],
    steps: [isKeyMetricsWidgetPresent && {
      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',
      isResponsive: true
    }, {
      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',
      isResponsive: true
    }, isAudienceSegmentationWidgetPresent && {
      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',
      isResponsive: true
    }, (!isKeyMetricsWidgetPresent || !isAudienceSegmentationWidgetPresent) && getTopSearchQueriesStep(), {
      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',
      isResponsive: true
    }, getDashboardSharingStep(isViewOnly, canAuthenticate, true)].filter(Boolean)
  };
}

/***/ },

/***/ "./js/googlesitekit-components.ts"
/*!****************************************!*\
  !*** ./js/googlesitekit-components.ts ***!
  \****************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Button: () => (/* binding */ Button),
/* harmony export */   Checkbox: () => (/* binding */ Checkbox),
/* harmony export */   Chip: () => (/* binding */ Chip),
/* harmony export */   CircularProgress: () => (/* binding */ CircularProgress),
/* harmony export */   Dialog: () => (/* binding */ Dialog),
/* harmony export */   DialogContent: () => (/* binding */ DialogContent),
/* harmony export */   DialogFooter: () => (/* binding */ DialogFooter),
/* harmony export */   DialogTitle: () => (/* binding */ DialogTitle),
/* harmony export */   HelperText: () => (/* binding */ HelperText),
/* harmony export */   Menu: () => (/* binding */ Menu),
/* harmony export */   Option: () => (/* binding */ Option),
/* harmony export */   ProgressBar: () => (/* binding */ ProgressBar),
/* harmony export */   Radio: () => (/* binding */ Radio),
/* harmony export */   Select: () => (/* binding */ Select),
/* harmony export */   SpinnerButton: () => (/* binding */ SpinnerButton),
/* harmony export */   Switch: () => (/* binding */ Switch),
/* harmony export */   Tab: () => (/* binding */ Tab),
/* harmony export */   TabBar: () => (/* binding */ TabBar),
/* harmony export */   TextField: () => (/* binding */ TextField),
/* harmony export */   Tooltip: () => (/* binding */ Tooltip)
/* harmony export */ });
/* harmony import */ var _googlesitekit_components_gm2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./googlesitekit/components-gm2 */ "./js/googlesitekit/components-gm2/index.js");
/**
 * Public components entrypoint.
 *
 * 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
 */

if (typeof globalThis.googlesitekit === 'undefined') {
  globalThis.googlesitekit = {};
}
globalThis.googlesitekit.components = _googlesitekit_components_gm2__WEBPACK_IMPORTED_MODULE_0__["default"];
const {
  Button,
  Checkbox,
  Chip,
  CircularProgress,
  Dialog,
  DialogTitle,
  DialogContent,
  DialogFooter,
  Menu,
  Option,
  ProgressBar,
  Radio,
  Select,
  SpinnerButton,
  Switch,
  Tab,
  TabBar,
  TextField,
  HelperText,
  Tooltip
} = _googlesitekit_components_gm2__WEBPACK_IMPORTED_MODULE_0__["default"];

/***/ },

/***/ "./js/googlesitekit-data.ts"
/*!**********************************!*\
  !*** ./js/googlesitekit-data.ts ***!
  \**********************************/
(__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 globalThis.googlesitekit === 'undefined') {
  globalThis.googlesitekit = {};
}
globalThis.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-analytics-4.ts"
/*!*************************************************!*\
  !*** ./js/googlesitekit-modules-analytics-4.ts ***!
  \*************************************************/
(__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_notifications__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! googlesitekit-notifications */ "googlesitekit-notifications");
/* harmony import */ var googlesitekit_notifications__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_notifications__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-widgets */ "googlesitekit-widgets");
/* harmony import */ var googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _modules_analytics_4__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./modules/analytics-4 */ "./js/modules/analytics-4/index.js");
/**
 * Analytics-4 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_analytics_4__WEBPACK_IMPORTED_MODULE_4__.registerStore)((googlesitekit_data__WEBPACK_IMPORTED_MODULE_0___default()));
(0,_modules_analytics_4__WEBPACK_IMPORTED_MODULE_4__.registerModule)((googlesitekit_modules__WEBPACK_IMPORTED_MODULE_1___default()));
(0,_modules_analytics_4__WEBPACK_IMPORTED_MODULE_4__.registerWidgets)((googlesitekit_widgets__WEBPACK_IMPORTED_MODULE_3___default()));
(0,_modules_analytics_4__WEBPACK_IMPORTED_MODULE_4__.registerNotifications)((googlesitekit_notifications__WEBPACK_IMPORTED_MODULE_2___default()));

/***/ },

/***/ "./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) {
  globalThis.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/components-gm2/Checkbox.tsx"
/*!******************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Checkbox.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 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_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Spinner__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Spinner */ "./js/components/Spinner.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Checkbox 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 Checkbox = ({
  onChange,
  id,
  name,
  value,
  checked = false,
  indeterminate = false,
  disabled = false,
  children,
  tabIndex,
  onKeyDown,
  loading = false,
  alignLeft = false,
  description,
  badge
}) => {
  const inputRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);

  // `indeterminate` is a DOM-only property with no React attribute, so it must
  // be set imperatively on the native input.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (inputRef.current) {
      inputRef.current.indeterminate = indeterminate;
    }
  }, [indeterminate, loading]);
  const label = !!badge ? /*#__PURE__*/React.createElement("div", {
    className: "mdc-checkbox__label-wrapper"
  }, /*#__PURE__*/React.createElement("label", {
    htmlFor: id
  }, children), badge) : /*#__PURE__*/React.createElement("label", {
    htmlFor: id
  }, children);
  return /*#__PURE__*/React.createElement("div", {
    className: "mdc-form-field"
  }, /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-checkbox', {
      'mdc-checkbox--disabled': disabled,
      'mdc-checkbox--align-left': alignLeft
    })
  }, loading ? /*#__PURE__*/React.createElement(_js_components_Spinner__WEBPACK_IMPORTED_MODULE_2__["default"], {
    style: {
      margin: '0'
    },
    isSaving: true
  }) : /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement("input", {
    ref: inputRef,
    "aria-checked": indeterminate ? 'mixed' : `${checked ? 'true' : 'false'}`,
    className: "mdc-checkbox__native-control",
    type: "checkbox",
    id: id,
    name: name,
    value: value,
    checked: checked,
    disabled: disabled,
    onChange: onChange,
    tabIndex: tabIndex,
    onKeyDown: onKeyDown
  }), /*#__PURE__*/React.createElement("div", {
    className: "mdc-checkbox__background"
  }, /*#__PURE__*/React.createElement("svg", {
    className: "mdc-checkbox__checkmark",
    viewBox: "0 0 12 9"
  }, /*#__PURE__*/React.createElement("path", {
    className: "mdc-checkbox__checkmark-path",
    d: "M2.08301 5.28834L3.55703 7.29507C4.24647 8.23368 5.5034 8.23368 6.19285 7.29507L10.083 1.99902",
    fill: "none",
    stroke: "none"
  })), /*#__PURE__*/React.createElement("div", {
    className: "mdc-checkbox__mixedmark"
  })))), !description && label, description && /*#__PURE__*/React.createElement("div", {
    className: "mdc-checkbox__content"
  }, label, /*#__PURE__*/React.createElement("div", {
    className: "mdc-checkbox__description"
  }, description)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Checkbox);

/***/ },

/***/ "./js/googlesitekit/components-gm2/Popper.tsx"
/*!****************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Popper.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 _material_ui_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material-ui/core */ "../node_modules/@material-ui/core/esm/Popper/Popper.js");
/* 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_2__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useKey.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Popper 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
 */

const DEFAULT_AUTO_DISMISS_MS = 4000;
const DEFAULT_OFFSET = 9;
/**
 * Renders a floating notification panel anchored to an element. It closes
 * after a delay, on an outside click, or when the user presses Escape.
 *
 * @since 1.182.0
 *
 * @param props                 Component props.
 * @param props.anchorElement   Anchor element. The popper opens when it is set, and closes when it is null.
 * @param props.onClose         Callback run when the popper should close.
 * @param [props.placement]     Placement relative to anchor, defaults to `top-end`.
 * @param [props.autoDismissMs] Auto-dismiss delay in ms, defaults to 4000. Pass 0 to disable.
 * @param [props.offset]        Gap between anchor and popper in px, defaults to 9.
 * @param [props.resetKey]      Changing this value resets the auto-dismiss timer.
 * @param props.children        Popper content.
 * @param [props.className]     Additional CSS class for the content wrapper.
 * @param [props.rootClassName] Additional CSS class for the popper root.
 * @param [props.arrow]         Whether to render a caret aligned to the anchor's centre, defaults to `false`.
 * @param [props.skidding]      Shift along the anchor's edge in px, defaults to 0. The arrow stays aligned to the anchor.
 * @param [props.positionFixed] Whether to position against the viewport instead of the page, defaults to `false`. Avoids scroll jank for anchors in sticky/fixed containers.
 * @return React element, or null when `anchorElement` is null.
 */
const Popper = ({
  anchorElement,
  onClose,
  placement = 'top-end',
  autoDismissMs = DEFAULT_AUTO_DISMISS_MS,
  offset = DEFAULT_OFFSET,
  resetKey,
  children,
  className,
  rootClassName,
  arrow = false,
  skidding = 0,
  positionFixed = false
}) => {
  const hasAnchorElement = Boolean(anchorElement);
  const contentRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
  // eslint-disable-next-line sitekit/acronym-case
  const [arrowElement, setArrowElement] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
  const timerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
  const onCloseRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(onClose);
  onCloseRef.current = onClose;
  const clearTimer = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
    if (timerRef.current !== undefined) {
      clearTimeout(timerRef.current);
      timerRef.current = undefined;
    }
  }, []);
  const startTimer = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
    clearTimer();
    if (autoDismissMs <= 0) {
      return;
    }
    timerRef.current = setTimeout(() => {
      onCloseRef.current();
    }, autoDismissMs);
  }, [autoDismissMs, clearTimer]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    if (hasAnchorElement) {
      startTimer();
    }
    return clearTimer;
  }, [hasAnchorElement, resetKey, startTimer, clearTimer]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    const ownerDoc = anchorElement?.ownerDocument ?? document;
    function handleMouseDown(event) {
      const target = event.target;
      if (contentRef.current?.contains(target)) {
        return;
      }
      if (anchorElement?.contains(target)) {
        return;
      }
      onCloseRef.current();
    }
    if (hasAnchorElement) {
      ownerDoc.addEventListener('mousedown', handleMouseDown);
    }
    return () => {
      ownerDoc.removeEventListener('mousedown', handleMouseDown);
    };
  }, [hasAnchorElement, anchorElement]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_2__["default"])(event => hasAnchorElement && event.key === 'Escape', () => onCloseRef.current());
  function handleInteractStart() {
    clearTimer();
  }
  function handleInteractEnd() {
    if (hasAnchorElement) {
      startTimer();
    }
  }
  function handleBlur(event) {
    if (contentRef.current?.contains(event.relatedTarget)) {
      return;
    }
    handleInteractEnd();
  }
  return /*#__PURE__*/React.createElement(_material_ui_core__WEBPACK_IMPORTED_MODULE_0__["default"], {
    open: hasAnchorElement,
    anchorEl: anchorElement,
    placement: placement,
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-popper-root', rootClassName)
    // MUI Popper sets `role="tooltip"` by default. Clear it because this is a notification panel, not a tooltip.
    ,
    role: undefined,
    modifiers: {
      offset: {
        offset: `${skidding}, ${offset}`
      },
      preventOverflow: {
        boundariesElement: 'window'
      },
      arrow: {
        enabled: arrow,
        element: arrowElement
      }
    },
    popperOptions: {
      positionFixed
    },
    disablePortal: true
  }, /*#__PURE__*/React.createElement("div", {
    ref: contentRef,
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-popper', className),
    onMouseEnter: handleInteractStart,
    onMouseLeave: handleInteractEnd,
    onFocus: handleInteractStart,
    onBlur: handleBlur
  }, children, arrow && /*#__PURE__*/React.createElement("span", {
    className: "googlesitekit-popper__arrow",
    ref: setArrowElement
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Popper);

/***/ },

/***/ "./js/googlesitekit/data/create-get-report-resolver.ts"
/*!*************************************************************!*\
  !*** ./js/googlesitekit/data/create-get-report-resolver.ts ***!
  \*************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   createGetReportResolver: () => (/* binding */ createGetReportResolver)
/* 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_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_report_options__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util/report-options */ "./js/util/report-options.ts");
/* harmony import */ var _create_error_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/**
 * Creates the shared `getReport` resolver.
 *
 * 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
 */



const {
  clearSelectorError,
  setErrorForSelector
} = _create_error_store__WEBPACK_IMPORTED_MODULE_4__.actions;

/**
 * Creates the `getReport` resolver for a report datastore.
 *
 * The Analytics 4, Search Console, and AdSense report stores share this
 * resolver. `reportID` is only a label that says which part of the plugin
 * asked for the report, and it does not change the report data. So two calls
 * ask for the same report when they differ only in `reportID`. The resolver
 * sends one request for them and shares the saved report.
 *
 * When a request for the same report is already running, the resolver waits
 * for it instead of sending a second one. If that request fails, the resolver
 * copies the error to each waiting call, so every call can read its own error.
 *
 * A call that passes its own `signal` makes its own request and never shares
 * one. That call decides when its request is cancelled, so sharing would let
 * one call's cancellation abort another call's report.
 *
 * @since 1.183.0
 *
 * @param storeName Report datastore name, such as `modules/analytics-4`.
 * @return Generator resolver for the store's `getReport` selector.
 */
function createGetReportResolver(storeName) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof storeName && storeName, 'storeName is required.');

  // Report requests that are still running, stored for each registry. Each
  // request is saved under its report cache key. That key leaves out
  // `reportID`, so two calls that differ only in `reportID` find the same
  // running request.
  //
  // This holds the request promise, not just an `isFetching` flag. A waiting
  // call must read the same request's result to copy its error, and a flag
  // can't hand that result back.
  const runningReportRequests = new WeakMap();

  // This resolver and the `getReport` selector take the same arguments, and
  // neither sets a default. The registry compares the arguments to decide if
  // a call is new, so this resolver must receive the exact arguments the
  // caller sent.
  return function* getReport(options, fetchOptions) {
    const registryResult = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const registry = registryResult;
    const existingReport = registry.select(storeName).getReport(options, fetchOptions);

    // An earlier call that differs only in `reportID` already loaded this
    // report, so stop without sending a request. Don't clear an existing
    // error here. A report and an error can both apply to these options,
    // and components that show a report error need the error to stay set.
    if (existingReport) {
      return;
    }

    // A call that brings its own `signal` decides when its request is
    // cancelled. Sharing one request across such calls would let one
    // call's cancellation abort another call's report. So this call makes
    // its own request and skips the shared map below. Calls without a
    // signal still share one request.
    if ((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(fetchOptions) && fetchOptions?.signal) {
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(registry.dispatch(storeName).fetchGetReport(options, fetchOptions));
      return;
    }
    let runningRequests = runningReportRequests.get(registry);
    if (!runningRequests) {
      runningRequests = new Map();
      runningReportRequests.set(registry, runningRequests);
    }
    const reportCacheKey = (0,_js_util_report_options__WEBPACK_IMPORTED_MODULE_3__.getReportCacheKey)(options);

    // A request for the same report may already be running. An earlier
    // call that differs only in `reportID` started it. Wait for that
    // request instead of sending a second one.
    const runningRequest = runningRequests.get(reportCacheKey);
    if (runningRequest) {
      // Clear this call's own stale error before waiting. If the shared
      // request now succeeds, this call should not keep an old error.
      // The cached-report branch above keeps an existing error on
      // purpose, because there a report and an error apply at once.
      yield clearSelectorError('getReport', [options]);
      const awaitResult = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(runningRequest);
      const {
        error
      } = awaitResult;
      if (error) {
        // Report state drops `reportID`, but error state keeps the full
        // options, so each call has its own error key. The call that
        // sent the request saves the error under its own options. Save
        // it under this call's options too, so `getErrorForSelector`
        // finds it for this call.
        yield setErrorForSelector(error, 'getReport', [options]);
      }
      return;
    }
    const request = registry.dispatch(storeName).fetchGetReport(options, fetchOptions);
    runningRequests.set(reportCacheKey, request);
    try {
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(request);
    } finally {
      runningRequests.delete(reportCacheKey);
    }
  };
}

/***/ },

/***/ "./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/notifications/components/layout/NoticeNotification.tsx"
/*!*********************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/layout/NoticeNotification.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 _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.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_Notice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* 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_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.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
 */

/**
 * Internal dependencies
 */





const NoticeNotification = ({
  notificationID,
  dismissButton,
  ctaButton,
  gaTrackingEventArgs,
  ...props
}) => {
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_4__["default"])(notificationID, gaTrackingEventArgs?.category);
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.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);

    // @ts-ignore TODO: Add types for the `ctaButton` prop.
    await ctaButton?.onClick?.(event);
    if (ctaButton?.dismissOnClick) {
      dismissNotification(notificationID, {
        // @ts-ignore TODO: Add types for the `ctaButton` prop.
        ...ctaButton?.dismissOptions
      });
    }
  }
  return /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Grid, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Row, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Cell, {
    size: 12,
    alignMiddle: true
  }, /*#__PURE__*/React.createElement(_js_components_Notice__WEBPACK_IMPORTED_MODULE_2__["default"], (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
    dismissButton: {
      ...dismissButton,
      onClick: handleDismissWithTrackEvent
    },
    ctaButton: {
      ...ctaButton,
      onClick: handleCTAClickWithTrackEvent
    }
  }, props)))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NoticeNotification);

/***/ },

/***/ "./js/googlesitekit/notifications/components/layout/OverlayNotification.tsx"
/*!**********************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/layout/OverlayNotification.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 _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_OverlayCard__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/OverlayCard */ "./js/components/OverlayCard/index.js");
/* harmony import */ var _js_googlesitekit_components_gm2_Popper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/components-gm2/Popper */ "./js/googlesitekit/components-gm2/Popper.tsx");
/* 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_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






// Shift of the anchored card along the anchor's edge, so the caret sits
// off-centre within the card rather than at its corner, per the design.
const ANCHORED_SKIDDING_PX = 48;
const OverlayNotification = ({
  notificationID,
  ctaButton,
  dismissButton,
  gaTrackingEventArgs,
  className,
  anchorID,
  ...props
}) => {
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_8__["default"])(notificationID, gaTrackingEventArgs?.category, {
    confirmAction: gaTrackingEventArgs?.confirmAction,
    dismissAction: gaTrackingEventArgs?.dismissAction
  });
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_NOTIFICATIONS);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_9__.useBreakpoint)();
  // eslint-disable-next-line sitekit/acronym-case
  const [anchorElement, setAnchorElement] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    setAnchorElement(
    // eslint-disable-next-line sitekit/acronym-case
    anchorID ? document.querySelector(anchorID) : null);
  }, [anchorID]);
  const isAnchored = Boolean(anchorElement) && breakpoint !== _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_9__.BREAKPOINT_SMALL;
  const dismissButtonProps = typeof dismissButton === 'object' ? dismissButton : undefined;
  async function handleDismissWithTrackEvent(event) {
    await dismissButtonProps?.onClick?.(event);
    trackEvents.dismiss(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
    dismissNotification(notificationID, {
      ...dismissButtonProps?.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;
  const card = /*#__PURE__*/React.createElement(_js_components_OverlayCard__WEBPACK_IMPORTED_MODULE_5__["default"], (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()(className, {
      'googlesitekit-overlay-card--anchored': isAnchored
    }),
    disableAnimation: isAnchored,
    ctaButton: overlayCTAButton,
    dismissButton: {
      ...dismissButtonProps,
      onClick: handleDismissWithTrackEvent
    }
  }, props, {
    visible: true
  }));
  if (!isAnchored) {
    return card;
  }
  return /*#__PURE__*/React.createElement(_js_googlesitekit_components_gm2_Popper__WEBPACK_IMPORTED_MODULE_6__["default"], {
    anchorElement: anchorElement,
    onClose: () => {},
    placement: "bottom",
    autoDismissMs: 0,
    offset: 12,
    skidding: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.isRTL)() ? ANCHORED_SKIDDING_PX : -ANCHORED_SKIDDING_PX,
    className: "googlesitekit-popper--overlay-notification",
    rootClassName: "googlesitekit-popper-root--overlay-notification",
    arrow: true,
    positionFixed: true
  }, card);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OverlayNotification);

/***/ },

/***/ "./js/googlesitekit/widgets/components/Widget.tsx"
/*!********************************************************!*\
  !*** ./js/googlesitekit/widgets/components/Widget.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 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_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_IconWrapper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/IconWrapper */ "./js/components/IconWrapper.js");
/* harmony import */ var _svg_icons_chevron_down_v2_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/icons/chevron-down-v2.svg */ "./svg/icons/chevron-down-v2.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Widget 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 Widget = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(({
  className = '',
  children,
  collapsible = false,
  defaultCollapsed,
  isCollapsed: isCollapsedProp,
  onToggleCollapsed,
  Header,
  headerContents,
  Footer,
  noPadding = false,
  widgetSlug
}, ref) => {
  const [isCollapsed, setIsCollapsed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(!!defaultCollapsed);
  const instanceID = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["default"])(Widget);

  // If the `isCollapsed` prop is provided, it will control the collapsed
  // state of the widget. This allows the parent component to manage the
  // state of the widget, while still allowing the widget to manage its
  // own state when the prop is not provided.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    if (isCollapsedProp !== undefined) {
      setIsCollapsed(isCollapsedProp);
    }
  }, [isCollapsedProp]);
  function toggleIsCollapsed() {
    if (collapsible) {
      setIsCollapsed(prevState => {
        onToggleCollapsed?.(!prevState);
        return !prevState;
      });
    }
  }
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    if (defaultCollapsed !== undefined && isCollapsedProp !== undefined) {
      // This console warning is meant to help developers understand
      // that the `defaultCollapsed` prop should not be combined with
      // the `isCollapsed` prop, so this console statement should be
      // allowed.
      // eslint-disable-next-line no-console
      console.warn(`Error in \`Widget\` component: The \`defaultCollapsed\` prop should not be used together with the \`isCollapsed\` prop. Providing the \`isCollapsed\` prop means the \`Widget\` component for slug "${widgetSlug}" is controlled by its parent component, and the \`defaultCollapsed\` prop will be ignored.`);
    }
  });

  // Check if the widget is collapsible and uncontrolled (i.e.
  // `isCollapsed` prop is not provided). If so, set the appropriate
  // aria-label for the toggle button.
  const collapsibleAndUncontrolled = !!collapsible && isCollapsedProp === undefined;
  let ariaLabel;
  if (collapsibleAndUncontrolled) {
    ariaLabel = isCollapsed ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Expand section', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Hide section', 'google-site-kit');
  }
  return /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget', `googlesitekit-widget--${widgetSlug}`, {
      'googlesitekit-widget--no-padding': noPadding
    }, {
      'googlesitekit-widget--with-header': Header
    }, className),
    ref: ref
  }, Header && /*#__PURE__*/React.createElement("div", {
    "aria-expanded": collapsibleAndUncontrolled ? !isCollapsed : undefined,
    "aria-controls": collapsibleAndUncontrolled ? `googlesitekit-widget-body-${instanceID}` : undefined,
    "aria-label": collapsibleAndUncontrolled ? ariaLabel : undefined,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget__header', {
      'googlesitekit-widget__header--collapsible': collapsible,
      'googlesitekit-widget__header--collapsed': isCollapsed
    }),
    onClick: collapsibleAndUncontrolled ? toggleIsCollapsed : undefined,
    onKeyUp: collapsibleAndUncontrolled ? event => {
      if (event.key === 'Enter') {
        toggleIsCollapsed();
      }
    } : undefined,
    role: collapsibleAndUncontrolled ? 'button' : undefined,
    tabIndex: collapsibleAndUncontrolled ? 0 : undefined
  }, /*#__PURE__*/React.createElement(Header, null, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-widget__header-inner"
  }, !!collapsible && /*#__PURE__*/React.createElement(_js_components_IconWrapper__WEBPACK_IMPORTED_MODULE_5__["default"], {
    marginLeft: 4,
    marginRight: 10
  }, /*#__PURE__*/React.createElement(_svg_icons_chevron_down_v2_svg__WEBPACK_IMPORTED_MODULE_6__["default"], {
    width: 12,
    height: 12,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget__header-icon', {
      'googlesitekit-widget__header-icon--collapsed': isCollapsed
    })
  })), headerContents))), /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget__body', {
      'googlesitekit-widget__body--collapsed': !!isCollapsed
    }),
    id: !!collapsible ? `googlesitekit-widget-body-${instanceID}` : undefined
  }, children), Footer && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-widget__footer"
  }, /*#__PURE__*/React.createElement(Footer, null)));
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Widget);

/***/ },

/***/ "./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.tsx"
/*!*******************************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WidgetHeaderTitle.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 _js_components_Typography__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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
 */

/**
 * Internal dependencies
 */

const WidgetHeaderTitle = ({
  children
}) => {
  return /*#__PURE__*/React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_0__["default"], {
    className: "googlesitekit-widget__header-title",
    as: "h3",
    type: "title",
    size: "small"
  }, children);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WidgetHeaderTitle);

/***/ },

/***/ "./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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_googlesitekit_widgets_components_WidgetContext__WEBPACK_IMPORTED_MODULE_1__ = __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_0__.useContext)(_js_googlesitekit_widgets_components_WidgetContext__WEBPACK_IMPORTED_MODULE_1__["default"]);
  return widgetContext;
}

/***/ },

/***/ "./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.
 */

/**
 * Internal dependencies
 */


/**
 * 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/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_event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hook/event */ "../node_modules/@react-hook/event/dist/module/index.js");
/* harmony import */ var _react_hook_throttle__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @react-hook/throttle */ "../node_modules/@react-hook/throttle/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 [globalThis.innerWidth, globalThis.innerHeight];
}
function useWindowSize({
  fps = 60,
  leading = false,
  initialWidth = 0,
  initialHeight = 0
} = {}) {
  const [size, setThrottledSize] = (0,_react_hook_throttle__WEBPACK_IMPORTED_MODULE_1__.useThrottle)(/* istanbul ignore next */
  typeof document === 'undefined' ? [initialWidth, initialHeight] : getSize, fps, leading);
  function setSize() {
    return setThrottledSize(getSize);
  }
  (0,_react_hook_event__WEBPACK_IMPORTED_MODULE_0__["default"])(window, 'resize', setSize);
  (0,_react_hook_event__WEBPACK_IMPORTED_MODULE_0__["default"])(window, 'orientationchange', setSize);
  return size;
}
function useWindowHeight(options = {}) {
  return useWindowSize(options)[1];
}
function useWindowWidth(options = {}) {
  return useWindowSize(options)[0];
}

/***/ },

/***/ "./js/material-components/layout/Cell.tsx"
/*!************************************************!*\
  !*** ./js/material-components/layout/Cell.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 _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* 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__);
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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
 */

const Cell = ({
  className = '',
  alignTop = false,
  alignMiddle = false,
  alignBottom = false,
  alignRight = false,
  alignLeft = false,
  smAlignRight = false,
  mdAlignRight = false,
  lgAlignRight = false,
  smSize = 0,
  smStart = 0,
  smOrder = 0,
  mdSize = 0,
  mdStart = 0,
  mdOrder = 0,
  lgSize = 0,
  lgStart = 0,
  lgOrder = 0,
  size = 0,
  children,
  ...otherProps
}) => {
  return /*#__PURE__*/React.createElement("div", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({}, otherProps, {
    className: classnames__WEBPACK_IMPORTED_MODULE_1___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);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Cell);

/***/ },

/***/ "./js/material-components/layout/Grid.tsx"
/*!************************************************!*\
  !*** ./js/material-components/layout/Grid.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 _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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 = false,
  fill = false,
  className = '',
  children,
  collapsed = false,
  ...otherProps
}, ref) => {
  return /*#__PURE__*/React.createElement("div", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
    className: classnames__WEBPACK_IMPORTED_MODULE_1___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);
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Grid);

/***/ },

/***/ "./js/material-components/layout/Row.tsx"
/*!***********************************************!*\
  !*** ./js/material-components/layout/Row.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 _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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__*/React.createElement("div", (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
    ref: ref,
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('mdc-layout-grid__inner', className)
  }, otherProps), children);
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Row);

/***/ },

/***/ "./js/material-components/layout/index.ts"
/*!************************************************!*\
  !*** ./js/material-components/layout/index.ts ***!
  \************************************************/
(__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.tsx");
/* harmony import */ var _Row__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Row */ "./js/material-components/layout/Row.tsx");
/* harmony import */ var _Grid__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Grid */ "./js/material-components/layout/Grid.tsx");
/**
 * 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/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationBackNotice.tsx"
/*!**************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationBackNotice.tsx ***!
  \**************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AUDIENCE_SEGMENTATION_BACK_NOTICE_SLUG: () => (/* binding */ AUDIENCE_SEGMENTATION_BACK_NOTICE_SLUG),
/* 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_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_components_Notice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_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_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./AudienceSelectionPanel/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * AudienceSegmentationBackNotice 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
 */









const AUDIENCE_SEGMENTATION_BACK_NOTICE_SLUG = 'audience-segmentation-back-notice';
const NoticeWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_components_Notice__WEBPACK_IMPORTED_MODULE_3__["default"]);
const AudienceSegmentationBackNotice = ({
  Widget
}) => {
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const trackEventCategory = `${viewContext}_audiences-reshown`;
  const onDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(trackEventCategory, 'dismiss_notice');
    dismissItem(AUDIENCE_SEGMENTATION_BACK_NOTICE_SLUG);
  }, [dismissItem, trackEventCategory]);
  const onInView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(trackEventCategory, 'view_notice');
  }, [trackEventCategory]);
  const onSelectGroups = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(trackEventCategory, 'confirm_notice');
    dismissItem(AUDIENCE_SEGMENTATION_BACK_NOTICE_SLUG);
    setValue(_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_SELECTION_PANEL_OPENED_KEY, true);
  }, [dismissItem, setValue, trackEventCategory]);
  return /*#__PURE__*/React.createElement(Widget, {
    noPadding: true
  }, /*#__PURE__*/React.createElement(NoticeWithIntersectionObserver, {
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.INFO_CIRCLE,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Visitor groups are back on your dashboard', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This section is now an integral part of the dashboard. You can customize your visitor group selection at any time to compare how they interact with your site.', 'google-site-kit'),
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Got it', 'google-site-kit'),
      onClick: onDismiss
    },
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select groups', 'google-site-kit'),
      onClick: onSelectGroups
    },
    onInView: onInView
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AudienceSegmentationBackNotice);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupErrorWidget.tsx"
/*!********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupErrorWidget.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.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_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * AudienceSegmentationSetupErrorWidget 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
 */









const AudienceSegmentationSetupErrorNoticeWithObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_10__["default"])(_js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"]);
const AudienceSegmentationSetupErrorWidget = ({
  Widget,
  errors,
  isAudienceCreationVariant = false,
  onRetry,
  onDismiss
}) => {
  const normalizedErrors = Array.isArray(errors) ? errors : [errors];
  const isPermissionsError = (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_9__.isInsufficientPermissionsError)(normalizedErrors[0]);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_7__["default"])('audience-segmentation-setup-error', viewContext, {
    viewAction: 'audience_segmentation_setup_error',
    confirmAction: 'audience_segmentation_setup_error_retry',
    dismissAction: 'audience_segmentation_setup_error_dismiss'
  });

  // Determine label based on variant and error type
  let label = '';
  if (isAudienceCreationVariant) {
    label = isPermissionsError ? 'audience_creation_permissions' : 'audience_creation_generic';
  } else {
    label = isPermissionsError ? 'data_loading_permissions' : 'data_loading_generic';
  }
  const visitorGroupsDocumentationLinkURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getDocumentationLinkURL('visitor-groups'), []);
  let title = '';
  let descriptionText = '';
  if (isAudienceCreationVariant) {
    title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Creating visitor groups failed', 'google-site-kit');
    descriptionText = isPermissionsError ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('It seems that you don’t have the required permissions to create visitor groups. <br />You can contact your administrator and ask for Analytics write permissions and then retry. <a>Learn more</a>', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('To create your audience groups we’ll need to update your Analytics property which failed during setup. <a>Learn more</a>', 'google-site-kit');
  } else {
    title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Visitor groups setup failed', 'google-site-kit');
    descriptionText = isPermissionsError ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('It seems that you don’t have the required permissions to set up visitor groups.<br />You can contact your administrator. <a>Learn more</a>', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('An error occurred while setting up visitor groups, please try again. <a>Learn more</a>', 'google-site-kit');
  }
  const description = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])(descriptionText, {
    a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
      href: visitorGroupsDocumentationLinkURL,
      external: true,
      hideExternalIndicator: true
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more', 'google-site-kit')),
    br: /*#__PURE__*/React.createElement("br", null)
  });
  function handleRetry(eventLabel) {
    trackEvents.confirm(eventLabel);
    onRetry();
  }
  function handleDismiss(eventLabel) {
    trackEvents.dismiss(eventLabel);
    onDismiss();
  }
  return /*#__PURE__*/React.createElement(Widget, {
    className: "googlesitekit-audience-segmentation-setup-error-widget",
    noPadding: true
  }, /*#__PURE__*/React.createElement(AudienceSegmentationSetupErrorNoticeWithObserver, {
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.ERROR,
    title: title,
    description: description,
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Retry', 'google-site-kit'),
      onClick: () => handleRetry(label)
    },
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No thanks', 'google-site-kit'),
      onClick: () => handleDismiss(label)
    },
    onInView: () => trackEvents.view(label)
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AudienceSegmentationSetupErrorWidget);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/buildPDFAudienceCard.ts"
/*!***********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/buildPDFAudienceCard.ts ***!
  \***********************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   buildPDFAudienceCard: () => (/* binding */ buildPDFAudienceCard),
/* harmony export */   buildTopCities: () => (/* binding */ buildTopCities),
/* harmony export */   buildTopContent: () => (/* binding */ buildTopContent),
/* harmony export */   readAudienceMetrics: () => (/* binding */ readAudienceMetrics),
/* harmony export */   siteKitAudienceDimensionValue: () => (/* binding */ siteKitAudienceDimensionValue)
/* harmony export */ });
/* harmony import */ var _js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/custom-dimensions */ "./js/modules/analytics-4/utils/custom-dimensions.js");
/* harmony import */ var _js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/report-rows-with-set-values */ "./js/modules/analytics-4/utils/report-rows-with-set-values.js");
/**
 * Audience card builder for the Your visitor groups PDF widget.
 *
 * Turns one audience's raw report results into the card data the PDF renders.
 * The loader in `getPDFData.ts` resolves and fetches the reports, then calls
 * `buildPDFAudienceCard` for each audience.
 *
 * 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
 */




/** The top content list shows at most three pages. */
const MAX_TOP_CONTENT_PAGES = 3;

/** A metric's value for the current period, and for the comparison period. */

/** The pageviews metric, plus its share of the site's total pageviews. */

/** One row of the top cities list. */

/** One row of the top content list. */

/** One audience card's fully loaded data. */

/** The result of one `fetchGetReport` dispatch. */

/** The audience type, as returned by the Analytics 4 store. */

/** An available audience, as returned by `getOrSyncAvailableAudiences`. */

/**
 * Reads one audience's four metric values for a date range.
 *
 * Finds the row for the audience and date range, then reads the four metrics in
 * order, like the dashboard's `Body.js`. A missing value reads as `0`.
 *
 * @since 1.184.0
 *
 * @param report         The metrics report, or `undefined`.
 * @param dimensionValue The audience's first-dimension value.
 * @param dateRange      Either `date_range_0` (current) or `date_range_1` (previous).
 * @return The four metric values: total users, sessions per user, pageviews per session, and pageviews.
 */
function readMetricRow(report, dimensionValue, dateRange) {
  const row = report?.rows?.find(({
    dimensionValues
  }) => dimensionValues?.[0]?.value === dimensionValue && dimensionValues?.[1]?.value === dateRange);
  return [0, 1, 2, 3].map(index => Number(row?.metricValues?.[index]?.value || 0));
}

/**
 * Reads one audience's four metrics, each with a current and previous value.
 *
 * @since 1.184.0
 *
 * @param report         The metrics report, or `undefined`.
 * @param dimensionValue The audience's first-dimension value.
 * @return The four metrics, each with its current and previous value.
 */
function readAudienceMetrics(report, dimensionValue) {
  const current = readMetricRow(report, dimensionValue, 'date_range_0');
  const previous = readMetricRow(report, dimensionValue, 'date_range_1');
  return {
    visitors: {
      current: current[0],
      previous: previous[0]
    },
    visitsPerVisitor: {
      current: current[1],
      previous: previous[1]
    },
    pagesPerVisit: {
      current: current[2],
      previous: previous[2]
    },
    pageviews: {
      current: current[3],
      previous: previous[3],
      percentageOfTotalPageViews: 0
    }
  };
}

/**
 * Builds an audience's top three cities, removing `(not set)`.
 *
 * Each percentage is the city's share of the audience's visitors, like the
 * dashboard.
 *
 * @since 1.184.0
 *
 * @param report   The top cities report, or `undefined`.
 * @param visitors The audience's current-period total visitors, the percentage denominator.
 * @return Up to three top cities.
 */
function buildTopCities(report, visitors) {
  const rows = report?.rows ? (0,_js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_1__.reportRowsWithSetValues)(report.rows) : [];
  return rows.map(row => {
    const users = Number(row.metricValues?.[0]?.value || 0);
    return {
      name: row.dimensionValues?.[0]?.value || '',
      percentage: visitors > 0 ? users / visitors : 0
    };
  });
}

/**
 * Builds an audience's top content, resolving each page path to its page title
 * and to its Analytics report link.
 *
 * @since 1.184.0
 *
 * @param {Object}   report               The top content report, or `undefined`.
 * @param {Object}   titlesReport         The page titles report that resolves a path to its title, or `undefined`.
 * @param {Function} getContentServiceURL Maps a page path to its Analytics report link, or to an empty string when the page has no link.
 * @return {Object[]} Up to three top content pages.
 */
function buildTopContent(report, titlesReport, getContentServiceURL) {
  const titlesByPath = (titlesReport?.rows || []).reduce((titles, row) => {
    const pagePath = row.dimensionValues?.[0]?.value;
    const pageTitle = row.dimensionValues?.[1]?.value;
    if (pagePath) {
      titles[pagePath] = pageTitle || '';
    }
    return titles;
  }, {});
  return (report?.rows || []).slice(0, MAX_TOP_CONTENT_PAGES).map(row => {
    const pagePath = row.dimensionValues?.[0]?.value || '';
    return {
      title: titlesByPath[pagePath] || pagePath,
      pageviews: Number(row.metricValues?.[0]?.value || 0),
      serviceURL: getContentServiceURL(pagePath)
    };
  });
}

/**
 * Returns `new` or `returning` for a Site Kit audience slug.
 *
 * @since 1.184.0
 *
 * @param audienceSlug The Site Kit audience slug, like `new-visitors`.
 * @return `new` for the new visitors audience, otherwise `returning`.
 */
function siteKitAudienceDimensionValue(audienceSlug) {
  return audienceSlug === 'new-visitors' ? 'new' : 'returning';
}

/** The reports and context for one audience card. */

/**
 * Builds one audience card, or returns `null` to drop the audience when its
 * reports fail.
 *
 * @since 1.184.0
 *
 * @param input The reports and context for the audience.
 * @return The audience card, or `null` when the audience is excluded.
 */
function buildPDFAudienceCard(input) {
  const {
    audienceResourceName,
    audience,
    usesSiteKitReport,
    metricsResult,
    topCitiesResult,
    topContentResult,
    topContentPageTitlesResult,
    totalPageviews,
    isAudiencePartialData,
    isTopContentPartialData,
    getContentServiceURL
  } = input;

  // Don't render when a metrics or cities report has any error, or when
  // a top content failure is anything other than a missing/invalid custom
  // dimension error.
  if (metricsResult.error || topCitiesResult.error || topContentResult.error && !(0,_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_0__.isInvalidCustomDimensionError)(topContentResult.error) || topContentPageTitlesResult.error && !(0,_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_0__.isInvalidCustomDimensionError)(topContentPageTitlesResult.error)) {
    return null;
  }
  const dimensionValue = usesSiteKitReport ? siteKitAudienceDimensionValue(audience?.audienceSlug) : audienceResourceName;
  const metrics = readAudienceMetrics(metricsResult.response, dimensionValue);
  metrics.pageviews.percentageOfTotalPageViews = totalPageviews !== 0 ? metrics.pageviews.current / totalPageviews : 0;
  return {
    audienceResourceName,
    audienceName: audience?.displayName || '',
    metrics,
    topCities: buildTopCities(topCitiesResult.response, metrics.visitors.current),
    topContent: buildTopContent(topContentResult.response, topContentPageTitlesResult.response, getContentServiceURL),
    isAudiencePartialData,
    isTopContentPartialData
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/getPDFData.ts"
/*!*************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/getPDFData.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 */ getPDFData),
/* harmony export */   getAudiencePartialDataFlags: () => (/* binding */ getAudiencePartialDataFlags)
/* 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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/audienceTilesReportOptions */ "./js/modules/analytics-4/utils/audienceTilesReportOptions.ts");
/* harmony import */ var _js_modules_analytics_4_utils_page_report_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/page-report-url */ "./js/modules/analytics-4/utils/page-report-url.ts");
/* harmony import */ var _buildPDFAudienceCard__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./buildPDFAudienceCard */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/buildPDFAudienceCard.ts");
/**
 * PDF data loader for the Your visitor groups widget.
 *
 * 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
 */






/** The section needs at least two cards, so a single-card row never appears. */
const MIN_AUDIENCE_TILES = 2;
/** The row shows at most three cards, the first three configured audiences. */
const MAX_AUDIENCE_TILES = 3;
/** Each audience fetches its own cities, content, and content page titles reports. */
const REPORTS_PER_AUDIENCE = 3;
const postTypeDimension = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.CUSTOM_DIMENSION_DEFINITIONS.googlesitekit_post_type.parameterName;

/** The loaded audience cards, or `null` when the section is omitted. */

/** The context needed to fetch every audience report. */

/** Every audience report result, in one object. */

/**
 * Fetches every report the audience cards need in parallel, each with the
 * abort signal.
 *
 * It mirrors the dashboard's branching: the main per-audience report, the
 * `newVsReturning` fallback for gathering-data Site Kit audiences, and a
 * cities and content report per audience.
 *
 * @since 1.184.0
 *
 * @param input The reports context.
 * @return Every report result.
 */
async function fetchAudienceReports(input) {
  const {
    registry,
    dates,
    audienceResourceNames,
    siteKitAudiences,
    isSiteKitAudiencePartialData,
    signal
  } = input;
  const otherAudienceCount = audienceResourceNames.length - siteKitAudiences.length;
  const shouldFetchMainReport = otherAudienceCount > 0 || isSiteKitAudiencePartialData === false;
  const shouldFetchSiteKitReport = siteKitAudiences.length > 0 && isSiteKitAudiencePartialData === true;
  const {
    fetchGetReport
  } = registry.dispatch(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4);

  /**
   * Dispatches one report fetch with the export's abort signal attached.
   *
   * @since 1.184.0
   *
   * @param options The report options to fetch.
   * @return The report fetch result.
   */
  function fetchReport(options) {
    return fetchGetReport(options, {
      signal
    });
  }
  const skippedReport = {
    response: undefined,
    error: undefined
  };

  /**
   * Adds the per-audience dimension filter, like `getReportForAllAudiences`:
   * `newVsReturning` for a gathering-data Site Kit audience,
   * `audienceResourceName` for every other.
   *
   * @since 1.184.0
   *
   * @param baseOptions          The report options to add the filter to.
   * @param audienceResourceName The audience the report is scoped to.
   * @return The report options with the per-audience dimension filter.
   */
  function perAudienceReportOptions(baseOptions, audienceResourceName) {
    const partialDataSiteKitAudience = registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getPartialDataSiteKitAudience(audienceResourceName);
    const dimensionFilters = partialDataSiteKitAudience ? {
      newVsReturning: (0,_buildPDFAudienceCard__WEBPACK_IMPORTED_MODULE_4__.siteKitAudienceDimensionValue)(partialDataSiteKitAudience.audienceSlug)
    } : {
      audienceResourceName
    };
    return {
      ...baseOptions,
      dimensionFilters: {
        ...baseOptions.dimensionFilters,
        ...dimensionFilters
      }
    };
  }
  const topCitiesOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_2__.getAudienceTilesTopCitiesReportOptions)(dates);
  const topContentOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_2__.getAudienceTilesTopContentReportOptions)(dates);
  const topContentPageTitlesOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_2__.getAudienceTilesTopContentPageTitlesReportOptions)(dates);
  const [mainResult, siteKitResult, totalPageviewsResult, ...cardResults] = await Promise.all([shouldFetchMainReport ? fetchReport((0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_2__.getAudienceTilesMetricsReportOptions)(dates, audienceResourceNames)) : Promise.resolve(skippedReport), shouldFetchSiteKitReport ? fetchReport((0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_2__.getAudienceTilesSiteKitAudiencesReportOptions)(dates)) : Promise.resolve(skippedReport), fetchReport((0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_2__.getAudienceTilesTotalPageviewsReportOptions)(dates)), ...audienceResourceNames.flatMap(audienceResourceName => [fetchReport(perAudienceReportOptions(topCitiesOptions, audienceResourceName)), fetchReport(perAudienceReportOptions(topContentOptions, audienceResourceName)), fetchReport(perAudienceReportOptions(topContentPageTitlesOptions, audienceResourceName))])]);
  return {
    mainResult,
    siteKitResult,
    totalPageviewsResult,
    cardResults
  };
}

/** The two partial-data flags one audience card renders its badges from. */

/**
 * Reads one audience's partial-data flags, mirroring the dashboard tile.
 *
 * The dashboard tile's `AudienceTile/index.js` derives the two flags from the
 * property, audience, and custom dimension partial-data selectors, in the same
 * order:
 *
 * - A partial-data property, or one still loading, clears both flags.
 * - A Site Kit audience clears `isAudiencePartialData`.
 * - A set `isAudiencePartialData` clears `isTopContentPartialData`.
 *
 * @since 1.185.0
 *
 * @param registry             WordPress data registry.
 * @param propertyID           The Analytics 4 property ID, or an empty string when none is set.
 * @param audienceResourceName The audience the flags are read for.
 * @return The audience's two partial-data flags.
 */
function getAudiencePartialDataFlags(registry, propertyID, audienceResourceName) {
  const isPropertyPartialData = propertyID ? registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).isPropertyPartialData(propertyID) : undefined;

  // A property still loading its partial-data state clears both flags.
  if (isPropertyPartialData === undefined) {
    return {
      isAudiencePartialData: false,
      isTopContentPartialData: false
    };
  }
  const isSiteKitAudience = registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).isSiteKitAudience(audienceResourceName);

  // A Site Kit audience, or a partial-data property, clears the header flag.
  const isAudiencePartialData = !isSiteKitAudience && !isPropertyPartialData && !!audienceResourceName && !!registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).isAudiencePartialData(audienceResourceName);

  // A partial-data property or audience clears the top content flag.
  const isTopContentPartialData = !isPropertyPartialData && !isAudiencePartialData && !!registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).isCustomDimensionPartialData(postTypeDimension);
  return {
    isAudiencePartialData,
    isTopContentPartialData
  };
}

/**
 * Loads the audience cards for the "Your visitor groups" PDF widget.
 *
 * It takes the first three configured audiences that are still available,
 * fetches their reports in parallel, and builds a card from each. It drops any
 * audience whose reports failed, and returns `{ data: null }` when fewer than
 * two cards remain, so a single-card row never appears. It captures no charts.
 * For a view-only user, the loader builds no top content links, because the
 * dashboard tile shows each page title as plain text.
 *
 * @since 1.184.0
 *
 * @param {Object}      params          Loader parameters.
 * @param {Object}      params.registry WordPress data registry.
 * @param {Object}      params.dates    Report date range, with the current day excluded.
 * @param {AbortSignal} params.signal   Cancellation signal.
 * @param {boolean}     params.viewOnly Whether the export runs on a view-only dashboard.
 * @return {Promise<Object>} The loaded audience cards, or `{ data: null }` when the loader omits the section or the user cancels the export.
 */
async function getPDFData({
  registry,
  dates,
  signal,
  viewOnly
}) {
  if (signal.aborted) {
    return {
      data: null
    };
  }
  const configuredAudiences = await registry.resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_0__.CORE_USER).getConfiguredAudiences();
  if (signal.aborted) {
    return {
      data: null
    };
  }

  // Stop early when fewer than two audiences are configured, since the
  // section needs two cards.
  if ((configuredAudiences || []).length < MIN_AUDIENCE_TILES) {
    return {
      data: null
    };
  }
  await registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
  if (signal.aborted) {
    return {
      data: null
    };
  }
  const availableAudiences = registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences() || [];

  /**
   * Finds an available audience by its resource name.
   *
   * @since 1.184.0
   *
   * @param audienceResourceName The audience resource name to find.
   * @return The matching available audience, or `undefined` when it is absent.
   */
  function findAvailableAudience(audienceResourceName) {
    return availableAudiences.find(({
      name
    }) => name === audienceResourceName);
  }

  // Drop a configured audience that is no longer in the available audiences,
  // like the dashboard tiles do, so a deleted audience never renders a card
  // with no name and zero values. Then take the first three, so a fourth is
  // never queried.
  const audienceResourceNames = (configuredAudiences || []).filter(audienceResourceName => !!findAvailableAudience(audienceResourceName)).slice(0, MAX_AUDIENCE_TILES);
  if (audienceResourceNames.length < MIN_AUDIENCE_TILES) {
    return {
      data: null
    };
  }
  const siteKitAudiences = audienceResourceNames.map(findAvailableAudience).filter(audience => audience?.audienceType === 'SITE_KIT_AUDIENCE');

  // Resolve the Site Kit audiences' partial data state first, so the branching
  // selectors below aren't `undefined`. It needs the gathering-data state and
  // each audience's data availability date.
  if (siteKitAudiences.length > 0) {
    await Promise.all([registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).isGatheringData(), ...siteKitAudiences.map(audience => registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(audience.name, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.RESOURCE_TYPE_AUDIENCE))]);
    if (signal.aborted) {
      return {
        data: null
      };
    }
  }
  const isSiteKitAudiencePartialData = registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).hasAudiencePartialData(siteKitAudiences);

  /**
   * Resolves the property ID and the property, audience, and custom dimension
   * partial-data states, so the synchronous flag selectors below never read an
   * `undefined` value.
   *
   * @since 1.185.0
   *
   * @return {string} Property ID, or an empty string when none is set.
   */
  async function resolvePartialDataInputs() {
    await registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getSettings();
    const propertyID = registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getPropertyID();
    await Promise.all([...(propertyID ? [registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(propertyID, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.RESOURCE_TYPE_PROPERTY)] : []), ...audienceResourceNames.map(audienceResourceName => registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(audienceResourceName, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.RESOURCE_TYPE_AUDIENCE)), registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(postTypeDimension, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.RESOURCE_TYPE_CUSTOM_DIMENSION)]);
    return propertyID;
  }

  // Fetch the reports and resolve the store data the per-card partial-data
  // flags read in parallel, so the synchronous flag selectors below never read
  // an `undefined` value.
  const [propertyID, {
    mainResult,
    siteKitResult,
    totalPageviewsResult,
    cardResults
  }] = await Promise.all([resolvePartialDataInputs(), fetchAudienceReports({
    registry,
    dates,
    audienceResourceNames,
    siteKitAudiences,
    isSiteKitAudiencePartialData,
    signal
  })]);
  if (signal.aborted) {
    return {
      data: null
    };
  }
  const totalPageviews = Number(totalPageviewsResult.response?.totals?.[0]?.metricValues?.[0]?.value) || 0;

  /**
   * Maps a top content page path to its Analytics report link.
   *
   * Each page title links to the same All pages and screens report the
   * dashboard tile links to. For a view-only user, this function resolves no
   * link, so each page title renders as plain text, matching how the
   * dashboard tile shows it.
   *
   * @since 1.185.0
   *
   * @param {string} pagePath Page path of a top content row.
   * @return {string} The page's Analytics report link, or an empty string for a view-only user.
   */
  function getContentServiceURL(pagePath) {
    if (viewOnly) {
      return '';
    }
    const {
      startDate,
      endDate
    } = dates;
    return (0,_js_modules_analytics_4_utils_page_report_url__WEBPACK_IMPORTED_MODULE_3__.getAllPagesReportURL)(registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4), pagePath, {
      startDate,
      endDate
    }) ?? '';
  }
  const audiences = audienceResourceNames.map((audienceResourceName, index) => {
    const audience = findAvailableAudience(audienceResourceName);
    const usesSiteKitReport = audience?.audienceType === 'SITE_KIT_AUDIENCE' && isSiteKitAudiencePartialData === true;
    const offset = index * REPORTS_PER_AUDIENCE;
    const {
      isAudiencePartialData,
      isTopContentPartialData
    } = getAudiencePartialDataFlags(registry, propertyID, audienceResourceName);
    return (0,_buildPDFAudienceCard__WEBPACK_IMPORTED_MODULE_4__.buildPDFAudienceCard)({
      audienceResourceName,
      audience,
      usesSiteKitReport,
      metricsResult: usesSiteKitReport ? siteKitResult : mainResult,
      topCitiesResult: cardResults[offset],
      topContentResult: cardResults[offset + 1],
      topContentPageTitlesResult: cardResults[offset + 2],
      totalPageviews,
      isAudiencePartialData,
      isTopContentPartialData,
      getContentServiceURL
    });
  }).filter(audience => !!audience);

  // Omit the whole section when fewer than two cards loaded, so a single-card row
  // never appears.
  if (audiences.length < MIN_AUDIENCE_TILES) {
    return {
      data: null
    };
  }
  return {
    data: {
      audiences
    }
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension.ts"
/*!*********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension.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 */ useCreateCustomDimension)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.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 _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_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_widgets_default_areas__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/**
 * Audience Segmentation useCreateCustomDimension 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.
 */

/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */








const SHOW_ERROR_MODAL_KEY = 'audience-tiles-show-error-modal';
function useCreateCustomDimension() {
  const showErrorModal = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI).getValue(SHOW_ERROR_MODAL_KEY) || false, []);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI);
  const setShowErrorModal = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(value => setValue(SHOW_ERROR_MODAL_KEY, value), [setValue]);
  const hasAnalyticsEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.EDIT_SCOPE), []);
  const {
    setPermissionScopeError,
    clearPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER);
  const {
    clearActionError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4);
  const {
    setSetupErrorCode
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE);
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getPropertyID(), []);
  const redirectURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.addQueryArgs)(globalThis.location.href, {
    notification: 'audience_segmentation',
    widgetArea: _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_7__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION
  });
  const errorRedirectURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.addQueryArgs)(globalThis.location.href, {
    widgetArea: _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_7__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION
  });
  const [, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'autoSubmit');
  const [, setIsRetrying] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isRetrying');
  const onCreateCustomDimension = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(({
    isRetrying
  } = {}) => {
    setAutoSubmit(true);
    setIsRetrying(isRetrying);
    if (!hasAnalyticsEditScope) {
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_10__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Additional permissions are required to create new audiences in Analytics.', 'google-site-kit'),
        data: {
          status: 403,
          scopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.EDIT_SCOPE],
          skipModal: true,
          skipDefaultErrorNotifications: true,
          redirectURL,
          errorRedirectURL
        }
      });
    }
  }, [hasAnalyticsEditScope, redirectURL, errorRedirectURL, setPermissionScopeError, setAutoSubmit, setIsRetrying]);
  const onCancel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    setAutoSubmit(false);
    setIsRetrying(false);
    setSetupErrorCode(null);
    clearPermissionScopeError();
    clearActionError('createCustomDimension', [propertyID, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.CUSTOM_DIMENSION_DEFINITIONS.googlesitekit_post_type]);
    setShowErrorModal(false);
  }, [clearActionError, clearPermissionScopeError, propertyID, setSetupErrorCode, setShowErrorModal, setAutoSubmit, setIsRetrying]);
  const [isAutoCreatingCustomDimensionsForAudience] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isAutoCreatingCustomDimensionsForAudience');
  const postTypeDimension = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.CUSTOM_DIMENSION_DEFINITIONS.googlesitekit_post_type.parameterName;
  const isCreatingCustomDimension = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isCreatingCustomDimension(postTypeDimension), [postTypeDimension]);
  const isSyncingAvailableCustomDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isFetchingSyncAvailableCustomDimensions(), []);
  const isSaving = isAutoCreatingCustomDimensionsForAudience || isCreatingCustomDimension || isSyncingAvailableCustomDimensions;
  return {
    onCreateCustomDimension,
    onCancel,
    isSaving,
    showErrorModal,
    setShowErrorModal
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/CustomDimensionErrorModal.tsx"
/*!*********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/CustomDimensionErrorModal.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 _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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_hooks_useCreateCustomDimension__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension.ts");
/* 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.ts");
/* harmony import */ var _AudienceErrorModal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AudienceErrorModal */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceErrorModal.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Audience Segmentation CustomDimensionErrorModal 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
 */







const CustomDimensionErrorModal = () => {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const postTypeDimension = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CUSTOM_DIMENSION_DEFINITIONS.googlesitekit_post_type.parameterName;
  const customDimensionError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getCreateCustomDimensionError(postTypeDimension), []);
  const [autoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'autoSubmit');
  const setupErrorCode = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getSetupErrorCode(), []);
  const hasOAuthError = !!(autoSubmit && setupErrorCode === 'access_denied');
  const {
    onCreateCustomDimension,
    onCancel,
    isSaving
  } = (0,_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_hooks_useCreateCustomDimension__WEBPACK_IMPORTED_MODULE_5__["default"])();
  return /*#__PURE__*/React.createElement(_AudienceErrorModal__WEBPACK_IMPORTED_MODULE_7__["default"], {
    apiErrors: [customDimensionError],
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Failed to enable metric', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Oops! Something went wrong. Retry enabling the metric.', 'google-site-kit'),
    onRetry: () => onCreateCustomDimension({
      isRetrying: true
    }),
    onCancel: onCancel,
    inProgress: isSaving,
    hasOAuthError: hasOAuthError,
    trackEventCategory: `${viewContext}_audiences-top-content-cta`
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CustomDimensionErrorModal);

/***/ },

/***/ "./js/modules/analytics-4/components/common/AccountCreate/AccountCreateIntro.tsx"
/*!***************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/AccountCreateIntro.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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 _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.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_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _AnalyticsAccountCreationErrorNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AnalyticsAccountCreationErrorNotice */ "./js/modules/analytics-4/components/common/AccountCreate/AnalyticsAccountCreationErrorNotice.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * AccountCreateIntro 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
 */






const AccountCreateIntro = ({
  isInitialSetupFlow,
  accountCreationErrorCode,
  onRetry
}) => {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefresh');
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const isSettingsContext = viewContext === _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_4__.VIEW_CONTEXT_SETTINGS;
  const errorNotice = setupFlowRefreshEnabled && !!accountCreationErrorCode ? /*#__PURE__*/React.createElement(_AnalyticsAccountCreationErrorNotice__WEBPACK_IMPORTED_MODULE_7__["default"], {
    errorCode: accountCreationErrorCode,
    onRetry: onRetry
  }) : null;
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !isSettingsContext && errorNotice, !isInitialSetupFlow &&
  /*#__PURE__*/
  /* @ts-expect-error - The `Typography` component does not yet expose `className` as optional. */
  React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    as: "h3",
    type: "title",
    size: "large"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Create your Analytics account', 'google-site-kit')), isSettingsContext && errorNotice, /*#__PURE__*/React.createElement(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
    size: isInitialSetupFlow ? 'large' : undefined
  }, (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')));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AccountCreateIntro);

/***/ },

/***/ "./js/modules/analytics-4/components/common/AccountCreate/Actions.tsx"
/*!****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/Actions.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 _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__);
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * AccountCreate Actions 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
 */


// The `Button` component from `googlesitekit-components` is not fully typed yet.
// Cast to an `FC` with the props we use here so this file can be type-checked.
const Button = googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button;
const Actions = ({
  canSubmitAccountCreate,
  onCreateAccount,
  accounts,
  onBack,
  hasAccountCreationError,
  isInitialSetupFlow,
  onContinueWithoutAnalytics
}) => {
  return /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-setup-module__action"
  }, /*#__PURE__*/React.createElement(Button, {
    disabled: !canSubmitAccountCreate,
    onClick: onCreateAccount
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Create Account', 'google-site-kit')), accounts && !!accounts.length && /*#__PURE__*/React.createElement(Button, {
    className: "googlesitekit-setup-module__sub-action",
    onClick: onBack,
    tertiary: true
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Back', 'google-site-kit')), hasAccountCreationError && isInitialSetupFlow && /*#__PURE__*/React.createElement(Button, {
    className: "googlesitekit-setup-module__sub-action",
    onClick: onContinueWithoutAnalytics,
    tertiary: true
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Continue without Analytics', 'google-site-kit')));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Actions);

/***/ },

/***/ "./js/modules/analytics-4/components/common/AccountCreate/AnalyticsAccountCreationErrorNotice.tsx"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/AccountCreate/AnalyticsAccountCreationErrorNotice.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.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");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * AnalyticsAccountCreationErrorNotice 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
 */








const AnalyticsAccountCreationErrorNotice = ({
  errorCode,
  onRetry
}) => {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const [showProgress] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_8__["default"])('showProgress');
  const isInitialSetupFlow = !!showProgress;
  const eventCategory = isInitialSetupFlow ? `${viewContext}_setup` : viewContext;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(eventCategory, 'analytics_account_creation_error', errorCode);
  }, [errorCode, eventCategory]);
  const additionalAnalyticsSupportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getDocumentationLinkURL('analytics-additional-support'), []);
  const title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Analytics account creation failed', 'google-site-kit');
  let description;
  let ctaButton;
  if (errorCode === 'user_cancel') {
    description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Creating a new Analytics account failed because the Terms of Service were not accepted. Go to Analytics to accept the Terms of Service.', 'google-site-kit');
    ctaButton = {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Go to Analytics', 'google-site-kit'),
      onClick: onRetry
    };
  } else {
    description = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Something went wrong. Try again or <a>get help</a>', 'google-site-kit'), {
      a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: additionalAnalyticsSupportURL,
        external: true
      })
    });
    ctaButton = {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Retry', 'google-site-kit'),
      onClick: onRetry
    };
  }
  return /*#__PURE__*/React.createElement(_js_components_Notice__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.NOTICE_TYPES.ERROR,
    title: title,
    description: description,
    ctaButton: ctaButton
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (AnalyticsAccountCreationErrorNotice);

/***/ },

/***/ "./js/modules/analytics-4/components/common/MeasurementSettingRow.tsx"
/*!****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/common/MeasurementSettingRow.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 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_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");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * MeasurementSettingRow 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
 */



const MeasurementSettingRow = ({
  isEnabled = false,
  loading = false,
  title,
  description,
  action = null
}) => {
  if (loading) {
    return /*#__PURE__*/React.createElement("div", {
      className: "googlesitekit-settings-measurement-row googlesitekit-settings-measurement-row--loading"
    }, /*#__PURE__*/React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.ProgressBar, {
      small: true,
      compress: true
    }));
  }
  return /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-settings-measurement-row"
  }, /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-settings-measurement-row__icon', {
      'googlesitekit-settings-measurement-row__icon--check': isEnabled
    })
  }, isEnabled ? /*#__PURE__*/React.createElement(_svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_2__["default"], null) : /*#__PURE__*/React.createElement(_svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_3__["default"], null)), /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-settings-measurement-row__content"
  }, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-settings-measurement-row__details"
  }, /*#__PURE__*/React.createElement("p", {
    className: "googlesitekit-settings-measurement-row__title"
  }, title), /*#__PURE__*/React.createElement("p", {
    className: "googlesitekit-module-settings-group__helper-text"
  }, description)), !isEnabled && action && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-settings-measurement-row__action"
  }, action)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (MeasurementSettingRow);

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/getPDFData.ts"
/*!************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/getPDFData.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 */ getPDFData)
/* 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_components_pdf_export_ensure_google_charts_loaded__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/ensure-google-charts-loaded */ "./js/components/pdf-export/ensure-google-charts-loaded.ts");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* harmony import */ var _js_components_pdf_export_render_google_chart_to_data_uri__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/render-google-chart-to-data-uri */ "./js/components/pdf-export/render-google-chart-to-data-uri.ts");
/* 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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_chart__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/chart */ "./js/modules/analytics-4/utils/chart.js");
/* harmony import */ var _js_modules_analytics_4_utils_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/parseDimensionStringToDate */ "./js/modules/analytics-4/utils/parseDimensionStringToDate.js");
/* harmony import */ var _reportOptions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./reportOptions */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/reportOptions.ts");
/**
 * DashboardAllTrafficWidgetGA4 PDF data loader.
 *
 * 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
 */









/**
 * The chart draws at 506 by 133, and the tile displays the image in a
 * box of the same size, so the image never stretches and no empty
 * space appears around it.
 */
const LINE_CHART_WIDTH = 506;
const LINE_CHART_HEIGHT = 133;

/**
 * The size of the hole in the middle of each breakdown donut, from 0 to 1.
 */
const BREAKDOWN_PIE_HOLE = 0.542;

/**
 * The width and height of each breakdown donut, in PDF points.
 */
const BREAKDOWN_CHART_SIZE = 72.85;

/**
 * How many times bigger than its display size each donut renders, so its curved
 * edges stay sharp in the PDF.
 */
const BREAKDOWN_CHART_SCALE_FACTOR = 4;

/**
 * How many top slices to keep for each breakdown. The rest combine into one
 * "Others" slice, the same as the dashboard's All Traffic pie.
 */
const BREAKDOWN_MAX_SLICES = 5;

/**
 * The three GA4 breakdowns shown below the line chart, in the order they
 * render. Each pairs a dashboard dimension with its own report ID, so the three
 * reports load and cache on their own.
 */
const BREAKDOWNS = [{
  dimensionName: 'sessionDefaultChannelGrouping',
  reportID: _reportOptions__WEBPACK_IMPORTED_MODULE_8__.CHANNELS_BREAKDOWN_REPORT_ID
}, {
  dimensionName: 'country',
  reportID: _reportOptions__WEBPACK_IMPORTED_MODULE_8__.LOCATIONS_BREAKDOWN_REPORT_ID
}, {
  dimensionName: 'deviceCategory',
  reportID: _reportOptions__WEBPACK_IMPORTED_MODULE_8__.DEVICES_BREAKDOWN_REPORT_ID
}];

/**
 * One legend row for a breakdown donut: a segment label and its share of the
 * total, as a fraction between 0 and 1.
 */

/**
 * Reduces the date-dimension graph report into parsed chart points.
 *
 * Rows whose date fails to parse are dropped, matching the dashboard's
 * tolerance for malformed dimension values.
 *
 * @since 1.182.0
 *
 * @param graphReport Date-dimension GA4 report.
 * @return Points of `{ date, value }`, ordered as returned.
 */
function getLineChartPoints(graphReport) {
  return (graphReport?.rows || []).reduce((points, row) => {
    const dateString = row.dimensionValues?.[0]?.value;
    const date = dateString ? (0,_js_modules_analytics_4_utils_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_7__["default"])(dateString) : false;
    if (date instanceof Date) {
      points.push({
        date,
        value: Number(row.metricValues?.[0]?.value) || 0
      });
    }
    return points;
  }, []);
}

/**
 * Builds the Google Charts `DataTable` for the All Visitors line chart.
 *
 * Mirrors the dashboard's `UserCountGraph` shape: a date column followed by a
 * total-users column.
 *
 * @since 1.182.0
 *
 * @param points Parsed chart points.
 * @return A `google.visualization.DataTable` instance.
 */
function buildLineChartDataTable(points) {
  const visualization = (0,_js_components_pdf_export_render_google_chart_to_data_uri__WEBPACK_IMPORTED_MODULE_3__.getVisualization)();
  if (!visualization?.DataTable) {
    throw new Error('Site Kit: Google Charts DataTable is unavailable after loading the library.');
  }
  const dataTable = new visualization.DataTable();
  dataTable.addColumn('date', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Day', 'google-site-kit'));
  dataTable.addColumn('number', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Users', 'google-site-kit'));
  dataTable.addRows(points.map(({
    date,
    value
  }) => [date, value]));
  return dataTable;
}

/**
 * Builds Google Charts options matching the dashboard's All Visitors line chart.
 *
 * @since 1.182.0
 *
 * @param points Parsed chart points.
 * @return Google Charts options object.
 */
function getLineChartOptions(points) {
  // A tick per day, dropping the first so a tick sits at the range start,
  // matching the dashboard's `UserCountGraph`.
  const [, ...ticks] = points.map(({
    date
  }) => date);
  const hasData = points.some(({
    value
  }) => value > 0);
  return {
    curveType: 'function',
    // Matches the dashboard's All Visitors line color.
    colors: [_js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SITE_KIT_SK_500],
    chartArea: {
      left: 8,
      right: 40,
      top: 16,
      bottom: 28
    },
    legend: {
      position: 'none'
    },
    hAxis: {
      format: 'MMM d',
      gridlines: {
        color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE
      },
      textPosition: 'out',
      textStyle: {
        color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT,
        fontName: 'Google Sans Text',
        fontSize: 14
      },
      ticks
    },
    vAxis: {
      gridlines: {
        color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE_1
      },
      lineWidth: 3,
      minorGridlines: {
        color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE
      },
      minValue: 0,
      textPosition: 'out',
      textStyle: {
        color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_ON_SURFACE_VARIANT,
        fontName: 'Google Sans Text',
        fontSize: 14
      },
      viewWindow: {
        min: 0,
        // Cap the empty-data axis so a flat zero line still reads well.
        ...(hasData ? {} : {
          max: 100
        })
      }
    },
    series: {
      0: {
        color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SITE_KIT_SK_500,
        lineWidth: 4,
        targetAxisIndex: 1
      }
    },
    focusTarget: 'category'
  };
}

/**
 * Builds the Google Charts `DataTable` for one breakdown donut.
 *
 * One row per legend entry, with the segment label and its share of the total.
 * The shares are proportions, so the donut draws the same slices whether the
 * values are fractions or whole counts.
 *
 * @since 1.183.0
 *
 * @param rows Legend rows of `{ label, percentage }`.
 * @return A `google.visualization.DataTable` instance.
 */
function buildBreakdownChartDataTable(rows) {
  const visualization = (0,_js_components_pdf_export_render_google_chart_to_data_uri__WEBPACK_IMPORTED_MODULE_3__.getVisualization)();
  if (!visualization?.DataTable) {
    throw new Error('Site Kit: Google Charts DataTable is unavailable after loading the library.');
  }
  const dataTable = new visualization.DataTable();
  dataTable.addColumn('string', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Source', 'google-site-kit'));
  dataTable.addColumn('number', (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Percent', 'google-site-kit'));
  dataTable.addRows(rows.map(({
    label,
    percentage
  }) => [label, percentage]));
  return dataTable;
}

/**
 * Builds Google Charts options for a breakdown donut.
 *
 * Uses the same hole size and colors as the dashboard's All Traffic donut, with
 * the slice labels, legend, and clicks removed, so the rendered image is a
 * clean donut.
 *
 * @since 1.183.0
 *
 * @return Google Charts options object.
 */
function getBreakdownChartOptions() {
  return {
    pieHole: BREAKDOWN_PIE_HOLE,
    colors: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PIE_CHART_COLORS,
    // Google Charts draws a white border between slices by default. A
    // transparent border makes the segments touch.
    pieSliceBorderColor: 'transparent',
    // JPEG output has no transparency, so a transparent background turns
    // black. Fill it white to match the card behind the donut.
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLORS.SURFACES_SURFACE,
    chartArea: {
      left: 0,
      top: 0,
      width: '100%',
      height: '100%'
    },
    legend: {
      position: 'none'
    },
    pieSliceText: 'none',
    enableInteractivity: false
  };
}

/**
 * Builds the legend rows and the donut image for one breakdown.
 *
 * Uses the dashboard's helper, so the slices and their order match the
 * dashboard: the top slices plus an "Others" slice. Returns `{ rows: null }`
 * on a missing report, empty data, or a failed or canceled render, so the
 * widget skips that tile while the other tiles render.
 *
 * @since 1.183.0
 *
 * @param report The breakdown report, or `null` when its fetch failed.
 * @param signal Cancellation signal forwarded to the renderer.
 * @return The breakdown's legend rows and donut image.
 */
async function loadBreakdownChart(report, signal) {
  if (!report) {
    return {
      rows: null
    };
  }
  try {
    const dataMap = (0,_js_modules_analytics_4_utils_chart__WEBPACK_IMPORTED_MODULE_6__.extractAnalyticsDataForPieChart)(report, {
      keyColumnIndex: 0,
      maxSlices: BREAKDOWN_MAX_SLICES,
      withOthers: true
    });

    // The first row is the header. The rest are `[ label, percentage ]`.
    const rows = dataMap.slice(1).map(row => ({
      label: row[0],
      percentage: row[1]
    }));
    if (rows.length === 0) {
      return {
        rows: null
      };
    }
    const chartImage = await (0,_js_components_pdf_export_render_google_chart_to_data_uri__WEBPACK_IMPORTED_MODULE_3__["default"])({
      chartType: 'PieChart',
      dataTable: buildBreakdownChartDataTable(rows),
      options: getBreakdownChartOptions(),
      width: BREAKDOWN_CHART_SIZE,
      height: BREAKDOWN_CHART_SIZE,
      scaleFactor: BREAKDOWN_CHART_SCALE_FACTOR,
      signal
    });
    return {
      rows,
      chartImage
    };
  } catch {
    return {
      rows: null
    };
  }
}

/**
 * Loads the GA4 reports and chart images for the All Visitors PDF widget.
 *
 * Fetches the totals, graph, and three breakdown reports (channels, locations,
 * and devices) at the same time, and stops early when the signal is aborted.
 * Then it draws the line chart and the three donuts as JPEG data URIs for the
 * PDF. If one breakdown's report or render fails, the widget skips that tile
 * and the other tiles still render.
 *
 * @since 1.181.0
 * @since 1.183.0 Also loads the channel, location, and device breakdown donuts.
 *
 * @param params          Loader parameters.
 * @param params.registry WordPress data registry.
 * @param params.dates    Report date range.
 * @param params.signal   Cancellation signal.
 * @return Resolved report data and chart images.
 */
async function getPDFData({
  registry,
  dates,
  signal
}) {
  if (signal.aborted) {
    return {
      data: null
    };
  }
  const {
    startDate,
    endDate,
    compareStartDate,
    compareEndDate
  } = dates;
  const url = registry.select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getCurrentEntityURL() || undefined;
  const totalsArgs = (0,_reportOptions__WEBPACK_IMPORTED_MODULE_8__.getTotalsReportArgs)({
    startDate,
    endDate,
    compareStartDate,
    compareEndDate,
    url
  });
  const graphArgs = (0,_reportOptions__WEBPACK_IMPORTED_MODULE_8__.getGraphReportArgs)({
    startDate,
    endDate,
    url
  });
  const breakdownArgsList = BREAKDOWNS.map(({
    dimensionName,
    reportID
  }) => (0,_reportOptions__WEBPACK_IMPORTED_MODULE_8__.getBreakdownReportArgs)({
    dimensionName,
    reportID,
    startDate,
    endDate,
    compareStartDate,
    compareEndDate,
    url
  }));

  // The registry remembers each `getReport` call by its arguments, and
  // every abort signal looks the same to it. After a canceled or failed
  // run, the registry would treat the calls below as already done and
  // return `undefined` reports without fetching. Invalidate the earlier
  // calls, so this run fetches the reports again. A report that already
  // loaded stays in state, so a successful earlier run adds no extra
  // request.
  const {
    invalidateResolution
  } = registry.dispatch(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4);
  invalidateResolution('getReport', [totalsArgs, {
    signal
  }]);
  invalidateResolution('getReport', [graphArgs, {
    signal
  }]);
  breakdownArgsList.forEach(args => invalidateResolution('getReport', [args, {
    signal
  }]));
  const [totalsReport, graphReport, ...breakdownReports] = await Promise.all([registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getReport(totalsArgs, {
    signal
  }), registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getReport(graphArgs, {
    signal
  }),
  // A breakdown report that fails is caught here, so the rest of
  // the widget still renders and nothing renders for that tile.
  ...breakdownArgsList.map(args => registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getReport(args, {
    signal
  }).catch(() => null))]);
  if (signal.aborted) {
    return {
      data: null
    };
  }
  await (0,_js_components_pdf_export_ensure_google_charts_loaded__WEBPACK_IMPORTED_MODULE_1__["default"])();

  // Canceling during loading stops here, before any chart is drawn.
  if (signal.aborted) {
    return {
      data: null
    };
  }
  const points = getLineChartPoints(graphReport);
  const lineChart = await (0,_js_components_pdf_export_render_google_chart_to_data_uri__WEBPACK_IMPORTED_MODULE_3__["default"])({
    chartType: 'LineChart',
    dataTable: buildLineChartDataTable(points),
    options: getLineChartOptions(points),
    width: LINE_CHART_WIDTH,
    height: LINE_CHART_HEIGHT,
    signal
  });
  const [channel, location, device] = await Promise.all(breakdownReports.map(report => loadBreakdownChart(report, signal)));
  if (signal.aborted) {
    return {
      data: null
    };
  }
  return {
    data: {
      totalsReport,
      graphReport,
      channelBreakdown: channel.rows,
      locationBreakdown: location.rows,
      deviceBreakdown: device.rows
    },
    chartImages: {
      lineChart,
      channelChart: channel.chartImage,
      locationChart: location.chartImage,
      deviceChart: device.chartImage
    }
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/reportOptions.ts"
/*!***************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/reportOptions.ts ***!
  \***************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CHANNELS_BREAKDOWN_REPORT_ID: () => (/* binding */ CHANNELS_BREAKDOWN_REPORT_ID),
/* harmony export */   DEVICES_BREAKDOWN_REPORT_ID: () => (/* binding */ DEVICES_BREAKDOWN_REPORT_ID),
/* harmony export */   GRAPH_REPORT_ID: () => (/* binding */ GRAPH_REPORT_ID),
/* harmony export */   LOCATIONS_BREAKDOWN_REPORT_ID: () => (/* binding */ LOCATIONS_BREAKDOWN_REPORT_ID),
/* harmony export */   TOTALS_REPORT_ID: () => (/* binding */ TOTALS_REPORT_ID),
/* harmony export */   getBreakdownReportArgs: () => (/* binding */ getBreakdownReportArgs),
/* harmony export */   getGraphReportArgs: () => (/* binding */ getGraphReportArgs),
/* harmony export */   getGraphReportOptions: () => (/* binding */ getGraphReportOptions),
/* harmony export */   getTotalsReportArgs: () => (/* binding */ getTotalsReportArgs),
/* harmony export */   getTotalsReportOptions: () => (/* binding */ getTotalsReportOptions)
/* harmony export */ });
/**
 * DashboardAllTrafficWidgetGA4 report options.
 *
 * 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
 */

const TOTALS_REPORT_ID = 'analytics-4_dashboard-all-traffic-widget-ga4_widget_totalsArgs';
const GRAPH_REPORT_ID = 'analytics-4_dashboard-all-traffic-widget-ga4_widget_graphArgs';
const CHANNELS_BREAKDOWN_REPORT_ID = 'analytics-4_dashboard-all-traffic-widget-ga4_widget_channelsBreakdownArgs';
const LOCATIONS_BREAKDOWN_REPORT_ID = 'analytics-4_dashboard-all-traffic-widget-ga4_widget_locationsBreakdownArgs';
const DEVICES_BREAKDOWN_REPORT_ID = 'analytics-4_dashboard-all-traffic-widget-ga4_widget_devicesBreakdownArgs';
const TOTAL_USERS_METRIC = [{
  name: 'totalUsers'
}];

/**
 * Builds the report-options fragment for the All Visitors totals report.
 *
 * Returns only the parts that vary between dashboard and PDF surfaces. The
 * dashboard combines this with start/end dates and entity URL via
 * `useAllTrafficWidgetReport`; the PDF loader combines it inside
 * `getTotalsReportArgs` below.
 *
 * @since 1.181.0
 *
 * @param {Object} [options]                  Options.
 * @param {string} [options.compareStartDate] Comparison start date.
 * @param {string} [options.compareEndDate]   Comparison end date.
 * @param {Object} [options.dimensionFilters] Dimension filters keyed by dimension name.
 * @return {Object} Report-options fragment.
 */
function getTotalsReportOptions({
  compareStartDate,
  compareEndDate,
  dimensionFilters
} = {}) {
  const args = {
    reportID: TOTALS_REPORT_ID
  };
  if (compareStartDate) {
    args.compareStartDate = compareStartDate;
  }
  if (compareEndDate) {
    args.compareEndDate = compareEndDate;
  }
  if (dimensionFilters) {
    args.dimensionFilters = dimensionFilters;
  }
  return args;
}

/**
 * Builds the report-options fragment for the All Visitors date-dimension graph report.
 *
 * @since 1.181.0
 *
 * @param {Object} [options]                  Options.
 * @param {Object} [options.dimensionFilters] Dimension filters keyed by dimension name.
 * @return {Object} Report-options fragment.
 */
function getGraphReportOptions({
  dimensionFilters
} = {}) {
  const args = {
    dimensions: ['date'],
    orderby: [{
      dimension: {
        dimensionName: 'date'
      }
    }],
    reportID: GRAPH_REPORT_ID
  };
  if (dimensionFilters) {
    args.dimensionFilters = dimensionFilters;
  }
  return args;
}

/**
 * Builds the complete GA4 `getReport` args for the All Visitors totals report.
 *
 * Used by the PDF loader, which has the full date range, entity URL, and
 * dimension filters available up-front.
 *
 * @since 1.181.0
 *
 * @param {Object} options                    Options.
 * @param {string} options.startDate          Report start date.
 * @param {string} options.endDate            Report end date.
 * @param {string} options.compareStartDate   Comparison start date.
 * @param {string} options.compareEndDate     Comparison end date.
 * @param {string} [options.url]              Entity URL filter, if any.
 * @param {Object} [options.dimensionFilters] Dimension filters keyed by dimension name.
 * @return {Object} GA4 getReport args.
 */
function getTotalsReportArgs({
  startDate,
  endDate,
  compareStartDate,
  compareEndDate,
  url,
  dimensionFilters
}) {
  const args = {
    startDate,
    endDate,
    metrics: TOTAL_USERS_METRIC,
    ...getTotalsReportOptions({
      compareStartDate,
      compareEndDate,
      dimensionFilters
    })
  };
  if (url) {
    args.url = url;
  }
  return args;
}

/**
 * Builds the complete GA4 `getReport` args for the All Visitors date-dimension graph report.
 *
 * @since 1.181.0
 *
 * @param {Object} options                    Options.
 * @param {string} options.startDate          Report start date.
 * @param {string} options.endDate            Report end date.
 * @param {string} [options.url]              Entity URL filter, if any.
 * @param {Object} [options.dimensionFilters] Dimension filters keyed by dimension name.
 * @return {Object} GA4 getReport args.
 */
function getGraphReportArgs({
  startDate,
  endDate,
  url,
  dimensionFilters
}) {
  const args = {
    startDate,
    endDate,
    metrics: TOTAL_USERS_METRIC,
    ...getGraphReportOptions({
      dimensionFilters
    })
  };
  if (url) {
    args.url = url;
  }
  return args;
}

/**
 * Builds the complete GA4 `getReport` args for one All Visitors breakdown pie.
 *
 * Uses the same query as the dashboard's pie chart in `index.js`: one breakdown
 * dimension, sorted by total users from high to low, over the same date range
 * and comparison range as the metric tile and line chart. The comparison range
 * stays in the args, so the rows come back split by date range. The dashboard's
 * `extractAnalyticsDataForPieChart` helper reads that split when it builds the
 * slices. The PDF loader calls this once for each dimension (channels,
 * locations, devices).
 *
 * @since 1.183.0
 *
 * @param {Object} options                    Options.
 * @param {string} options.dimensionName      GA4 dimension to break down by.
 * @param {string} options.reportID           Report ID for this breakdown.
 * @param {string} options.startDate          Report start date.
 * @param {string} options.endDate            Report end date.
 * @param {string} [options.compareStartDate] Comparison start date.
 * @param {string} [options.compareEndDate]   Comparison end date.
 * @param {string} [options.url]              Entity URL filter, if any.
 * @return {Object} GA4 getReport args.
 */
function getBreakdownReportArgs({
  dimensionName,
  reportID,
  startDate,
  endDate,
  compareStartDate,
  compareEndDate,
  url
}) {
  const args = {
    startDate,
    endDate,
    metrics: TOTAL_USERS_METRIC,
    dimensions: [dimensionName],
    orderby: [{
      metric: {
        metricName: 'totalUsers'
      },
      desc: true
    }],
    reportID
  };
  if (compareStartDate) {
    args.compareStartDate = compareStartDate;
  }
  if (compareEndDate) {
    args.compareEndDate = compareEndDate;
  }
  if (url) {
    args.url = url;
  }
  return args;
}

/***/ },

/***/ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/getPDFData.ts"
/*!********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/getPDFData.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 */ getPDFData)
/* harmony export */ });
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_0__ = __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_1__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_page_report_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/page-report-url */ "./js/modules/analytics-4/utils/page-report-url.ts");
/* harmony import */ var _js_modules_analytics_4_utils_page_titles_report__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/page-titles-report */ "./js/modules/analytics-4/utils/page-titles-report.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _reportOptions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./reportOptions */ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/reportOptions.ts");
/**
 * ModulePopularPagesWidgetGA4 PDF data loader.
 *
 * 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
 */







/**
 * Links for one page row: the link the page title points to, and the page's own
 * public URL for the URL line.
 */

/**
 * Data the Top content over time PDF widget renders.
 */

/**
 * Maps each page path to its title link and public URL.
 *
 * The title links to the same All pages and screens report the dashboard widget
 * links to for an administrator, and to the page's entity dashboard for a
 * view-only user, the same `serviceURL || detailsURL` fallback the dashboard
 * widget's `DetailsPermaLinks` renders. The URL line links to the page itself
 * for every user.
 *
 * @since 1.182.0
 * @since n.e.x.t Links the title to the Analytics report for an administrator and to the entity dashboard for a view-only user.
 *
 * @param {Object}   params           Link map parameters.
 * @param {Object}   params.registry  WordPress data registry.
 * @param {Object}   params.dates     Report date range.
 * @param {string[]} params.pagePaths Page paths from the main report rows.
 * @param {boolean}  params.viewOnly  Whether the export runs on a view-only dashboard.
 * @return {Object} Map of page path to its title link and public URL.
 */
function getPopularPageLinkMap({
  registry,
  dates,
  pagePaths,
  viewOnly
}) {
  const coreSite = registry.select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_0__.CORE_SITE);
  const siteURL = coreSite.getReferenceSiteURL();
  const analytics = registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4);
  const {
    startDate,
    endDate
  } = dates;
  const links = {};
  pagePaths.forEach(pagePath => {
    const permaLink = (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.getFullURL)(siteURL, pagePath);

    // An administrator's title links to the Analytics report. A view-only
    // user has no service link, so the title falls back to the page's entity
    // dashboard, the same `serviceURL || detailsURL` fallback the dashboard
    // widget renders for that user.
    const serviceURL = viewOnly ? null : (0,_js_modules_analytics_4_utils_page_report_url__WEBPACK_IMPORTED_MODULE_2__.getAllPagesReportURL)(analytics, pagePath, {
      startDate,
      endDate
    });
    const detailsURL = coreSite.getAdminURL('googlesitekit-dashboard', {
      permaLink
    });
    links[pagePath] = {
      titleURL: serviceURL || detailsURL || '',
      permaLink
    };
  });
  return links;
}

/**
 * Loads the report rows and page titles for the Top content over time PDF widget.
 *
 * Loads the Most popular pages report, then a second report that matches each
 * page path to its title. Passes the abort signal to both requests. Returns
 * `{ data: null }` when the signal aborts or the report has no rows, so the
 * report document skips this widget.
 *
 * @since 1.182.0
 * @since 1.183.0 Returns null data when the report has no rows.
 * @since n.e.x.t Links each title to the Analytics report for an administrator and to the entity dashboard for a view-only user.
 *
 * @param {Object}      params          Loader parameters.
 * @param {Object}      params.registry WordPress data registry.
 * @param {Object}      params.dates    Report date range.
 * @param {AbortSignal} params.signal   Cancellation signal.
 * @param {boolean}     params.viewOnly Whether the export runs on a view-only dashboard.
 * @return {Promise<Object>} The report rows and the page-path-to-title map.
 */
async function getPDFData({
  registry,
  dates,
  signal,
  viewOnly
}) {
  if (signal.aborted) {
    return {
      data: null
    };
  }
  const args = (0,_reportOptions__WEBPACK_IMPORTED_MODULE_5__.getPopularPagesReportArgs)(dates);

  // The store caches `getReport` by its arguments, so after a cancelled or
  // failed run the next call returns `undefined` without fetching. Invalidate
  // the resolution first to force a fresh fetch.
  const {
    invalidateResolution
  } = registry.dispatch(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4);
  invalidateResolution('getReport', [args, {
    signal
  }]);
  const report = await registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getReport(args, {
    signal
  });
  if (signal.aborted) {
    return {
      data: null
    };
  }
  const rows = report?.rows ?? [];

  // With no rows the widget has nothing to render. `data: null` lets the
  // report document skip the widget, so the PDF holds no empty section.
  if (rows.length === 0) {
    return {
      data: null
    };
  }
  const pagePaths = (0,_js_modules_analytics_4_utils_page_titles_report__WEBPACK_IMPORTED_MODULE_3__.getPagePaths)(report);
  const links = getPopularPageLinkMap({
    registry,
    dates,
    pagePaths,
    viewOnly
  });
  if (pagePaths.length === 0) {
    return {
      data: {
        rows,
        titles: {},
        links
      }
    };
  }
  const titlesArgs = (0,_js_modules_analytics_4_utils_page_titles_report__WEBPACK_IMPORTED_MODULE_3__.getPageTitlesReportOptions)(dates, pagePaths);
  invalidateResolution('getReport', [titlesArgs, {
    signal
  }]);
  const titlesReport = await registry.resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).getReport(titlesArgs, {
    signal
  });
  if (signal.aborted) {
    return {
      data: null
    };
  }
  return {
    data: {
      rows,
      titles: (0,_js_modules_analytics_4_utils_page_titles_report__WEBPACK_IMPORTED_MODULE_3__.getPageTitleMap)(pagePaths, titlesReport),
      links
    }
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/reportOptions.ts"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/reportOptions.ts ***!
  \***********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   POPULAR_PAGES_REPORT_ID: () => (/* binding */ POPULAR_PAGES_REPORT_ID),
/* harmony export */   getPopularPagesReportArgs: () => (/* binding */ getPopularPagesReportArgs),
/* harmony export */   getPopularPagesReportOptions: () => (/* binding */ getPopularPagesReportOptions)
/* harmony export */ });
/**
 * ModulePopularPagesWidgetGA4 report options.
 *
 * 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
 */

/**
 * Report ID the dashboard widget and its PDF export share, so both read one
 * cached Most popular pages report.
 */
const POPULAR_PAGES_REPORT_ID = 'analytics-4_module-popular-pages-widget-ga4_widget_args';

/**
 * Builds the report options the dashboard widget and its PDF export share.
 *
 * Returns the page-path dimension, the four metrics, the pageviews-descending
 * order, the ten-row limit, and the report ID. The caller adds the date range.
 * One builder keeps the two widgets from requesting different reports.
 *
 * @since 1.182.0
 *
 * @return The report options, without the date range.
 */
function getPopularPagesReportOptions() {
  return {
    dimensions: ['pagePath'],
    metrics: [{
      name: 'screenPageViews'
    }, {
      name: 'sessions'
    }, {
      name: 'engagementRate'
    }, {
      name: 'averageSessionDuration'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 10,
    reportID: POPULAR_PAGES_REPORT_ID
  };
}

/**
 * Builds the full GA4 `getReport` args for the Most popular pages report.
 *
 * Adds the date range to the shared options, so the PDF loader requests the
 * same report the dashboard widget uses.
 *
 * @since 1.182.0
 *
 * @param dates           Report date range.
 * @param dates.startDate Report start date (YYYY-MM-DD).
 * @param dates.endDate   Report end date (YYYY-MM-DD).
 * @return GA4 getReport args.
 */
function getPopularPagesReportArgs({
  startDate,
  endDate
}) {
  return {
    startDate,
    endDate,
    ...getPopularPagesReportOptions()
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/settings/SettingsAdvancedDataBreakdowns.tsx"
/*!***************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/SettingsAdvancedDataBreakdowns.tsx ***!
  \***************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ADVANCED_DATA_BREAKDOWNS_FORM: () => (/* binding */ ADVANCED_DATA_BREAKDOWNS_FORM),
/* 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_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_common_MeasurementSettingRow__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common/MeasurementSettingRow */ "./js/modules/analytics-4/components/common/MeasurementSettingRow.tsx");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * SettingsAdvancedDataBreakdowns 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
 */












const ADVANCED_DATA_BREAKDOWNS_FORM = 'advancedDataBreakdownsForm';
const SettingsAdvancedDataBreakdowns = ({
  hasModuleAccess = true
}) => {
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getPropertyID(), []);
  const isAdvancedDataBreakdownsEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isAdvancedDataBreakdownsEnabled(propertyID), [propertyID]);

  /**
   * Until the per-property map loads, the row stays in its loading state, so
   * the Enable button can't save a partly loaded map and drop the other
   * properties.
   */
  const isSettingsLoaded = isAdvancedDataBreakdownsEnabled !== undefined;
  const hasAllCustomDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    // "Set up a new property" has no custom dimensions yet.
    if (propertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.PROPERTY_CREATE) {
      return false;
    }

    // The selected property isn't known yet, for example right after an
    // account change, before a property is matched.
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertyID)(propertyID)) {
      return undefined;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).hasCustomDimensionsForProperty(propertyID, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.SITE_GOALS_CUSTOM_DIMENSIONS);
  }, [propertyID]);

  /**
   * The row's enabled state depends on the selected property's custom
   * dimensions, so the row keeps loading until the selection is final and
   * those dimensions resolve, like the Enhanced measurement switch above
   * it. The "Set up a new property" selection has nothing to resolve.
   */
  const isDimensionsLoaded = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertySelection)(propertyID) || select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isLoadingPropertySummaries()) {
      return false;
    }
    if (propertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.PROPERTY_CREATE) {
      return true;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).hasFinishedResolution('getCustomDimensions', [propertyID]);
  }, [propertyID]);
  const hasEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.EDIT_SCOPE), []);
  const supportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/10075209'
  }), []);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(ADVANCED_DATA_BREAKDOWNS_FORM, 'autoSubmit');
  const isSaving = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isFetchingSaveAdvancedDataBreakdownsSettings(), []);
  const isCreatingDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    const customDimensionsBeingCreated = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.SITE_GOALS_CUSTOM_DIMENSIONS.some(dimension => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isCreatingCustomDimension(dimension));
    return customDimensionsBeingCreated || select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isSyncingAvailableCustomDimensions();
  }, []);
  const {
    setAdvancedDataBreakdownsEnabled,
    saveAdvancedDataBreakdownsSettings,
    createCustomDimensions
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4);
  const {
    setPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
  const enableAndCreate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    setAdvancedDataBreakdownsEnabled({
      [propertyID]: true
    });
    const {
      error
    } = await saveAdvancedDataBreakdownsSettings();

    // A failed save shows at the top of the settings through
    // StoreErrorNotices, so stop here and skip creating the dimensions.
    if (error) {
      return;
    }
    createCustomDimensions();
  }, [propertyID, setAdvancedDataBreakdownsEnabled, saveAdvancedDataBreakdownsSettings, createCustomDimensions]);
  function handleEnable() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_analytics-custom-dimensions-setting`, 'enable_custom_dimensions');
    if (hasEditScope === false) {
      setAutoSubmit(true);
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Additional permissions are required to create the custom dimensions needed for the Site Goals widget.', 'google-site-kit'),
        data: {
          status: 403,
          scopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.EDIT_SCOPE],
          skipModal: true
        }
      });
      return;
    }
    enableAndCreate();
  }
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (autoSubmit && hasEditScope) {
      setAutoSubmit(false);
      enableAndCreate();
    }
  }, [autoSubmit, enableAndCreate, hasEditScope, setAutoSubmit]);

  /**
   * The green check reflects whether the selected property has all the Site
   * Goals custom dimensions, so it updates with the property selection and
   * stays when you switch away and back. The per-property enabled flag
   * controls custom dimension creation, not this display state.
   */
  const isComplete = hasAllCustomDimensions === true;

  // This uses Link instead of SupportLink, because SupportLink is not typed
  // for the `external` and `onClick` props in TypeScript.
  const learnMoreLink = /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
    href: supportURL,
    "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Learn more about advanced data breakdowns', 'google-site-kit'),
    onClick: () => {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(viewContext, 'click_learn_more_link', 'advanced_data_breakdowns');
    },
    external: true,
    hideExternalIndicator: true
  });
  const helperText = isComplete ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Detailed performance tracking and access to the most granular data available, enabled by granting Site Kit permission to create custom dimensions in Google Analytics. <a>Learn more</a>', 'google-site-kit'), {
    a: learnMoreLink
  }) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Grant Site Kit permission to create custom dimensions in Google Analytics. This enables detailed performance tracking and access to the most granular data available. <a>Learn more</a>', 'google-site-kit'), {
    a: learnMoreLink
  });
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_common_MeasurementSettingRow__WEBPACK_IMPORTED_MODULE_10__["default"], {
    loading: !isSettingsLoaded || !isDimensionsLoaded,
    isEnabled: isComplete,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Advanced data breakdowns', 'google-site-kit'),
    description: helperText,
    action:
    /*#__PURE__*/
    // @ts-expect-error - The `SpinnerButton` component is not typed yet.
    React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.SpinnerButton, {
      onClick: handleEnable,
      disabled: isSaving || isCreatingDimensions || !hasModuleAccess || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertyID)(propertyID),
      isSaving: isSaving || isCreatingDimensions,
      inverse: true
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enable', 'google-site-kit'))
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SettingsAdvancedDataBreakdowns);

/***/ },

/***/ "./js/modules/analytics-4/components/setup/SetupLayout/InitialSetupLayout.tsx"
/*!************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/setup/SetupLayout/InitialSetupLayout.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": () => (/* binding */ InitialSetupLayout)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_ProgressIndicator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ProgressIndicator */ "./js/components/ProgressIndicator.js");
/* harmony import */ var _js_components_setup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/setup */ "./js/components/setup/index.ts");
/* harmony import */ var _js_components_setup_ExitSetup__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/setup/ExitSetup */ "./js/components/setup/ExitSetup.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_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Analytics InitialSetupLayout 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 InitialSetupLayout({
  moduleSlug
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES).getModule(moduleSlug), [moduleSlug]);
  const finishSetup = (0,_js_components_setup__WEBPACK_IMPORTED_MODULE_4__.useFinishSetup)(moduleSlug, {
    gaTrackingEventArgs: {
      category: `${viewContext}_setup`,
      action: 'setup_flow_v3_complete_analytics_step'
    }
  });
  (0,_js_components_setup__WEBPACK_IMPORTED_MODULE_4__.useModuleSetupTracking)(moduleSlug, {
    viewGATrackingEventArgs: {
      category: `${viewContext}_setup`,
      action: 'setup_flow_v3_view_analytics_step'
    }
  });
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])(() => {
    globalThis.document.body.classList.add('googlesitekit-setup-flow');
  });
  if (!module?.SetupComponent) {
    return null;
  }
  const {
    SetupComponent
  } = module;
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement(_js_components_setup__WEBPACK_IMPORTED_MODULE_4__.SetupHeader, null, /*#__PURE__*/React.createElement(_js_components_setup_ExitSetup__WEBPACK_IMPORTED_MODULE_5__["default"], {
    gaTrackingEventArgs: {
      category: `${viewContext}_setup`,
      action: 'setup_flow_v3_exit_setup',
      label: moduleSlug
    }
  })), /*#__PURE__*/React.createElement("div", {
    className: `googlesitekit-setup googlesitekit-initial-setup googlesitekit-initial-setup--${moduleSlug}`
  }, /*#__PURE__*/React.createElement(_js_components_ProgressIndicator__WEBPACK_IMPORTED_MODULE_3__["default"], {
    currentSegment: 3,
    totalSegments: 6
  }), /*#__PURE__*/React.createElement("section", {
    className: "googlesitekit-setup__wrapper"
  }, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_8__.Grid, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_8__.Row, null, /*#__PURE__*/React.createElement(_js_material_components__WEBPACK_IMPORTED_MODULE_8__.Cell, {
    size: 12
  }, /*#__PURE__*/React.createElement(SetupComponent, {
    module: module,
    finishSetup: finishSetup
  })))))));
}

/***/ },

/***/ "./js/modules/analytics-4/components/setup/SetupLayout/index.tsx"
/*!***********************************************************************!*\
  !*** ./js/modules/analytics-4/components/setup/SetupLayout/index.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": () => (/* binding */ SetupLayout)
/* harmony export */ });
/* harmony import */ var _js_components_setup__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/setup */ "./js/components/setup/index.ts");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.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 _InitialSetupLayout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./InitialSetupLayout */ "./js/modules/analytics-4/components/setup/SetupLayout/InitialSetupLayout.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Analytics setup layout 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.
 */

/**
 * Internal dependencies
 */





function SetupLayout({
  moduleSlug
}) {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_1__.useFeature)('setupFlowRefresh');
  const [showProgress] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_2__["default"])('showProgress');
  const isInitialSetupFlow = setupFlowRefreshEnabled && moduleSlug === _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ANALYTICS_4 && showProgress === 'true';
  if (!isInitialSetupFlow) {
    return /*#__PURE__*/React.createElement(_js_components_setup__WEBPACK_IMPORTED_MODULE_0__.DefaultModuleSetup, {
      moduleSlug: moduleSlug
    });
  }
  return /*#__PURE__*/React.createElement(_InitialSetupLayout__WEBPACK_IMPORTED_MODULE_4__["default"], {
    moduleSlug: moduleSlug
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/ChangeGoalDriversLink.tsx"
/*!********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/ChangeGoalDriversLink.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": () => (/* binding */ ChangeGoalDriversLink)
/* 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 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_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/icons/pencil-alt.svg */ "./svg/icons/pencil-alt.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals ChangeGoalDriversLink 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 ChangeGoalDriversLink({
  className,
  goalType
}) {
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  return /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-site-goals-change-drivers-cta', className),
    onClick: () => {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_site-goals-sidebar`, 'change_goal_drivers', goalType);
      setValue(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_6__.SITE_GOALS_SELECTION_PANEL_OPENED_KEY, true);
    },
    leadingIcon: /*#__PURE__*/React.createElement(_svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_8__["default"], {
      width: 20,
      height: 20
    }),
    secondary: true,
    linkButton: true
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select metrics', 'google-site-kit'));
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/BreakdownTabs.tsx"
/*!***********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/BreakdownTabs.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 _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_InfoTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var _js_components_ScrollableTabs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ScrollableTabs */ "./js/components/ScrollableTabs.tsx");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals breakdown tabs.
 *
 * 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
 */






const BreakdownTabs = ({
  tabs,
  activeTabID,
  onTabChange,
  showOtherSources = true,
  otherSourcesLabel
}) => {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__["default"])();

  // The trailing "Other sources" tab aggregates every event without a value
  // for the breakdown dimension; only appended when such events exist.
  const allTabs = [...tabs, ...(showOtherSources ? [{
    id: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__.SITE_GOALS_BREAKDOWN_OTHER_SOURCES_TAB_ID,
    label: otherSourcesLabel || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Other sources', 'google-site-kit')
  }] : [])];
  const activeIndex = allTabs.findIndex(tab => tab.id === activeTabID);
  return /*#__PURE__*/React.createElement(_js_components_ScrollableTabs__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-site-goals-breakdown-tabs"
  }, /*#__PURE__*/React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.TabBar, {
    activeIndex: activeIndex < 0 ? 0 : activeIndex,
    handleActiveIndexUpdate: index => {
      const tab = allTabs[index];
      if (tab) {
        onTabChange(tab.id);
      }
    }
  }, allTabs.map(tab => /*#__PURE__*/React.createElement(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Tab, {
    key: tab.id,
    className: "mdc-tab--min-width",
    focusOnActivate: false
  }, /*#__PURE__*/React.createElement("span", {
    className: "mdc-tab__text-label"
  }, tab.label), tab.tooltip && /*#__PURE__*/React.createElement(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_2__["default"], {
    title: tab.tooltip,
    onOpen: () => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_site-goals-widget`, 'view_tab_tooltip', tab.id)
  })))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BreakdownTabs);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/GatheringBreakdownDataBadge.tsx"
/*!*************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/GatheringBreakdownDataBadge.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/BadgeWithTooltip */ "./js/components/BadgeWithTooltip.js");
/* 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_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals gathering breakdown data badge.
 *
 * 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
 */






const GatheringBreakdownDataBadge = ({
  goalType,
  variant = 'panel'
}) => {
  // Gate on this section's own breakdown dimension, matching the per-goal-type
  // "New" notice (the ecommerce dimension for the store, the form dimension for
  // lead generation).
  const requiredDimension = _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_6__.SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE[goalType];
  const hasBreakdownDimension = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasCustomDimensions(requiredDimension), [requiredDimension]);
  const isGatheringData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => hasBreakdownDimension ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).areCustomDimensionsGatheringData([requiredDimension]) : undefined, [hasBreakdownDimension, requiredDimension]);
  const isSyncing = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isSyncingAvailableCustomDimensions(), []);
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('site-goals-gathering-breakdown-data'), []);

  // Avoid a flash while either gating selector is still resolving, or while a
  // dimensions sync is in flight.
  if (hasBreakdownDimension === undefined || isGatheringData === undefined || isSyncing) {
    return null;
  }

  // Render only while the dimension exists but is still gathering data; the
  // widget transitions to the breakdown view once enough data accumulates.
  if (!isGatheringData) {
    return null;
  }
  const label = variant === 'widget' ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Gathering breakdown data', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Gathering data', 'google-site-kit');
  return /*#__PURE__*/React.createElement(_js_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-site-goals-gathering-breakdown-data-badge",
    label: label,
    tooltipTitle: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('We’re still collecting breakdown data for your selected dashboard timeframe and previous period comparisons. <a>Learn more</a>', 'google-site-kit'), {
      a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: documentationURL,
        external: true,
        hideExternalIndicator: true
      })
    })
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GatheringBreakdownDataBadge);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/GoalTile.tsx"
/*!******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/GoalTile.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 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_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals tile shell 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
 */


const GoalTile = ({
  baseClassName,
  className,
  title,
  headerLabel,
  infoTooltip,
  bodyClassName,
  children
}) => {
  return /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(baseClassName, className)
  }, /*#__PURE__*/React.createElement("div", {
    className: `${baseClassName}__inner`
  }, /*#__PURE__*/React.createElement("div", {
    className: `${baseClassName}__header`
  }, /*#__PURE__*/React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    as: "h3",
    type: "title",
    size: "small",
    className: `${baseClassName}__title`
  }, title), !!infoTooltip && /*#__PURE__*/React.createElement(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__["default"], {
    title: infoTooltip
  }), !!headerLabel && /*#__PURE__*/React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    as: "span",
    type: "body",
    size: "medium",
    className: `${baseClassName}__header-label`
  }, headerLabel)), /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(`${baseClassName}__body`, bodyClassName)
  }, children)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GoalTile);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/KeyActionTiles.tsx"
/*!************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/KeyActionTiles.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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 _js_modules_analytics_4_components_site_goals_components_Tile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/Tile */ "./js/modules/analytics-4/components/site-goals/components/Tile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/utils/formats */ "./js/modules/analytics-4/components/site-goals/utils/formats.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals Key action tiles.
 *
 * 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
 */



// Renders the Key action rate and total tiles, shared by the Site Goals
// widgets. The parent supplies all copy (titles/subtitle) so this stays
// presentational.
const KeyActionTiles = ({
  isOtherSourcesTab,
  supportURL,
  rateTitle,
  totalTitle,
  totalSubtitle,
  currentRate,
  previousRate,
  currentSessions,
  currentCount,
  previousCount,
  otherSourcesCount,
  otherSourcesPreviousCount
}) => /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, !isOtherSourcesTab && /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_Tile__WEBPACK_IMPORTED_MODULE_3__.Tile, {
  title: rateTitle,
  subtitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: formatted number of total sessions */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('of %s total sessions', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.numFmt)(currentSessions, _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_4__.NUMBER_FORMAT)),
  infoTooltip: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The percentage of total visitors who successfully completed a key action (like making a purchase or filling out a form). <a>Learn more</a>', 'google-site-kit'), {
    a:
    /*#__PURE__*/
    // Content is supplied by createInterpolateElement.
    // eslint-disable-next-line jsx-a11y/anchor-has-content
    React.createElement("a", {
      href: supportURL,
      target: "_blank",
      rel: "noreferrer noopener"
    })
  }),
  currentValue: currentRate,
  previousValue: previousRate,
  format: _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_4__.PERCENT_FORMAT,
  primary: true
}), /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_Tile__WEBPACK_IMPORTED_MODULE_3__.Tile, {
  title: totalTitle,
  subtitle: totalSubtitle,
  currentValue: isOtherSourcesTab ? otherSourcesCount : currentCount,
  previousValue: isOtherSourcesTab ? otherSourcesPreviousCount : previousCount,
  format: _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_4__.NUMBER_FORMAT
}));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (KeyActionTiles);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/OtherSourcesNotice.tsx"
/*!****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/OtherSourcesNotice.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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 _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");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals Other sources notice.
 *
 * 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
 */


const OtherSourcesNotice = ({
  learnMoreURL
}) => {
  return /*#__PURE__*/React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_3__["default"], {
    as: "p",
    type: "body",
    size: "large",
    className: "googlesitekit-site-goals-other-sources-notice"
  }, (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('These events were recorded in your Analytics property, but Site Kit doesn’t track additional data for these events. They are shown here so you can still see your total activity in one place. <a>Learn more</a>', 'google-site-kit'), {
    a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
      href: learnMoreURL,
      external: true,
      hideExternalIndicator: true
    })
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (OtherSourcesNotice);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/PartialDataBadge.tsx"
/*!**************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/PartialDataBadge.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 _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_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/BadgeWithTooltip */ "./js/components/BadgeWithTooltip.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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/parseDimensionStringToDate */ "./js/modules/analytics-4/utils/parseDimensionStringToDate.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals partial data badge.
 *
 * 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
 */





/**
 * Formats a YYYYMMDD availability date as a localized long-form date, e.g.
 * `20260519` → "May 19, 2026", or an empty string when it's missing/invalid
 * (e.g. `0`, which can occur while the resource is still partial).
 *
 * @since 1.182.0
 *
 * @param {number} [availabilityDate] Availability date as a YYYYMMDD number.
 * @return {string} The localized date, or an empty string.
 */
function formatStartDate(availabilityDate) {
  const value = String(availabilityDate ?? '');
  if (value.length !== 8) {
    return '';
  }
  const date = (0,_js_modules_analytics_4_utils_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_4__["default"])(value);
  if (!date) {
    return '';
  }
  return new Intl.DateTimeFormat((0,_js_util__WEBPACK_IMPORTED_MODULE_5__.getLocale)(), {
    year: 'numeric',
    month: 'long',
    day: 'numeric'
  }).format(date);
}
const PartialDataBadge = ({
  customDimensionSlug
}) => {
  const isPartialData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).isCustomDimensionPartialData(customDimensionSlug), [customDimensionSlug]);
  const availabilityDate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(customDimensionSlug, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.RESOURCE_TYPE_CUSTOM_DIMENSION), [customDimensionSlug]);
  if (!isPartialData) {
    return null;
  }

  // The start date may be 0/unknown while still partial; the tooltip then omits
  // it.
  const date = formatStartDate(availabilityDate);
  const tooltipTitle = date ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: date the breakdown began collecting data, e.g. "May 19, 2026". */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Breakdown data tracking began on %s. We’re still collecting full data for your selected dashboard timeframe and previous period comparisons.', 'google-site-kit'), date) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('We’re still collecting full data for your selected dashboard timeframe and previous period comparisons.', 'google-site-kit');
  return /*#__PURE__*/React.createElement(_js_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_2__["default"], {
    className: "googlesitekit-site-goals-partial-data-badge",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Partial data', 'google-site-kit'),
    tooltipTitle: tooltipTitle
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PartialDataBadge);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx"
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/TableTile.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 _js_components_Link__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_components_ReportError__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/ReportError */ "./js/components/ReportError.js");
/* harmony import */ var _GoalTile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./GoalTile */ "./js/modules/analytics-4/components/site-goals/components/GoalTile.tsx");
/* harmony import */ var _ZeroDataMessage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ZeroDataMessage */ "./js/modules/analytics-4/components/site-goals/components/ZeroDataMessage.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals table tile 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
 */





const TableTile = ({
  title,
  headerLabel,
  rows = [],
  loading = false,
  error,
  limit,
  noDataMetricLabel,
  zeroState
}) => {
  const visibleRows = rows.slice(0, limit || rows.length);
  return /*#__PURE__*/React.createElement(_GoalTile__WEBPACK_IMPORTED_MODULE_3__["default"], {
    baseClassName: "googlesitekit-table-tile",
    title: title,
    headerLabel: headerLabel
  }, loading && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-table-tile__loading"
  }, /*#__PURE__*/React.createElement(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
    width: "100%",
    height: "18px"
  }), /*#__PURE__*/React.createElement(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
    width: "100%",
    height: "18px"
  }), /*#__PURE__*/React.createElement(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
    width: "100%",
    height: "18px"
  })), !loading && !!error && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-table-tile__error"
  }, /*#__PURE__*/React.createElement(_js_components_ReportError__WEBPACK_IMPORTED_MODULE_2__["default"], {
    moduleSlug: "analytics-4",
    error: error
  })), !loading && !error && rows.length === 0 && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-table-tile__zero-state"
  }, zeroState || /*#__PURE__*/React.createElement(_ZeroDataMessage__WEBPACK_IMPORTED_MODULE_4__["default"], {
    metricLabel: noDataMetricLabel || 'visitors'
  })), !loading && !error && rows.length > 0 && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-table-tile__rows"
  }, visibleRows.map((row, index) => /*#__PURE__*/React.createElement("div", {
    key: `${row.label}-${index}`,
    className: "googlesitekit-table-tile__row"
  }, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-table-tile__cell googlesitekit-table-tile__cell--label"
  }, row.url ? /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_0__["default"], {
    href: row.url,
    title: row.label,
    external: true,
    hideExternalIndicator: true
  }, row.label) : /*#__PURE__*/React.createElement("span", null, row.label)), /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-table-tile__cell googlesitekit-table-tile__cell--value"
  }, row.value)))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TableTile);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/Tile.tsx"
/*!**************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/Tile.tsx ***!
  \**************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   Tile: () => (/* binding */ Tile)
/* 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_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/ChangeBadge */ "./js/components/ChangeBadge.tsx");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_components_ReportError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/ReportError */ "./js/components/ReportError.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_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _GoalTile__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./GoalTile */ "./js/modules/analytics-4/components/site-goals/components/GoalTile.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







const Tile = ({
  className,
  title,
  subtitle,
  infoTooltip,
  currentValue,
  previousValue,
  loading = false,
  error,
  format,
  primary
}) => {
  const comparisonDays = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getDateRangeNumberOfDays(), []);
  return /*#__PURE__*/React.createElement(_GoalTile__WEBPACK_IMPORTED_MODULE_9__["default"], {
    baseClassName: "googlesitekit-site-goals-tile",
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, {
      'googlesitekit-site-goals-tile--primary': primary,
      'googlesitekit-site-goals-tile--primary__positive': primary && currentValue > previousValue,
      'googlesitekit-site-goals-tile--primary__negative': primary && currentValue < previousValue,
      'googlesitekit-site-goals-tile--primary__neutral': primary && currentValue === previousValue && previousValue !== 0
    }),
    title: title,
    infoTooltip: infoTooltip
  }, loading && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tile__loading"
  }, /*#__PURE__*/React.createElement(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
    width: "100%",
    height: "24px"
  }), /*#__PURE__*/React.createElement(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
    width: "100%",
    height: "16px"
  })), !loading && !!error && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tile__error"
  }, /*#__PURE__*/React.createElement(_js_components_ReportError__WEBPACK_IMPORTED_MODULE_6__["default"], {
    moduleSlug: "analytics-4",
    error: error
  })), !loading && !error && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tile__metric-container"
  }, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tile__metric"
  }, (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(currentValue, format)), /*#__PURE__*/React.createElement("p", {
    className: "googlesitekit-site-goals-tile__subtext"
  }, subtitle)), previousValue !== 0 && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tile__change-container"
  }, /*#__PURE__*/React.createElement(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_4__["default"], {
    previousValue: previousValue,
    currentValue: currentValue,
    zeroChangeLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No change', 'google-site-kit')
  }), comparisonDays && /*#__PURE__*/React.createElement("p", {
    className: "googlesitekit-site-goals-tile__comparison-label"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %d: number of days in the comparison period */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Vs. prev. %d days', 'google-site-kit'), comparisonDays)))));
};

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/TilesGroup.tsx"
/*!********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/TilesGroup.tsx ***!
  \********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   TilesGroup: () => (/* binding */ TilesGroup)
/* 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 _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

const TilesGroup = ({
  title,
  className,
  headerCTA,
  badge,
  children
}) => {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.useBreakpoint)();
  const isMobileBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.BREAKPOINT_SMALL;
  return /*#__PURE__*/React.createElement("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-site-goals-tiles-group', className)
  }, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tiles-group__header"
  }, /*#__PURE__*/React.createElement("p", {
    className: "googlesitekit-site-goals-tiles-group__title"
  }, title), !isMobileBreakpoint && headerCTA && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tiles-group__cta"
  }, headerCTA)), badge && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tiles-group__badge"
  }, badge), /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tiles-group__tiles"
  }, children), isMobileBreakpoint && headerCTA && /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-tiles-group__footer-cta"
  }, headerCTA));
};

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/components/ZeroDataMessage.tsx"
/*!*************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/components/ZeroDataMessage.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 _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");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals ZeroDataMessage 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
 */


const METRIC_LABELS = {
  sales: {
    page: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your page hasn’t received any sales yet', 'google-site-kit'),
    site: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your site hasn’t received any sales yet', 'google-site-kit')
  },
  leads: {
    page: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your page hasn’t received any leads yet', 'google-site-kit'),
    site: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your site hasn’t received any leads yet', 'google-site-kit')
  },
  visitors: {
    page: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your page hasn’t received any visitors yet', 'google-site-kit'),
    site: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to display: your site hasn’t received any visitors yet', 'google-site-kit')
  }
};
const ZeroDataMessage = ({
  metricLabel
}) => {
  const url = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getCurrentEntityURL(), []);
  const labels = METRIC_LABELS[metricLabel];
  return /*#__PURE__*/React.createElement("span", null, url ? labels.page : labels.site);
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ZeroDataMessage);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/constants.ts"
/*!*******************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/constants.ts ***!
  \*******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   BREAKDOWN_DISMISSED_FORM_KEY: () => (/* binding */ BREAKDOWN_DISMISSED_FORM_KEY),
/* harmony export */   BREAKDOWN_ORIGIN_FORM_KEY: () => (/* binding */ BREAKDOWN_ORIGIN_FORM_KEY),
/* harmony export */   BREAKDOWN_ORIGIN_PANEL: () => (/* binding */ BREAKDOWN_ORIGIN_PANEL),
/* harmony export */   BREAKDOWN_ORIGIN_WIDGET: () => (/* binding */ BREAKDOWN_ORIGIN_WIDGET),
/* harmony export */   BREAKDOWN_SCOPE_BOTH: () => (/* binding */ BREAKDOWN_SCOPE_BOTH),
/* harmony export */   BREAKDOWN_SCOPE_FORM_KEY: () => (/* binding */ BREAKDOWN_SCOPE_FORM_KEY),
/* harmony export */   SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSIONS: () => (/* binding */ SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSIONS),
/* harmony export */   SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE: () => (/* binding */ SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE),
/* harmony export */   SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDERS: () => (/* binding */ SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDERS),
/* harmony export */   SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDER_LABELS: () => (/* binding */ SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDER_LABELS),
/* harmony export */   SITE_GOALS_BREAKDOWN_NOTICE: () => (/* binding */ SITE_GOALS_BREAKDOWN_NOTICE),
/* harmony export */   SITE_GOALS_BREAKDOWN_NOTIFICATION: () => (/* binding */ SITE_GOALS_BREAKDOWN_NOTIFICATION),
/* harmony export */   SITE_GOALS_BREAKDOWN_OTHER_SOURCES_TAB_ID: () => (/* binding */ SITE_GOALS_BREAKDOWN_OTHER_SOURCES_TAB_ID),
/* harmony export */   SITE_GOALS_DEFAULT_SELECTED_DRIVERS: () => (/* binding */ SITE_GOALS_DEFAULT_SELECTED_DRIVERS),
/* harmony export */   SITE_GOALS_DEFAULT_SELECTED_VISITOR_ENGAGEMENT: () => (/* binding */ SITE_GOALS_DEFAULT_SELECTED_VISITOR_ENGAGEMENT),
/* harmony export */   SITE_GOALS_MAX_SELECTED_DRIVERS: () => (/* binding */ SITE_GOALS_MAX_SELECTED_DRIVERS),
/* harmony export */   SITE_GOALS_MIN_SELECTED_DRIVERS: () => (/* binding */ SITE_GOALS_MIN_SELECTED_DRIVERS),
/* harmony export */   SITE_GOALS_PANEL_VOTE_IDS_BY_GOAL_TYPE: () => (/* binding */ SITE_GOALS_PANEL_VOTE_IDS_BY_GOAL_TYPE),
/* harmony export */   SITE_GOALS_SELECTED_DRIVERS: () => (/* binding */ SITE_GOALS_SELECTED_DRIVERS),
/* harmony export */   SITE_GOALS_SELECTED_VISITOR_ENGAGEMENT: () => (/* binding */ SITE_GOALS_SELECTED_VISITOR_ENGAGEMENT),
/* harmony export */   SITE_GOALS_SELECTION_FORM: () => (/* binding */ SITE_GOALS_SELECTION_FORM),
/* harmony export */   SITE_GOALS_SELECTION_PANEL_OPENED_KEY: () => (/* binding */ SITE_GOALS_SELECTION_PANEL_OPENED_KEY),
/* harmony export */   SITE_GOALS_SURVEY_TRIGGER_BREAKDOWN_ENABLED: () => (/* binding */ SITE_GOALS_SURVEY_TRIGGER_BREAKDOWN_ENABLED),
/* harmony export */   SITE_GOALS_SURVEY_TRIGGER_NOT_INTERACTED: () => (/* binding */ SITE_GOALS_SURVEY_TRIGGER_NOT_INTERACTED),
/* harmony export */   SITE_GOALS_SURVEY_TRIGGER_NO_BREAKDOWN: () => (/* binding */ SITE_GOALS_SURVEY_TRIGGER_NO_BREAKDOWN),
/* harmony export */   SITE_GOALS_THUMBS_DOWNVOTE_FORM_URL: () => (/* binding */ SITE_GOALS_THUMBS_DOWNVOTE_FORM_URL),
/* harmony export */   SITE_GOALS_VOTE_ID_PANEL_LEAD_GENERATION: () => (/* binding */ SITE_GOALS_VOTE_ID_PANEL_LEAD_GENERATION),
/* harmony export */   SITE_GOALS_VOTE_ID_PANEL_ONLINE_STORE: () => (/* binding */ SITE_GOALS_VOTE_ID_PANEL_ONLINE_STORE),
/* harmony export */   SITE_GOALS_VOTE_ID_WIDGET_LEAD_GENERATION: () => (/* binding */ SITE_GOALS_VOTE_ID_WIDGET_LEAD_GENERATION),
/* harmony export */   SITE_GOALS_VOTE_ID_WIDGET_ONLINE_STORE: () => (/* binding */ SITE_GOALS_VOTE_ID_WIDGET_ONLINE_STORE)
/* harmony export */ });
/* 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.ts");
/* harmony import */ var _goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/**
 * Site Goals selection panel constants.
 *
 * 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
 */


const SITE_GOALS_SELECTION_PANEL_OPENED_KEY = 'googlesitekit-site-goals-selection-panel-opened';
const SITE_GOALS_SELECTION_FORM = 'site-goals-selection-form';
const SITE_GOALS_SELECTED_DRIVERS = 'site-goals-selected-drivers';
const SITE_GOALS_SELECTED_VISITOR_ENGAGEMENT = 'site-goals-selected-visitor-engagement';
const SITE_GOALS_MIN_SELECTED_DRIVERS = 1;
const SITE_GOALS_MAX_SELECTED_DRIVERS = 6;
const SITE_GOALS_BREAKDOWN_NOTICE = 'site-goals-breakdown-notice';
const SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE = {
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE]: 'googlesitekit_event_provider',
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.LEAD]: 'googlesitekit_form_id'
};
const SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSIONS = Object.values(SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE);
const SITE_GOALS_BREAKDOWN_OTHER_SOURCES_TAB_ID = 'other-sources';
const SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDER_LABELS = {
  woocommerce: 'WooCommerce',
  'easy-digital-downloads': 'Easy Digital Downloads'
};
const SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDERS = Object.keys(SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDER_LABELS);
const SITE_GOALS_BREAKDOWN_NOTIFICATION = 'site_goals_breakdown';
const BREAKDOWN_ORIGIN_WIDGET = 'widget';
const BREAKDOWN_ORIGIN_PANEL = 'panel';
const BREAKDOWN_ORIGIN_FORM_KEY = 'breakdownOrigin';
const BREAKDOWN_SCOPE_FORM_KEY = 'breakdownScope';
const BREAKDOWN_DISMISSED_FORM_KEY = 'breakdownDismissed';
const BREAKDOWN_SCOPE_BOTH = 'both';
const SITE_GOALS_DEFAULT_SELECTED_DRIVERS = {
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE]: [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS, _goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS_RATE, _goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_DRIVER_IDS.VISITOR_TYPE],
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.LEAD]: [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS, _goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS_RATE, _goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_DRIVER_IDS.VISITOR_TYPE]
};
const SITE_GOALS_DEFAULT_SELECTED_VISITOR_ENGAGEMENT = {
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE]: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.ENUM_CONVERSION_EVENTS.ADD_TO_CART],
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.LEAD]: []
};
const SITE_GOALS_SURVEY_TRIGGER_NOT_INTERACTED = 'view_site_goals_not_interacted';
const SITE_GOALS_SURVEY_TRIGGER_NO_BREAKDOWN = 'view_site_goals_no_breakdown';
const SITE_GOALS_SURVEY_TRIGGER_BREAKDOWN_ENABLED = 'view_site_goals_breakdown_enabled';
const SITE_GOALS_VOTE_ID_WIDGET_ONLINE_STORE = 'site_goals_widget_online_store';
const SITE_GOALS_VOTE_ID_WIDGET_LEAD_GENERATION = 'site_goals_widget_lead_generation';
const SITE_GOALS_VOTE_ID_PANEL_ONLINE_STORE = 'site_goals_primary_action_panel_online_store';
const SITE_GOALS_VOTE_ID_PANEL_LEAD_GENERATION = 'site_goals_primary_action_panel_lead_generation';
const SITE_GOALS_PANEL_VOTE_IDS_BY_GOAL_TYPE = {
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE]: SITE_GOALS_VOTE_ID_PANEL_ONLINE_STORE,
  [_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.LEAD]: SITE_GOALS_VOTE_ID_PANEL_LEAD_GENERATION
};

// Placeholder for the downvote "Tell us more" Google Form URL. Replace it once
// the real URL is ready. Tracked in #12727.
const SITE_GOALS_THUMBS_DOWNVOTE_FORM_URL = '#';

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/feature-tours/site-goals.ts"
/*!**********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/feature-tours/site-goals.ts ***!
  \**********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   SITE_GOALS_TOUR: () => (/* binding */ SITE_GOALS_TOUR),
/* harmony export */   SITE_GOALS_TOUR_PRELOAD_WIDGET_AREAS: () => (/* binding */ SITE_GOALS_TOUR_PRELOAD_WIDGET_AREAS),
/* harmony export */   getSiteGoalsTour: () => (/* binding */ getSiteGoalsTour),
/* harmony export */   waitForSiteGoalsSectionReady: () => (/* binding */ waitForSiteGoalsSectionReady)
/* 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");
/* harmony import */ var _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/**
 * Site Goals feature tour.
 *
 * 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 SITE_GOALS_TOUR = 'site-goals-feature-tour';

/**
 * The first element the tour points to. The modal waits for it before it
 * shows. The tour waits for it before it starts.
 */
const FIRST_STEP_TARGET = '.googlesitekit-site-goals-primary-action';

/**
 * The widget areas at and above the Site Goals section, in the order they
 * appear on the page. Normally an area loads its data only when the user
 * scrolls to it. The tour loads all of these before it starts, so the page
 * reaches its full height first. Without this, an area that loads later would
 * push the Site Goals section down, and the tour would point at the wrong
 * place. Loading an area the site does not have has no effect.
 */
const SITE_GOALS_TOUR_PRELOAD_WIDGET_AREAS = [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_2__.AREA_MAIN_DASHBOARD_SITE_GOALS_PRIMARY];

/**
 * The CSS class of the gray placeholder a widget shows while it loads its
 * data, rendered by `PreviewBlock`. The wait below looks for this class to
 * tell when a widget area is still loading, so keep it in sync if
 * `PreviewBlock` renames the class.
 */
const LOADING_PLACEHOLDER_CLASS = 'googlesitekit-preview-block';

/**
 * The CSS class on a widget area's container, rendered by `WidgetAreaRenderer`.
 * Each area also carries a `--<slug>` suffix, so the wait can look at one area
 * at a time. Keep it in sync if `WidgetAreaRenderer` renames the class.
 */
const WIDGET_AREA_CLASS = 'googlesitekit-widget-area';

/**
 * How often the wait checks the page (250 milliseconds), and the longest it
 * runs before it gives up (30 seconds). The limit stops a section that never
 * loads from blocking the modal or the tour.
 */
const SECTION_READY_CHECK_INTERVAL_MS = 250;
const SECTION_READY_CHECK_MAX_TOTAL_WAIT_MS = 30000;

/**
 * Waits until the Site Goals section has loaded and its layout has settled.
 *
 * The tour draws a spotlight around its target and redraws it on every
 * layout shift. The widget areas above and including Site Goals shift the
 * layout as their data loads, so the tour must wait for them, or the
 * spotlight lands in the wrong place. The wait ends once those areas have
 * loaded and the layout settles, or after 30 seconds, so a section that
 * never loads cannot block the modal or the tour.
 *
 * @since 1.181.0
 * @since 1.182.0 Renamed from `checkSiteGoalsTourRequirements`, exported it, and made it wait for the widget areas above Site Goals to load and the layout to settle before the tour starts.
 *
 * @param signal Optional `AbortSignal` to stop the wait. The hook passes one so it can cancel on unmount. The tour passes the data registry through `checkRequirements`, which is not a signal, so the wait ignores it.
 * @return Promise that resolves to `true` when the section is ready or the wait gives up, or `false` when the signal aborts.
 */
function waitForSiteGoalsSectionReady(signal) {
  return new Promise(resolve => {
    let remainingWaitMs = SECTION_READY_CHECK_MAX_TOTAL_WAIT_MS;
    let previousTargetTop;
    let timeoutID;
    function checkSection() {
      if (signal?.aborted) {
        resolve(false);
        return;
      }
      const target = globalThis.document.querySelector(FIRST_STEP_TARGET);
      const targetTop = target?.getBoundingClientRect().top;

      // Check whether any widget area the tour loads still shows a
      // placeholder. A placeholder means the data has not arrived, so the
      // layout can still shift.
      const isPreloadAreaLoading = SITE_GOALS_TOUR_PRELOAD_WIDGET_AREAS.some(slug => globalThis.document.querySelector(`.${WIDGET_AREA_CLASS}--${slug} .${LOADING_PLACEHOLDER_CLASS}`));

      // The section is ready when all three are true: no placeholder is
      // left, the target is on the page, and its top position matches the
      // last check. The layout has settled, so the tour can start and its
      // spotlight will not jump.
      if (target && !isPreloadAreaLoading && targetTop === previousTargetTop || remainingWaitMs <= 0) {
        resolve(true);
        return;
      }
      previousTargetTop = targetTop;
      remainingWaitMs -= SECTION_READY_CHECK_INTERVAL_MS;
      timeoutID = globalThis.setTimeout(checkSection, SECTION_READY_CHECK_INTERVAL_MS);
    }

    // The hook passes an `AbortSignal` so it can stop the loop when its
    // component unmounts. The tour passes the data registry here through
    // `checkRequirements`, which is not a signal, so only listen for a
    // real `AbortSignal`.
    if (signal instanceof AbortSignal) {
      signal.addEventListener('abort', () => {
        globalThis.clearTimeout(timeoutID);
        resolve(false);
      });
    }
    checkSection();
  });
}
const defaultStepOptions = {
  offset: -2,
  spotlightPadding: 0,
  styles: {
    spotlight: {
      boxSizing: 'content-box',
      paddingTop: '24px',
      paddingBottom: '24px',
      paddingInlineEnd: '24px',
      marginTop: '-24px',
      marginInlineEnd: '-24px'
    }
  },
  placement: 'top',
  isResponsive: true
};

/**
 * Returns the Google Analytics event category for the Site Goals tour,
 * prefixed with the current view context.
 *
 * @since 1.181.0
 *
 * @param viewContext The current view context.
 * @return The event category string.
 */
function gaEventCategory(viewContext) {
  return `${viewContext}_site-goals-tour`;
}

/**
 * Returns the Site Goals tour config.
 *
 * The tour starts from the "Show me" button on the intro modal and runs on
 * the Site Goals widget. It loads the widget areas above and including Site
 * Goals and waits for the layout to settle before it starts, through
 * `preloadWidgetAreas` and `checkRequirements`.
 *
 * The breakdown step appears only when a widget shows its notice. Both widgets
 * render that notice under one class, so the step targets the first match on
 * the page. That match is the Online store widget's notice when that widget
 * shows one, and the Lead generation widget's notice otherwise.
 *
 * @since 1.181.0
 * @since 1.182.0 Load every widget area above and including the Site Goals section before the tour starts, and wait for them to load and the layout to settle.
 * @since 1.184.0 Pick the breakdown step copy from the widget the step points at, in place of the detected event types.
 *
 * @param params                             The tour params.
 * @param params.hasEcommerceBreakdownNotice Whether the Online store widget shows the breakdown notice.
 * @param params.hasLeadBreakdownNotice      Whether the Lead generation widget shows the breakdown notice.
 * @return The Site Goals tour config.
 */
function getSiteGoalsTour({
  hasEcommerceBreakdownNotice,
  hasLeadBreakdownNotice
}) {
  const breakdownStep = {
    ...defaultStepOptions,
    target: '.googlesitekit-site-goals-breakdown-notice',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Get into the details', 'google-site-kit'),
    content: hasEcommerceBreakdownNotice ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Want to see whether WooCommerce or Easy Digital Downloads is driving more success? You can break these numbers down to see the performance of each plugin.', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Want to know which specific form is bringing in the most interest? You can break these numbers down to see the performance of each individual form on your site.', 'google-site-kit'),
    styles: {
      spotlight: {
        ...defaultStepOptions.styles.spotlight,
        paddingInlineStart: '24px',
        marginInlineStart: '-24px'
      }
    }
  };
  return {
    slug: SITE_GOALS_TOUR,
    isRepeatable: true,
    contexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD],
    gaEventCategory,
    preloadWidgetAreas: SITE_GOALS_TOUR_PRELOAD_WIDGET_AREAS,
    checkRequirements: waitForSiteGoalsSectionReady,
    steps: [{
      ...defaultStepOptions,
      target: FIRST_STEP_TARGET,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your main goal is front and center', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Track the most important metric (like sales or lead submissions) to understand how your site is helping you reach your goals.', 'google-site-kit')
    }, ...(hasEcommerceBreakdownNotice || hasLeadBreakdownNotice ? [breakdownStep] : []), {
      ...defaultStepOptions,
      target: '.googlesitekit-site-goals-goal-drivers-group',
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Find what drives success', 'google-site-kit'),
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Discover which traffic channels or locations are bringing in the best results, so you can focus on what works. Customize this list with metrics that matter the most to you.', 'google-site-kit'),
      // Show "Done" on the last step's button instead of the
      // shared "Got it". react-joyride uses this label on this
      // step only and keeps the other labels.
      locale: {
        last: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Done', 'google-site-kit')
      }
    }]
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/CitiesGoalDriver.tsx"
/*!****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/CitiesGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * CitiesGoalDriver 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
 */







const CitiesGoalDriver = ({
  title = '',
  goalType,
  limit,
  rows: providedRows,
  loading: providedLoading,
  error: providedError,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates(), []);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const eventNames = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.normalizePrimaryEvents)(primaryEvent);
    if (!dates || !eventNames.length) {
      return undefined;
    }
    const eventDimensionFilters = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.getDimensionFiltersForEvents)(eventNames, breakdownFilter);
    return {
      ...dates,
      dimensions: ['city'],
      dimensionFilters: {
        ...(eventDimensionFilters || {}),
        city: {
          filterType: 'emptyFilter',
          notExpression: true
        }
      },
      metrics: [{
        name: 'eventCount'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_cities_${goalType}`
    };
  }, [dates, goalType, primaryEvent, breakdownFilter]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]) : undefined, [reportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!reportOptions) {
      return false;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
  }, [reportOptions]);
  const sourceRows = report?.rows || [];
  const totalCount = sourceRows.reduce((total, row) => {
    return total + parseFloat(String(row.metricValues?.[0]?.value ?? 0));
  }, 0);
  const mappedRows = sourceRows.map(row => {
    const city = row.dimensionValues?.[0]?.value || '';
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    return {
      label: city || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(not set)', 'google-site-kit'),
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalCount > 0 ? eventCount / totalCount : 0, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      })
    };
  });
  const rows = providedRows || mappedRows;
  const loading = providedLoading ?? reportLoading;
  const error = providedError ?? reportError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_IDS.CITIES, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: title,
    rows: rows,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CitiesGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/CountriesGoalDriver.tsx"
/*!*******************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/CountriesGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * CountriesGoalDriver 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
 */







const CountriesGoalDriver = ({
  title = '',
  goalType,
  limit,
  rows: providedRows,
  loading: providedLoading,
  error: providedError,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates(), []);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const eventNames = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.normalizePrimaryEvents)(primaryEvent);
    if (!dates || !eventNames.length) {
      return undefined;
    }
    const eventDimensionFilters = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.getDimensionFiltersForEvents)(eventNames, breakdownFilter);
    return {
      ...dates,
      dimensions: ['country'],
      dimensionFilters: {
        ...(eventDimensionFilters || {}),
        country: {
          filterType: 'emptyFilter',
          notExpression: true
        }
      },
      metrics: [{
        name: 'eventCount'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_countries_${goalType}`
    };
  }, [dates, goalType, primaryEvent, breakdownFilter]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]) : undefined, [reportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!reportOptions) {
      return false;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
  }, [reportOptions]);
  const sourceRows = report?.rows || [];
  const totalCount = sourceRows.reduce((total, row) => {
    return total + parseFloat(String(row.metricValues?.[0]?.value ?? 0));
  }, 0);
  const mappedRows = sourceRows.map(row => {
    const country = row.dimensionValues?.[0]?.value || '';
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    return {
      label: country || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(not set)', 'google-site-kit'),
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalCount > 0 ? eventCount / totalCount : 0, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      })
    };
  });
  const rows = providedRows || mappedRows;
  const loading = providedLoading ?? reportLoading;
  const error = providedError ?? reportError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_IDS.COUNTRIES, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: title,
    rows: rows,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CountriesGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/DeviceTypeGoalDriver.tsx"
/*!********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/DeviceTypeGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DeviceTypeGoalDriver 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
 */







const DeviceTypeGoalDriver = ({
  title = '',
  goalType,
  limit,
  rows: providedRows,
  loading: providedLoading,
  error: providedError,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates(), []);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const eventNames = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.normalizePrimaryEvents)(primaryEvent);
    if (!dates || !eventNames.length) {
      return undefined;
    }
    const eventDimensionFilters = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.getDimensionFiltersForEvents)(eventNames, breakdownFilter);
    return {
      ...dates,
      dimensions: ['deviceCategory'],
      dimensionFilters: eventDimensionFilters,
      metrics: [{
        name: 'eventCount'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_device-type_${goalType}`
    };
  }, [dates, goalType, primaryEvent, breakdownFilter]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]) : undefined, [reportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!reportOptions) {
      return false;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
  }, [reportOptions]);
  const sourceRows = report?.rows || [];
  const totalCount = sourceRows.reduce((total, row) => {
    return total + parseFloat(String(row.metricValues?.[0]?.value ?? 0));
  }, 0);
  const mappedRows = sourceRows.map(row => {
    const rawDeviceCategory = row.dimensionValues?.[0]?.value || '';
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    return {
      label: rawDeviceCategory || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(not set)', 'google-site-kit'),
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalCount > 0 ? eventCount / totalCount : 0, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      })
    };
  });
  const rows = providedRows || mappedRows;
  const loading = providedLoading ?? reportLoading;
  const error = providedError ?? reportError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_IDS.DEVICE_TYPE, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: title,
    rows: rows,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DeviceTypeGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/GoalDriverTiles.tsx"
/*!***************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/GoalDriverTiles.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 _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * GoalDriverTiles 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 isRenderableGoalDriver(driver) {
  return !!driver.Component;
}
const GoalDriverTiles = ({
  drivers = [],
  hasExpandableRows,
  primaryEvent,
  goalType,
  breakdownFilter
}) => {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.useBreakpoint)();
  const isMobileBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_SMALL;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const [isExpanded, setIsExpanded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [expandableDrivers, setExpandableDrivers] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)({});
  const onShowMoreClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    setIsExpanded(currentState => {
      const nextState = !currentState;
      (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_site-goals-sidebar`, 'toggle_extended_view', nextState ? 'on' : 'off');
      return nextState;
    });
  }, [viewContext]);
  const onExpandableRowsChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)((driverID, canExpand) => {
    setExpandableDrivers(currentState => {
      if (currentState[driverID] === canExpand) {
        return currentState;
      }
      return {
        ...currentState,
        [driverID]: canExpand
      };
    });
  }, []);
  const limit = isExpanded && !isMobileBreakpoint ? _constants__WEBPACK_IMPORTED_MODULE_7__.GOAL_DRIVER_ROW_LIMIT_EXPANDED : _constants__WEBPACK_IMPORTED_MODULE_7__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED;
  const filteredDrivers = drivers.filter(isRenderableGoalDriver).slice(0, _constants__WEBPACK_IMPORTED_MODULE_7__.MAX_VISIBLE_GOAL_DRIVERS);
  const emptySlots = filteredDrivers.length > _constants__WEBPACK_IMPORTED_MODULE_7__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED ? Math.max(0, _constants__WEBPACK_IMPORTED_MODULE_7__.MAX_VISIBLE_GOAL_DRIVERS - filteredDrivers.length) : 0;
  const hasExpandableDrivers = typeof hasExpandableRows === 'boolean' ? hasExpandableRows : Object.values(expandableDrivers).some(Boolean);
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-goal-drivers-section__tiles"
  }, filteredDrivers.map(({
    Component: DriverComponent,
    ...driver
  }) => /*#__PURE__*/React.createElement("div", {
    key: driver.id,
    className: "googlesitekit-site-goals-goal-drivers-section__tile"
  }, /*#__PURE__*/React.createElement(DriverComponent, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
    goalType: goalType,
    primaryEvent: primaryEvent,
    breakdownFilter: breakdownFilter,
    limit: limit,
    onExpandableRowsChange: onExpandableRowsChange
  }, driver)))), Array.from({
    length: emptySlots
  }).map((_, index) => /*#__PURE__*/React.createElement("div", {
    key: `empty-slot-${index}`,
    className: "googlesitekit-site-goals-goal-drivers-section__tile googlesitekit-site-goals-goal-drivers-section__tile--empty",
    "aria-hidden": "true"
  }))), hasExpandableDrivers && !isMobileBreakpoint && /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-site-goals-goal-drivers-section__show-more",
    onClick: onShowMoreClick,
    linkButton: true
  }, isExpanded ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show less', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show more', 'google-site-kit')));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (GoalDriverTiles);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsGoalDriver.tsx"
/*!********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useCustomDimensionsData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useCustomDimensionsData */ "./js/modules/analytics-4/hooks/useCustomDimensionsData.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _TopAuthorsZeroState__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./TopAuthorsZeroState */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsZeroState.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * TopAuthorsGoalDriver 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
 */











const TopAuthorsGoalDriver = ({
  title = '',
  goalType,
  limit,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates(), []);
  const eventNames = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_7__.normalizePrimaryEvents)(primaryEvent), [primaryEvent]);
  const dimensionFilters = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_7__.getDimensionFiltersForEvents)(eventNames, breakdownFilter), [eventNames, breakdownFilter]);
  const candidateReportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (!dates || !eventNames.length) {
      return undefined;
    }
    return {
      ...dates,
      dimensions: ['customEvent:googlesitekit_post_author', 'eventName'],
      dimensionFilters: {
        ...(dimensionFilters || {}),
        'customEvent:googlesitekit_post_author': {
          filterType: 'emptyFilter',
          notExpression: true
        }
      },
      metrics: [{
        name: 'eventCount'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_top-authors_${goalType}`
    };
  }, [dates, dimensionFilters, eventNames, goalType]);
  const totalReportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (!dates || !eventNames.length) {
      return undefined;
    }
    return {
      ...dates,
      dimensionFilters,
      metrics: [{
        name: 'eventCount'
      }],
      reportID: `analytics-4_site-goals_top-authors-total_${goalType}`
    };
  }, [dates, dimensionFilters, eventNames, goalType]);
  const {
    hasCustomDimensions,
    customDimensionsCreationErrors,
    hasAnalyticsEditScope,
    isSyncingAvailableCustomDimensions,
    loading: customDimensionsLoading,
    isGatheringData,
    hasInvalidCustomDimensionError,
    invalidCustomDimensionReportOptions,
    redirectURL
  } = (0,_js_modules_analytics_4_hooks_useCustomDimensionsData__WEBPACK_IMPORTED_MODULE_9__["default"])({
    dimensions: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS,
    reportOptions: candidateReportOptions
  });
  const canLoadReports = hasCustomDimensions === true && isGatheringData !== true;
  const reportOptions = canLoadReports ? candidateReportOptions : undefined;
  const enabledTotalReportOptions = canLoadReports ? totalReportOptions : undefined;
  const allReportOptions = [enabledTotalReportOptions, reportOptions].filter(Boolean);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const totalReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => enabledTotalReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(enabledTotalReportOptions) : undefined, [enabledTotalReportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getFirstReportError(...allReportOptions), [enabledTotalReportOptions, reportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).areReportsLoading(...allReportOptions), [enabledTotalReportOptions, reportOptions]);
  const {
    clearSelectorError,
    createCustomDimensions,
    scheduleSyncAvailableCustomDimensions
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4);
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_FORMS);
  const {
    setPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
  const handleCreateCustomDimensions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    if (customDimensionsLoading) {
      return;
    }
    if (!hasAnalyticsEditScope) {
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.FORM_CUSTOM_DIMENSIONS_CREATE, {
        autoSubmit: true,
        customDimensions: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS
      });
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_11__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Additional permissions are required to create new Analytics custom dimensions', 'google-site-kit'),
        data: {
          status: 403,
          scopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.EDIT_SCOPE],
          skipModal: true,
          redirectURL
        }
      });
      return;
    }
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.FORM_CUSTOM_DIMENSIONS_CREATE, {
      customDimensions: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS
    });
    createCustomDimensions(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS);
  }, [createCustomDimensions, customDimensionsLoading, hasAnalyticsEditScope, redirectURL, setPermissionScopeError, setValues]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!hasInvalidCustomDimensionError || isSyncingAvailableCustomDimensions) {
      return;
    }
    (async () => {
      await Promise.all(invalidCustomDimensionReportOptions.map(options => clearSelectorError('getReport', [options])));
      scheduleSyncAvailableCustomDimensions();
    })();
  }, [clearSelectorError, hasInvalidCustomDimensionError, invalidCustomDimensionReportOptions, isSyncingAvailableCustomDimensions, scheduleSyncAvailableCustomDimensions]);
  const sourceRows = report?.rows || [];
  const totalCount = parseFloat(String(totalReport?.rows?.[0]?.metricValues?.[0]?.value ?? 0));
  const mappedRows = sourceRows.slice(0, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.GOAL_DRIVER_ROW_LIMIT_EXPANDED).map(row => {
    const author = row.dimensionValues?.[0]?.value || '';
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    return {
      label: author || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(not set)', 'google-site-kit'),
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(totalCount > 0 ? eventCount / totalCount : 0, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      })
    };
  });
  const hasMissingCustomDimensions = hasCustomDimensions === false;
  const rows = mappedRows;
  const loading = customDimensionsLoading || reportLoading || isGatheringData === undefined;
  const error = customDimensionsCreationErrors?.[0] ?? reportError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.GOAL_DRIVER_IDS.TOP_AUTHORS, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  const zeroState = hasMissingCustomDimensions || isGatheringData ? /*#__PURE__*/React.createElement(_TopAuthorsZeroState__WEBPACK_IMPORTED_MODULE_12__["default"], {
    hasMissingCustomDimensions: hasMissingCustomDimensions,
    isGatheringData: isGatheringData,
    customDimensionsLoading: customDimensionsLoading,
    onCreateCustomDimensions: handleCreateCustomDimensions
  }) : undefined;
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_5__["default"], {
    title: title,
    rows: rows,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel,
    zeroState: zeroState
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TopAuthorsGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsZeroState.tsx"
/*!*******************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsZeroState.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 _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__);
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * TopAuthorsZeroState 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
 */

const TopAuthorsZeroState = ({
  hasMissingCustomDimensions,
  isGatheringData,
  customDimensionsLoading,
  onCreateCustomDimensions
}) => {
  if (hasMissingCustomDimensions) {
    return /*#__PURE__*/React.createElement("div", {
      className: "googlesitekit-table-tile__custom-dimensions-missing"
    }, /*#__PURE__*/React.createElement("p", {
      className: "googlesitekit-table-tile__custom-dimensions-missing-title"
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to show', 'google-site-kit')), /*#__PURE__*/React.createElement("p", {
      className: "googlesitekit-table-tile__custom-dimensions-missing-description"
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Update Analytics to track metric', 'google-site-kit')), /*#__PURE__*/React.createElement("div", {
      className: "googlesitekit-table-tile__custom-dimensions-missing-actions"
    }, /*#__PURE__*/React.createElement("button", {
      type: "button",
      className: "googlesitekit-table-tile__custom-dimensions-missing-button",
      onClick: onCreateCustomDimensions,
      disabled: customDimensionsLoading
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Update', 'google-site-kit'))));
  }
  if (isGatheringData) {
    return /*#__PURE__*/React.createElement("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Setup successful: Analytics is gathering data for this metric', 'google-site-kit'));
  }
  return null;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TopAuthorsZeroState);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopPagesGoalDriver.tsx"
/*!******************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/TopPagesGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * TopPagesGoalDriver 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
 */








const TopPagesGoalDriver = ({
  title = '',
  goalType,
  limit,
  rows: providedRows,
  loading: providedLoading,
  error: providedError,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const headerLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Events', 'google-site-kit');
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates(), []);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const eventNames = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.normalizePrimaryEvents)(primaryEvent);
    if (!dates || !eventNames.length) {
      return undefined;
    }
    return {
      ...dates,
      dimensions: ['pagePath', 'eventName'],
      dimensionFilters: (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.getDimensionFiltersForEvents)(eventNames, breakdownFilter),
      metrics: [{
        name: 'eventCount'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_top-pages_${goalType}`
    };
  }, [dates, primaryEvent, goalType, breakdownFilter]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => report && reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [report, reportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]) : undefined, [reportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!reportOptions) {
      return false;
    }
    if (!select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions])) {
      return true;
    }
    const sourceRows = report?.rows || [];
    return sourceRows.length > 0 && titles === undefined;
  }, [report, reportOptions, titles]);
  const sourceRows = report?.rows || [];
  const mappedRows = sourceRows.slice(0, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED).map(row => {
    const pagePath = row.dimensionValues?.[0]?.value || '';
    const rawPageTitle = titles?.[pagePath];
    const pageTitle = rawPageTitle ? (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_8__.decodeAmpersand)(rawPageTitle).trim() : undefined;
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    return {
      label: !pageTitle || pageTitle === (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(unknown)', 'google-site-kit') ? pagePath : pageTitle,
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(eventCount),
      pagePath
    };
  });
  const rows = providedRows || mappedRows;
  const loading = providedLoading ?? reportLoading;
  const error = providedError ?? reportError;
  const pagePaths = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => rows.map(row => row.pagePath).filter(Boolean), [rows]);
  const pageURLs = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!pagePaths.length) {
      return {};
    }
    const reportDates = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates();
    if (!reportDates) {
      return {};
    }
    const analytics4Store = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
    return pagePaths.reduce((urlsByPath, pagePath) => {
      urlsByPath[pagePath] = analytics4Store.getServiceReportURL('all-pages-and-screens', {
        filters: {
          unifiedPagePathScreen: pagePath
        },
        dates: reportDates
      });
      return urlsByPath;
    }, {});
  }, [pagePaths]);
  const rowsWithURLs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => rows.map(row => ({
    ...row,
    url: row.pagePath ? pageURLs[row.pagePath] : row.url
  })), [pageURLs, rows]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_IDS.TOP_PAGES, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: title,
    headerLabel: headerLabel,
    rows: rowsWithURLs,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TopPagesGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsGoalDriver.tsx"
/*!****************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * TopTrafficChannelsGoalDriver 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
 */







const TopTrafficChannelsGoalDriver = ({
  title = '',
  goalType,
  limit,
  rows: providedRows,
  loading: providedLoading,
  error: providedError,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates(), []);
  const eventNames = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.normalizePrimaryEvents)(primaryEvent), [primaryEvent]);
  const dimensionFilters = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.getDimensionFiltersForEvents)(eventNames, breakdownFilter), [eventNames, breakdownFilter]);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (!dates || !eventNames.length) {
      return undefined;
    }
    return {
      ...dates,
      dimensions: ['sessionDefaultChannelGroup'],
      dimensionFilters,
      metrics: [{
        name: 'eventCount'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_top-traffic-channels_${goalType}`
    };
  }, [dates, dimensionFilters, eventNames, goalType]);
  const totalReportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (!dates || !eventNames.length) {
      return undefined;
    }
    return {
      ...dates,
      dimensionFilters,
      metrics: [{
        name: 'eventCount'
      }],
      reportID: `analytics-4_site-goals_top-traffic-channels-total_${goalType}`
    };
  }, [dates, dimensionFilters, eventNames, goalType]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const totalReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => totalReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(totalReportOptions) : undefined, [totalReportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions && totalReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getFirstReportError(reportOptions, totalReportOptions) : undefined, [reportOptions, totalReportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions && totalReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).areReportsLoading(reportOptions, totalReportOptions) : false, [reportOptions, totalReportOptions]);
  const sourceRows = report?.rows || [];
  const totalCount = parseFloat(String(totalReport?.rows?.[0]?.metricValues?.[0]?.value ?? 0)) || sourceRows.reduce((total, row) => {
    return total + parseFloat(String(row.metricValues?.[0]?.value ?? 0));
  }, 0);
  const mappedRows = sourceRows.map(row => {
    const channel = row.dimensionValues?.[0]?.value || '-';
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    return {
      label: channel || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(not set)', 'google-site-kit'),
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalCount > 0 ? eventCount / totalCount : 0, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      })
    };
  });
  const rows = providedRows || mappedRows;
  const loading = providedLoading ?? reportLoading;
  const error = providedError ?? reportError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: title,
    rows: rows,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TopTrafficChannelsGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsRateGoalDriver.tsx"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsRateGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * TopTrafficChannelsRateGoalDriver 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
 */







const TopTrafficChannelsRateGoalDriver = ({
  title = '',
  goalType,
  limit,
  rows: providedRows,
  loading: providedLoading,
  error: providedError,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates(), []);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const eventNames = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.normalizePrimaryEvents)(primaryEvent);
    if (!dates || !eventNames.length) {
      return undefined;
    }
    const dimensionFilters = (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.getDimensionFiltersForEvents)(eventNames, breakdownFilter);
    return {
      ...dates,
      dimensions: ['sessionDefaultChannelGroup'],
      dimensionFilters,
      metrics: [{
        name: 'eventCount'
      }, {
        name: 'sessions'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_top-traffic-channels-rate_${goalType}`
    };
  }, [dates, goalType, primaryEvent, breakdownFilter]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]) : undefined, [reportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!reportOptions) {
      return false;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
  }, [reportOptions]);
  const sourceRows = report?.rows || [];
  const mappedRows = sourceRows.map(row => {
    const channel = row.dimensionValues?.[0]?.value || '-';
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    const sessions = parseFloat(String(row.metricValues?.[1]?.value ?? 0));
    const rate = sessions > 0 ? eventCount / sessions : 0;
    return {
      label: channel || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(not set)', 'google-site-kit'),
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      })
    };
  });
  const rows = providedRows || mappedRows;
  const loading = providedLoading ?? reportLoading;
  const error = providedError ?? reportError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS_RATE, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: title,
    rows: rows,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TopTrafficChannelsRateGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/VisitorTypeGoalDriver.tsx"
/*!*********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/VisitorTypeGoalDriver.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TableTile */ "./js/modules/analytics-4/components/site-goals/components/TableTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/utils */ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * VisitorTypeGoalDriver 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
 */







const VISITOR_TYPE_LABELS = {
  new: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New visitors', 'google-site-kit'),
  returning: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Returning visitors', 'google-site-kit')
};
const VisitorTypeGoalDriver = ({
  title = '',
  goalType,
  limit,
  rows: providedRows,
  loading: providedLoading,
  error: providedError,
  primaryEvent,
  breakdownFilter,
  onExpandableRowsChange
}) => {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates(), []);
  const eventNames = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.normalizePrimaryEvents)(primaryEvent), [primaryEvent]);
  const dimensionFilters = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => (0,_js_modules_analytics_4_components_site_goals_goal_drivers_utils__WEBPACK_IMPORTED_MODULE_6__.getDimensionFiltersForEvents)(eventNames, breakdownFilter), [eventNames, breakdownFilter]);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (!dates || !eventNames.length) {
      return undefined;
    }
    return {
      ...dates,
      dimensions: ['newVsReturning'],
      dimensionFilters,
      metrics: [{
        name: 'eventCount'
      }],
      orderby: [{
        metric: {
          metricName: 'eventCount'
        },
        desc: true
      }],
      limit: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_EXPANDED,
      keepEmptyRows: false,
      reportID: `analytics-4_site-goals_visitor-type_${goalType}`
    };
  }, [dates, dimensionFilters, eventNames, goalType]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [reportOptions]);
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => reportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]) : undefined, [reportOptions]);
  const reportLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!reportOptions) {
      return false;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
  }, [reportOptions]);
  const sourceRows = report?.rows || [];
  const totalCount = sourceRows.reduce((total, row) => {
    return total + parseFloat(String(row.metricValues?.[0]?.value ?? 0));
  }, 0);
  const mappedRows = sourceRows.map(row => {
    const visitorType = row.dimensionValues?.[0]?.value || '';
    const visitorTypeKey = visitorType;
    const eventCount = parseFloat(String(row.metricValues?.[0]?.value ?? 0));
    return {
      label: VISITOR_TYPE_LABELS[visitorTypeKey] || visitorType || '-',
      value: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalCount > 0 ? eventCount / totalCount : 0, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      })
    };
  });
  const rows = providedRows || mappedRows;
  const loading = providedLoading ?? reportLoading;
  const error = providedError ?? reportError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    onExpandableRowsChange?.(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_IDS.VISITOR_TYPE, rows.length > _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED);
  }, [onExpandableRowsChange, rows.length]);
  const noDataMetricLabel = goalType === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_5__.GOAL_TYPES.ECOMMERCE ? 'sales' : 'leads';
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TableTile__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: title,
    rows: rows,
    loading: loading,
    error: error,
    limit: limit,
    noDataMetricLabel: noDataMetricLabel
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VisitorTypeGoalDriver);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts"
/*!********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts ***!
  \********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   GOAL_DRIVER_IDS: () => (/* binding */ GOAL_DRIVER_IDS),
/* harmony export */   GOAL_DRIVER_ROW_LIMIT_COLLAPSED: () => (/* binding */ GOAL_DRIVER_ROW_LIMIT_COLLAPSED),
/* harmony export */   GOAL_DRIVER_ROW_LIMIT_EXPANDED: () => (/* binding */ GOAL_DRIVER_ROW_LIMIT_EXPANDED),
/* harmony export */   GOAL_TYPES: () => (/* binding */ GOAL_TYPES),
/* harmony export */   MAX_VISIBLE_GOAL_DRIVERS: () => (/* binding */ MAX_VISIBLE_GOAL_DRIVERS),
/* harmony export */   POST_AUTHOR_CUSTOM_DIMENSION: () => (/* binding */ POST_AUTHOR_CUSTOM_DIMENSION),
/* harmony export */   TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS: () => (/* binding */ TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS)
/* harmony export */ });
/**
 * Site Goals Goal Drivers constants.
 *
 * 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.
 */

const GOAL_DRIVER_ROW_LIMIT_COLLAPSED = 3;
const GOAL_DRIVER_ROW_LIMIT_EXPANDED = 6;
const MAX_VISIBLE_GOAL_DRIVERS = 6;
const GOAL_TYPES = {
  LEAD: 'lead',
  ECOMMERCE: 'ecommerce'
};
const GOAL_DRIVER_IDS = {
  TOP_TRAFFIC_CHANNELS: 'topTrafficChannels',
  TOP_TRAFFIC_CHANNELS_RATE: 'topTrafficChannelsRate',
  TOP_PAGES: 'topPages',
  TOP_AUTHORS: 'topAuthors',
  VISITOR_TYPE: 'visitorType',
  CITIES: 'cities',
  COUNTRIES: 'countries',
  DEVICE_TYPE: 'deviceType'
};
const POST_AUTHOR_CUSTOM_DIMENSION = 'googlesitekit_post_author';
const TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS = [POST_AUTHOR_CUSTOM_DIMENSION];

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/index.ts"
/*!****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/index.ts ***!
  \****************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   CitiesGoalDriver: () => (/* reexport safe */ _CitiesGoalDriver__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   CountriesGoalDriver: () => (/* reexport safe */ _CountriesGoalDriver__WEBPACK_IMPORTED_MODULE_9__["default"]),
/* harmony export */   DeviceTypeGoalDriver: () => (/* reexport safe */ _DeviceTypeGoalDriver__WEBPACK_IMPORTED_MODULE_10__["default"]),
/* harmony export */   GOAL_DRIVER_CATALOG: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_1__.GOAL_DRIVER_CATALOG),
/* harmony export */   GOAL_DRIVER_IDS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.GOAL_DRIVER_IDS),
/* harmony export */   GOAL_DRIVER_ROW_LIMIT_COLLAPSED: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.GOAL_DRIVER_ROW_LIMIT_COLLAPSED),
/* harmony export */   GOAL_DRIVER_ROW_LIMIT_EXPANDED: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.GOAL_DRIVER_ROW_LIMIT_EXPANDED),
/* harmony export */   GOAL_TYPES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.GOAL_TYPES),
/* harmony export */   GoalDriverTiles: () => (/* reexport safe */ _GoalDriverTiles__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   MAX_VISIBLE_GOAL_DRIVERS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.MAX_VISIBLE_GOAL_DRIVERS),
/* harmony export */   POST_AUTHOR_CUSTOM_DIMENSION: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.POST_AUTHOR_CUSTOM_DIMENSION),
/* harmony export */   TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_2__.TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS),
/* harmony export */   TopAuthorsGoalDriver: () => (/* reexport safe */ _TopAuthorsGoalDriver__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   TopPagesGoalDriver: () => (/* reexport safe */ _TopPagesGoalDriver__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   TopTrafficChannelsGoalDriver: () => (/* reexport safe */ _TopTrafficChannelsGoalDriver__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   TopTrafficChannelsRateGoalDriver: () => (/* reexport safe */ _TopTrafficChannelsRateGoalDriver__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   VisitorTypeGoalDriver: () => (/* reexport safe */ _VisitorTypeGoalDriver__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   getGoalDriverContent: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_1__.getGoalDriverContent),
/* harmony export */   getGoalDriverOptions: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_1__.getGoalDriverOptions),
/* harmony export */   getGoalDriverTitle: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_1__.getGoalDriverTitle),
/* harmony export */   getGoalTypeDriverIDs: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_1__.getGoalTypeDriverIDs),
/* harmony export */   resolveGoalDriverIDs: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_1__.resolveGoalDriverIDs),
/* harmony export */   resolveGoalDriverSelectionState: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_1__.resolveGoalDriverSelectionState)
/* harmony export */ });
/* harmony import */ var _GoalDriverTiles__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./GoalDriverTiles */ "./js/modules/analytics-4/components/site-goals/goal-drivers/GoalDriverTiles.tsx");
/* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./registry */ "./js/modules/analytics-4/components/site-goals/goal-drivers/registry.ts");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _TopTrafficChannelsGoalDriver__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./TopTrafficChannelsGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsGoalDriver.tsx");
/* harmony import */ var _TopTrafficChannelsRateGoalDriver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TopTrafficChannelsRateGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsRateGoalDriver.tsx");
/* harmony import */ var _TopPagesGoalDriver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TopPagesGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopPagesGoalDriver.tsx");
/* harmony import */ var _TopAuthorsGoalDriver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TopAuthorsGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsGoalDriver.tsx");
/* harmony import */ var _VisitorTypeGoalDriver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./VisitorTypeGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/VisitorTypeGoalDriver.tsx");
/* harmony import */ var _CitiesGoalDriver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./CitiesGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/CitiesGoalDriver.tsx");
/* harmony import */ var _CountriesGoalDriver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CountriesGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/CountriesGoalDriver.tsx");
/* harmony import */ var _DeviceTypeGoalDriver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./DeviceTypeGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/DeviceTypeGoalDriver.tsx");
/**
 * Site Goals Goal Drivers exports.
 *
 * 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/modules/analytics-4/components/site-goals/goal-drivers/registry.ts"
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/registry.ts ***!
  \*******************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   GOAL_DRIVER_CATALOG: () => (/* binding */ GOAL_DRIVER_CATALOG),
/* harmony export */   getGoalDriverContent: () => (/* binding */ getGoalDriverContent),
/* harmony export */   getGoalDriverOptions: () => (/* binding */ getGoalDriverOptions),
/* harmony export */   getGoalDriverTitle: () => (/* binding */ getGoalDriverTitle),
/* harmony export */   getGoalTypeDriverIDs: () => (/* binding */ getGoalTypeDriverIDs),
/* harmony export */   resolveGoalDriverIDs: () => (/* binding */ resolveGoalDriverIDs),
/* harmony export */   resolveGoalDriverSelectionState: () => (/* binding */ resolveGoalDriverSelectionState)
/* 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_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_CitiesGoalDriver__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/CitiesGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/CitiesGoalDriver.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_CountriesGoalDriver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/CountriesGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/CountriesGoalDriver.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_DeviceTypeGoalDriver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/DeviceTypeGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/DeviceTypeGoalDriver.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_TopAuthorsGoalDriver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopAuthorsGoalDriver.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_TopPagesGoalDriver__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/TopPagesGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopPagesGoalDriver.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_TopTrafficChannelsGoalDriver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsGoalDriver.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_TopTrafficChannelsRateGoalDriver__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsRateGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/TopTrafficChannelsRateGoalDriver.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_VisitorTypeGoalDriver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/VisitorTypeGoalDriver */ "./js/modules/analytics-4/components/site-goals/goal-drivers/VisitorTypeGoalDriver.tsx");
/**
 * Site Goals Goal Drivers registry.
 *
 * 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 GOAL_DRIVER_CATALOG = {
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS,
    order: 10,
    defaultEnabled: true,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic channels by total sales', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Where do most of your buyers come from?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic channels by total form completions', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Where do most of your leads come from?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_TopTrafficChannelsGoalDriver__WEBPACK_IMPORTED_MODULE_8__["default"]
  },
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS_RATE]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_TRAFFIC_CHANNELS_RATE,
    order: 10,
    defaultEnabled: true,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic channels by sales rate', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which channels have the highest percentage of buyers?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top traffic channels by form completion rate', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which channels are most efficient at capturing leads?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_TopTrafficChannelsRateGoalDriver__WEBPACK_IMPORTED_MODULE_9__["default"]
  },
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_PAGES]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_PAGES,
    order: 10,
    defaultEnabled: false,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top pages driving sales', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which pages bring in the most sales?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top pages driving leads', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which pages get people to take action?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_TopPagesGoalDriver__WEBPACK_IMPORTED_MODULE_7__["default"]
  },
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_AUTHORS]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.TOP_AUTHORS,
    order: 10,
    defaultEnabled: false,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top authors driving sales', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Whose content is best at converting buyers?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top authors driving leads', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Whose content is best at converting readers?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_TopAuthorsGoalDriver__WEBPACK_IMPORTED_MODULE_6__["default"],
    requiredCustomDimensions: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.TOP_AUTHORS_REQUIRED_CUSTOM_DIMENSIONS
  },
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.VISITOR_TYPE]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.VISITOR_TYPE,
    order: 10,
    defaultEnabled: true,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sales by visitor type', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which types of visitors are most likely to buy?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Leads by visitor type', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which types of visitors are most likely to reach out?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_VisitorTypeGoalDriver__WEBPACK_IMPORTED_MODULE_10__["default"]
  },
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.CITIES]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.CITIES,
    order: 10,
    defaultEnabled: false,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sales by cities', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which cities bring in the most buyers?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Leads by cities', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which cities are people reaching out from?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_CitiesGoalDriver__WEBPACK_IMPORTED_MODULE_2__["default"]
  },
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.COUNTRIES]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.COUNTRIES,
    order: 10,
    defaultEnabled: false,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sales by countries', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which countries bring in the most buyers?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Leads by countries', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Which countries are people reaching out from?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_CountriesGoalDriver__WEBPACK_IMPORTED_MODULE_4__["default"]
  },
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.DEVICE_TYPE]: {
    id: _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_DRIVER_IDS.DEVICE_TYPE,
    order: 10,
    defaultEnabled: false,
    copyByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sales by device type', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Are people buying more on mobile or desktop?', 'google-site-kit')
      },
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Leads by device type', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('What devices do people use when they take action?', 'google-site-kit')
      }
    },
    Component: _js_modules_analytics_4_components_site_goals_goal_drivers_DeviceTypeGoalDriver__WEBPACK_IMPORTED_MODULE_5__["default"]
  }
};
const GOAL_DRIVER_ID_SET = new Set(Object.keys(GOAL_DRIVER_CATALOG));
function isGoalDriverID(id) {
  return GOAL_DRIVER_ID_SET.has(id);
}
function getGoalDriverContent(goalType, driverID) {
  return GOAL_DRIVER_CATALOG[driverID].copyByGoalType[goalType];
}
function getGoalTypeDriverIDs(goalType) {
  return Object.values(GOAL_DRIVER_CATALOG).filter(goalDriver => Boolean(goalDriver.copyByGoalType[goalType])).sort((currentGoalDriver, nextGoalDriver) => currentGoalDriver.order - nextGoalDriver.order).map(goalDriver => goalDriver.id);
}
function getGoalDriverEntriesForType(goalType) {
  return Object.values(GOAL_DRIVER_CATALOG).filter(goalDriver => Boolean(goalDriver.copyByGoalType[goalType])).sort((currentGoalDriver, nextGoalDriver) => currentGoalDriver.order - nextGoalDriver.order);
}
function getDefaultGoalDriverIDs(goalType) {
  const defaultDriverIDs = Object.values(GOAL_DRIVER_CATALOG).filter(goalDriver => goalDriver.defaultEnabled).sort((currentGoalDriver, nextGoalDriver) => currentGoalDriver.order - nextGoalDriver.order).map(goalDriver => goalDriver.id).slice(0, _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__.SITE_GOALS_MAX_SELECTED_DRIVERS);
  if (defaultDriverIDs.length) {
    return defaultDriverIDs;
  }
  return resolveGoalDriverIDs(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__.SITE_GOALS_DEFAULT_SELECTED_DRIVERS[goalType], goalType);
}
function getGoalDriverOptions(goalType) {
  return getGoalDriverEntriesForType(goalType).map(goalDriver => {
    const content = getGoalDriverContent(goalType, goalDriver.id);
    if (!content) {
      return null;
    }
    const option = {
      id: goalDriver.id,
      order: goalDriver.order,
      title: content.title,
      description: content.description
    };
    if (goalDriver.requiredCustomDimensions) {
      option.requiredCustomDimensions = goalDriver.requiredCustomDimensions;
    }
    return option;
  }).filter(goalDriverOption => Boolean(goalDriverOption));
}
function getGoalDriverTitle(goalType, driverID) {
  return getGoalDriverContent(goalType, driverID)?.title;
}
function resolveGoalDriverIDs(selectedDriverIDs = undefined, goalType = _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE) {
  if (selectedDriverIDs === undefined) {
    return getDefaultGoalDriverIDs(goalType);
  }
  if (!selectedDriverIDs.length) {
    return [];
  }
  const validSelectedIDs = [];
  selectedDriverIDs.forEach(selectedDriverID => {
    if (typeof selectedDriverID === 'string' && isGoalDriverID(selectedDriverID) && !validSelectedIDs.includes(selectedDriverID)) {
      validSelectedIDs.push(selectedDriverID);
    }
  });
  return validSelectedIDs.slice(0, _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__.SITE_GOALS_MAX_SELECTED_DRIVERS);
}
function resolveGoalDriverSelectionState(selectedDrivers) {
  const selectionState = selectedDrivers || _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__.SITE_GOALS_DEFAULT_SELECTED_DRIVERS;
  const ecommerceSelection = selectionState?.[_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE];
  const leadSelection = selectionState?.[_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD];
  return {
    [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE]: ecommerceSelection !== undefined ? resolveGoalDriverIDs(ecommerceSelection, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE) : resolveGoalDriverIDs(undefined, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.ECOMMERCE),
    [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD]: leadSelection !== undefined ? resolveGoalDriverIDs(leadSelection, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD) : resolveGoalDriverIDs(undefined, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_3__.GOAL_TYPES.LEAD)
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts"
/*!****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/goal-drivers/utils.ts ***!
  \****************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getDimensionFiltersForEvents: () => (/* binding */ getDimensionFiltersForEvents),
/* harmony export */   normalizePrimaryEvents: () => (/* binding */ normalizePrimaryEvents)
/* harmony export */ });
/**
 * Site Goals Goal Drivers utility functions.
 *
 * 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.
 */

function normalizePrimaryEvents(primaryEvent) {
  const primaryEvents = Array.isArray(primaryEvent) ? primaryEvent : [primaryEvent];
  return Array.from(new Set(primaryEvents.filter(event => Boolean(event))));
}
function getDimensionFiltersForEvents(eventNames, breakdownFilter) {
  if (!eventNames.length) {
    return undefined;
  }
  return {
    eventName: {
      filterType: 'inListFilter',
      value: eventNames
    },
    ...breakdownFilter
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsBreakdown.tsx"
/*!**************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsBreakdown.tsx ***!
  \**************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useSiteGoalsBreakdown: () => (/* binding */ useSiteGoalsBreakdown)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* 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.ts");
/**
 * Site Goals breakdown 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.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



/**
 * Resolves the breakdown tab state for a Site Goals widget.
 *
 * @since 1.182.0
 *
 * @param {string} goalType                      The goal type whose breakdown dimension to resolve.
 * @param {Object} [options]                     Discovery, detection and allowlist options.
 * @param {Array}  [options.eventNames]          Events to scope the discovered values to.
 * @param {Array}  [options.detectionEventNames] Events used to detect "Other sources" data; defaults to `eventNames`.
 * @param {Array}  [options.supportedValues]     Allowlist of values that get a tab; any other value is excluded.
 * @return {Object} The breakdown state.
 */
function useSiteGoalsBreakdown(goalType, {
  eventNames = [],
  detectionEventNames = eventNames,
  supportedValues
} = {}) {
  const breakdownDimension = _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_2__.SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE[goalType];

  // The tab structure (the values below and `hasUnattributedEvents`) is
  // evaluated over a fixed 90-day discovery window in the datastore, so it is
  // stable for the session — changing the dashboard date range never adds or
  // removes tabs, only the metrics follow the selected range.
  const breakdownValues = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => {
    const values = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getBreakdownValues(breakdownDimension, eventNames);

    // Restrict the tabs to the allowlist so values that aren't supported
    // (e.g. an unrelated plugin sharing the provider dimension) surface in
    // "Other sources" instead of as their own tab.
    if (!values || !supportedValues) {
      return values;
    }
    return values.filter(value => supportedValues.includes(value));
  }, [breakdownDimension, eventNames, supportedValues]);
  const hasOtherSources = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).hasUnattributedEvents(breakdownDimension, detectionEventNames, breakdownValues ?? []), [breakdownDimension, detectionEventNames, breakdownValues]) ?? false;

  // The displayed Other sources count follows the selected date range; only
  // queried once the tab exists.
  const otherSourceCounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => hasOtherSources ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).getUnattributedEventCounts(breakdownDimension, detectionEventNames, breakdownValues ?? []) : undefined, [breakdownDimension, detectionEventNames, breakdownValues, hasOtherSources]);
  const otherSourcesCount = otherSourceCounts?.currentCount ?? 0;
  const otherSourcesPreviousCount = otherSourceCounts?.previousCount ?? 0;
  const hasBreakdownTabs = !!breakdownValues?.length;
  const [selectedTab, setSelectedTab] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
  const activeTabID = selectedTab ?? breakdownValues?.[0] ?? '';
  const isOtherSourcesTab = activeTabID === _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_2__.SITE_GOALS_BREAKDOWN_OTHER_SOURCES_TAB_ID;

  // Scopes every section report to the selected value tab. The "Other sources"
  // tab has no server-side filter (its single metric comes from the
  // unattributed counts above), so no filter is produced for it.
  const breakdownFilter = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    if (!hasBreakdownTabs || isOtherSourcesTab) {
      return undefined;
    }
    return {
      [`customEvent:${breakdownDimension}`]: activeTabID
    };
  }, [hasBreakdownTabs, isOtherSourcesTab, activeTabID, breakdownDimension]);
  return {
    breakdownDimension,
    breakdownValues,
    hasBreakdownTabs,
    activeTabID,
    setSelectedTab,
    isOtherSourcesTab,
    hasOtherSources,
    otherSourcesCount,
    otherSourcesPreviousCount,
    breakdownFilter
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsWidgetViewAction.tsx"
/*!*********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsWidgetViewAction.tsx ***!
  \*********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useSiteGoalsWidgetViewAction: () => (/* binding */ useSiteGoalsWidgetViewAction)
/* 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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * Site Goals widget view-action 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
 */


/**
 * Resolves the Site Goals widget's current breakdown display state to a
 * single GA4 view action.
 *
 * The widget's header/tabs area is always in exactly one of four mutually
 * exclusive states, matching what is actually rendered: the "aggregated"
 * default (no breakdown dimension, or no discovered breakdown values yet),
 * the "Gathering breakdown data" badge, the tabbed breakdown with a "Partial
 * data" badge, or the tabbed breakdown with the full selected date range
 * covered.
 *
 * @since 1.183.0
 *
 * @param {Object}  options                    Hook options.
 * @param {string}  options.breakdownDimension The breakdown custom dimension slug for this goal type.
 * @param {boolean} options.hasBreakdownTabs   Whether the widget is currently showing breakdown tabs.
 * @return {(SiteGoalsWidgetViewAction|undefined)} The resolved view action, or `undefined` while resolving.
 */
function useSiteGoalsWidgetViewAction({
  breakdownDimension,
  hasBreakdownTabs
}) {
  const hasBreakdownDimension = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).hasCustomDimensions(breakdownDimension), [breakdownDimension]);
  const isGatheringData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => hasBreakdownDimension ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).areCustomDimensionsGatheringData([breakdownDimension]) : undefined, [hasBreakdownDimension, breakdownDimension]);
  const isPartialData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => hasBreakdownTabs ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4).isCustomDimensionPartialData(breakdownDimension) : undefined, [hasBreakdownTabs, breakdownDimension]);
  if (hasBreakdownDimension === undefined) {
    return undefined;
  }

  // No breakdown dimension (feature not enabled yet) — the original
  // aggregated default.
  if (!hasBreakdownDimension) {
    return 'view_widget';
  }
  if (isGatheringData === undefined) {
    return undefined;
  }
  if (isGatheringData) {
    return 'view_widget_gathering_data';
  }

  // Dimension exists and isn't gathering, but no breakdown values have been
  // discovered yet, so no tabs render — falls back to the aggregated state.
  if (!hasBreakdownTabs) {
    return 'view_widget';
  }
  if (isPartialData === undefined) {
    return undefined;
  }
  return isPartialData ? 'view_widget_partial_data' : 'view_widget_breakdown';
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownErrorNotice.tsx"
/*!*********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/BreakdownErrorNotice.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_util_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals breakdown error notice.
 *
 * 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 BreakdownErrorNotice = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({
  error,
  permissionsTitle,
  onRetry,
  onDismiss,
  ctaInProgress,
  className
}, ref) => {
  const troubleshootingURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getErrorTroubleshootingLinkURL(error), [error]);
  const isPermissionsError = (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_8__.isInsufficientPermissionsError)(error);
  const title = isPermissionsError ? permissionsTitle : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Analytics update failed', 'google-site-kit');
  const message = isPermissionsError ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('We were unable to configure your Google Analytics account settings due to insufficient permissions. To fix this, you can contact your administrator or <a>get help</a>.', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('There was a problem updating your Analytics property. <a>Learn more</a>', 'google-site-kit');
  return /*#__PURE__*/React.createElement(_js_components_Notice__WEBPACK_IMPORTED_MODULE_5__["default"], {
    ref: ref,
    className: className,
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.NOTICE_TYPES.ERROR,
    title: title,
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])(message, {
      a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: troubleshootingURL,
        external: true
      })
    }),
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Retry', 'google-site-kit'),
      onClick: onRetry,
      inProgress: ctaInProgress,
      // The retry is already underway, so block a second click.
      disabled: ctaInProgress
    },
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it', 'google-site-kit'),
      onClick: onDismiss
    }
  });
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BreakdownErrorNotice);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownNotice.tsx"
/*!****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/BreakdownNotice.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_Notice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals breakdown notice.
 *
 * 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
 */





const BreakdownNotice = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({
  title,
  description,
  ctaLabel,
  onCTAClick,
  className,
  ctaInProgress,
  ctaDisabled,
  onDismissComplete
}, ref) => {
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER);
  async function handleDismiss() {
    // Wait for the dismissal to persist (which hides the notice) before
    // triggering the tooltip, so they don't briefly overlap.
    await dismissItem(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_6__.SITE_GOALS_BREAKDOWN_NOTICE);
    onDismissComplete?.();
  }
  return /*#__PURE__*/React.createElement(_js_components_Notice__WEBPACK_IMPORTED_MODULE_3__["default"], {
    ref: ref,
    className: className,
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.NEW,
    title: title,
    description: description,
    ctaButton: {
      label: ctaLabel,
      onClick: onCTAClick,
      inProgress: ctaInProgress,
      disabled: ctaDisabled
    },
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No thanks', 'google-site-kit'),
      onClick: handleDismiss
    }
  });
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BreakdownNotice);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownNoticeArea.tsx"
/*!********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/BreakdownNoticeArea.tsx ***!
  \********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AVAILABILITY_SYNC_CACHE_KEY: () => (/* binding */ AVAILABILITY_SYNC_CACHE_KEY),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_BreakdownErrorNotice__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/BreakdownErrorNotice */ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownErrorNotice.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_BreakdownNotice__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/BreakdownNotice */ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownNotice.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_BreakdownSuccessNotice__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/BreakdownSuccessNotice */ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownSuccessNotice.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_IntroModalBanner__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner */ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/index.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_useBreakdownNoticeTooltip__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/useBreakdownNoticeTooltip */ "./js/modules/analytics-4/components/site-goals/notifications/useBreakdownNoticeTooltip.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_useSiteGoalsBreakdownNoticeCopy__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownNoticeCopy */ "./js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownNoticeCopy.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_useSiteGoalsBreakdownResultCopy__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownResultCopy */ "./js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownResultCopy.tsx");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useBreakdownEnableHandler__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useBreakdownEnableHandler */ "./js/modules/analytics-4/hooks/useBreakdownEnableHandler.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * Site Goals breakdown notice area (orchestrator).
 *
 * 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
 */





















const AVAILABILITY_SYNC_CACHE_KEY = 'analytics4_site-goals_breakdown_availability-synced';

// `view_notification` should only fire once a notice is actually scrolled
// into view, so each variant is wrapped to receive an `onInView` prop.
const BreakdownNoticeWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_22__["default"])(_js_modules_analytics_4_components_site_goals_notifications_BreakdownNotice__WEBPACK_IMPORTED_MODULE_12__["default"]);
const BreakdownErrorNoticeWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_22__["default"])(_js_modules_analytics_4_components_site_goals_notifications_BreakdownErrorNotice__WEBPACK_IMPORTED_MODULE_11__["default"]);
const BreakdownSuccessNoticeWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_22__["default"])(_js_modules_analytics_4_components_site_goals_notifications_BreakdownSuccessNotice__WEBPACK_IMPORTED_MODULE_13__["default"]);
function deriveBreakdownScope(goalTypes) {
  const hasEcommerce = goalTypes.includes(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.ECOMMERCE);
  const hasLead = goalTypes.includes(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.LEAD);
  if (hasEcommerce && hasLead) {
    return _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_SCOPE_BOTH;
  }
  return hasEcommerce ? _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.ECOMMERCE : _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.LEAD;
}
function getBreakdownDimensionState(args) {
  const {
    goalTypes,
    presenceByGoalType
  } = args;
  const dimensionsResolving = goalTypes.some(goalType => presenceByGoalType[goalType] === undefined);
  const missingGoalTypes = goalTypes.filter(goalType => presenceByGoalType[goalType] === false);
  return {
    hasBreakdownDimensions: dimensionsResolving ? undefined : missingGoalTypes.length === 0,
    // Derived from what is still missing; once nothing is missing it falls
    // back to the full set (then only used for the handler, never rendered).
    missingScope: deriveBreakdownScope(missingGoalTypes.length ? missingGoalTypes : goalTypes)
  };
}
function isBreakdownClickedInstance(args) {
  const {
    breakdownOrigin,
    origin,
    breakdownScope,
    goalTypes
  } = args;
  if (breakdownOrigin !== origin) {
    return false;
  }

  // The Side Panel renders a single combined notice, so an origin match alone
  // identifies it. The widgets render one notice per goal type, so they also
  // match on scope to keep the two apart.
  return goalTypes.length > 1 || breakdownScope === goalTypes[0];
}
function resolveBreakdownNoticeState(args) {
  const {
    hasBreakdownDimensions,
    isIntroModalDismissed,
    isNoticeDismissed,
    creationError,
    isBusy,
    isDismissed,
    isClickedInstance,
    attempted
  } = args;

  // Error: render at every section whose own dimension is still missing after
  // an attempt — in both the widget and the Side Panel.
  if (creationError && attempted && hasBreakdownDimensions === false && !isDismissed) {
    return 'error';
  }

  // Loading: only at the clicked instance. `isBusy` spans the whole enable
  // action — the click, the OAuth redirect and the dimension creation — so the
  // notice persists throughout.
  if (isBusy && isClickedInstance) {
    return 'loading';
  }

  // Success: a single notice at the clicked instance, once its dimension
  // actually exists (so a failed creation never shows success).
  if (hasBreakdownDimensions && isClickedInstance && !isDismissed) {
    return 'success';
  }

  // "New": while this section's dimension is still missing, the intro modal has
  // been dismissed and the notice has not been dismissed (persisted "No
  // thanks"). It is suppressed once an enable was attempted this session, so a
  // section being created does not flash "New" while availability settles.
  if (hasBreakdownDimensions === false && isIntroModalDismissed && !isNoticeDismissed && !attempted) {
    return 'new';
  }
  return null;
}
/**
 * Resolves the notice state, gating on the view-only and still-resolving cases.
 *
 * @since 1.182.0
 *
 * @param {Object} args Resolver arguments, see `ComputeNoticeStateArgs`.
 * @return {?string} The resolved notice state, or `null` while gated or when no notice applies.
 */
function computeNoticeState(args) {
  const {
    isViewOnly,
    hasBreakdownDimensions,
    isIntroModalDismissed,
    isNoticeDismissed,
    ...rest
  } = args;

  // Avoid a flash while any of the gating selectors are still resolving.
  if (isViewOnly || hasBreakdownDimensions === undefined || isIntroModalDismissed === undefined || isNoticeDismissed === undefined) {
    return null;
  }
  return resolveBreakdownNoticeState({
    hasBreakdownDimensions,
    isIntroModalDismissed,
    isNoticeDismissed,
    ...rest
  });
}
/**
 * Tracks the breakdown notice area's view/confirm/dismiss events.
 *
 * Kept outside the main component to keep its cyclomatic complexity within
 * the project's lint threshold.
 *
 * @since 1.182.0
 *
 * @param {Object}   args                        Hook arguments.
 * @param {string}   args.origin                 Notice origin, either the widget or the Side Panel.
 * @param {Array}    args.goalTypes              Goal types the notice area covers.
 * @param {*}        args.creationError          Custom dimension creation error, if any.
 * @param {Function} args.handleEnable           Triggers the breakdown "enable" action.
 * @param {Function} args.onDismissComplete      Called once the "New" notice's dismissal is persisted.
 * @param {Function} args.dismissBreakdownResult Persists dismissal of the success/error notice.
 * @return {Object} The tracked event handlers for the notice variants.
 */
function useBreakdownNoticeTracking({
  origin,
  goalTypes,
  creationError,
  handleEnable,
  onDismissComplete,
  dismissBreakdownResult
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();

  // `widget_ecommerce` | `widget_lead` | `side_panel`: the widgets render one
  // notice per goal type, while the Side Panel renders a single combined one.
  const noticeLabel = origin === _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_ORIGIN_WIDGET ? `widget_${goalTypes[0]}` : 'side_panel';
  const errorLabel = creationError && (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_21__.isInsufficientPermissionsError)(creationError) ? 'insufficient_permissions' : 'setup_error';

  // `view_notification` should fire only once the notice is actually scrolled
  // into view, not as soon as it mounts, AND only once per page load overall.
  // The `withIntersectionObserver`-wrapped notice's `onInView` only guards the
  // "once per *mounted instance*" case — the wrapping widget can legitimately
  // remount this notice while the page stays open (e.g. its data briefly
  // re-resolves to a loading/error/null branch and back), which would reset
  // that per-instance guard. `trackEventOnce` dedupes at the module level, so
  // it stays correct across any such remount.
  const handleNewNoticeView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEventOnce)(`${viewContext}_site-goals-breakdown-notice`, 'view_notification', noticeLabel);
  }, [viewContext, noticeLabel]);
  const handleSuccessView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEventOnce)(`${viewContext}_site-goals-breakdown-success-notice`, 'view_notification');
  }, [viewContext]);
  const handleErrorView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEventOnce)(`${viewContext}_site-goals-breakdown-error-notice`, 'view_notification', errorLabel);
  }, [viewContext, errorLabel]);
  const handleNewNoticeConfirm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEvent)(`${viewContext}_site-goals-breakdown-notice`, 'confirm_notification', noticeLabel);
    handleEnable();
  }, [viewContext, noticeLabel, handleEnable]);
  const handleNewNoticeDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEvent)(`${viewContext}_site-goals-breakdown-notice`, 'dismiss_notification', noticeLabel);
    onDismissComplete();
  }, [viewContext, noticeLabel, onDismissComplete]);
  const handleSuccessDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEvent)(`${viewContext}_site-goals-breakdown-success-notice`, 'dismiss_notification');
    dismissBreakdownResult();
  }, [viewContext, dismissBreakdownResult]);
  const handleErrorRetry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEvent)(`${viewContext}_site-goals-breakdown-error-notice`, 'confirm_notification', errorLabel);
    handleEnable();
  }, [viewContext, errorLabel, handleEnable]);
  const handleErrorDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_20__.trackEvent)(`${viewContext}_site-goals-breakdown-error-notice`, 'dismiss_notification', errorLabel);
    dismissBreakdownResult();
  }, [viewContext, errorLabel, dismissBreakdownResult]);
  return {
    handleNewNoticeView,
    handleSuccessView,
    handleErrorView,
    handleNewNoticeConfirm,
    handleNewNoticeDismiss,
    handleSuccessDismiss,
    handleErrorRetry,
    handleErrorDismiss
  };
}
const BreakdownNoticeArea = ({
  origin,
  goalTypes
}) => {
  // Trigger the resolver so the dimension checks run against synced data.
  (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).getAvailableCustomDimensions(), []);
  const hasEcommerceDimension = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).hasCustomDimensions(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE[_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.ECOMMERCE]), []);
  const hasLeadDimension = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).hasCustomDimensions(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE[_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.LEAD]), []);
  const {
    hasBreakdownDimensions,
    missingScope
  } = getBreakdownDimensionState({
    goalTypes,
    presenceByGoalType: {
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.ECOMMERCE]: hasEcommerceDimension,
      [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.LEAD]: hasLeadDimension
    }
  });
  const {
    onEnable,
    inProgress,
    disabled
  } = (0,_js_modules_analytics_4_hooks_useBreakdownEnableHandler__WEBPACK_IMPORTED_MODULE_19__.useBreakdownEnableHandler)(origin, missingScope);

  // Keep the notice in its loading state from the moment the CTA is clicked,
  // covering the window before the OAuth redirect starts (when neither
  // `inProgress` nor `disabled` is true yet). Cleared once a real busy signal
  // takes over, and reset on reload.
  const [isEnabling, setIsEnabling] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const handleEnable = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    setIsEnabling(true);
    try {
      const completedLocally = await onEnable();
      // Clear once the enable settles locally — covers early-return paths (e.g.
      // dimensions already exist) where neither `inProgress` nor `disabled`
      // toggles. On the OAuth path the redirect holds busy state, so let
      // `disabled`/reload clear `isEnabling`.
      if (completedLocally) {
        setIsEnabling(false);
      }
    } catch {
      // An unexpected failure means no OAuth redirect took over, so don't
      // leave the CTA spinning.
      setIsEnabling(false);
    }
  }, [onEnable]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    // Clears while the action is still underway on the create and
    // OAuth-redirect paths, where `inProgress`/`disabled` carry the busy
    // state after this resets.
    if (isEnabling && (inProgress || disabled)) {
      setIsEnabling(false);
    }
  }, [isEnabling, inProgress, disabled]);
  const isBusy = inProgress || disabled || isEnabling;

  // On "No thanks", the widget shows the settings tooltip immediately while the
  // Side Panel defers it until the panel overlay closes (read on close in the
  // panel's `closePanel`). Both hooks always run; origin picks the behavior.
  const showBreakdownTooltip = (0,_js_modules_analytics_4_components_site_goals_notifications_useBreakdownNoticeTooltip__WEBPACK_IMPORTED_MODULE_15__.useBreakdownNoticeTooltip)();
  const {
    setSiteGoalsBreakdownTooltipPending,
    scheduleSyncAvailableCustomDimensions
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4);
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_FORMS);
  const canSyncCustomDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isAuthenticated() && select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.PERMISSION_MANAGE_OPTIONS), []);

  // The synced `availableCustomDimensions` setting is only refreshed via report
  // errors, and no report yet queries the breakdown dimensions. Sync it (at
  // most once a day) so an out-of-band GA4 change to them is detected.
  //
  // TODO: Scope down once #12803 lands — its breakdown reports query these
  // dimensions while a breakdown is enabled, so the report-error sync then
  // covers that case and this can be limited to the not-yet-enabled one.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    let ignore = false;
    if (canSyncCustomDimensions) {
      (async () => {
        const {
          cacheHit
        } = await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.getItem)(AVAILABILITY_SYNC_CACHE_KEY);
        if (ignore || cacheHit) {
          return;
        }
        await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.setItem)(AVAILABILITY_SYNC_CACHE_KEY, true, {
          ttl: _js_util__WEBPACK_IMPORTED_MODULE_20__.DAY_IN_SECONDS
        });
        scheduleSyncAvailableCustomDimensions();
      })();
    }
    return () => {
      ignore = true;
    };
  }, [canSyncCustomDimensions, scheduleSyncAvailableCustomDimensions]);
  const onDismissComplete = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (origin === _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_ORIGIN_WIDGET) {
      showBreakdownTooltip();
    } else {
      setSiteGoalsBreakdownTooltipPending(true);
    }
  }, [origin, showBreakdownTooltip, setSiteGoalsBreakdownTooltipPending]);
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const creationError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    for (const customDimension of _js_modules_analytics_4_hooks_useBreakdownEnableHandler__WEBPACK_IMPORTED_MODULE_19__.ALL_CUSTOM_DIMENSIONS) {
      const error = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).getCreateCustomDimensionError(customDimension);
      if (error) {
        return error;
      }
    }

    // Also surface a failure to load the property's custom dimensions (e.g.
    // the user lacks permission on the GA4 property), which aborts creation
    // before any create error is recorded and otherwise leaves the notice
    // stuck loading.
    const propertyID = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).getPropertyID();
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).getCustomDimensionsError(propertyID);
  }, []);
  const isIntroModalDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isItemDismissed(_js_modules_analytics_4_components_site_goals_notifications_IntroModalBanner__WEBPACK_IMPORTED_MODULE_14__.SITE_GOALS_INTRO_MODAL_BANNER), []);
  const isNoticeDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isItemDismissed(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.SITE_GOALS_BREAKDOWN_NOTICE), []);
  const [breakdownOrigin] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.FORM_CUSTOM_DIMENSIONS_CREATE, _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_ORIGIN_FORM_KEY);
  const [breakdownScope] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.FORM_CUSTOM_DIMENSIONS_CREATE, _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_SCOPE_FORM_KEY);
  const [isDismissed] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.FORM_CUSTOM_DIMENSIONS_CREATE, _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_DISMISSED_FORM_KEY);
  const isClickedInstance = isBreakdownClickedInstance({
    breakdownOrigin,
    origin,
    breakdownScope,
    goalTypes
  });

  // "New"/loading copy follows what is still missing (`missingScope`); the
  // success/error copy follows the scope that was enabled at this instance.
  const noticeCopy = (0,_js_modules_analytics_4_components_site_goals_notifications_useSiteGoalsBreakdownNoticeCopy__WEBPACK_IMPORTED_MODULE_16__.useSiteGoalsBreakdownNoticeCopy)(missingScope);
  const {
    successTitle,
    successDescription,
    permissionsErrorTitle
  } = (0,_js_modules_analytics_4_components_site_goals_notifications_useSiteGoalsBreakdownResultCopy__WEBPACK_IMPORTED_MODULE_17__.useSiteGoalsBreakdownResultCopy)(isClickedInstance && breakdownScope ? breakdownScope : missingScope);
  const className = origin === _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_ORIGIN_WIDGET ? 'googlesitekit-site-goals-breakdown-notice' : 'googlesitekit-site-goals-selection-panel__breakdown-notice';

  // Dismiss the in-session success/error notice and drop the shared
  // `customDimensions` list so unrelated auto-create flows don't inherit it.
  const dismissBreakdownResult = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    return setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.FORM_CUSTOM_DIMENSIONS_CREATE, {
      [_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_DISMISSED_FORM_KEY]: true,
      customDimensions: []
    });
  }, [setValues]);

  // Suppresses "New" once an enable was attempted this session (any scope set).
  const attempted = Boolean(breakdownScope);
  const noticeState = computeNoticeState({
    isViewOnly,
    hasBreakdownDimensions,
    isIntroModalDismissed,
    isNoticeDismissed,
    creationError,
    isBusy,
    isDismissed: Boolean(isDismissed),
    isClickedInstance,
    attempted
  });
  const {
    handleNewNoticeView,
    handleSuccessView,
    handleErrorView,
    handleNewNoticeConfirm,
    handleNewNoticeDismiss,
    handleSuccessDismiss,
    handleErrorRetry,
    handleErrorDismiss
  } = useBreakdownNoticeTracking({
    origin,
    goalTypes,
    creationError,
    handleEnable,
    onDismissComplete,
    dismissBreakdownResult
  });
  if (noticeState === 'error') {
    return /*#__PURE__*/React.createElement(BreakdownErrorNoticeWithIntersectionObserver, {
      className: className,
      error: creationError,
      permissionsTitle: permissionsErrorTitle,
      onRetry: handleErrorRetry,
      onDismiss: handleErrorDismiss
      // The error state outranks the loading one, so a retry keeps this
      // notice rendered. Reflect the enable flow's busy state on the CTA
      // so the retry visibly progresses instead of appearing to do
      // nothing.
      ,
      ctaInProgress: isBusy,
      onInView: handleErrorView
    });
  }
  if (noticeState === 'success') {
    return /*#__PURE__*/React.createElement(BreakdownSuccessNoticeWithIntersectionObserver, {
      className: className,
      title: successTitle,
      description: successDescription,
      onDismiss: handleSuccessDismiss,
      onInView: handleSuccessView
    });
  }

  // Both 'loading' and 'new' render the "New" notice. In the loading state the
  // enable action is underway, so the CTA shows a spinner and is disabled so it
  // can't be triggered again.
  if (noticeState === 'loading' || noticeState === 'new') {
    const ctaBusy = noticeState === 'loading';
    return /*#__PURE__*/React.createElement(BreakdownNoticeWithIntersectionObserver, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
      className: className
    }, noticeCopy, {
      onCTAClick: handleNewNoticeConfirm,
      ctaInProgress: ctaBusy,
      ctaDisabled: ctaBusy,
      onDismissComplete: handleNewNoticeDismiss,
      onInView: handleNewNoticeView
    }));
  }
  return null;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BreakdownNoticeArea);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownSuccessNotice.tsx"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/BreakdownSuccessNotice.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_Notice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals breakdown success notice.
 *
 * 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
 */


const BreakdownSuccessNotice = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({
  title,
  description,
  onDismiss,
  className
}, ref) => {
  return /*#__PURE__*/React.createElement(_js_components_Notice__WEBPACK_IMPORTED_MODULE_2__["default"], {
    ref: ref,
    className: className,
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_3__.NOTICE_TYPES.SUCCESS,
    title: title,
    description: description,
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Got it', 'google-site-kit'),
      onClick: onDismiss
    }
  });
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (BreakdownSuccessNotice);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalEcommerce.tsx"
/*!*************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalEcommerce.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_BannerModal_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/BannerModal/index */ "./js/components/BannerModal/index.tsx");
/* 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 _svg_graphics_site_goals_intro_modal_ecommerce_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/graphics/site-goals-intro-modal-ecommerce.svg */ "./svg/graphics/site-goals-intro-modal-ecommerce.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * IntroModalEcommerce 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
 */





const IntroModalEcommerce = ({
  onConfirm,
  onClickLearnMore,
  onDismiss,
  onView
}) => {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('site-goals'), []);
  return /*#__PURE__*/React.createElement(_js_components_BannerModal_index__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-banner-modal--site-goals-intro",
    Graphic: _svg_graphics_site_goals_intro_modal_ecommerce_svg__WEBPACK_IMPORTED_MODULE_6__["default"],
    onView: onView,
    onClose: onDismiss,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('See what drives your sales', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Understand which parts of your site are most effective at turning visitors into customers. This new section shows you exactly which pages, cities, and traffic sources are bringing in the most sales and actions like add to cart. Use these insights to see what works best for your business so you can focus on the areas that help you grow. <a>Learn more</a>', 'google-site-kit'), {
      a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: documentationURL,
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more about site goals', 'google-site-kit'),
        onClick: onClickLearnMore,
        external: true,
        hideExternalIndicator: true
      })
    }),
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show me', 'google-site-kit'),
      onClick: onConfirm
    },
    dismissButton: {
      onClick: onDismiss
    },
    newBadge: true
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IntroModalEcommerce);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalEcommerceAndLead.tsx"
/*!********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalEcommerceAndLead.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_BannerModal_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/BannerModal/index */ "./js/components/BannerModal/index.tsx");
/* 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 _svg_graphics_site_goals_intro_modal_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/graphics/site-goals-intro-modal.svg */ "./svg/graphics/site-goals-intro-modal.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * IntroModalEcommerceAndLead 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
 */





const IntroModalEcommerceAndLead = ({
  onConfirm,
  onClickLearnMore,
  onDismiss,
  onView
}) => {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('site-goals'), []);
  return /*#__PURE__*/React.createElement(_js_components_BannerModal_index__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-banner-modal--site-goals-intro",
    Graphic: _svg_graphics_site_goals_intro_modal_svg__WEBPACK_IMPORTED_MODULE_6__["default"],
    onView: onView,
    onClose: onDismiss,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Track your most valuable goals', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Discover which channels, cities, and pages are bringing in your best results. A new section shows you exactly how <b>sales</b> and <b>sign ups</b> are performing, so you can focus on the sources that grow your business. <a>Learn more</a>', 'google-site-kit'), {
      b: /*#__PURE__*/React.createElement("strong", null),
      a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: documentationURL,
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more about site goals', 'google-site-kit'),
        onClick: onClickLearnMore,
        external: true,
        hideExternalIndicator: true
      })
    }),
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show me', 'google-site-kit'),
      onClick: onConfirm
    },
    dismissButton: {
      onClick: onDismiss
    },
    newBadge: true
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IntroModalEcommerceAndLead);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalLead.tsx"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalLead.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_BannerModal_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/BannerModal/index */ "./js/components/BannerModal/index.tsx");
/* 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 _svg_graphics_site_goals_intro_modal_lead_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/graphics/site-goals-intro-modal-lead.svg */ "./svg/graphics/site-goals-intro-modal-lead.svg");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * IntroModalLead 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
 */





const IntroModalLead = ({
  onConfirm,
  onClickLearnMore,
  onDismiss,
  onView
}) => {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('site-goals'), []);
  return /*#__PURE__*/React.createElement(_js_components_BannerModal_index__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-banner-modal--site-goals-intro",
    Graphic: _svg_graphics_site_goals_intro_modal_lead_svg__WEBPACK_IMPORTED_MODULE_6__["default"],
    onView: onView,
    onClose: onDismiss,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('See what brings in new leads', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Discover which parts of your site are most successful at encouraging people to reach out. This new section highlights the specific pages, locations, and visitor groups that result in more sign-ups, quote requests, and other important goals. These details help you understand exactly where your most interested visitors are coming from. <a>Learn more</a>', 'google-site-kit'), {
      a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: documentationURL,
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more about site goals', 'google-site-kit'),
        onClick: onClickLearnMore,
        external: true,
        hideExternalIndicator: true
      })
    }),
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show me', 'google-site-kit'),
      onClick: onConfirm
    },
    dismissButton: {
      onClick: onDismiss
    },
    newBadge: true
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IntroModalLead);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/hasGoalTypeBreakdownNotice.ts"
/*!*******************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/hasGoalTypeBreakdownNotice.ts ***!
  \*******************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   hasGoalTypeBreakdownNotice: () => (/* binding */ hasGoalTypeBreakdownNotice)
/* 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_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* 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.ts");
/**
 * Site Goals breakdown notice presence helper.
 *
 * 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
 */





/**
 * Checks whether a goal type's widget shows the breakdown notice.
 *
 * The intro modal calls this helper once per goal type, so the tour knows
 * which widget its breakdown step lands on. It leaves out the intro modal's
 * own dismissal. Confirming the modal saves that dismissal before the tour
 * starts.
 *
 * @since 1.184.0
 * @since n.e.x.t Required the goal type's widget to render, rather than only its category to be active, so the tour never points at a widget that is absent from the page.
 *
 * @param select   The registry `select` function.
 * @param goalType The goal type whose widget to check.
 * @return `true` when the goal type's widget shows the notice, `false` otherwise.
 */
function hasGoalTypeBreakdownNotice(select, goalType) {
  // Each selector returns `undefined` until it resolves, so compare against
  // the resolved value. An unresolved read counts as no notice, which keeps
  // the tour from pointing at a missing step target.
  return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).isSiteGoalsWidgetRenderable(goalType) === true && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).hasCustomDimensions(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__.SITE_GOALS_BREAKDOWN_CUSTOM_DIMENSION_BY_GOAL_TYPE[goalType]) === false && select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_0__.CORE_USER).isItemDismissed(_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_1__.SITE_GOALS_BREAKDOWN_NOTICE) === false;
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/index.tsx"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/index.tsx ***!
  \***********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   INTRO_MODAL_VARIANTS: () => (/* binding */ INTRO_MODAL_VARIANTS),
/* harmony export */   SITE_GOALS_INTRO_MODAL_BANNER: () => (/* binding */ SITE_GOALS_INTRO_MODAL_BANNER),
/* harmony export */   SITE_GOALS_INTRO_MODAL_BANNER_CONFIRMED: () => (/* binding */ SITE_GOALS_INTRO_MODAL_BANNER_CONFIRMED),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* 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_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_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_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_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useHasBeenViewed */ "./js/googlesitekit/notifications/hooks/useHasBeenViewed.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_feature_tours_site_goals__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/feature-tours/site-goals */ "./js/modules/analytics-4/components/site-goals/feature-tours/site-goals.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__ = __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_12__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useSiteGoalsSectionReady__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useSiteGoalsSectionReady */ "./js/modules/analytics-4/hooks/useSiteGoalsSectionReady.ts");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.js");
/* harmony import */ var _hasGoalTypeBreakdownNotice__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./hasGoalTypeBreakdownNotice */ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/hasGoalTypeBreakdownNotice.ts");
/* harmony import */ var _IntroModalEcommerce__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./IntroModalEcommerce */ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalEcommerce.tsx");
/* harmony import */ var _IntroModalEcommerceAndLead__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./IntroModalEcommerceAndLead */ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalEcommerceAndLead.tsx");
/* harmony import */ var _IntroModalLead__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./IntroModalLead */ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/IntroModalLead.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * IntroModal 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
 */



















const SITE_GOALS_INTRO_MODAL_BANNER = 'site-goals-intro-modal-banner';
/**
 * Dismissed-item slug that the Site Goals intro modal saves when the user
 * clicks "Show me". Closing the modal any other way saves only
 * `SITE_GOALS_INTRO_MODAL_BANNER`, so the survey triggers compare the two
 * slugs to tell a user who confirmed the modal from one who dismissed it.
 */
const SITE_GOALS_INTRO_MODAL_BANNER_CONFIRMED = 'site-goals-intro-modal-banner-confirmed';
const INTRO_MODAL_VARIANTS = {
  ECOMMERCE: 'ecommerce',
  LEAD: 'lead',
  ECOMMERCE_AND_LEAD: 'ecommerce_lead'
};
function createModalHandlers(label, onClose, trackEvent, onShowMeCTAClicked, onView) {
  return {
    onConfirm: () => {
      trackEvent.confirm(label);
      // The "Show me" path saves its dismissed items inside
      // `onShowMeCTAClicked`, so don't also call `onClose`. A second
      // save running in parallel can drop one of the dismissed items.
      onShowMeCTAClicked();
    },
    onClickLearnMore: () => {
      trackEvent.clickLearnMore(label);
    },
    onDismiss: () => {
      trackEvent.dismiss(label);
      onClose();
    },
    onView
  };
}
const IntroModal = ({
  id,
  Notification
}) => {
  const {
    dismissItem,
    triggerOnDemandTour
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER);
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_NOTIFICATIONS);
  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_8__.useBreakpoint)();
  const trackEvent = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_7__["default"])(SITE_GOALS_INTRO_MODAL_BANNER);

  // Whether each goal type's widget renders. The modal introduces those
  // widgets, so it follows the exact conditions they apply.
  const isEcommerceWidgetRenderable = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).isSiteGoalsWidgetRenderable(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.ECOMMERCE), []);
  const isLeadWidgetRenderable = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).isSiteGoalsWidgetRenderable(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.LEAD), []);

  // Read the notice per widget, so the tour's breakdown step knows which one
  // it lands on and takes that widget's copy.
  const hasEcommerceBreakdownNotice = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => (0,_hasGoalTypeBreakdownNotice__WEBPACK_IMPORTED_MODULE_15__.hasGoalTypeBreakdownNotice)(select, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.ECOMMERCE), []);
  const hasLeadBreakdownNotice = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => (0,_hasGoalTypeBreakdownNotice__WEBPACK_IMPORTED_MODULE_15__.hasGoalTypeBreakdownNotice)(select, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_10__.GOAL_TYPES.LEAD), []);
  const hasInsufficientAnalyticsAccess = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    // Skip the access check for view-only users. The check only works
    // for signed-in users. The shared dashboard already limits this
    // modal to roles that can view Analytics.
    if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAuthenticated()) {
      return false;
    }
    const hasAccess = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).hasModuleAccess(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4);

    // While the access check is still loading, the modal stays hidden.
    // It only appears after the check returns `true`.
    return hasAccess !== true;
  }, []);

  // All the checks the modal needs, apart from the section being ready.
  // At least one Site Goals widget must render. If none does, the modal never
  // shows, so the hook below should not load the widget areas or wait.
  //
  // The dismissed-item check is intentionally omitted here: `isDismissible`
  // on the notification registration keeps the framework from mounting this
  // component while the modal is dismissed.
  const canShowSiteGoalsIntroModal = (isEcommerceWidgetRenderable === true || isLeadWidgetRenderable === true) && !hasInsufficientAnalyticsAccess;

  // While the modal can show, the hook loads the widget areas above and
  // including the Site Goals section, and reports ready once the section
  // has loaded and its layout has settled.
  const isSiteGoalsSectionReady = (0,_js_modules_analytics_4_hooks_useSiteGoalsSectionReady__WEBPACK_IMPORTED_MODULE_13__.useSiteGoalsSectionReady)(canShowSiteGoalsIntroModal);
  function handleClose() {
    dismissNotification(id);
  }

  // The modal content renders inside a fixed-position Dialog, which is taken
  // out of the flow of the `<Notification>` wrapper's `<section>`. That
  // leaves the section with no measurable area, so the framework's own
  // intersection observer never flips the notification to "viewed" and the
  // `view_notification` event never fires. `BannerModal` observes its own
  // visible content instead, so mark the notification viewed when the modal
  // comes into view, which is what makes `<Notification>` fire the view event.
  function handleView() {
    setValue(_js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_6__.useHasBeenViewed.getKey(id), true);
  }
  async function handleShowMe() {
    // Save the confirmed slug before the notification ID slug. Each save
    // replaces the whole dismissed-items list with the server's copy, so
    // two in parallel can overwrite each other and drop a slug. A dropped
    // confirmed slug makes the survey triggers read the wrong segment.
    await dismissItem(SITE_GOALS_INTRO_MODAL_BANNER_CONFIRMED);
    await dismissNotification(id);
    triggerOnDemandTour((0,_js_modules_analytics_4_components_site_goals_feature_tours_site_goals__WEBPACK_IMPORTED_MODULE_9__.getSiteGoalsTour)({
      hasEcommerceBreakdownNotice,
      hasLeadBreakdownNotice
    }));

    // Go to the Site Goals section the same way the navigation chip
    // does. Set the URL hash, set the section as the active context,
    // and scroll to the section anchor. The active context makes the
    // Site Goals widgets load right away, so the tour finds its first
    // target. From here the navigation's scroll tracking updates the
    // hash and the active context.
    globalThis.history.replaceState({}, '', `#${_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SITE_GOALS}`);
    setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.ACTIVE_CONTEXT_ID, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SITE_GOALS);
    globalThis.scrollTo({
      top: (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_14__.getNavigationalScrollTop)(`#${_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SITE_GOALS}`, breakpoint),
      behavior: 'smooth'
    });
  }
  if (!canShowSiteGoalsIntroModal || !isSiteGoalsSectionReady) {
    return null;
  }
  const ecommerceHandlers = createModalHandlers(INTRO_MODAL_VARIANTS.ECOMMERCE, handleClose, trackEvent, handleShowMe, handleView);
  const leadHandlers = createModalHandlers(INTRO_MODAL_VARIANTS.LEAD, handleClose, trackEvent, handleShowMe, handleView);
  const ecommerceAndLeadHandlers = createModalHandlers(INTRO_MODAL_VARIANTS.ECOMMERCE_AND_LEAD, handleClose, trackEvent, handleShowMe, handleView);
  if (isEcommerceWidgetRenderable && isLeadWidgetRenderable) {
    return /*#__PURE__*/React.createElement(Notification, {
      gaTrackingEventArgs: {
        label: INTRO_MODAL_VARIANTS.ECOMMERCE_AND_LEAD
      }
    }, /*#__PURE__*/React.createElement(_IntroModalEcommerceAndLead__WEBPACK_IMPORTED_MODULE_17__["default"], ecommerceAndLeadHandlers));
  }
  if (isEcommerceWidgetRenderable) {
    return /*#__PURE__*/React.createElement(Notification, {
      gaTrackingEventArgs: {
        label: INTRO_MODAL_VARIANTS.ECOMMERCE
      }
    }, /*#__PURE__*/React.createElement(_IntroModalEcommerce__WEBPACK_IMPORTED_MODULE_16__["default"], ecommerceHandlers));
  }
  if (isLeadWidgetRenderable) {
    return /*#__PURE__*/React.createElement(Notification, {
      gaTrackingEventArgs: {
        label: INTRO_MODAL_VARIANTS.LEAD
      }
    }, /*#__PURE__*/React.createElement(_IntroModalLead__WEBPACK_IMPORTED_MODULE_18__["default"], leadHandlers));
  }
  return null;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (IntroModal);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/useBreakdownNoticeTooltip.tsx"
/*!**************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/useBreakdownNoticeTooltip.tsx ***!
  \**************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useBreakdownNoticeTooltip: () => (/* binding */ useBreakdownNoticeTooltip)
/* harmony export */ });
/* 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_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/AdminScreenTooltip */ "./js/components/AdminScreenTooltip/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_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_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals breakdown notice tooltip 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.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */







/**
 * Returns the `showTooltip` callback for the shared breakdown notice tooltip.
 *
 * The tooltip is triggered by the notice's parents, not the notice itself: the
 * widgets show it immediately on dismiss, while the Side Panel defers it until
 * the panel overlay has closed. Keeping it here means the tooltip slug, copy and
 * dismiss label live in a single place shared by all of them.
 *
 * @since 1.181.0
 *
 * @return {Function} The `showTooltip` callback.
 */
function useBreakdownNoticeTooltip() {
  const analyticsSettingsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getModuleSettingsURL(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ANALYTICS_4), []);
  const tooltipSettings = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    tooltipSlug: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_7__.SITE_GOALS_BREAKDOWN_NOTICE,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You can always enable breakdown from settings later', 'google-site-kit'),
    content: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enable “Advanced data breakdowns” from <a>Analytics settings</a> to start collecting breakdown data.', 'google-site-kit'), {
      a: /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
        href: analyticsSettingsURL
      })
    }),
    dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it', 'google-site-kit')
  }), [analyticsSettingsURL]);
  return (0,_js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_4__.useShowTooltip)(tooltipSettings);
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownNoticeCopy.tsx"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownNoticeCopy.tsx ***!
  \********************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useSiteGoalsBreakdownNoticeCopy: () => (/* binding */ useSiteGoalsBreakdownNoticeCopy)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals breakdown notice copy 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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





/**
 * Gets the breakdown notice copy for a goal type.
 *
 * Single source of truth for the notice copy so the widgets and the Side Panel
 * render the same strings without duplicating them at each call site. This is a
 * hook (rather than a plain function) so the "Learn more" documentation URL can
 * be resolved from the data store here, instead of being passed in awkwardly
 * from every caller.
 *
 * @since 1.181.0
 *
 * @param {string} scope The goal scope/type the notice is shown for.
 * @return {BreakdownNoticeCopy} The `title`, `description` and `ctaLabel`.
 */
function useSiteGoalsBreakdownNoticeCopy(scope) {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getDocumentationLinkURL('site-goals-advanced-data-breakdown'), []);
  const hasMultipleEcommerceProviders = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).hasMultipleActiveEcommerceEventProviders(), []);
  const ctaLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get breakdown', 'google-site-kit');
  const learnMoreLink = /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
    href: documentationURL,
    "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more about site goals', 'google-site-kit'),
    external: true,
    hideExternalIndicator: true
  });
  if (scope === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.GOAL_TYPES.ECOMMERCE) {
    // Two ecommerce plugins active (WooCommerce + Easy Digital Downloads):
    // the breakdown separates the two stores.
    if (hasMultipleEcommerceProviders) {
      return {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('See how different plugins contribute to your goals', 'google-site-kit'),
        description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('If you use both WooCommerce and Easy Digital Downloads, your events data might be grouped together. Enable this breakdown to see results for each plugin separately and track how each store is performing. Because this uses a new, more precise tracking method, your data will start fresh from the moment you turn it on. <a>Learn more</a>', 'google-site-kit'), {
          a: learnMoreLink
        }),
        ctaLabel
      };
    }

    // A single ecommerce plugin active: the breakdown separates results by
    // plugin (source) more generally.
    return {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('See exactly which plugins are driving your results', 'google-site-kit'),
      description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Currently, your sales and leads are combined into one total. Enable this breakdown to separate results by plugin and track specific flows. Because this uses a new, more precise tracking method, your data will start fresh from the moment you turn it on. <a>Learn more</a>', 'google-site-kit'), {
        a: learnMoreLink
      }),
      ctaLabel
    };
  }

  // Both the lead and ecommerce breakdown dimensions are missing (the Side
  // Panel's combined notice covering both goal type sections at once).
  if (scope === _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__.BREAKDOWN_SCOPE_BOTH) {
    // Two ecommerce plugins active: name both stores alongside forms.
    if (hasMultipleEcommerceProviders) {
      return {
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Have multiple forms, or using both WooCommerce and Easy Digital Downloads for your site?', 'google-site-kit'),
        description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('If you use both WooCommerce and Easy Digital Downloads, your events data might be grouped together. Enable this breakdown to see results for each plugin separately and track how each store is performing. Because this uses a new, more precise tracking method, your data will start fresh from the moment you turn it on. <a>Learn more</a>', 'google-site-kit'), {
          a: learnMoreLink
        }),
        ctaLabel
      };
    }

    // A single ecommerce plugin active: keep the copy generic across forms
    // and products.
    return {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Have multiple forms, or selling products or services?', 'google-site-kit'),
      description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('If you use multiple forms or sell products, your events data might be grouped together. Enable this breakdown to see results for each form and product source separately and track how each one is performing. Because this uses a new, more precise tracking method, your data will start fresh from the moment you turn it on. <a>Learn more</a>', 'google-site-kit'), {
        a: learnMoreLink
      }),
      ctaLabel
    };
  }
  return {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Want to see results for each form?', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('If you use multiple forms, your events data may be grouped together. Enable this breakdown to see results for each form and track how each one is performing. Because this uses a new, more precise tracking method, data collection will start fresh from the moment you turn it on. <a>Learn more</a>', 'google-site-kit'), {
      a: learnMoreLink
    }),
    ctaLabel
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownResultCopy.tsx"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/notifications/useSiteGoalsBreakdownResultCopy.tsx ***!
  \********************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useSiteGoalsBreakdownResultCopy: () => (/* binding */ useSiteGoalsBreakdownResultCopy)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals breakdown result (success/error) copy 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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */





function useSiteGoalsBreakdownResultCopy(scope) {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getDocumentationLinkURL('site-goals-gathering-breakdown-data'), []);
  const learnMoreLink = /*#__PURE__*/React.createElement(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
    href: documentationURL,
    external: true,
    hideExternalIndicator: true
  });
  if (scope === _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_6__.GOAL_TYPES.ECOMMERCE) {
    return {
      successTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Success! Event breakdown is now active', 'google-site-kit'),
      successDescription: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit is now tracking your plugins individually. Because this more precise tracking just started from scratch, your dashboard will show fresh data building up from this moment forward. Individual results will appear soon, with long-term trends following as more data is gathered. <a>Learn more</a>', 'google-site-kit'), {
        a: learnMoreLink
      }),
      permissionsErrorTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Event breakdown setup failed', 'google-site-kit')
    };
  }

  // Both goal types were enabled together (the Side Panel's combined notice).
  if (scope === _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__.BREAKDOWN_SCOPE_BOTH) {
    return {
      successTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Success! Breakdown is now active', 'google-site-kit'),
      successDescription: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit is now tracking specific data for your sales and leads. Because this more precise tracking just started from scratch, your dashboard will show fresh data building up from this moment forward. Individual results will appear soon, with long-term trends following as more data is gathered. <a>Learn more</a>', 'google-site-kit'), {
        a: learnMoreLink
      }),
      permissionsErrorTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sales plugin breakdown setup failed', 'google-site-kit')
    };
  }
  return {
    successTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Success! Individual form tracking is now active', 'google-site-kit'),
    successDescription: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit is now tracking data for each of your forms individually. Because this more precise tracking just started from scratch, your dashboard will show fresh data building up from this moment forward. Individual results will appear soon, with long-term trends following as more data is gathered. <a>Learn more</a>', 'google-site-kit'), {
      a: learnMoreLink
    }),
    permissionsErrorTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Individual form tracking setup failed', 'google-site-kit')
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/utils/formats.ts"
/*!***********************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/utils/formats.ts ***!
  \***********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   NUMBER_FORMAT: () => (/* binding */ NUMBER_FORMAT),
/* harmony export */   PERCENT_FORMAT: () => (/* binding */ PERCENT_FORMAT)
/* 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.
 */

const PERCENT_FORMAT = {
  style: 'percent',
  signDisplay: 'never',
  maximumFractionDigits: 1
};
const NUMBER_FORMAT = {
  style: 'decimal'
};

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/utils/reports.ts"
/*!***********************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/utils/reports.ts ***!
  \***********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   processReports: () => (/* binding */ processReports)
/* 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.
 */

/**
 * Internal dependencies
 */

/**
 * Creates a find callback for locating rows by date range slug at a specific dimension index.
 *
 * @since 1.179.0
 *
 * @param {string} dateRangeSlug  Date range slug to match, e.g. "date_range_0".
 * @param {number} dimensionIndex Index of the dimension value to compare against.
 * @return {Function} Predicate function that returns true when the row matches.
 */
function makeFind(dateRangeSlug, dimensionIndex) {
  return row => row?.dimensionValues?.[dimensionIndex]?.value === dateRangeSlug;
}

/**
 * Returns current and previous primary event counts by summing across all matching rows.
 * Used when multiple event names each contribute to the total (e.g. lead generation events).
 *
 * @since 1.179.0
 *
 * @param {Report} eventsReport Report whose rows contain one entry per eventName + dateRange combination.
 * @return {{current: number, previous: number}} Summed counts for each date range.
 */
function getAggregatedPrimaryCounts(eventsReport) {
  const {
    rows: eventRows = []
  } = eventsReport || {};
  // dateRange is at dimensionValues[1] since eventName is at [0].
  const current = eventRows.filter(makeFind('date_range_0', 1)).reduce((sum, row) => sum + (parseInt(row?.metricValues?.[0]?.value ?? '', 10) || 0), 0);
  const previous = eventRows.filter(makeFind('date_range_1', 1)).reduce((sum, row) => sum + (parseInt(row?.metricValues?.[0]?.value ?? '', 10) || 0), 0);
  return {
    current,
    previous
  };
}

/**
 * Returns current and previous primary event counts by reading a single matching row.
 * Used when the report is already filtered to one event name (e.g. a single ecommerce event).
 *
 * @since 1.179.0
 *
 * @param {Report} eventsReport Report whose rows contain one entry per dateRange.
 * @return {{current: number, previous: number}} Counts for each date range.
 */
function getSinglePrimaryCounts(eventsReport) {
  const {
    rows: eventRows = []
  } = eventsReport || {};
  // dateRange is at dimensionValues[1] since eventName is at [0].
  const current = parseInt(eventRows?.find?.(makeFind('date_range_0', 1))?.metricValues?.[0]?.value ?? '', 10) || 0;
  const previous = parseInt(eventRows?.find?.(makeFind('date_range_1', 1))?.metricValues?.[0]?.value ?? '', 10) || 0;
  return {
    current,
    previous
  };
}

/**
 * Processes events and engagement reports into a set of derived metrics.
 *
 * @since 1.179.0
 *
 * @param {Report}  eventsReport        Report containing event rows (rows keyed by eventName + dateRange).
 * @param {Report}  engagementReport    Report containing engagement totals (engagementRate + sessions).
 * @param {Object}  [options]           Optional processing options.
 * @param {boolean} [options.aggregate] When true, sums eventCount across all matching rows (for
 *                                      multi-event lead generation). When false (default), reads
 *                                      a single matching row (for a single primary ecommerce event).
 * @return {Object} Derived metrics including rates, counts, and engagement values.
 */
function processReports(eventsReport, engagementReport, options = {}) {
  const {
    aggregate = false
  } = options;
  const {
    totals: engagementRows = []
  } = engagementReport || {};
  const {
    current: currentPrimaryCount,
    previous: previousPrimaryCount
  } = aggregate ? getAggregatedPrimaryCounts(eventsReport) : getSinglePrimaryCounts(eventsReport);

  // engagementRate is metricValues[0], sessions is metricValues[1].
  const currentEngagementRate = parseFloat(engagementRows?.find?.(makeFind('date_range_0', 0))?.metricValues?.[0]?.value ?? '') || 0;
  const previousEngagementRate = parseFloat(engagementRows?.find?.(makeFind('date_range_1', 0))?.metricValues?.[0]?.value ?? '') || 0;
  const currentSessions = parseInt(engagementRows?.find?.(makeFind('date_range_0', 0))?.metricValues?.[1]?.value ?? '', 10) || 0;
  const previousSessions = parseInt(engagementRows?.find?.(makeFind('date_range_1', 0))?.metricValues?.[1]?.value ?? '', 10) || 0;
  const currentRate = currentSessions === 0 ? 0 : currentPrimaryCount / currentSessions;
  const previousRate = previousSessions === 0 ? 0 : previousPrimaryCount / previousSessions;
  return {
    currentRate,
    previousRate,
    currentPrimaryCount,
    previousPrimaryCount,
    currentSessions,
    currentEngagementRate,
    previousEngagementRate
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/visitor-engagement/EngagementRateTile.tsx"
/*!************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/visitor-engagement/EngagementRateTile.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_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_components_site_goals_components_Tile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/Tile */ "./js/modules/analytics-4/components/site-goals/components/Tile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/utils/formats */ "./js/modules/analytics-4/components/site-goals/utils/formats.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/utils/reports */ "./js/modules/analytics-4/components/site-goals/utils/reports.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals Visitor Engagement Rate tile.
 *
 * 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
 */







const EngagementRateTile = ({
  dates,
  breakdownFilter
}) => {
  const engagementDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getDocumentationLinkURL('site-goals-engagement-rate'), []);
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    compareEndDate: dates.compareEndDate,
    compareStartDate: dates.compareStartDate,
    endDate: dates.endDate,
    metrics: [{
      name: 'engagementRate'
    }, {
      name: 'sessions'
    }],
    // Scopes the engagement report to the selected breakdown tab when set.
    ...(breakdownFilter ? {
      dimensionFilters: breakdownFilter
    } : {}),
    reportID: 'analytics-4_site-goals_engagementReportOptions',
    startDate: dates.startDate
  }), [dates.compareEndDate, dates.compareStartDate, dates.endDate, dates.startDate, breakdownFilter]);
  const engagementReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]) || [];
  const [loading, error] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const isFetching = !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
    return [isFetching, select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions])];
  }, [reportOptions]);
  const {
    currentSessions,
    currentEngagementRate,
    previousEngagementRate
  } = (0,_js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_7__.processReports)({}, engagementReport);
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_Tile__WEBPACK_IMPORTED_MODULE_5__.Tile, {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Engagement rate', 'google-site-kit'),
    subtitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: formatted number of total sessions */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('of %s total sessions', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(currentSessions, _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_6__.NUMBER_FORMAT)),
    infoTooltip: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('The percentage of visitors who engaged with your content by staying on a page for a period of time, viewing multiple pages, or completing a key action. <a>Learn more</a>', 'google-site-kit'), {
      a:
      /*#__PURE__*/
      // Content is added via createInterpolateElement, so this
      // can be safely ignored.
      //
      // eslint-disable-next-line jsx-a11y/anchor-has-content
      React.createElement("a", {
        href: engagementDocumentationURL,
        target: "_blank",
        rel: "noreferrer noopener"
      })
    }),
    currentValue: currentEngagementRate,
    previousValue: previousEngagementRate,
    loading: loading,
    error: error,
    format: _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_6__.PERCENT_FORMAT
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EngagementRateTile);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/visitor-engagement/VisitorEngagementEventTile.tsx"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/visitor-engagement/VisitorEngagementEventTile.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_components_site_goals_components_Tile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/Tile */ "./js/modules/analytics-4/components/site-goals/components/Tile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/utils/formats */ "./js/modules/analytics-4/components/site-goals/utils/formats.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/utils/reports */ "./js/modules/analytics-4/components/site-goals/utils/reports.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_visitor_engagement_registry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/visitor-engagement/registry */ "./js/modules/analytics-4/components/site-goals/visitor-engagement/registry.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals Visitor Engagement Event tile.
 *
 * 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
 */






const VisitorEngagementEventTile = ({
  dates,
  eventName,
  breakdownFilter
}) => {
  const reportOptions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => ({
    compareEndDate: dates.compareEndDate,
    compareStartDate: dates.compareStartDate,
    metrics: [{
      name: 'eventCount'
    }],
    dimensions: [{
      name: 'eventName'
    }],
    dimensionFilters: {
      eventName,
      // Scopes the report to the selected breakdown tab when set.
      ...breakdownFilter
    },
    endDate: dates.endDate,
    reportID: `analytics-4_site-goals_visitor-engagement_${eventName}`,
    startDate: dates.startDate
  }), [dates.compareEndDate, dates.compareStartDate, dates.endDate, dates.startDate, eventName, breakdownFilter]);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]) || [];
  const [loading, error] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const isFetching = !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
    return [isFetching, select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions])];
  }, [reportOptions]);
  const {
    currentPrimaryCount,
    previousPrimaryCount
  } = (0,_js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_5__.processReports)(report, {});
  return /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_Tile__WEBPACK_IMPORTED_MODULE_3__.Tile, {
    title: (0,_js_modules_analytics_4_components_site_goals_visitor_engagement_registry__WEBPACK_IMPORTED_MODULE_6__.getVisitorEngagementEventTileLabel)(eventName),
    subtitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: GA4 event name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('“%s” events', 'google-site-kit'), eventName),
    currentValue: currentPrimaryCount,
    previousValue: previousPrimaryCount,
    loading: loading,
    error: error,
    format: _js_modules_analytics_4_components_site_goals_utils_formats__WEBPACK_IMPORTED_MODULE_4__.NUMBER_FORMAT
  });
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VisitorEngagementEventTile);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/visitor-engagement/VisitorEngagementTiles.tsx"
/*!****************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/visitor-engagement/VisitorEngagementTiles.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_visitor_engagement_EngagementRateTile__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/visitor-engagement/EngagementRateTile */ "./js/modules/analytics-4/components/site-goals/visitor-engagement/EngagementRateTile.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_visitor_engagement_VisitorEngagementEventTile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/visitor-engagement/VisitorEngagementEventTile */ "./js/modules/analytics-4/components/site-goals/visitor-engagement/VisitorEngagementEventTile.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * Site Goals Visitor Engagement tiles.
 *
 * 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
 */


const VisitorEngagementTiles = ({
  dates,
  events = [],
  breakdownFilter
}) => {
  return /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_visitor_engagement_EngagementRateTile__WEBPACK_IMPORTED_MODULE_1__["default"], {
    dates: dates,
    breakdownFilter: breakdownFilter
  }), events.map(eventName => /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_visitor_engagement_VisitorEngagementEventTile__WEBPACK_IMPORTED_MODULE_2__["default"], {
    key: eventName,
    dates: dates,
    eventName: eventName,
    breakdownFilter: breakdownFilter
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VisitorEngagementTiles);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/visitor-engagement/index.ts"
/*!**********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/visitor-engagement/index.ts ***!
  \**********************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   VISITOR_ENGAGEMENT_EVENT_CATALOG: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_0__.VISITOR_ENGAGEMENT_EVENT_CATALOG),
/* harmony export */   VISITOR_ENGAGEMENT_EVENT_IDS: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_0__.VISITOR_ENGAGEMENT_EVENT_IDS),
/* harmony export */   VisitorEngagementTiles: () => (/* reexport safe */ _VisitorEngagementTiles__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   getVisitorEngagementEventOptions: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_0__.getVisitorEngagementEventOptions),
/* harmony export */   getVisitorEngagementEventTileLabel: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_0__.getVisitorEngagementEventTileLabel),
/* harmony export */   resolveVisitorEngagementEventIDs: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_0__.resolveVisitorEngagementEventIDs),
/* harmony export */   resolveVisitorEngagementSelectionState: () => (/* reexport safe */ _registry__WEBPACK_IMPORTED_MODULE_0__.resolveVisitorEngagementSelectionState)
/* harmony export */ });
/* harmony import */ var _registry__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./registry */ "./js/modules/analytics-4/components/site-goals/visitor-engagement/registry.ts");
/* harmony import */ var _VisitorEngagementTiles__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./VisitorEngagementTiles */ "./js/modules/analytics-4/components/site-goals/visitor-engagement/VisitorEngagementTiles.tsx");
/**
 * Site Goals Visitor Engagement exports.
 *
 * 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/modules/analytics-4/components/site-goals/visitor-engagement/registry.ts"
/*!*************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/visitor-engagement/registry.ts ***!
  \*************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   VISITOR_ENGAGEMENT_EVENT_CATALOG: () => (/* binding */ VISITOR_ENGAGEMENT_EVENT_CATALOG),
/* harmony export */   VISITOR_ENGAGEMENT_EVENT_IDS: () => (/* binding */ VISITOR_ENGAGEMENT_EVENT_IDS),
/* harmony export */   getVisitorEngagementEventOptions: () => (/* binding */ getVisitorEngagementEventOptions),
/* harmony export */   getVisitorEngagementEventTileLabel: () => (/* binding */ getVisitorEngagementEventTileLabel),
/* harmony export */   resolveVisitorEngagementEventIDs: () => (/* binding */ resolveVisitorEngagementEventIDs),
/* harmony export */   resolveVisitorEngagementSelectionState: () => (/* binding */ resolveVisitorEngagementSelectionState)
/* 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_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* 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.ts");
/**
 * Site Goals Visitor Engagement registry.
 *
 * 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 VISITOR_ENGAGEMENT_EVENT_IDS = {
  ADD_TO_CART: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.ENUM_CONVERSION_EVENTS.ADD_TO_CART
};
const VISITOR_ENGAGEMENT_EVENT_CATALOG = {
  [VISITOR_ENGAGEMENT_EVENT_IDS.ADD_TO_CART]: {
    id: VISITOR_ENGAGEMENT_EVENT_IDS.ADD_TO_CART,
    order: 10,
    defaultEnabled: true,
    panelLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Products added to cart', 'google-site-kit'),
    tileLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Products added to cart', 'google-site-kit'),
    goalTypes: [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE]
  }
};
function isVisitorEngagementEventID(eventID) {
  return VISITOR_ENGAGEMENT_EVENT_CATALOG[eventID] !== undefined;
}
function getVisitorEngagementEntries(goalType) {
  return Object.values(VISITOR_ENGAGEMENT_EVENT_CATALOG).filter(event => event.goalTypes.includes(goalType)).sort((currentEvent, nextEvent) => {
    return currentEvent.order - nextEvent.order;
  });
}
function getVisitorEngagementEventOptions(goalType) {
  return getVisitorEngagementEntries(goalType).map(event => ({
    id: event.id,
    order: event.order,
    title: event.panelLabel
  }));
}
function getVisitorEngagementEventTileLabel(eventID) {
  return VISITOR_ENGAGEMENT_EVENT_CATALOG[eventID].tileLabel;
}
function resolveVisitorEngagementEventIDs(selectedEventIDs = undefined, goalType = _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE) {
  const entries = getVisitorEngagementEntries(goalType);
  if (selectedEventIDs === undefined) {
    return entries.filter(event => event.defaultEnabled).map(event => event.id);
  }
  if (!selectedEventIDs.length) {
    return [];
  }
  const selectedSet = new Set(selectedEventIDs.filter(eventID => {
    return typeof eventID === 'string' && isVisitorEngagementEventID(eventID);
  }));
  return entries.filter(event => selectedSet.has(event.id)).map(event => event.id);
}
function getSelectedEventsForGoalType(selectedEvents, goalType) {
  if (!selectedEvents || typeof selectedEvents !== 'object') {
    return undefined;
  }
  const selectedGoalTypeEvents = selectedEvents[goalType];
  return Array.isArray(selectedGoalTypeEvents) ? selectedGoalTypeEvents.filter(eventID => typeof eventID === 'string') : undefined;
}
function resolveVisitorEngagementSelectionState(selectedEvents) {
  return {
    [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE]: resolveVisitorEngagementEventIDs(getSelectedEventsForGoalType(selectedEvents, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE), _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.ECOMMERCE),
    [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.LEAD]: resolveVisitorEngagementEventIDs(getSelectedEventsForGoalType(selectedEvents, _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.LEAD), _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_1__.GOAL_TYPES.LEAD)
  };
}

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/widgets/LeadGenerationPerformanceWidget.tsx"
/*!**************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/widgets/LeadGenerationPerformanceWidget.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.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_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetHeaderTitle */ "./js/googlesitekit/widgets/components/WidgetHeaderTitle.tsx");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_ChangeGoalDriversLink__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/ChangeGoalDriversLink */ "./js/modules/analytics-4/components/site-goals/ChangeGoalDriversLink.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_BreakdownTabs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/BreakdownTabs */ "./js/modules/analytics-4/components/site-goals/components/BreakdownTabs.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_GatheringBreakdownDataBadge__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/GatheringBreakdownDataBadge */ "./js/modules/analytics-4/components/site-goals/components/GatheringBreakdownDataBadge.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_KeyActionTiles__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/KeyActionTiles */ "./js/modules/analytics-4/components/site-goals/components/KeyActionTiles.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_OtherSourcesNotice__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/OtherSourcesNotice */ "./js/modules/analytics-4/components/site-goals/components/OtherSourcesNotice.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_PartialDataBadge__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/PartialDataBadge */ "./js/modules/analytics-4/components/site-goals/components/PartialDataBadge.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TilesGroup */ "./js/modules/analytics-4/components/site-goals/components/TilesGroup.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers */ "./js/modules/analytics-4/components/site-goals/goal-drivers/index.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsBreakdown__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsBreakdown */ "./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsBreakdown.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsWidgetViewAction__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsWidgetViewAction */ "./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsWidgetViewAction.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_BreakdownNoticeArea__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/BreakdownNoticeArea */ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownNoticeArea.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/utils/reports */ "./js/modules/analytics-4/components/site-goals/utils/reports.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_visitor_engagement__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/visitor-engagement */ "./js/modules/analytics-4/components/site-goals/visitor-engagement/index.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _WidgetFeedbackPrompt__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./WidgetFeedbackPrompt */ "./js/modules/analytics-4/components/site-goals/widgets/WidgetFeedbackPrompt.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */
























// Maps a lead-form event provider slug (the `googlesitekit_event_provider`
// dimension value carried on every form conversion event) to its plugin's
// display name, so the form tooltip can name the source from the report alone.
// Keep this in sync with the lead-form providers in `assets/js/event-providers/`:
// a slug missing here silently omits the form tab's source tooltip.
const LEAD_PROVIDER_LABELS = {
  'contact-form-7': 'Contact Form 7',
  'ninja-forms': 'Ninja Forms',
  wpforms: 'WPForms',
  mailchimp: 'Mailchimp for WordPress',
  'popup-maker': 'Popup Maker',
  'optin-monster': 'OptinMonster'
};

// Builds the info-tooltip for a form tab. Has three variants depending on how
// many pages the form was seen on, and falls back to the plugin-only variant
// while the page report is still resolving (so a hover never shows nothing).
function getFormTabTooltip(plugin, pages, referenceSiteURL, learnMoreURL) {
  if (!plugin) {
    return undefined;
  }
  const learnMore =
  /*#__PURE__*/
  // Content is added via createInterpolateElement.
  // eslint-disable-next-line jsx-a11y/anchor-has-content
  React.createElement("a", {
    href: learnMoreURL,
    target: "_blank",
    rel: "noreferrer noopener"
  });

  // No (or not-yet-resolved) pages: plugin only.
  if (!pages?.length) {
    return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: name of the plugin that created the form (e.g. "WPForms"). */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This form was created with <strong>%s</strong>. <a>Learn more</a> about Plugin conversion tracking.', 'google-site-kit'), plugin), {
      strong: /*#__PURE__*/React.createElement("strong", null),
      a: learnMore
    });
  }
  const pageLink =
  /*#__PURE__*/
  // Content is added via createInterpolateElement.
  // eslint-disable-next-line jsx-a11y/anchor-has-content
  React.createElement("a", {
    // The page path always starts with a slash, so strip the site URL's
    // trailing one to avoid a double slash.
    href: `${(0,_js_util__WEBPACK_IMPORTED_MODULE_24__.untrailingslashit)(referenceSiteURL)}${pages[0]}`,
    target: "_blank",
    rel: "noreferrer noopener"
  });

  // A single page: link straight to it. Multiple pages: link to the busiest
  // one but flag it as an example.
  const template = pages.length === 1 ? /* translators: %s: name of the plugin that created the form (e.g. "WPForms"). */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This form was created with <strong>%s</strong> and appears on this <page>page</page>. <a>Learn more</a> about Plugin conversion tracking.', 'google-site-kit') : /* translators: %s: name of the plugin that created the form (e.g. "WPForms"). */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('This form was created with <strong>%s</strong> and appears on this <page>page</page> as an example. <a>Learn more</a> about Plugin conversion tracking.', 'google-site-kit');
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(template, plugin), {
    strong: /*#__PURE__*/React.createElement("strong", null),
    page: pageLink,
    a: learnMore
  });
}

// Builds the per-form tabs. Returns undefined until both the form IDs and their
// titles have resolved, so tab labels don't flicker from ID to title.
function getFormBreakdownTabs(breakdownValues, formTitles, formProviders, formPagePaths, referenceSiteURL, learnMoreURL) {
  // No values → no tabs (an empty array would still render a lone "Other
  // sources" tab). Also wait for titles so labels don't flicker from ID.
  if (!breakdownValues?.length || !formTitles) {
    return undefined;
  }
  return breakdownValues.map(formID => {
    // The provider slug comes straight off the event's
    // `googlesitekit_event_provider` dimension; map it to the plugin's
    // display name for the tooltip.
    const providerSlug = formProviders?.[formID];
    const plugin = providerSlug ? LEAD_PROVIDER_LABELS[providerSlug] : undefined;
    return {
      id: formID,
      label: formTitles[formID],
      tooltip: getFormTabTooltip(plugin, formPagePaths?.[formID], referenceSiteURL, learnMoreURL)
    };
  });
}

// The single/plural subtitle for the Total form completions tile.
function getTotalSubtitle(detectedLeadEvents) {
  if (detectedLeadEvents.length === 1) {
    return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: GA4 event name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('“%s” events', 'google-site-kit'), detectedLeadEvents[0]);
  }
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %d: number of detected event types */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('%d event type', '%d event types', detectedLeadEvents.length, 'google-site-kit'), detectedLeadEvents.length);
}
function getWidgetReportOptions(dates, detectedLeadEvents, breakdownFilter) {
  if (!detectedLeadEvents.length) {
    return {
      leadEventsReportOptions: null,
      engagementReportOptions: null
    };
  }
  return {
    leadEventsReportOptions: {
      ...dates,
      metrics: [{
        name: 'eventCount'
      }],
      dimensions: [{
        name: 'eventName'
      }],
      dimensionFilters: {
        eventName: {
          filterType: 'inListFilter',
          value: detectedLeadEvents
        },
        // Scopes the Key action to the selected breakdown tab.
        ...breakdownFilter
      },
      reportID: 'analytics-4_lead-generation-performance-widget_widget_leadEventsReportOptions'
    },
    engagementReportOptions: {
      ...dates,
      metrics: [{
        name: 'engagementRate'
      }, {
        name: 'sessions'
      }],
      ...(breakdownFilter ? {
        dimensionFilters: breakdownFilter
      } : {}),
      reportID: 'analytics-4_site-goals_engagementReportOptions'
    }
  };
}
const LeadGenerationPerformanceWidget = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({
  Widget,
  WidgetNull,
  WidgetReportError,
  selectedGoalDriverIDs,
  hasBeenInView
}, ref) => {
  const WidgetComponent = Widget;
  const WidgetNullComponent = WidgetNull;
  const WidgetReportErrorComponent = WidgetReportError;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const widgetEventCategory = `${viewContext}_site-goals-widget`;
  const handleToggleCollapsed = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(isCollapsed => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_24__.trackEvent)(widgetEventCategory, isCollapsed ? 'collapse_widget' : 'expand_widget', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD);
  }, [widgetEventCategory]);
  const handleRetryError = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_24__.trackEvent)(widgetEventCategory, 'data_loading_error_retry', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD);
  }, [widgetEventCategory]);
  const handleRequestAccess = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_24__.trackEvent)(widgetEventCategory, 'insufficient_permissions_error_request_access', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD);
  }, [widgetEventCategory]);
  const keyActionDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('site-goals-lead-generation-key-action'), []);
  const otherFormCompletionsDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('site-goals-other-form-completions'), []);
  const pluginConversionTrackingDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('plugin-conversion-tracking'), []);
  const detectedLeadEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getDetectedLeadEvents(), []);
  const effectiveSelectedDrivers = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getSiteGoalsGoalDrivers(), []);
  const resolvedSelections = (0,_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.resolveGoalDriverSelectionState)(effectiveSelectedDrivers || _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_16__.SITE_GOALS_DEFAULT_SELECTED_DRIVERS);
  const hasLeadEvents = !!detectedLeadEvents?.length;
  const drivers = (0,_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.resolveGoalDriverIDs)(selectedGoalDriverIDs || resolvedSelections[_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD], _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD).map(driverID => ({
    ..._js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_DRIVER_CATALOG[driverID],
    title: (0,_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.getGoalDriverTitle)(_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD, driverID)
  }));
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getDateRangeDates({
    compare: true
  }), []);
  const {
    breakdownDimension,
    breakdownValues,
    hasBreakdownTabs,
    activeTabID,
    setSelectedTab,
    isOtherSourcesTab,
    hasOtherSources,
    otherSourcesCount,
    otherSourcesPreviousCount,
    breakdownFilter
    // The form ID dimension is set only on form events, so discovery
    // needs no event scoping. The lead events only detect unattributed
    // "Other sources" data.
  } = (0,_js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsBreakdown__WEBPACK_IMPORTED_MODULE_18__.useSiteGoalsBreakdown)(_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD, {
    detectionEventNames: detectedLeadEvents || []
  });

  // Only the tabbed breakdown shows the partial-data badge, and only when
  // the dimension is in the partial-data state.
  const partialDataBadge = hasBreakdownTabs ? /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_PartialDataBadge__WEBPACK_IMPORTED_MODULE_14__["default"], {
    customDimensionSlug: breakdownDimension
  }) : undefined;
  const handleTabChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(tabID => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_24__.trackEvent)(widgetEventCategory, 'breakdown_tab_select', tabID);
    setSelectedTab(tabID);
  }, [widgetEventCategory, setSelectedTab]);

  // The widget's header and tabs area is always in exactly one of four
  // states. `viewAction` resolves which one, so the widget sends a single
  // `view_widget*` event per view.
  const viewAction = (0,_js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsWidgetViewAction__WEBPACK_IMPORTED_MODULE_19__.useSiteGoalsWidgetViewAction)({
    breakdownDimension,
    hasBreakdownTabs
  });
  // `hasBeenInView` comes from the `withIntersectionObserver` wrapper
  // around this widget's export. `viewAction` depends on several async
  // selectors, so the view event waits until `viewAction` resolves.
  const [hasTrackedView, setHasTrackedView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (hasBeenInView && !hasTrackedView && viewAction) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_24__.trackEvent)(widgetEventCategory, viewAction, _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD);
      setHasTrackedView(true);
    }
  }, [hasBeenInView, hasTrackedView, viewAction, widgetEventCategory]);
  const formTitles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => breakdownValues ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getFormTitles(breakdownValues) : undefined, [breakdownValues]);
  const formProviders = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => breakdownValues?.length ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getFormProviders(breakdownDimension, breakdownValues) : undefined, [breakdownDimension, breakdownValues]);

  // These are the pages each form appears on. The widget uses them to
  // pick the tooltip variant.
  const formPagePaths = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => breakdownValues?.length ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getFormPagePaths(breakdownDimension, breakdownValues) : undefined, [breakdownDimension, breakdownValues]);
  const referenceSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getReferenceSiteURL(), []);
  const breakdownTabs = getFormBreakdownTabs(breakdownValues, formTitles, formProviders, formPagePaths, referenceSiteURL, pluginConversionTrackingDocumentationURL);
  const {
    leadEventsReportOptions,
    engagementReportOptions
  } = getWidgetReportOptions(dates, detectedLeadEvents || [], breakdownFilter);
  const leadEventsReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => leadEventsReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getReport(leadEventsReportOptions) : null, [leadEventsReportOptions]) || [];
  const engagementReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => engagementReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getReport(engagementReportOptions) : null, [engagementReportOptions]) || [];
  const [loading, error] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const reportsToCheck = [];
    if (leadEventsReportOptions) {
      reportsToCheck.push(leadEventsReportOptions);
    }
    if (engagementReportOptions) {
      reportsToCheck.push(engagementReportOptions);
    }
    return [select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).areReportsLoading(...reportsToCheck), select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_23__.MODULES_ANALYTICS_4).getFirstReportError(...reportsToCheck)];
  }, [leadEventsReportOptions, engagementReportOptions]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (error) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_24__.trackEvent)(widgetEventCategory, 'data_loading_error', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD);
    }
  }, [error, widgetEventCategory]);
  if (!hasLeadEvents) {
    return /*#__PURE__*/React.createElement(WidgetNullComponent, null);
  }
  if (error) {
    return /*#__PURE__*/React.createElement(WidgetComponent, null, /*#__PURE__*/React.createElement(WidgetReportErrorComponent, {
      moduleSlug: "analytics-4",
      error: error,
      onRetry: handleRetryError,
      onRequestAccess: handleRequestAccess
    }));
  }
  const {
    currentPrimaryCount,
    previousPrimaryCount,
    currentSessions,
    currentRate,
    previousRate
  } = (0,_js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_21__.processReports)(leadEventsReport, engagementReport, {
    aggregate: true
  });
  return /*#__PURE__*/React.createElement(WidgetComponent, {
    ref: ref,
    onToggleCollapsed: handleToggleCollapsed,
    Header: _js_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_7__["default"],
    headerContents: /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Lead generation performance', 'google-site-kit')), /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_GatheringBreakdownDataBadge__WEBPACK_IMPORTED_MODULE_11__["default"], {
      goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD,
      variant: "widget"
    })),
    collapsible: true
  }, breakdownTabs && /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_BreakdownTabs__WEBPACK_IMPORTED_MODULE_10__["default"], {
    tabs: breakdownTabs,
    activeTabID: activeTabID,
    onTabChange: handleTabChange,
    showOtherSources: hasOtherSources,
    otherSourcesLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Other form completions', 'google-site-kit')
  }), isOtherSourcesTab && /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_OtherSourcesNotice__WEBPACK_IMPORTED_MODULE_13__["default"], {
    learnMoreURL: otherFormCompletionsDocumentationURL
  }), loading ? /*#__PURE__*/React.createElement(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_4__["default"], {
    width: "100%",
    height: "130px"
  }) : /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_15__.TilesGroup, {
    className: "googlesitekit-site-goals-primary-action",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Key action', 'google-site-kit'),
    badge: partialDataBadge
  }, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_KeyActionTiles__WEBPACK_IMPORTED_MODULE_12__["default"], {
    isOtherSourcesTab: isOtherSourcesTab,
    supportURL: keyActionDocumentationURL,
    rateTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Form completion rate', 'google-site-kit'),
    totalTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Total form completions', 'google-site-kit'),
    totalSubtitle: getTotalSubtitle(detectedLeadEvents),
    currentRate: currentRate,
    previousRate: previousRate,
    currentSessions: currentSessions,
    currentCount: currentPrimaryCount,
    previousCount: previousPrimaryCount,
    otherSourcesCount: otherSourcesCount,
    otherSourcesPreviousCount: otherSourcesPreviousCount
  })), /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_notifications_BreakdownNoticeArea__WEBPACK_IMPORTED_MODULE_20__["default"], {
    origin: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_16__.BREAKDOWN_ORIGIN_WIDGET,
    goalTypes: [_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD]
  }), !isOtherSourcesTab && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, null, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_15__.TilesGroup, {
    className: "googlesitekit-site-goals-visitor-engagement",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('How are your visitors engaging?', 'google-site-kit'),
    badge: partialDataBadge
  }, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_visitor_engagement__WEBPACK_IMPORTED_MODULE_22__.VisitorEngagementTiles, {
    dates: dates,
    breakdownFilter: breakdownFilter
  })), /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_15__.TilesGroup, {
    className: "googlesitekit-site-goals-goal-drivers-group",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('What’s helping you reach your goals?', 'google-site-kit'),
    headerCTA: /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_ChangeGoalDriversLink__WEBPACK_IMPORTED_MODULE_9__["default"], {
      goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD
    }),
    badge: partialDataBadge
  }, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GoalDriverTiles, {
    drivers: drivers,
    primaryEvent: detectedLeadEvents,
    goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD,
    breakdownFilter: breakdownFilter
  }))), /*#__PURE__*/React.createElement(_WidgetFeedbackPrompt__WEBPACK_IMPORTED_MODULE_26__["default"], {
    voteID: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_16__.SITE_GOALS_VOTE_ID_WIDGET_LEAD_GENERATION,
    goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_17__.GOAL_TYPES.LEAD
  }));
});
LeadGenerationPerformanceWidget.displayName = 'LeadGenerationPerformanceWidget';
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_25__["default"])(LeadGenerationPerformanceWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/widgets/OnlineStorePerformanceWidget.tsx"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/widgets/OnlineStorePerformanceWidget.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_PreviewBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.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_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_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetHeaderTitle */ "./js/googlesitekit/widgets/components/WidgetHeaderTitle.tsx");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_ChangeGoalDriversLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/ChangeGoalDriversLink */ "./js/modules/analytics-4/components/site-goals/ChangeGoalDriversLink.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_BreakdownTabs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/BreakdownTabs */ "./js/modules/analytics-4/components/site-goals/components/BreakdownTabs.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_GatheringBreakdownDataBadge__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/GatheringBreakdownDataBadge */ "./js/modules/analytics-4/components/site-goals/components/GatheringBreakdownDataBadge.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_KeyActionTiles__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/KeyActionTiles */ "./js/modules/analytics-4/components/site-goals/components/KeyActionTiles.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_OtherSourcesNotice__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/OtherSourcesNotice */ "./js/modules/analytics-4/components/site-goals/components/OtherSourcesNotice.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_PartialDataBadge__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/PartialDataBadge */ "./js/modules/analytics-4/components/site-goals/components/PartialDataBadge.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/components/TilesGroup */ "./js/modules/analytics-4/components/site-goals/components/TilesGroup.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers */ "./js/modules/analytics-4/components/site-goals/goal-drivers/index.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsBreakdown__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsBreakdown */ "./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsBreakdown.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsWidgetViewAction__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsWidgetViewAction */ "./js/modules/analytics-4/components/site-goals/hooks/useSiteGoalsWidgetViewAction.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_BreakdownNoticeArea__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/BreakdownNoticeArea */ "./js/modules/analytics-4/components/site-goals/notifications/BreakdownNoticeArea.tsx");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/utils/reports */ "./js/modules/analytics-4/components/site-goals/utils/reports.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_visitor_engagement__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/visitor-engagement */ "./js/modules/analytics-4/components/site-goals/visitor-engagement/index.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _WidgetFeedbackPrompt__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./WidgetFeedbackPrompt */ "./js/modules/analytics-4/components/site-goals/widgets/WidgetFeedbackPrompt.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */
























const EVENT_RATE_LABELS = {
  purchase: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Sales Rate', 'google-site-kit'),
  add_to_cart: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Add to Cart Rate', 'google-site-kit')
};
const EVENT_TOTAL_LABELS = {
  purchase: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Total Sales', 'google-site-kit'),
  add_to_cart: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Products added to cart', 'google-site-kit')
};
function getWidgetReportOptions(dates, primaryEvent, breakdownFilter) {
  const primaryEventReportOptions = primaryEvent ? {
    ...dates,
    metrics: [{
      name: 'eventCount'
    }],
    dimensions: [{
      name: 'eventName'
    }],
    dimensionFilters: {
      eventName: primaryEvent,
      // Scopes the Key action to the selected breakdown tab.
      ...breakdownFilter
    },
    reportID: 'analytics-4_online-store-performance-widget_primaryEventReportOptions'
  } : null;
  const engagementReportOptions = primaryEvent ? {
    ...dates,
    metrics: [{
      name: 'engagementRate'
    }, {
      name: 'sessions'
    }],
    ...(breakdownFilter ? {
      dimensionFilters: breakdownFilter
    } : {}),
    reportID: 'analytics-4_site-goals_engagementReportOptions'
  } : null;
  return {
    primaryEventReportOptions,
    engagementReportOptions
  };
}
function getReportsToCheck(primaryEventReportOptions, engagementReportOptions) {
  return [primaryEventReportOptions, engagementReportOptions].filter(reportOptions => Boolean(reportOptions));
}
const OnlineStorePerformanceWidget = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(({
  Widget,
  WidgetNull,
  WidgetReportError,
  selectedGoalDriverIDs,
  hasBeenInView
}, ref) => {
  const WidgetComponent = Widget;
  const WidgetNullComponent = WidgetNull;
  const WidgetReportErrorComponent = WidgetReportError;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const widgetEventCategory = `${viewContext}_site-goals-widget`;
  const handleToggleCollapsed = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(isCollapsed => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(widgetEventCategory, isCollapsed ? 'collapse_widget' : 'expand_widget', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE);
  }, [widgetEventCategory]);
  const handleRetryError = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(widgetEventCategory, 'data_loading_error_retry', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE);
  }, [widgetEventCategory]);
  const handleRequestAccess = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(widgetEventCategory, 'insufficient_permissions_error_request_access', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE);
  }, [widgetEventCategory]);
  const keyActionDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getDocumentationLinkURL('site-goals-online-store-key-action'), []);
  const otherSourcesDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getDocumentationLinkURL('site-goals-other-sources'), []);
  const primaryEvent = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getPrimaryEcommerceEvent(), []);
  const effectiveSelectedDrivers = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getSiteGoalsGoalDrivers(), []);
  const resolvedSelections = (0,_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.resolveGoalDriverSelectionState)(effectiveSelectedDrivers || _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_DEFAULT_SELECTED_DRIVERS);
  const effectiveVisitorEngagement = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getSiteGoalsVisitorEngagement(), []);
  const resolvedVisitorEngagement = (0,_js_modules_analytics_4_components_site_goals_visitor_engagement__WEBPACK_IMPORTED_MODULE_21__.resolveVisitorEngagementSelectionState)(effectiveVisitorEngagement || _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_DEFAULT_SELECTED_VISITOR_ENGAGEMENT);
  const selectedVisitorEngagementEvents = resolvedVisitorEngagement[_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE];
  const secondaryEcommerceEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => primaryEvent ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getSecondaryEcommerceEvents(primaryEvent) : [], [primaryEvent]);
  const enabledSecondaryEvents = selectedVisitorEngagementEvents.filter(eventName => secondaryEcommerceEvents.includes(eventName));
  const drivers = (0,_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.resolveGoalDriverIDs)(selectedGoalDriverIDs || resolvedSelections[_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE], _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE).map(driverID => ({
    ..._js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_DRIVER_CATALOG[driverID],
    title: (0,_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.getGoalDriverTitle)(_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE, driverID)
  }));
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }), []);

  // The "Other sources" metric mirrors the Key action's primary event, so detect
  // unattributed events for that event only.
  const detectionEventNames = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => primaryEvent ? [primaryEvent] : [], [primaryEvent]);
  const {
    breakdownDimension,
    breakdownValues,
    hasBreakdownTabs,
    activeTabID,
    setSelectedTab,
    isOtherSourcesTab,
    hasOtherSources,
    otherSourcesCount,
    otherSourcesPreviousCount,
    breakdownFilter
  } = (0,_js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsBreakdown__WEBPACK_IMPORTED_MODULE_17__.useSiteGoalsBreakdown)(_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE, {
    // Discovery is scoped to the known ecommerce events. The allowlist
    // then restricts the tabs to supported ecommerce plugins.
    eventNames: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.CONVERSION_REPORTING_ECOMMERCE_EVENTS,
    detectionEventNames,
    supportedValues: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDERS
  });

  // Only the tabbed breakdown shows the partial-data badge, and only when
  // the dimension is in the partial-data state.
  const partialDataBadge = hasBreakdownTabs ? /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_PartialDataBadge__WEBPACK_IMPORTED_MODULE_13__["default"], {
    customDimensionSlug: breakdownDimension
  }) : undefined;
  const handleTabChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(tabID => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(widgetEventCategory, 'breakdown_tab_select', tabID);
    setSelectedTab(tabID);
  }, [widgetEventCategory, setSelectedTab]);

  // The widget's header and tabs area is always in exactly one of four
  // states. `viewAction` resolves which one, so the widget sends a single
  // `view_widget*` event per view.
  const viewAction = (0,_js_modules_analytics_4_components_site_goals_hooks_useSiteGoalsWidgetViewAction__WEBPACK_IMPORTED_MODULE_18__.useSiteGoalsWidgetViewAction)({
    breakdownDimension,
    hasBreakdownTabs
  });
  // `hasBeenInView` comes from the `withIntersectionObserver` wrapper
  // around this widget's export. `viewAction` depends on several async
  // selectors, so the view event waits until `viewAction` resolves.
  const [hasTrackedView, setHasTrackedView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (hasBeenInView && !hasTrackedView && viewAction) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(widgetEventCategory, viewAction, _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE);
      setHasTrackedView(true);
    }
  }, [hasBeenInView, hasTrackedView, viewAction, widgetEventCategory]);
  const {
    primaryEventReportOptions,
    engagementReportOptions
  } = getWidgetReportOptions(dates, primaryEvent, breakdownFilter);
  const primaryEventReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => primaryEventReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getReport(primaryEventReportOptions) : null, [primaryEventReportOptions]) || [];
  const engagementReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => engagementReportOptions ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getReport(engagementReportOptions) : null, [engagementReportOptions]) || [];
  const [loading, error] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const reportsToCheck = getReportsToCheck(primaryEventReportOptions, engagementReportOptions);
    return [select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).areReportsLoading(...reportsToCheck), select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getFirstReportError(...reportsToCheck)];
  }, [primaryEventReportOptions, engagementReportOptions]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (error) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(widgetEventCategory, 'data_loading_error', _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE);
    }
  }, [error, widgetEventCategory]);
  if (!primaryEvent) {
    return /*#__PURE__*/React.createElement(WidgetNullComponent, null);
  }
  if (error) {
    return /*#__PURE__*/React.createElement(WidgetComponent, null, /*#__PURE__*/React.createElement(WidgetReportErrorComponent, {
      moduleSlug: "analytics-4",
      error: error,
      onRetry: handleRetryError,
      onRequestAccess: handleRequestAccess
    }));
  }
  const {
    currentPrimaryCount,
    previousPrimaryCount,
    currentSessions,
    currentRate,
    previousRate
  } = (0,_js_modules_analytics_4_components_site_goals_utils_reports__WEBPACK_IMPORTED_MODULE_20__.processReports)(primaryEventReport, engagementReport);
  return /*#__PURE__*/React.createElement(WidgetComponent, {
    ref: ref,
    onToggleCollapsed: handleToggleCollapsed,
    Header: _js_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_6__["default"],
    headerContents: /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement("span", null, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Online store performance', 'google-site-kit')), /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_GatheringBreakdownDataBadge__WEBPACK_IMPORTED_MODULE_10__["default"], {
      goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE,
      variant: "widget"
    })),
    collapsible: true
  }, hasBreakdownTabs && /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_BreakdownTabs__WEBPACK_IMPORTED_MODULE_9__["default"], {
    tabs: (breakdownValues ?? []).map(value => ({
      id: value,
      label: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_BREAKDOWN_ECOMMERCE_PROVIDER_LABELS[value] ?? value
    })),
    activeTabID: activeTabID,
    onTabChange: handleTabChange,
    showOtherSources: hasOtherSources,
    otherSourcesLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Other sources', 'google-site-kit')
  }), isOtherSourcesTab && /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_OtherSourcesNotice__WEBPACK_IMPORTED_MODULE_12__["default"], {
    learnMoreURL: otherSourcesDocumentationURL
  }), loading ? /*#__PURE__*/React.createElement(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-site-goals-tiles-group",
    width: "100%",
    height: "130px"
  }) : /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_14__.TilesGroup, {
    className: "googlesitekit-site-goals-primary-action",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Key action', 'google-site-kit'),
    badge: partialDataBadge
  }, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_KeyActionTiles__WEBPACK_IMPORTED_MODULE_11__["default"], {
    isOtherSourcesTab: isOtherSourcesTab,
    supportURL: keyActionDocumentationURL,
    rateTitle: EVENT_RATE_LABELS[primaryEvent],
    totalTitle: EVENT_TOTAL_LABELS[primaryEvent],
    totalSubtitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: GA4 event name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('“%s” events', 'google-site-kit'), primaryEvent),
    currentRate: currentRate,
    previousRate: previousRate,
    currentSessions: currentSessions,
    currentCount: currentPrimaryCount,
    previousCount: previousPrimaryCount,
    otherSourcesCount: otherSourcesCount,
    otherSourcesPreviousCount: otherSourcesPreviousCount
  })), /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_notifications_BreakdownNoticeArea__WEBPACK_IMPORTED_MODULE_19__["default"], {
    origin: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_15__.BREAKDOWN_ORIGIN_WIDGET,
    goalTypes: [_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE]
  }), !isOtherSourcesTab && /*#__PURE__*/React.createElement(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, null, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_14__.TilesGroup, {
    className: "googlesitekit-site-goals-visitor-engagement",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('How are your visitors engaging?', 'google-site-kit'),
    badge: partialDataBadge
  }, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_visitor_engagement__WEBPACK_IMPORTED_MODULE_21__.VisitorEngagementTiles, {
    dates: dates,
    events: enabledSecondaryEvents,
    breakdownFilter: breakdownFilter
  })), /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_components_TilesGroup__WEBPACK_IMPORTED_MODULE_14__.TilesGroup, {
    className: "googlesitekit-site-goals-goal-drivers-group",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('What’s helping you reach your goals?', 'google-site-kit'),
    headerCTA: /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_ChangeGoalDriversLink__WEBPACK_IMPORTED_MODULE_8__["default"], {
      goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE
    }),
    badge: partialDataBadge
  }, /*#__PURE__*/React.createElement(_js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GoalDriverTiles, {
    drivers: drivers,
    primaryEvent: primaryEvent,
    goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE,
    breakdownFilter: breakdownFilter
  }))), /*#__PURE__*/React.createElement(_WidgetFeedbackPrompt__WEBPACK_IMPORTED_MODULE_25__["default"], {
    voteID: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_VOTE_ID_WIDGET_ONLINE_STORE,
    goalType: _js_modules_analytics_4_components_site_goals_goal_drivers__WEBPACK_IMPORTED_MODULE_16__.GOAL_TYPES.ECOMMERCE
  }));
});
OnlineStorePerformanceWidget.displayName = 'OnlineStorePerformanceWidget';
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_24__["default"])(OnlineStorePerformanceWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/widgets/WidgetFeedbackPrompt.tsx"
/*!***************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/widgets/WidgetFeedbackPrompt.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 _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_surveys_ThumbsSurveyTrigger__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/surveys/ThumbsSurveyTrigger */ "./js/components/surveys/ThumbsSurveyTrigger.tsx");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * WidgetFeedbackPrompt 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
 */






/**
 * Renders the "Is this section helpful?" prompt with thumbs feedback
 * for a Site Goals widget card.
 *
 * @since 1.182.0
 *
 * @param props          Component props.
 * @param props.voteID   Identifier used to build the survey trigger string.
 * @param props.goalType Goal type (`ecommerce` or `lead`), used for tracking.
 * @return React element.
 */
const WidgetFeedbackPrompt = ({
  voteID,
  goalType
}) => {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.useBreakpoint)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__["default"])();
  // On mobile the feedback row isn't right-aligned, so `top-end` pushes the
  // popper past the card edge. Center it above the thumbs instead and let
  // Popper shift it to fit.
  const popperPlacement = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.BREAKPOINT_SMALL ? 'top' : 'top-end';
  function handleVote(direction) {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_site-goals-widget-survey`, direction === 'up' ? 'vote_up' : 'vote_down', goalType);
  }
  return /*#__PURE__*/React.createElement("div", {
    className: "googlesitekit-site-goals-widget__feedback"
  }, /*#__PURE__*/React.createElement(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    type: "label",
    size: "small",
    className: "googlesitekit-site-goals-widget__feedback-prompt"
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Is this section helpful?', 'google-site-kit')), /*#__PURE__*/React.createElement(_js_components_surveys_ThumbsSurveyTrigger__WEBPACK_IMPORTED_MODULE_1__["default"], {
    voteID: voteID,
    onVote: handleVote,
    downvoteFormURL: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_5__.SITE_GOALS_THUMBS_DOWNVOTE_FORM_URL,
    popperPlacement: popperPlacement
  }));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (WidgetFeedbackPrompt);

/***/ },

/***/ "./js/modules/analytics-4/components/site-goals/widgets/index.ts"
/*!***********************************************************************!*\
  !*** ./js/modules/analytics-4/components/site-goals/widgets/index.ts ***!
  \***********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   LeadGenerationPerformanceWidget: () => (/* reexport safe */ _LeadGenerationPerformanceWidget__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   OnlineStorePerformanceWidget: () => (/* reexport safe */ _OnlineStorePerformanceWidget__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _LeadGenerationPerformanceWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./LeadGenerationPerformanceWidget */ "./js/modules/analytics-4/components/site-goals/widgets/LeadGenerationPerformanceWidget.tsx");
/* harmony import */ var _OnlineStorePerformanceWidget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./OnlineStorePerformanceWidget */ "./js/modules/analytics-4/components/site-goals/widgets/OnlineStorePerformanceWidget.tsx");
/**
 * Site Goals widget components.
 *
 * 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/modules/analytics-4/datastore/advanced-data-breakdowns.ts"
/*!**********************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/advanced-data-breakdowns.ts ***!
  \**********************************************************************/
(__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 _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.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_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.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_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: advanced data breakdowns settings.
 *
 * 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
 */








const {
  setErrorForAction,
  clearActionError
} = _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_3__.actions;

/**
 * Advanced data breakdowns settings: a map of GA4 property ID to enabled flag.
 *
 * @since 1.181.0
 * @since 1.182.0 Stored a per-property map instead of a single `enabled` flag.
 */

const SET_ADVANCED_DATA_BREAKDOWNS_ENABLED = 'SET_ADVANCED_DATA_BREAKDOWNS_ENABLED';
/**
 * Checks that advanced data breakdowns settings are an object whose values are all booleans.
 *
 * @since 1.181.0
 * @since 1.182.0 Validated a per-property map of enabled flags.
 *
 * @param  settings Advanced data breakdowns settings to validate.
 * @return {void}
 */
function validateAdvancedDataBreakdownsSettings(settings) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(settings && typeof settings === 'object', 'advancedDataBreakdownsSettings should be an object.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Object.values(settings).every(isEnabled => typeof isEnabled === 'boolean'), 'advancedDataBreakdownsSettings values should all be booleans.');
}
const fetchStoreReducerCallback = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, settings) => {
  state.advancedDataBreakdownsSettings = settings;
});

// `createFetchStore` is an untyped helper that returns a generic object, so we
// describe the one fetch action we call on each store here. The rest of the
// store shape (controls, reducer, selectors) is merged in by `combineStores`.

const fetchGetAdvancedDataBreakdownsSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'getAdvancedDataBreakdownsSettings',
  controlCallback() {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4, 'advanced-data-breakdowns-settings', {}, {
      useCache: false
    });
  },
  reducerCallback: fetchStoreReducerCallback
});
const fetchSaveAdvancedDataBreakdownsSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'saveAdvancedDataBreakdownsSettings',
  controlCallback: settings => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4, 'save-advanced-data-breakdowns-settings', {
    settings
  }),
  reducerCallback: fetchStoreReducerCallback,
  argsToParams: settings => settings,
  validateParams: validateAdvancedDataBreakdownsSettings,
  isAction: true
});
const baseInitialState = {
  advancedDataBreakdownsSettings: undefined
};
const baseActions = {
  /**
   * Sets the advanced data breakdowns enabled flags for one or more properties in local state.
   *
   * @since 1.181.0
   * @since 1.182.0 Took a property-to-boolean map, so one call can set several properties.
   *
   * @param settings A map of GA4 property ID to enabled flag, for example `{ '123456789': true }`.
   * @return Redux-style action.
   */
  setAdvancedDataBreakdownsEnabled(settings) {
    validateAdvancedDataBreakdownsSettings(settings);

    // `validateAdvancedDataBreakdownsSettings` checks the values are
    // booleans. Check the keys here too, because this action is the one
    // place a caller writes a property ID into the saved map.
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Object.keys(settings).every(propertyID => (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_7__.isValidPropertyID)(propertyID)), 'advancedDataBreakdownsSettings keys should all be valid GA4 property IDs.');
    return {
      type: SET_ADVANCED_DATA_BREAKDOWNS_ENABLED,
      payload: {
        settings
      }
    };
  },
  /**
   * Saves the advanced data breakdowns settings via the dedicated endpoint.
   *
   * @since 1.181.0
   *
   * @return Object with `response` and `error`.
   */
  saveAdvancedDataBreakdownsSettings: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_5__.createValidatedAction)(
  // The first callback validates the action's arguments. This action
  // takes none. It reads the settings from state and validates them
  // inside the generator below.
  () => {}, function* () {
    const registryResult = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const registry = registryResult;
    const settings = registry.select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getAdvancedDataBreakdownsSettings();
    validateAdvancedDataBreakdownsSettings(settings);
    yield clearActionError('saveAdvancedDataBreakdownsSettings', []);
    const saveResponse = yield fetchSaveAdvancedDataBreakdownsSettingsStore.actions.fetchSaveAdvancedDataBreakdownsSettings(settings);
    const {
      response,
      error
    } = saveResponse;
    if (error) {
      yield setErrorForAction(error, 'saveAdvancedDataBreakdownsSettings', []);
    }
    return {
      response,
      error
    };
  })
};
const baseResolvers = {
  *getAdvancedDataBreakdownsSettings() {
    const registryResult = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const registry = registryResult;
    const settings = registry.select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getAdvancedDataBreakdownsSettings();
    if (settings === undefined) {
      yield fetchGetAdvancedDataBreakdownsSettingsStore.actions.fetchGetAdvancedDataBreakdownsSettings();
    }
  }
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, {
  type,
  payload
}) => {
  switch (type) {
    case SET_ADVANCED_DATA_BREAKDOWNS_ENABLED:
      {
        const {
          settings
        } = payload;
        state.advancedDataBreakdownsSettings = {
          ...state.advancedDataBreakdownsSettings,
          ...settings
        };
        break;
      }
    default:
      break;
  }
});
const baseSelectors = {
  /**
   * Gets the full advanced data breakdowns settings object.
   *
   * @since 1.181.0
   *
   * @param state Data store's state.
   * @return Settings object, or `undefined` while loading.
   */
  getAdvancedDataBreakdownsSettings(state) {
    return state.advancedDataBreakdownsSettings;
  },
  /**
   * Checks whether advanced data breakdowns is enabled for the given property.
   *
   * @since 1.181.0
   * @since 1.182.0 Read the flag per property, not as a single shared flag.
   *
   * @param state      Data store's state.
   * @param propertyID The GA4 property ID to check.
   * @return `true` when enabled for the property, `false` when not, `undefined` while loading.
   */
  isAdvancedDataBreakdownsEnabled: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, propertyID) => {
    const settings = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getAdvancedDataBreakdownsSettings();
    if (settings === undefined) {
      return undefined;
    }
    return !!settings[propertyID];
  })
};

// `combineStores` is an untyped helper that returns a generic object, so we
// describe the merged store's shape and cast to it (the same approach as
// `core/pdf`). `controls` is contributed by the fetch stores, so it stays
// loosely typed here.

const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchGetAdvancedDataBreakdownsSettingsStore, fetchSaveAdvancedDataBreakdownsSettingsStore, {
  initialState: baseInitialState,
  actions: baseActions,
  resolvers: baseResolvers,
  selectors: baseSelectors,
  reducer: baseReducer
});
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/analytics-4/datastore/constants.ts"
/*!*******************************************************!*\
  !*** ./js/modules/analytics-4/datastore/constants.ts ***!
  \*******************************************************/
(__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_ECOMMERCE_EVENTS: () => (/* binding */ CONVERSION_REPORTING_ECOMMERCE_EVENTS),
/* 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_GOALS_CUSTOM_DIMENSIONS: () => (/* binding */ SITE_GOALS_CUSTOM_DIMENSIONS),
/* 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'
  },
  googlesitekit_event_provider: {
    parameterName: 'googlesitekit_event_provider',
    displayName: 'WordPress Event Provider',
    description: 'Created by Site Kit: Plugin source that triggered a conversion event',
    scope: 'EVENT'
  },
  googlesitekit_form_id: {
    parameterName: 'googlesitekit_form_id',
    displayName: 'WordPress Form ID',
    description: 'Created by Site Kit: ID of the form that triggered a lead generation event',
    scope: 'EVENT'
  }
};
const SITE_GOALS_CUSTOM_DIMENSIONS = Object.keys(CUSTOM_DIMENSION_DEFINITIONS);
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];
const CONVERSION_REPORTING_ECOMMERCE_EVENTS = [ENUM_CONVERSION_EVENTS.PURCHASE, ENUM_CONVERSION_EVENTS.ADD_TO_CART];

// 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/datastore/site-goals-breakdown.ts"
/*!******************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/site-goals-breakdown.ts ***!
  \******************************************************************/
(__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 _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_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 _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_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.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_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__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: site goals breakdown.
 *
 * 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
 */








// The breakdown tab structure (which provider/form tabs exist, and whether
// there are unattributed "Other sources" events) is determined over the widest
// dashboard date range rather than the selected one, so changing the date
// range never adds or removes tabs — only the metrics follow the selection.
const BREAKDOWN_DISCOVERY_DAYS = 90;
/**
 * Reads a report's total event count for a date range.
 *
 * @since 1.182.0
 *
 * @param {Object} report        Report with totals per date range.
 * @param {string} dateRangeSlug Date range slug, e.g. `date_range_0`.
 * @return {number} The total event count, or `0` when absent.
 */
function getDateRangeTotal(report, dateRangeSlug) {
  const row = report.totals?.find(total => total?.dimensionValues?.[0]?.value === dateRangeSlug);
  return parseInt(row?.metricValues?.[0]?.value ?? '', 10) || 0;
}

/**
 * Reads a single-range report's total event count.
 *
 * @since 1.182.0
 *
 * @param {Object} report Report with a single totals row.
 * @return {number} The total event count, or `0` when absent.
 */
function getSingleRangeTotal(report) {
  return parseInt(report.totals?.[0]?.metricValues?.[0]?.value ?? '', 10) || 0;
}

/**
 * Gets the fixed discovery date range (the last 90 days up to the reference
 * date), mirroring the `audiences` 90-day window precedent.
 *
 * @since 1.182.0
 *
 * @param {Function} getReferenceDate Returns the reference date string.
 * @return {Object} Date range with `startDate` and `endDate`.
 */
function getDiscoveryDates(getReferenceDate) {
  const endDate = getReferenceDate();
  return {
    startDate: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.getPreviousDate)(endDate, BREAKDOWN_DISCOVERY_DAYS),
    endDate
  };
}

/**
 * Builds the discovery report options for a breakdown custom dimension.
 *
 * The report groups events by the custom dimension and excludes empty values,
 * so its rows surface the distinct values present within the date range.
 *
 * @since 1.182.0
 *
 * @param {Object}        dates               Date range with `startDate` and `endDate`.
 * @param {string}        customDimensionSlug Custom dimension slug.
 * @param {Array<string>} eventNames          Event names to scope discovery to (empty for none).
 * @return {Object} Report options.
 */
function getBreakdownReportOptions(dates, customDimensionSlug, eventNames) {
  const dimension = `customEvent:${customDimensionSlug}`;
  return {
    ...dates,
    dimensions: [dimension],
    dimensionFilters: {
      [dimension]: {
        filterType: 'emptyFilter',
        notExpression: true
      },
      // Scope to the goal's own events so providers/forms from other goal
      // types (e.g. a form plugin in the ecommerce provider dimension) don't
      // leak into the tab list.
      ...(eventNames.length ? {
        eventName: {
          filterType: 'inListFilter',
          value: eventNames
        }
      } : {})
    },
    metrics: [{
      name: 'eventCount'
    }],
    orderby: [{
      metric: {
        metricName: 'eventCount'
      },
      desc: true
    }],
    reportID: `analytics-4_site-goals-breakdown_values_${customDimensionSlug}`
  };
}
/**
 * Builds the report options that pair each form with one extra dimension's value.
 *
 * The page and provider breakdowns both group the form events by a second
 * dimension, scoped to the given form IDs and ordered by event count, so the
 * busiest value for each form comes first; only the second dimension and the
 * report ID differ. They are kept as two separate reports — rather than one
 * `[ formID, provider, pagePath ]` report — so each yields its busiest value
 * per form independently: a combined report's first row per form would be the
 * busiest provider-and-page pair, not the busiest of each.
 *
 * @since 1.183.0
 *
 * @param {Object}        dates               Date range with `startDate` and `endDate`.
 * @param {string}        customDimensionSlug Form ID custom dimension slug.
 * @param {Array<string>} formIDs             Form IDs to scope to.
 * @param {string}        secondDimension     Dimension paired with the form ID.
 * @param {string}        reportSlug          Report ID suffix identifying the report.
 * @return {Object} Report options.
 */
function getFormPairedDimensionReportOptions(dates, customDimensionSlug, formIDs, secondDimension, reportSlug) {
  const dimension = `customEvent:${customDimensionSlug}`;
  return {
    ...dates,
    dimensions: [dimension, secondDimension],
    dimensionFilters: {
      [dimension]: {
        filterType: 'inListFilter',
        value: formIDs
      }
    },
    metrics: [{
      name: 'eventCount'
    }],
    orderby: [{
      metric: {
        metricName: 'eventCount'
      },
      desc: true
    }],
    reportID: `analytics-4_site-goals-breakdown_${reportSlug}_${customDimensionSlug}`
  };
}

/**
 * Builds the report options that surface the pages each form appears on.
 *
 * @since 1.182.0
 *
 * @param {Object}        dates               Date range with `startDate` and `endDate`.
 * @param {string}        customDimensionSlug Form ID custom dimension slug.
 * @param {Array<string>} formIDs             Form IDs to look up pages for.
 * @return {Object} Report options.
 */
function getFormPagesReportOptions(dates, customDimensionSlug, formIDs) {
  return getFormPairedDimensionReportOptions(dates, customDimensionSlug, formIDs, 'pagePath', 'form-pages');
}
/**
 * Builds the report options that surface the event provider each form came from.
 *
 * Every conversion event carries both the form ID dimension and the
 * `googlesitekit_event_provider` dimension, so this report pairs each form ID
 * with its originating provider slug (e.g. `wpforms`, `optin-monster`) without
 * any server-side plugin detection.
 *
 * @since 1.183.0
 *
 * @param {Object}        dates               Date range with `startDate` and `endDate`.
 * @param {string}        customDimensionSlug Form ID custom dimension slug.
 * @param {Array<string>} formIDs             Form IDs to look up providers for.
 * @return {Object} Report options.
 */
function getFormProvidersReportOptions(dates, customDimensionSlug, formIDs) {
  return getFormPairedDimensionReportOptions(dates, customDimensionSlug, formIDs, 'customEvent:googlesitekit_event_provider', 'form-providers');
}
/**
 * Builds report options for a total event count over compare dates, optionally
 * scoped to a set of attributed dimension values.
 *
 * @since 1.182.0
 *
 * @param {Object}        dates               Compare date range.
 * @param {string}        customDimensionSlug Breakdown custom dimension slug.
 * @param {Array<string>} eventNames          Events to count.
 * @param {Array<string>} [attributedValues]  Dimension values to scope to; omit for all events.
 * @return {Object} Report options.
 */
function getUnattributedReportOptions(dates, customDimensionSlug, eventNames, attributedValues) {
  const dimension = `customEvent:${customDimensionSlug}`;
  return {
    ...dates,
    metrics: [{
      name: 'eventCount'
    }],
    dimensionFilters: {
      eventName: {
        filterType: 'inListFilter',
        value: eventNames
      },
      ...(attributedValues ? {
        [dimension]: {
          filterType: 'inListFilter',
          value: attributedValues
        }
      } : {})
    },
    reportID: `analytics-4_site-goals-breakdown_other-sources-${attributedValues ? 'attributed' : 'all'}_${customDimensionSlug}`
  };
}
const fetchGetFormMetadataStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'getFormMetadata',
  controlCallback: params => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'form-metadata', params),
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, formMetadata, params) => {
    state.formMetadata = {
      ...state.formMetadata,
      ...formMetadata
    };

    // Resolve every requested ID, even ones the server couldn't echo back
    // (e.g. dropped as a non-positive ID). Without this they'd stay
    // `undefined` and wedge the metadata selectors in a loading state.
    params.formIDs.forEach(formID => {
      if (state.formMetadata[formID] === undefined) {
        state.formMetadata[formID] = {
          title: null
        };
      }
    });
  }),
  argsToParams: formIDs => ({
    formIDs
  }),
  validateParams: params => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(params.formIDs), 'formIDs must be an array.');
  }
});
const baseInitialState = {
  formMetadata: {}
};

/**
 * Loads a paired-dimension form report (pages or providers).
 *
 * `getFormPagePaths` and `getFormProviders` resolve the same form-dimension
 * report shape over the same events and date range; only the options builder
 * (and therefore the second dimension) differs.
 *
 * @since 1.183.0
 *
 * @param {Object}        registry            WordPress data registry.
 * @param {Function}      optionsBuilder      Builds the report options to resolve.
 * @param {string}        customDimensionSlug Form ID custom dimension slug.
 * @param {Array<string>} formIDs             Form IDs to scope to.
 * @return {Promise<void>} Resolves once the report has loaded.
 */
async function loadFormDimensionReport(registry, optionsBuilder, customDimensionSlug, formIDs) {
  await registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSettings();
  const dates = getDiscoveryDates(registry.select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate);
  await registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(optionsBuilder(dates, customDimensionSlug, formIDs));
}
const baseResolvers = {
  *getBreakdownValues(customDimensionSlug, eventNames = []) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSettings());
    const dates = getDiscoveryDates(registry.select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate);
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getBreakdownReportOptions(dates, customDimensionSlug, eventNames)));
  },
  *getFormPagePaths(customDimensionSlug, formIDs) {
    if (!formIDs?.length) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(loadFormDimensionReport(registry, getFormPagesReportOptions, customDimensionSlug, formIDs));
  },
  *getFormProviders(customDimensionSlug, formIDs) {
    if (!formIDs?.length) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(loadFormDimensionReport(registry, getFormProvidersReportOptions, customDimensionSlug, formIDs));
  },
  *getUnattributedEventCounts(customDimensionSlug, detectionEventNames = [], attributedValues = []) {
    if (!detectionEventNames.length || !attributedValues.length) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSettings());
    const dates = registry.select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getDateRangeDates({
      compare: true
    });
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(Promise.all([registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames)), registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames, attributedValues))]));
  },
  *hasUnattributedEvents(customDimensionSlug, detectionEventNames = [], attributedValues = []) {
    if (!detectionEventNames.length || !attributedValues.length) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSettings());
    const dates = getDiscoveryDates(registry.select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate);
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(Promise.all([registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames)), registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames, attributedValues))]));
  },
  *getFormMetadata(formIDs) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const missingFormIDs = formIDs.filter(formID => registry.select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getFormMetadataForID(formID) === undefined);
    if (missingFormIDs.length > 0) {
      yield fetchGetFormMetadataStore.actions.fetchGetFormMetadata(missingFormIDs);
    }
  }
};
const baseSelectors = {
  /**
   * Gets the distinct non-empty values for a breakdown custom dimension.
   *
   * @since 1.182.0
   *
   * @param {Object}        state               Data store's state.
   * @param {string}        customDimensionSlug Custom dimension slug.
   * @param {Array<string>} [eventNames]        Event names to scope discovery to (the goal's events).
   * @return {(Array<string>|undefined)} Distinct values, an empty array when none exist, or `undefined` while loading.
   */
  getBreakdownValues: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, customDimensionSlug, eventNames = []) => {
    const dates = getDiscoveryDates(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate);
    const report = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getBreakdownReportOptions(dates, customDimensionSlug, eventNames));
    if (report === undefined) {
      return undefined;
    }
    const values = (report.rows || []).map(row => row.dimensionValues?.[0]?.value).filter(value => !!value && value !== '(not set)');
    return Array.from(new Set(values));
  }),
  /**
   * Gets the pages each form appears on, ordered by event count (busiest
   * first).
   *
   * @since 1.182.0
   *
   * @param {Object}        state               Data store's state.
   * @param {string}        customDimensionSlug Form ID custom dimension slug.
   * @param {Array<string>} formIDs             Form IDs to look up pages for.
   * @return {(Object|undefined)} Map of form ID to its ordered page paths, or `undefined` while loading.
   */
  getFormPagePaths: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, customDimensionSlug, formIDs) => {
    if (!formIDs?.length) {
      return {};
    }
    const dates = getDiscoveryDates(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate);
    const report = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getFormPagesReportOptions(dates, customDimensionSlug, formIDs));
    if (report === undefined) {
      return undefined;
    }
    const pagesByForm = {};

    // Rows arrive ordered by event count, so the first page seen for
    // each form is its busiest one.
    for (const row of report.rows || []) {
      const formID = row.dimensionValues?.[0]?.value;
      const pagePath = row.dimensionValues?.[1]?.value;
      if (!formID || !pagePath) {
        continue;
      }
      pagesByForm[formID] = pagesByForm[formID] || [];
      if (!pagesByForm[formID].includes(pagePath)) {
        pagesByForm[formID].push(pagePath);
      }
    }
    return pagesByForm;
  }),
  /**
   * Gets the event provider each form came from.
   *
   * Reads the `googlesitekit_event_provider` dimension carried on every
   * conversion event, mapping each form ID to its originating provider slug
   * (e.g. `wpforms`, `optin-monster`). This needs no server-side plugin
   * detection: the source is already attached to the event.
   *
   * @since 1.183.0
   *
   * @param {Object}        state               Data store's state.
   * @param {string}        customDimensionSlug Form ID custom dimension slug.
   * @param {Array<string>} formIDs             Form IDs to look up providers for.
   * @return {(Object|undefined)} Map of form ID to provider slug, or `undefined` while loading.
   */
  getFormProviders: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, customDimensionSlug, formIDs) => {
    if (!formIDs?.length) {
      return {};
    }
    const dates = getDiscoveryDates(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate);
    const report = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getFormProvidersReportOptions(dates, customDimensionSlug, formIDs));
    if (report === undefined) {
      return undefined;
    }
    const providersByForm = {};
    const ambiguousFormIDs = new Set();

    // Form IDs aren't unique across plugins, so one ID can carry more
    // than one provider. When it does we can't name a single creator,
    // so drop the form ID rather than assert the busiest provider.
    for (const row of report.rows || []) {
      const formID = row.dimensionValues?.[0]?.value;
      const provider = row.dimensionValues?.[1]?.value;
      if (!formID || !provider || ambiguousFormIDs.has(formID)) {
        continue;
      }
      const seenProvider = providersByForm[formID];
      if (seenProvider === undefined) {
        providersByForm[formID] = provider;
      } else if (seenProvider !== provider) {
        delete providersByForm[formID];
        ambiguousFormIDs.add(formID);
      }
    }
    return providersByForm;
  }),
  /**
   * Gets the count of "Other sources" events — the goal's events not attributed
   * to any tab value — for the current and previous date ranges.
   *
   * GA4 reports an unset custom dimension as the literal "(not set)", which a
   * server-side filter can't reliably isolate, so this subtracts the attributed
   * total (events whose dimension is one of the tab values) from the overall
   * total rather than filtering for the unattributed events directly.
   *
   * @since 1.182.0
   *
   * @param {Object}        state                 Data store's state.
   * @param {string}        customDimensionSlug   Breakdown custom dimension slug.
   * @param {Array<string>} [detectionEventNames] Events to count (the goal's events).
   * @param {Array<string>} [attributedValues]    Dimension values that have a tab.
   * @return {(Object|undefined)} `{ currentCount, previousCount }`, or `undefined` while loading.
   */
  getUnattributedEventCounts: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, customDimensionSlug, detectionEventNames = [], attributedValues = []) => {
    if (!detectionEventNames.length || !attributedValues.length) {
      return {
        currentCount: 0,
        previousCount: 0
      };
    }
    const dates = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getDateRangeDates({
      compare: true
    });
    const allReport = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames));
    const attributedReport = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames, attributedValues));

    // Wait for both totals so the difference never briefly equals the
    // full total (which would flash the Other sources tab in then out).
    if (allReport === undefined || attributedReport === undefined) {
      return undefined;
    }
    return {
      currentCount: Math.max(0, getDateRangeTotal(allReport, 'date_range_0') - getDateRangeTotal(attributedReport, 'date_range_0')),
      previousCount: Math.max(0, getDateRangeTotal(allReport, 'date_range_1') - getDateRangeTotal(attributedReport, 'date_range_1'))
    };
  }),
  /**
   * Gets whether any "Other sources" events exist within the discovery window
   * (the last 90 days), which decides whether the Other sources tab is shown.
   *
   * Like the value tabs, this is evaluated over the fixed discovery window
   * rather than the selected date range, so the tab never appears or vanishes
   * when the range changes — only its displayed count follows the selection
   * (see `getUnattributedEventCounts`).
   *
   * @since 1.182.0
   *
   * @param {Object}        state                 Data store's state.
   * @param {string}        customDimensionSlug   Breakdown custom dimension slug.
   * @param {Array<string>} [detectionEventNames] Events to count (the goal's events).
   * @param {Array<string>} [attributedValues]    Dimension values that have a tab.
   * @return {(boolean|undefined)} Whether unattributed events exist, or `undefined` while loading.
   */
  hasUnattributedEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, customDimensionSlug, detectionEventNames = [], attributedValues = []) => {
    if (!detectionEventNames.length || !attributedValues.length) {
      return false;
    }
    const dates = getDiscoveryDates(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate);
    const allReport = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames));
    const attributedReport = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(getUnattributedReportOptions(dates, customDimensionSlug, detectionEventNames, attributedValues));

    // Wait for both totals so the difference never briefly equals the
    // full total (which would flash the Other sources tab in then out).
    if (allReport === undefined || attributedReport === undefined) {
      return undefined;
    }
    return getSingleRangeTotal(allReport) > getSingleRangeTotal(attributedReport);
  }),
  /**
   * Gets resolved metadata for a single form ID from state.
   *
   * @since 1.182.0
   *
   * @param {Object} state  Data store's state.
   * @param {string} formID Form ID.
   * @return {(Object|undefined)} The form metadata, or `undefined` while loading.
   */
  getFormMetadataForID(state, formID) {
    return state.formMetadata[formID];
  },
  /**
   * Gets metadata for a set of form IDs.
   *
   * @since 1.182.0
   *
   * @param {Object}        state   Data store's state.
   * @param {Array<string>} formIDs Form IDs to resolve.
   * @return {(Object|undefined)} Map of form ID to metadata, or `undefined` while any is still loading.
   */
  getFormMetadata: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, formIDs) => {
    const metadataByID = {};
    for (const formID of formIDs) {
      const metadata = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getFormMetadataForID(formID);

      // Any entry still loading means the set isn't ready yet.
      if (metadata === undefined) {
        return undefined;
      }
      metadataByID[formID] = metadata;
    }
    return metadataByID;
  }),
  /**
   * Gets the display labels for a set of form IDs.
   *
   * @since 1.182.0
   *
   * @param {Object}        state   Data store's state.
   * @param {Array<string>} formIDs Form IDs to label.
   * @return {(Object|undefined)} Map of form ID to display label, or `undefined` while any metadata is still loading.
   */
  getFormTitles: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, formIDs) => {
    const metadata = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getFormMetadata(formIDs);
    if (metadata === undefined) {
      return undefined;
    }
    const labels = {};
    for (const formID of formIDs) {
      const {
        title
      } = metadata[formID];

      // `null` means resolved-but-unresolvable; a real title of "0"
      // must still render, so check against null rather than falsy.
      labels[formID] = title !== null ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: form title, e.g. "Contact". */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('“%s” form', 'google-site-kit'), title) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: form ID used as the fallback tab label when the form has no title, such as "12" or the campaign slug "jnpfwoygltxurnayflew". */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Form #%s', 'google-site-kit'), formID);
    }
    return labels;
  })
};

// `combineStores` is untyped JS and returns `Object`, so the combined shape is
// asserted here to keep the re-exports typed.

const store = (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_5__.combineStores)(fetchGetFormMetadataStore, {
  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/analytics-4/datastore/site-goals-settings.ts"
/*!*****************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/site-goals-settings.ts ***!
  \*****************************************************************/
(__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 _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.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");
/* harmony import */ var _js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: site goals settings.
 *
 * 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
 */








const {
  setErrorForAction,
  clearActionError
} = _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__.actions;

/**
 * Conversion events that belong to each Site Goals widget category.
 *
 * Mirrors the pairing in
 * `Conversion_Reporting_Provider::update_active_site_goals_widgets()`, which
 * pairs `ECOMMERCE_EVENT_NAMES`/`LEAD_EVENT_NAMES` with the same categories
 * when it populates the site-wide `activeWidgets` list.
 */
const SITE_GOALS_WIDGET_EVENTS = {
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_7__.GOAL_TYPES.ECOMMERCE]: _constants__WEBPACK_IMPORTED_MODULE_9__.CONVERSION_REPORTING_ECOMMERCE_EVENTS,
  [_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_7__.GOAL_TYPES.LEAD]: _constants__WEBPACK_IMPORTED_MODULE_9__.CONVERSION_REPORTING_LEAD_EVENTS
};

/**
 * Per-user fields that the SAVE endpoint accepts.
 */

/**
 * Full merged settings returned by the GET endpoint.
 */

const SET_SITE_GOALS_BREAKDOWN_TOOLTIP_PENDING = 'SET_SITE_GOALS_BREAKDOWN_TOOLTIP_PENDING';

/**
 * Result shape returned by the fetch-store save action.
 */

/**
 * Minimal typed view over the registry exposed inside the generator actions and
 * resolvers. The shared redux-routine/registry infrastructure is untyped JS, so
 * only the selectors this store actually reaches are declared here.
 */

/**
 * Validates the per-goal-type selections of a site goals setting.
 *
 * @since 1.181.0
 *
 * @param {*}      selections Goal type selections to validate.
 * @param {string} key        The setting key the selections belong to.
 * @return {void}
 */
function validateGoalTypeSelections(selections, key) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(selections), `${key} should be an object.`);
  const goalTypeSelections = selections;

  // Goal type sub-keys come from the shared GOAL_TYPES source of truth.
  Object.values(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_7__.GOAL_TYPES).forEach(goalType => {
    if (goalTypeSelections[goalType] !== undefined) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(goalTypeSelections[goalType]), `${key}.${goalType} should be an array.`);
    }
  });
}

/**
 * Validates the per-user site goals settings (goalDrivers, visitorEngagement).
 *
 * @since 1.181.0
 *
 * @param {*} settings Per-user site goals settings to validate.
 * @return {void}
 */
function validateSiteGoalsSettings(settings) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(settings), 'settings should be an object.');
  const siteGoalsSettings = settings;
  ['goalDrivers', 'visitorEngagement'].forEach(key => {
    if (siteGoalsSettings[key] !== undefined) {
      validateGoalTypeSelections(siteGoalsSettings[key], key);
    }
  });
}
const fetchGetSiteGoalsSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'getSiteGoalsSettings',
  controlCallback() {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ANALYTICS_4, 'site-goals-settings', {}, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, settings) => {
    state.siteGoalsSettings = settings;
  })
});
const fetchSaveSiteGoalsSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'saveSiteGoalsSettings',
  controlCallback: settings => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ANALYTICS_4, 'save-site-goals-settings', {
    settings
  }),
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, perUserSettings) => {
    // Merge the per-user response over existing settings, preserving
    // site-wide activeWidgets already in state.
    state.siteGoalsSettings = {
      ...state.siteGoalsSettings,
      ...perUserSettings
    };
  }),
  argsToParams: settings => settings,
  validateParams: validateSiteGoalsSettings,
  isAction: true
});
const baseInitialState = {
  siteGoalsSettings: undefined,
  breakdownTooltipPending: false
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, action) => {
  switch (action.type) {
    case SET_SITE_GOALS_BREAKDOWN_TOOLTIP_PENDING:
      state.breakdownTooltipPending = action.payload.isPending;
      break;
    default:
      break;
  }
});
const baseActions = {
  /**
   * Saves the per-user site goals settings (goalDrivers, visitorEngagement).
   *
   * @since 1.181.0
   *
   * @param {Object} settings Partial per-user site goals settings to save.
   * @return {Object} Object with `response` and `error`.
   */
  saveSiteGoalsSettings: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__.createValidatedAction)(settings => {
    validateSiteGoalsSettings(settings);
  }, function* (settings) {
    yield clearActionError('saveSiteGoalsSettings', []);
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const currentSettings = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSiteGoalsSettings());

    // Only send the per-user fields to the save endpoint.
    const perUserSettings = {
      ...(currentSettings?.goalDrivers !== undefined && {
        goalDrivers: currentSettings.goalDrivers
      }),
      ...(currentSettings?.visitorEngagement !== undefined && {
        visitorEngagement: currentSettings.visitorEngagement
      }),
      ...settings
    };
    const {
      response,
      error
    } = yield fetchSaveSiteGoalsSettingsStore.actions.fetchSaveSiteGoalsSettings(perUserSettings);
    if (error) {
      yield setErrorForAction(error, 'saveSiteGoalsSettings', []);
    }
    return {
      response,
      error
    };
  }),
  /**
   * Marks the breakdown notice tooltip as pending, so the Side Panel parent
   * shows it once the panel overlay closes.
   *
   * @since 1.181.0
   *
   * @return {Object} Redux-style action.
   */
  setSiteGoalsBreakdownTooltipPending() {
    return {
      type: SET_SITE_GOALS_BREAKDOWN_TOOLTIP_PENDING,
      payload: {
        isPending: true
      }
    };
  },
  /**
   * Clears the pending breakdown notice tooltip flag.
   *
   * @since 1.181.0
   *
   * @return {Object} Redux-style action.
   */
  clearSiteGoalsBreakdownTooltipPending() {
    return {
      type: SET_SITE_GOALS_BREAKDOWN_TOOLTIP_PENDING,
      payload: {
        isPending: false
      }
    };
  }
};
const baseResolvers = {
  *getSiteGoalsSettings() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    if (registry.select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSiteGoalsSettings() === undefined) {
      yield fetchGetSiteGoalsSettingsStore.actions.fetchGetSiteGoalsSettings();
    }
  }
};
const baseSelectors = {
  /**
   * Gets the merged site goals settings (per-user + site-wide).
   *
   * @since 1.181.0
   *
   * @param {Object} state Data store's state.
   * @return {Object|undefined} Site goals settings, or `undefined` if not loaded.
   */
  getSiteGoalsSettings(state) {
    return state.siteGoalsSettings;
  },
  /**
   * Gets the selected site goals goal drivers.
   *
   * @since 1.181.0
   *
   * @return {Object|undefined} Goal driver selections, or `undefined` if not loaded.
   */
  getSiteGoalsGoalDrivers: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSiteGoalsSettings()?.goalDrivers),
  /**
   * Gets the selected site goals visitor engagement events.
   *
   * @since 1.181.0
   *
   * @return {Object|undefined} Visitor engagement selections, or `undefined` if not loaded.
   */
  getSiteGoalsVisitorEngagement: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSiteGoalsSettings()?.visitorEngagement),
  /**
   * Checks whether a given widget category is active.
   *
   * Reads only the site-wide `activeWidgets` list, which the conversion
   * reporting cron populates once a category's events are detected and one of
   * its event provider plugins is active. That list is only ever unioned, so a
   * category stays in it after the provider is deactivated.
   *
   * To decide whether a widget actually renders, use
   * `isSiteGoalsWidgetRenderable()` instead, which also accounts for the events
   * still being detected.
   *
   * @since 1.182.0
   *
   * @param {Object} state    Data store's state.
   * @param {string} category Widget category slug (e.g. 'lead' or 'ecommerce').
   * @return {boolean|undefined} `true` if active, `false` if not, `undefined` if not loaded.
   */
  isSiteGoalsWidgetActive: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (_state, category) => {
    const settings = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getSiteGoalsSettings();
    if (settings === undefined) {
      return undefined;
    }
    return (settings.activeWidgets ?? []).includes(category);
  }),
  /**
   * Checks whether a given widget category's widget will render.
   *
   * Combines the site-wide `activeWidgets` entry with the events currently
   * detected for the same category. Together, these are the conditions the
   * widget's registration and its own zero state use to determine if it should
   * render.
   *
   * This is the single source of truth for every Site Goals surface
   * that depends on a widget being on the page (eg. widget registration,
   * intro modal, feature tour, and survey triggers). These never show for
   * a widget that is not rendered.
   *
   * @since 1.185.0
   *
   * @param {Object} state    Data store's state.
   * @param {string} category Widget category slug (e.g. 'lead' or 'ecommerce').
   * @return {boolean|undefined} `true` if the widget renders, `false` if not, `undefined` if not loaded.
   */
  isSiteGoalsWidgetRenderable: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (_state, category) => {
    const events = SITE_GOALS_WIDGET_EVENTS[category];
    if (!events) {
      return false;
    }
    const isActive = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isSiteGoalsWidgetActive(category);
    const hasEvents = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasConversionReportingEvents(events);
    if (isActive === undefined || hasEvents === undefined) {
      return undefined;
    }
    return isActive && hasEvents;
  }),
  /**
   * Checks whether the site goals settings are currently being saved.
   *
   * @since 1.181.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean} `true` if the settings are being saved, otherwise `false`.
   */
  isSavingSiteGoalsSettings(state) {
    return Object.values(state.isFetchingSaveSiteGoalsSettings || {}).some(Boolean);
  },
  /**
   * Checks whether the breakdown notice tooltip is pending (deferred from the
   * Side Panel until it closes).
   *
   * @since 1.181.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean} `true` if the tooltip is pending, otherwise `false`.
   */
  isSiteGoalsBreakdownTooltipPending(state) {
    return !!state.breakdownTooltipPending;
  }
};

// `combineStores` is untyped JS and returns `Object`, so the combined shape is
// asserted here to keep the re-exports typed.

const store = (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__.combineStores)(fetchGetSiteGoalsSettingsStore, fetchSaveSiteGoalsSettingsStore, {
  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/analytics-4/hooks/useBreakdownEnableHandler.ts"
/*!*******************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useBreakdownEnableHandler.ts ***!
  \*******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ALL_CUSTOM_DIMENSIONS: () => (/* binding */ ALL_CUSTOM_DIMENSIONS),
/* harmony export */   useBreakdownEnableHandler: () => (/* binding */ useBreakdownEnableHandler)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_data_create_snapshot_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/data/create-snapshot-store */ "./js/googlesitekit/data/create-snapshot-store.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_datastore_location_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/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_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_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/constants */ "./js/modules/analytics-4/components/site-goals/constants.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/**
 * Site Goals breakdown "Enable" handler 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.
 */

/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */











// Every Site Kit custom dimension is created, not just the Site Goals-specific
// ones, so a single "Enable" sets up all advanced data breakdowns at once.
const ALL_CUSTOM_DIMENSIONS = Object.keys(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CUSTOM_DIMENSION_DEFINITIONS);
function useBreakdownEnableHandler(origin, scope) {
  const registry = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useRegistry)();
  const hasAnalytics4EditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.EDIT_SCOPE), []);
  const redirectURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getAdminURL('googlesitekit-dashboard', {
    notification: _js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.SITE_GOALS_BREAKDOWN_NOTIFICATION,
    // Scroll back to the Site Goals widget section on OAuth return.
    widgetArea: _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_8__.AREA_MAIN_DASHBOARD_SITE_GOALS_PRIMARY
  }), []);
  const isNavigatingToOAuthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const OAuthURL = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getConnectURL({
      additionalScopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.EDIT_SCOPE],
      redirectURL
    });
    return OAuthURL ? select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_LOCATION).isNavigatingTo(OAuthURL) : false;
  }, [redirectURL]);
  const inProgress = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => ALL_CUSTOM_DIMENSIONS.some(customDimension => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).isCreatingCustomDimension(customDimension)), []);
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_FORMS);
  const {
    setPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
  const {
    createCustomDimensions
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4);
  const onEnable = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    // Record where creation was triggered and the enabled scope, so the
    // notices know where to render and which result copy to show. A fresh
    // attempt (including retry) clears any prior dismissal so the new result
    // can surface.
    const breakdownValues = {
      customDimensions: ALL_CUSTOM_DIMENSIONS,
      [_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_ORIGIN_FORM_KEY]: origin,
      [_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_SCOPE_FORM_KEY]: scope,
      [_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_DISMISSED_FORM_KEY]: false
    };
    if (!hasAnalytics4EditScope) {
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.FORM_CUSTOM_DIMENSIONS_CREATE, {
        ...breakdownValues,
        autoSubmit: true
      });
      await (0,_js_googlesitekit_data_create_snapshot_store__WEBPACK_IMPORTED_MODULE_3__.snapshotAllStores)(registry);
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_11__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Additional permissions are required to create new Analytics custom dimensions', 'google-site-kit'),
        data: {
          status: 403,
          scopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.EDIT_SCOPE],
          skipModal: true,
          redirectURL
        }
      });

      // Deferred to OAuth; the redirect keeps the busy state.
      return false;
    }
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.FORM_CUSTOM_DIMENSIONS_CREATE, breakdownValues);

    // Await so `onEnable` resolves only once the action settles, including
    // the path where nothing is created (all dimensions already exist), so
    // the caller can clear its loading state.
    const {
      error
    } = (await createCustomDimensions(ALL_CUSTOM_DIMENSIONS)) ?? {};

    // The confirming sync can fail even when the dimensions exist, leaving
    // `availableCustomDimensions` stale and the notice unrendered. Reset the
    // attempt so the "New" CTA returns for a retry rather than the section
    // vanishing.
    if (error) {
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.FORM_CUSTOM_DIMENSIONS_CREATE, {
        [_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_ORIGIN_FORM_KEY]: undefined,
        [_js_modules_analytics_4_components_site_goals_constants__WEBPACK_IMPORTED_MODULE_9__.BREAKDOWN_SCOPE_FORM_KEY]: undefined
      });
    }
    return true;
  }, [createCustomDimensions, scope, hasAnalytics4EditScope, origin, redirectURL, registry, setPermissionScopeError, setValues]);
  return {
    onEnable,
    inProgress,
    disabled: isNavigatingToOAuthURL
  };
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useSiteGoalsSectionReady.ts"
/*!******************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useSiteGoalsSectionReady.ts ***!
  \******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   useSiteGoalsSectionReady: () => (/* binding */ useSiteGoalsSectionReady)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_ui_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_feature_tours_site_goals__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/feature-tours/site-goals */ "./js/modules/analytics-4/components/site-goals/feature-tours/site-goals.ts");
/**
 * Hook to wait for the Site Goals section to load.
 *
 * 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
 */




/**
 * Waits for the Site Goals section to load and its layout to settle.
 *
 * While `enabled` is `true`, the hook tells the widget areas above and
 * including the Site Goals section to load their data, so the page reaches
 * its full height before the tour starts. It returns `true` once those areas
 * finish loading and the target the tour points to keeps the same position,
 * after at most 30 seconds. When `enabled` turns `false`, or the component
 * unmounts, the hook stops loading those areas. The widgets keep the data
 * they already fetched, because an area stays loaded once it has come into
 * view.
 *
 * @since 1.182.0
 *
 * @param enabled Whether to load the widget areas and wait. While `false`, the hook reports the section as not ready.
 * @return Whether the Site Goals section is ready.
 */
function useSiteGoalsSectionReady(enabled) {
  const [isSectionReady, setIsSectionReady] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!enabled) {
      setIsSectionReady(false);
      return undefined;
    }
    setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.FORCED_IN_VIEW_WIDGET_AREAS, _js_modules_analytics_4_components_site_goals_feature_tours_site_goals__WEBPACK_IMPORTED_MODULE_3__.SITE_GOALS_TOUR_PRELOAD_WIDGET_AREAS);
    const abortController = new AbortController();
    (async () => {
      const isReady = await (0,_js_modules_analytics_4_components_site_goals_feature_tours_site_goals__WEBPACK_IMPORTED_MODULE_3__.waitForSiteGoalsSectionReady)(abortController.signal);
      if (isReady) {
        setIsSectionReady(true);
      }
    })();
    return () => {
      abortController.abort();
      // When the user clicks "Show me", the tour sets its own list to
      // load right after this cleanup runs.
      setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.FORCED_IN_VIEW_WIDGET_AREAS, undefined);
    };
  }, [enabled, setValue]);
  return isSectionReady;
}

/***/ },

/***/ "./js/modules/analytics-4/utils/audienceTilesReportOptions.ts"
/*!********************************************************************!*\
  !*** ./js/modules/analytics-4/utils/audienceTilesReportOptions.ts ***!
  \********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAudienceTilesMetricsReportOptions: () => (/* binding */ getAudienceTilesMetricsReportOptions),
/* harmony export */   getAudienceTilesSiteKitAudiencesReportOptions: () => (/* binding */ getAudienceTilesSiteKitAudiencesReportOptions),
/* harmony export */   getAudienceTilesTopCitiesReportOptions: () => (/* binding */ getAudienceTilesTopCitiesReportOptions),
/* harmony export */   getAudienceTilesTopContentPageTitlesReportOptions: () => (/* binding */ getAudienceTilesTopContentPageTitlesReportOptions),
/* harmony export */   getAudienceTilesTopContentReportOptions: () => (/* binding */ getAudienceTilesTopContentReportOptions),
/* harmony export */   getAudienceTilesTotalPageviewsReportOptions: () => (/* binding */ getAudienceTilesTotalPageviewsReportOptions)
/* harmony export */ });
/**
 * Report option builders for the Audience Tiles widget.
 *
 * 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
 */

/**
 * The date range parts every builder needs. The metrics builders also read the
 * comparison range for the delta chip.
 *
 * @since 1.184.0
 */

/**
 * The four per-audience metrics, in the order the tile reads them: visitors,
 * visits per visitor, pages per visit, and pageviews.
 *
 * @since 1.184.0
 */
const AUDIENCE_METRICS = [{
  name: 'totalUsers'
}, {
  name: 'sessionsPerUser'
}, {
  name: 'screenPageViewsPerSession'
}, {
  name: 'screenPageViews'
}];

/**
 * Limits the top content reports to posts, matching the dashboard's
 * `googlesitekit_post_type` filter.
 *
 * @since 1.184.0
 */
const POST_TYPE_DIMENSION_FILTERS = {
  'customEvent:googlesitekit_post_type': {
    filterType: 'stringFilter',
    matchType: 'EXACT',
    value: 'post'
  }
};

/**
 * Builds the main metrics report options, one report split by
 * `audienceResourceName` and filtered to the given audiences.
 *
 * @since 1.184.0
 *
 * @param dates     Report date range, including the comparison range.
 * @param audiences Audience resource names to filter the report to.
 * @return Report options for the main per-audience metrics report.
 */
function getAudienceTilesMetricsReportOptions(dates, audiences) {
  return {
    ...dates,
    dimensions: [{
      name: 'audienceResourceName'
    }],
    dimensionFilters: {
      audienceResourceName: audiences
    },
    metrics: AUDIENCE_METRICS,
    reportID: 'audience-segmentation_use-audience-tiles-reports_hook_reportOptions'
  };
}

/**
 * Builds the Site Kit fallback report options, the same four metrics split by
 * `newVsReturning`.
 *
 * It covers new and returning visitors while they're still gathering data, when
 * the `audienceResourceName` dimension is empty.
 *
 * @since 1.184.0
 *
 * @param dates Report date range, including the comparison range.
 * @return Report options for the `newVsReturning` fallback report.
 */
function getAudienceTilesSiteKitAudiencesReportOptions(dates) {
  return {
    ...dates,
    dimensions: [{
      name: 'newVsReturning'
    }],
    dimensionFilters: {
      newVsReturning: ['new', 'returning']
    },
    metrics: AUDIENCE_METRICS,
    reportID: 'audience-segmentation_use-audience-tiles-reports_hook_newVsReturningReportOptions'
  };
}

/**
 * Builds the total pageviews report options, one `screenPageViews` total for
 * the whole site, the denominator for each audience's "% of total pageviews".
 *
 * @since 1.184.0
 *
 * @param dates Report date range.
 * @return Report options for the total pageviews report.
 */
function getAudienceTilesTotalPageviewsReportOptions(dates) {
  const {
    startDate,
    endDate
  } = dates;
  return {
    startDate,
    endDate,
    metrics: [{
      name: 'screenPageViews'
    }],
    reportID: 'audience-segmentation_use-audience-tiles-reports_hook_totalPageviewsReportOptions'
  };
}

/**
 * Builds the top cities report options for cities ranked by `totalUsers`,
 * limited to 4 so the `(not set)` row drops and three cities remain.
 *
 * @since 1.184.0
 *
 * @param dates Report date range.
 * @return Report options for the top cities report.
 */
function getAudienceTilesTopCitiesReportOptions(dates) {
  const {
    startDate,
    endDate
  } = dates;
  return {
    startDate,
    endDate,
    dimensions: ['city'],
    metrics: [{
      name: 'totalUsers'
    }],
    orderby: [{
      metric: {
        metricName: 'totalUsers'
      },
      desc: true
    }],
    limit: 4,
    reportID: 'audience-segmentation_use-audience-tiles-reports_hook_topCitiesReportOptions'
  };
}

/**
 * Builds the top content report options for post pages ranked by
 * `screenPageViews`, filtered to posts by the `googlesitekit_post_type` custom
 * event, limited to three.
 *
 * @since 1.184.0
 *
 * @param dates Report date range.
 * @return Report options for the top content report.
 */
function getAudienceTilesTopContentReportOptions(dates) {
  const {
    startDate,
    endDate
  } = dates;
  return {
    startDate,
    endDate,
    dimensions: ['pagePath'],
    metrics: [{
      name: 'screenPageViews'
    }],
    dimensionFilters: POST_TYPE_DIMENSION_FILTERS,
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 3,
    reportID: 'audience-segmentation_use-audience-tiles-reports_hook_topContentReportOptions'
  };
}

/**
 * Builds the page titles report options.
 *
 * It pairs `pagePath` with `pageTitle` for the post pages, so a path from the
 * top content report resolves to its title. The limit of 15 gives enough rows
 * for the lookup.
 *
 * @since 1.184.0
 *
 * @param dates Report date range.
 * @return Report options for the top content page titles report.
 */
function getAudienceTilesTopContentPageTitlesReportOptions(dates) {
  const {
    startDate,
    endDate
  } = dates;
  return {
    startDate,
    endDate,
    dimensions: ['pagePath', 'pageTitle'],
    metrics: [{
      name: 'screenPageViews'
    }],
    dimensionFilters: POST_TYPE_DIMENSION_FILTERS,
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 15,
    reportID: 'audience-segmentation_use-audience-tiles-reports_hook_topContentPageTitlesReportOptions'
  };
}

/***/ },

/***/ "./js/modules/analytics-4/utils/page-report-url.ts"
/*!*********************************************************!*\
  !*** ./js/modules/analytics-4/utils/page-report-url.ts ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getAllPagesReportURL: () => (/* binding */ getAllPagesReportURL)
/* harmony export */ });
/**
 * Analytics 4 page report URL helper.
 *
 * Shared by the PDF export loaders that link a page title to its All pages and
 * screens report.
 *
 * 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.
 */

/**
 * The Analytics 4 selectors this helper reads.
 */

/**
 * Builds the All pages and screens report URL a page title links to.
 *
 * @since n.e.x.t
 *
 * @param {ReportURLSelect} analytics       The Analytics 4 store's selectors.
 * @param {string}          pagePath        The page path to filter the report to.
 * @param {Object}          dates           The report's date range.
 * @param {string}          dates.startDate The first day of the range (YYYY-MM-DD).
 * @param {string}          dates.endDate   The last day of the range (YYYY-MM-DD).
 * @return {string|undefined} The report URL, or `undefined` before the Analytics property loads.
 */
function getAllPagesReportURL(analytics, pagePath, dates) {
  return analytics.getServiceReportURL('all-pages-and-screens', {
    filters: {
      unifiedPagePathScreen: pagePath
    },
    dates
  });
}

/***/ },

/***/ "./js/modules/analytics-4/utils/page-titles-report.ts"
/*!************************************************************!*\
  !*** ./js/modules/analytics-4/utils/page-titles-report.ts ***!
  \************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   PAGE_TITLES_REPORT_ID: () => (/* binding */ PAGE_TITLES_REPORT_ID),
/* harmony export */   PAGE_TITLES_REQUEST_MULTIPLIER: () => (/* binding */ PAGE_TITLES_REQUEST_MULTIPLIER),
/* harmony export */   getPagePaths: () => (/* binding */ getPagePaths),
/* harmony export */   getPageTitleMap: () => (/* binding */ getPageTitleMap),
/* harmony export */   getPageTitlesReportOptions: () => (/* binding */ getPageTitlesReportOptions)
/* 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 4 page titles report helpers.
 *
 * Shared by the `getPageTitles` selector and the PDF export loaders, so the page
 * titles report they request — and the cache key it resolves to — cannot drift.
 *
 * 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
 */

/**
 * How many rows the page titles report requests for each page path.
 *
 * @since 1.184.0
 */
const PAGE_TITLES_REQUEST_MULTIPLIER = 5;

/**
 * Report ID (cache key) for the page titles report.
 *
 * @since 1.184.0
 */
const PAGE_TITLES_REPORT_ID = 'analytics-4_get-page-titles_store:selector_options';

/**
 * Collects the unique page paths from a report's rows.
 *
 * The reports this serves dimension `pagePath` first, so each row's first
 * dimension value is its page path.
 *
 * @since 1.184.0
 *
 * @param [report] Report whose rows carry the page paths.
 * @return Unique page paths in row order.
 */
function getPagePaths(report) {
  const pagePaths = [];
  (report?.rows ?? []).forEach(row => {
    const pagePath = row.dimensionValues?.[0]?.value;
    if (pagePath && !pagePaths.includes(pagePath)) {
      pagePaths.push(pagePath);
    }
  });
  return pagePaths;
}

/**
 * Builds the GA4 `getReport` args for the page titles report.
 *
 * @since 1.184.0
 *
 * @param dates           Report date range.
 * @param dates.startDate Report start date (YYYY-MM-DD).
 * @param dates.endDate   Report end date (YYYY-MM-DD).
 * @param pagePaths       Page paths to resolve titles for.
 * @return GA4 getReport args for the page titles report.
 */
function getPageTitlesReportOptions({
  startDate,
  endDate
}, pagePaths) {
  return {
    startDate,
    endDate,
    dimensions: ['pagePath', 'pageTitle'],
    dimensionFilters: {
      pagePath: [...pagePaths].sort()
    },
    metrics: [{
      name: 'screenPageViews'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: PAGE_TITLES_REQUEST_MULTIPLIER * pagePaths.length,
    reportID: PAGE_TITLES_REPORT_ID
  };
}

/**
 * Maps each page path to its title.
 *
 * Keeps the first title found for each path and falls back to `(unknown)` for
 * any path the titles report missed.
 *
 * @since 1.184.0
 *
 * @param pagePaths      Page paths the titles were requested for.
 * @param [titlesReport] Page titles report.
 * @return Map of page path to page title.
 */
function getPageTitleMap(pagePaths, titlesReport) {
  const titles = {};
  (titlesReport?.rows ?? []).forEach(row => {
    const pagePath = row.dimensionValues?.[0]?.value;
    const pageTitle = row.dimensionValues?.[1]?.value;
    if (pagePath && !titles[pagePath]) {
      titles[pagePath] = pageTitle ?? '';
    }
  });
  pagePaths.forEach(pagePath => {
    if (!titles[pagePath]) {
      titles[pagePath] = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('(unknown)', 'google-site-kit');
    }
  });
  return titles;
}

/***/ },

/***/ "./js/util/escape-uri.ts"
/*!*******************************!*\
  !*** ./js/util/escape-uri.ts ***!
  \*******************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   escapeURI: () => (/* binding */ escapeURI)
/* harmony export */ });
/**
 * Escape URI components 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.
 */

/**
 * Escapes URI components in a template string as a tag function.
 *
 * @example
 * ```
 * // Escape a redirect url:
 * const redirectTo = 'http://localhost/admin/';
 * const loginUrl = escapeURI`http://localhost/login?redirect=${ redirectTo }`;
 * ```
 * @since 1.11.0
 *
 * @param strings The array of static strings in the template.
 * @param values  The array of expressions used in the template.
 * @return The escaped URI.
 */
function escapeURI(
/**
 * The array of static strings in the template.
 */
strings,
/**
 * The array of expressions used in the template.
 */
...values) {
  return strings.reduce((acc, string, idx) => {
    return acc + string + encodeURIComponent(values[idx] || '');
  }, '');
}

/***/ },

/***/ "./js/util/report-options.ts"
/*!***********************************!*\
  !*** ./js/util/report-options.ts ***!
  \***********************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   getCacheableReportOptions: () => (/* binding */ getCacheableReportOptions),
/* harmony export */   getReportCacheKey: () => (/* binding */ getReportCacheKey)
/* 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 _stringify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./stringify */ "./js/util/stringify.js");
/**
 * Helpers for report cache keys.
 *
 * 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
 */



/**
 * Report options shared by the Analytics 4, Search Console, and AdSense stores.
 *
 * Analytics 4 passes `ReportOptions`. The type also allows any object, because
 * the Search Console and AdSense stores pass other shapes. Search Console has
 * no `metrics`, which `ReportOptions` requires, and AdSense uses a different
 * `orderby`.
 *
 * @since 1.183.0
 */

/**
 * Removes `reportID` from report options.
 *
 * `reportID` is only a label that says which part of the plugin asked for the
 * report, and it does not change the report data. So two calls that differ
 * only in `reportID` ask for the same report. They can share one request and
 * one cache entry. Returns the value unchanged when it is not a plain object,
 * so option validation still sees the original input.
 *
 * @since 1.183.0
 *
 * @param options Report options as the caller passed them.
 * @return Report options without `reportID`.
 */
function getCacheableReportOptions(options) {
  if (!(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(options)) {
    return options;
  }
  return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.omit)(options, ['reportID']);
}

/**
 * Builds the cache key for a report from its options.
 *
 * Removes `reportID` first, then turns the rest of the options into a stable
 * string. So two calls that differ only in `reportID` get the same key, and
 * they share one saved report and one request.
 *
 * @since 1.183.0
 *
 * @param options Report options as the caller passed them.
 * @return Cache key for the saved report and the running request map.
 */
function getReportCacheKey(options) {
  return (0,_stringify__WEBPACK_IMPORTED_MODULE_1__.stringifyObject)(getCacheableReportOptions(options));
}

/***/ },

/***/ "./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/withIntersectionObserver.tsx"
/*!**********************************************!*\
  !*** ./js/util/withIntersectionObserver.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": () => (/* binding */ withIntersectionObserver)
/* harmony export */ });
/* harmony import */ var _babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/extends */ "../node_modules/@babel/runtime/helpers/esm/extends.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");

/**
 * `withIntersectionObserver` HOC.
 *
 * 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
 */

/**
 * Higher-Order Component that tells a wrapped component when it is in view.
 *
 * Observes the wrapped component's element with an `IntersectionObserver`. The
 * first time at least `threshold` of the element is visible (`0.45` by
 * default), it calls `onInView`, sets the `hasBeenInView` prop to `true`, and
 * disconnects the observer, so it reports only that first time.
 *
 * @since 1.125.0
 * @since 1.184.0 Replaces the `react-use` `useIntersection` hook. Adds the `hasBeenInView` prop and a configurable `threshold`, and makes `onInView` optional.
 *
 * @param WrappedComponent  Component to wrap. It must attach the ref it receives to the element to observe.
 * @param options           Observer options.
 * @param options.threshold Fraction of the element that must be visible for it to count as in view, from `0` to `1`. Defaults to `0.45`.
 * @return The component that observes its element and renders the wrapped component.
 */
function withIntersectionObserver(WrappedComponent, {
  threshold = 0.45
} = {}) {
  // Besides its own props, the wrapped component receives the ref of the
  // element to observe and the `hasBeenInView` prop.
  const ObservedComponent = WrappedComponent;
  function WithIntersectionObserverComponent({
    onInView,
    ...props
  }) {
    const [hasBeenInView, setHasBeenInView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
    const hasBeenInViewRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
    const observerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
    const onInViewRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(onInView);
    (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
      onInViewRef.current = onInView;
    }, [onInView]);
    (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
      return () => {
        observerRef.current?.disconnect();
        observerRef.current = null;
      };
    }, []);

    // `observeElement` is a callback ref, so React calls it each time
    // the wrapped component attaches or detaches the observed element.
    // The element can appear on a later render, for example once the
    // component's data loads, and a ref object read once inside an
    // effect with empty dependencies would miss it.
    const observeElement = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(element => {
      observerRef.current?.disconnect();
      observerRef.current = null;
      if (!element || hasBeenInViewRef.current || typeof globalThis.IntersectionObserver !== 'function') {
        return;
      }
      const observer = new globalThis.IntersectionObserver(entries => {
        if (!entries.some(entry => entry.isIntersecting)) {
          return;
        }

        // The wrapped component needs this only once, so disconnect
        // the observer.
        observer.disconnect();
        observerRef.current = null;
        hasBeenInViewRef.current = true;
        onInViewRef.current?.();
        setHasBeenInView(true);
      }, {
        threshold
      });
      observer.observe(element);
      observerRef.current = observer;
    }, []);
    return /*#__PURE__*/React.createElement(ObservedComponent, (0,_babel_runtime_helpers_extends__WEBPACK_IMPORTED_MODULE_0__["default"])({
      ref: observeElement
    }, props, {
      hasBeenInView: hasBeenInView
    }));
  }
  WithIntersectionObserverComponent.displayName = 'WithIntersectionObserverComponent';
  if (WrappedComponent.displayName || WrappedComponent.name) {
    WithIntersectionObserverComponent.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
  }
  return WithIntersectionObserverComponent;
}

/***/ },

/***/ "./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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _svg_icons_warning_v2_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/warning-v2.svg */ "./svg/icons/warning-v2.svg");
/* harmony import */ var _VisuallyHidden__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./VisuallyHidden */ "./js/components/VisuallyHidden.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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_2__.__)('Error', 'google-site-kit'),
  width = 14
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_VisuallyHidden__WEBPACK_IMPORTED_MODULE_4__["default"], {
      children: screenReaderText
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_svg_icons_warning_v2_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
      width: width,
      height: height
    })]
  });
}
AccessibleWarningIcon.propTypes = {
  height: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
  screenReaderText: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_0__ = __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_components_JoyrideTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/JoyrideTooltip */ "./js/components/JoyrideTooltip.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_5__["default"])();
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_UI);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.useBreakpoint)();
  const {
    isTooltipVisible = false,
    target,
    placement,
    className,
    tooltipSlug,
    title,
    content,
    dismissLabel,
    gaTrackingEventLabel,
    floaterProps,
    isCenteredOnMobile = true
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_UI).getValue('admin-screen-tooltip') || {
    isTooltipVisible: false
  });
  function handleViewTooltip() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_${tooltipSlug}`, 'tooltip_view', gaTrackingEventLabel);
  }
  const handleDismissTooltip = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    // Track dismiss event.
    if (tooltipSlug) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.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_4__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_TABLET;
  const shouldCenter = isCenteredOnMobile && isMobileTablet;
  const desktopTarget = target ?? '#adminmenu [href*="page=googlesitekit-settings"]';
  const desktopPlacement = 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_7__.jsx)(_js_components_JoyrideTooltip__WEBPACK_IMPORTED_MODULE_2__["default"], {
    target: shouldCenter ? 'body' : desktopTarget,
    placement: shouldCenter ? 'center' : desktopPlacement,
    className: shouldCenter ? 'googlesitekit-tour-tooltip__modal_step' : desktopClassName(),
    disableOverlay: !shouldCenter,
    slug: "admin-screen-tooltip",
    title: title,
    content: content,
    dismissLabel: dismissLabel,
    onView: handleViewTooltip,
    onDismiss: handleDismissTooltip,
    floaterProps: floaterProps
  });
}

/***/ },

/***/ "./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_0__ = __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_ui_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function useShowTooltip(tooltipSettings) {
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI);
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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_3__.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_1___default().string).isRequired,
  hasLeftSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Badge);

/***/ },

/***/ "./js/components/BadgeWithTooltip.js"
/*!*******************************************!*\
  !*** ./js/components/BadgeWithTooltip.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 */ BadgeWithTooltip)
/* 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_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 _InfoTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * BadgeWithTooltip 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 BadgeWithTooltip({
  className = '',
  label,
  onTooltipOpen,
  tooltipTitle
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("span", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-badge-with-tooltip', 'googlesitekit-badge', className),
    children: [label, tooltipTitle && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_InfoTooltip__WEBPACK_IMPORTED_MODULE_2__["default"], {
      onOpen: onTooltipOpen,
      title: tooltipTitle
    })]
  });
}
BadgeWithTooltip.propTypes = {
  onTooltipOpen: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  tooltipTitle: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node).isRequired
};

/***/ },

/***/ "./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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _LearnMoreLink__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./LearnMoreLink */ "./js/components/Banner/LearnMoreLink.tsx");
/* 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.
 */

/**
 * External dependencies
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */



function Description({
  className,
  description,
  learnMoreLink,
  additionalDescription,
  children
}) {
  function renderDescription() {
    if ((0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.isValidElement)(description)) {
      return description;
    }
    if ('string' === typeof description) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
        dangerouslySetInnerHTML: (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.sanitizeHTML)(description, {
          ALLOWED_TAGS: ['strong', 'em', 'br', 'a'],
          ALLOWED_ATTR: ['href']
        })
      });
    }
    return description;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.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_5__.jsx)(_LearnMoreLink__WEBPACK_IMPORTED_MODULE_4__["default"], {
      ...learnMoreLink
    }), additionalDescription && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      className: "googlesitekit-banner__additional-description",
      children: additionalDescription
    }), children]
  });
}
Description.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)]),
  learnMoreLink: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(_LearnMoreLink__WEBPACK_IMPORTED_MODULE_4__["default"].propTypes),
  additionalDescription: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)]),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)
};

/***/ },

/***/ "./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_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_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
 */



function Footer({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__footer', className),
    children: children
  });
}
Footer.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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_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
 */



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

/***/ },

/***/ "./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_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_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
 */



function Title({
  className,
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-banner__title', className),
    children: children
  });
}
Title.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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_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
 */



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

/***/ },

/***/ "./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 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_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_2__ = __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_2__.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_2__.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_1___default().string),
  invertColor: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  height: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)
};
ChangeArrow.defaultProps = {
  direction: 'up',
  invertColor: false,
  width: 9,
  height: 9
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ChangeArrow);

/***/ },

/***/ "./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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.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_2__.useBreakpoint)();
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_3__["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_0__.useCallback)(() => {
    if (visibleSections.includes(_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_KEY_METRICS)) {
      return _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_KEY_METRICS;
    }
    if (!viewOnlyDashboard) {
      return _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.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_0__.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_0__.useCallback)(chipID => {
    globalThis.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_0__.useCallback)(chipID => {
    return chipID !== defaultChipID ? (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_4__.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_0__.useCallback)(chipID => {
    globalThis.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_0__.useCallback)(ref => {
    const entityHeader = document.querySelector('.googlesitekit-entity-header')?.getBoundingClientRect?.()?.bottom;
    const {
      bottom
    } = ref?.current?.getBoundingClientRect?.() ?? {};
    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_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_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_contexts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-contexts */ "./js/googlesitekit/widgets/default-contexts.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_4__.CONTEXT_MAIN_DASHBOARD_KEY_METRICS,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_TRAFFIC]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.CONTEXT_MAIN_DASHBOARD_TRAFFIC,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SITE_GOALS]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.CONTEXT_MAIN_DASHBOARD_SITE_GOALS,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_CONTENT]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.CONTEXT_MAIN_DASHBOARD_CONTENT,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SPEED]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.CONTEXT_MAIN_DASHBOARD_SPEED,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_MONETIZATION]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.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_4__.CONTEXT_ENTITY_DASHBOARD_TRAFFIC,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_CONTENT]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.CONTEXT_ENTITY_DASHBOARD_CONTENT,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_SPEED]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.CONTEXT_ENTITY_DASHBOARD_SPEED,
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.ANCHOR_ID_MONETIZATION]: _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_4__.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_2__.CORE_USER).getViewableModules() : null;
    const isKeyMetricsWidgetHidden = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_3__.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 _material_react_chips__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material/react-chips */ "../node_modules/@material/react-chips/dist/index.js");
/* harmony import */ var _material_react_chips__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_material_react_chips__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_2__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-throttle/index.js");
/* 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_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);
/* 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_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.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 _js_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_nav_content_icon_svg__WEBPACK_IMPORTED_MODULE_13__ = __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_14__ = __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_15__ = __webpack_require__(/*! @/svg/icons/nav-monetization-icon.svg */ "./svg/icons/nav-monetization-icon.svg");
/* harmony import */ var _svg_icons_nav_site_goals_icon_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/svg/icons/nav-site-goals-icon.svg */ "./svg/icons/nav-site-goals-icon.svg");
/* harmony import */ var _svg_icons_nav_speed_icon_svg__WEBPACK_IMPORTED_MODULE_17__ = __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_18__ = __webpack_require__(/*! @/svg/icons/nav-traffic-icon.svg */ "./svg/icons/nav-traffic-icon.svg");
/* harmony import */ var _hooks_useNavChipHelpers__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./hooks/useNavChipHelpers */ "./js/components/DashboardNavigation/Navigation/hooks/useNavChipHelpers.js");
/* harmony import */ var _hooks_useVisibleSections__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./hooks/useVisibleSections */ "./js/components/DashboardNavigation/Navigation/hooks/useVisibleSections.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__ = __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_10__["default"])();
  const elementRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const visibleSections = (0,_hooks_useVisibleSections__WEBPACK_IMPORTED_MODULE_20__["default"])();
  const {
    calculateScrollPosition,
    defaultChipID,
    findClosestSection,
    isValidChipID,
    scrollToChip,
    updateURLHash
  } = (0,_hooks_useNavChipHelpers__WEBPACK_IMPORTED_MODULE_19__["default"])({
    visibleSections
  });
  const initialHash = globalThis.location.hash?.substring(1);
  const [isJumpingTo, setIsJumpingTo] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(initialHash || undefined);
  const [isSticky, setIsSticky] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(false);
  const [selectedID, setSelectedID] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(initialHash);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__.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_5__.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_12__.trackEvent)(`${viewContext}_navigation`, 'tab_select', chipID);
    setTimeout(() => {
      setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__.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_5__.useCallback)(() => {
    if (!elementRef?.current) {
      return;
    }
    const {
      top
    } = elementRef?.current?.getBoundingClientRect();
    if (globalThis.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_5__.useCallback)(event => {
    function changeSelectedChip(chipID) {
      setValue(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__.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
      } = globalThis.location;
      if (closestID !== hash?.substring(1)) {
        if (event) {
          (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.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_3__["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_9__.ACTIVE_CONTEXT_ID, chipID);

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

  // Handle scroll events to update sticky state and selected chip.
  (0,react_use__WEBPACK_IMPORTED_MODULE_2__["default"])('scroll', throttledOnScroll);
  const navigationChipIconSize = 20;
  const chips = {
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_8__.ANCHOR_ID_KEY_METRICS]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Key metrics', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_svg_icons_nav_key_metrics_icon_svg__WEBPACK_IMPORTED_MODULE_14__["default"], {
        width: navigationChipIconSize,
        height: navigationChipIconSize
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_8__.ANCHOR_ID_TRAFFIC]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Traffic', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_svg_icons_nav_traffic_icon_svg__WEBPACK_IMPORTED_MODULE_18__["default"], {
        width: navigationChipIconSize,
        height: navigationChipIconSize
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_8__.ANCHOR_ID_SITE_GOALS]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Site goals', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_svg_icons_nav_site_goals_icon_svg__WEBPACK_IMPORTED_MODULE_16__["default"], {
        width: navigationChipIconSize,
        height: navigationChipIconSize
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_8__.ANCHOR_ID_CONTENT]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Content', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_svg_icons_nav_content_icon_svg__WEBPACK_IMPORTED_MODULE_13__["default"], {
        width: navigationChipIconSize,
        height: navigationChipIconSize
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_8__.ANCHOR_ID_SPEED]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Speed', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_svg_icons_nav_speed_icon_svg__WEBPACK_IMPORTED_MODULE_17__["default"], {
        width: navigationChipIconSize,
        height: navigationChipIconSize
      })
    },
    [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_8__.ANCHOR_ID_MONETIZATION]: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Monetization', 'google-site-kit'),
      icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_svg_icons_nav_monetization_icon_svg__WEBPACK_IMPORTED_MODULE_15__["default"], {
        width: navigationChipIconSize,
        height: navigationChipIconSize
      })
    }
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("nav", {
    className: classnames__WEBPACK_IMPORTED_MODULE_1___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_21__.jsx)(_material_react_chips__WEBPACK_IMPORTED_MODULE_0__.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_components_LoadingWrapper__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/LoadingWrapper */ "./js/components/LoadingWrapper.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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_3__["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_2__.CORE_USER).getViewableModules();
  });
  const keyMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_1__["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 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_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 _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_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ChangeArrow */ "./js/components/ChangeArrow.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");
/**
 * 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_4__.numFmt)(change, {
        style: 'percent',
        signDisplay: 'never',
        maximumFractionDigits: 1
      });
    } else {
      changeFormatted = (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.numFmt)(change, changeDataUnit);
    }
  }

  // If period is given (requires %s placeholder), add it.
  if (period) {
    changeFormatted = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(period, changeFormatted);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.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_5__.jsx)("span", {
      className: "googlesitekit-data-block__arrow",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.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_5__.jsx)("span", {
      className: "googlesitekit-data-block__value",
      children: changeFormatted
    })]
  });
}
Change.propTypes = {
  change: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)]),
  changeDataUnit: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)]),
  period: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Badge */ "./js/components/Badge.js");
/* harmony import */ var _js_components_SourceLink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _Change__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Change */ "./js/components/DataBlock/Change.js");
/* harmony import */ var _Sparkline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Sparkline */ "./js/components/DataBlock/Sparkline.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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_5__.numFmt)(datapoint, datapointUnit);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "googlesitekit-data-block__title-datapoint-wrapper",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_4__["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_8__.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_8__.jsx)("span", {
          className: "googlesitekit-data-block__title-inner",
          children: title
        })]
      }), !gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
        className: "googlesitekit-data-block__datapoint",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("span", {
          className: "googlesitekit-data-block__datapoint--resize",
          children: datapointFormatted
        })
      })]
    }), !gatheringData && sparkline && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Sparkline__WEBPACK_IMPORTED_MODULE_7__["default"], {
      sparkline: sparkline,
      invertChangeColor: invertChangeColor
    }), !gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "googlesitekit-data-block__change-source-wrapper",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Change__WEBPACK_IMPORTED_MODULE_6__["default"], {
        change: change,
        changeDataUnit: changeDataUnit,
        period: period,
        invertChangeColor: invertChangeColor
      }), source && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_3__["default"], {
        className: "googlesitekit-data-block__source",
        name: source.name,
        href: source.link,
        external: source?.external
      })]
    })]
  });
}
Content.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  datapoint: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)]),
  datapointUnit: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  change: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)]),
  changeDataUnit: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)]),
  period: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  source: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  sparkline: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  badge: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* 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_2__ = __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_2__.jsx)("div", {
    className: "googlesitekit-data-block__sparkline",
    children: sparklineComponent
  });
}
Sparkline.propTypes = {
  sparkline: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_0___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 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/GatheringDataNotice */ "./js/components/GatheringDataNotice.js");
/* harmony import */ var _Content__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Content */ "./js/components/DataBlock/Content.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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_3__.NOTICE_STYLE.DEFAULT,
  badge
}) {
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    if (!gatheringData && handleStatSelection) {
      handleStatSelection(stat);
    }
  }, [gatheringData, handleStatSelection, stat]);
  const handleKeyDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.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_5__.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_5__.jsx)(_Content__WEBPACK_IMPORTED_MODULE_4__["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_5__.jsx)(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_3__["default"], {
      style: gatheringDataNoticeStyle
    })]
  });
}
DataBlock.propTypes = {
  stat: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  datapoint: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)]),
  datapointUnit: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  change: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)]),
  changeDataUnit: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)]),
  context: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  period: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  selected: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  source: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  sparkline: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
  handleStatSelection: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  gatheringDataNoticeStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(Object.values(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_3__.NOTICE_STYLE)),
  badge: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_1___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_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __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_3__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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
 */


/**
 * Internal 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(globalThis?.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_3__.useDebounce)(adjustFontSize, 50);
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])('resize', debouncedAdjustFontSize);
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    debouncedAdjustFontSize();
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
    ref: ref,
    className: className,
    children: children
  });
}

/***/ },

/***/ "./js/components/DetailsPermaLinks.js"
/*!********************************************!*\
  !*** ./js/components/DetailsPermaLinks.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 */ DetailsPermaLinks)
/* 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/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__);
/* 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_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Details Permalink Links 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 DetailsPermaLinks({
  title,
  path,
  serviceURL
}) {
  const siteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getReferenceSiteURL());
  const permaLink = (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.getFullURL)(siteURL, path);
  const detailsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getAdminURL('googlesitekit-dashboard', {
      permaLink
    });
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
      className: "googlesitekit-font-weight-medium",
      href: serviceURL || detailsURL,
      external: !!serviceURL,
      hideExternalIndicator: true,
      children: title
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-display-block', 'googlesitekit-overflow-wrap-break-word'),
      href: permaLink,
      target: "_blank" // No external styling.
      ,
      small: true,
      children: path
    })]
  });
}
DetailsPermaLinks.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  path: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  serviceURL: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
};

/***/ },

/***/ "./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.
 */

/**
 * External dependencies
 */

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 react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-throttle/index.js");
/* 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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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 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_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_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.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_util_urls__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/urls */ "./js/util/urls.js");
/* harmony import */ var _svg_icons_keyboard_backspace_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/svg/icons/keyboard-backspace.svg */ "./svg/icons/keyboard-backspace.svg");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var _Typography_P__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __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.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */












function EntityHeader() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const dashboardType = (0,_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const currentEntityTitle = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getCurrentEntityTitle());
  const entityURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getCurrentEntityURL());
  const headerDetailsRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)();
  const [url, setURL] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(entityURL);
  const shortenEntityURL = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.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 = globalThis.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_11__.shortenURL)(entityURL, maxChars));
  }, [entityURL]);
  const throttledShortenEntityURL = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])(shortenEntityURL, 150);
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])('resize', throttledShortenEntityURL);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_LOCATION);
  const returnURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getAdminURL('googlesitekit-dashboard'));
  const onClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_navigation`, 'return_to_dashboard');
    navigateTo(returnURL);
  }, [returnURL, navigateTo, viewContext]);
  if (_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_8__.DASHBOARD_TYPE_ENTITY !== dashboardType || entityURL === null || currentEntityTitle === null) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("div", {
    className: "googlesitekit-entity-header",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div", {
      className: "googlesitekit-entity-header__back",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
        icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_svg_icons_keyboard_backspace_svg__WEBPACK_IMPORTED_MODULE_12__["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_3__.__)('Back to dashboard', 'google-site-kit'),
        onClick: onClick,
        text: true,
        tertiary: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Back to dashboard', 'google-site-kit')
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("div", {
      ref: headerDetailsRef,
      className: "googlesitekit-entity-header__details",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_Typography_P__WEBPACK_IMPORTED_MODULE_14__["default"], {
        children: currentEntityTitle
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_13__["default"], {
        href: entityURL,
        "aria-label": entityURL,
        secondary: true,
        external: true,
        children: url
      })]
    })]
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (EntityHeader);

/***/ },

/***/ "./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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_1__ = __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_0__.createContext)(_js_features__WEBPACK_IMPORTED_MODULE_1__.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 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_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 _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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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_3__.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_3__.jsx)("span", {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Gathering data…', 'google-site-kit')
    })
  });
}
GatheringDataNotice.propTypes = {
  style: prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* 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 _ReportErrorButton__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ReportErrorButton */ "./js/components/ReportErrorButton/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_4__.jsxs)("div", {
    className: "googlesitekit-generic-error-handler-actions",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_ReportErrorButton__WEBPACK_IMPORTED_MODULE_3__["default"], {
      message: message,
      componentStack: componentStack
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_2__["default"], {
      href: "https://wordpress.org/support/plugin/google-site-kit/",
      external: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Report this problem', 'google-site-kit')
    })]
  });
}
GenericErrorHandlerActions.propTypes = {
  message: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  componentStack: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/icon/index.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/library/info.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_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_5__["default"])();
  const eventCategory = `${viewContext}_ga4-data-collection-line`;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(eventCategory, 'chart_line_view');
  }, [eventCategory]);
  const trackTooltipOpen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(eventCategory, 'chart_tooltip_view');
  }, [eventCategory]);
  const handleTooltipOpen = (0,_js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_4__.useDebounce)(trackTooltipOpen, 5000, {
    leading: true,
    trailing: false
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      id: `googlesitekit-chart__date-marker-line--${id}`,
      className: "googlesitekit-chart__date-marker-line"
    }), text && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      id: `googlesitekit-chart__date-marker-tooltip--${id}`,
      className: "googlesitekit-chart__date-marker-tooltip",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Tooltip, {
        title: text,
        onOpen: handleTooltipOpen,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_1__["default"], {
            fill: "currentColor",
            icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_2__["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_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_google_charts__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-google-charts */ "../node_modules/react-google-charts/dist/index.esm.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.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_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/GatheringDataNotice */ "./js/components/GatheringDataNotice.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 _js_components_GoogleChartErrorHandler__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/components/GoogleChartErrorHandler */ "./js/components/GoogleChartErrorHandler/index.js");
/* harmony import */ var _DateMarker__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./DateMarker */ "./js/components/GoogleChart/DateMarker.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./constants */ "./js/components/GoogleChart/constants.ts");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util_is_site_kit_screen__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/util/is-site-kit-screen */ "./js/util/is-site-kit-screen.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./utils */ "./js/components/GoogleChart/utils.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__ = __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
 */
// eslint-disable-next-line sitekit/sort-import-groups -- prevent the `initialize-google-global` import from being moved to the "Internal dependencies" group.






/**
 * 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_6__["default"])(GoogleChart);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_20__.useBreakpoint)();
  const {
    startDate,
    endDate
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).getDateRangeDates());
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_16__["default"])();
  const googleChartsCollisionError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_15__.CORE_UI).getValue('googleChartsCollisionError'));
  const [isChartLoaded, setIsChartLoaded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useState)(false);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_11__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_15__.CORE_UI);
  const filteredData = (0,_utils__WEBPACK_IMPORTED_MODULE_18__.getFilteredChartData)(data, selectedStats);
  const loadingShape = chartType === 'PieChart' ? 'circular' : 'square';
  const loadingDimensions = (0,_utils__WEBPACK_IMPORTED_MODULE_18__.getLoadingDimensions)(loadingHeight, height, loadingWidth, width);
  const loader = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("div", {
    className: "googlesitekit-chart-loading",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_8__["default"], {
      className: "googlesitekit-chart-loading__wrapper",
      shape: loadingShape,
      ...loadingDimensions
    })
  });
  const chartWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.useRef)();
  const googleRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.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_5__["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_17__.isSiteKitScreen)(viewContext) && globalThis?.google?.charts) {
      globalThis.google.charts = undefined;
    }
    if (!(0,_js_util_is_site_kit_screen__WEBPACK_IMPORTED_MODULE_17__.isSiteKitScreen)(viewContext) && globalThis?.google?.charts) {
      setValue('googleChartsCollisionError', true);
    } else {
      setValue('googleChartsCollisionError', false);
    }
  });
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_19__.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_19__.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_19__.stringToDate)((0,_js_util__WEBPACK_IMPORTED_MODULE_19__.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_21__.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_18__.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_18__.getChartOptions)(options, {
    gatheringData,
    chartType,
    startDate,
    endDate,
    breakpoint
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_GoogleChartErrorHandler__WEBPACK_IMPORTED_MODULE_12__["default"], {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.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_21__.jsx)(react_google_charts__WEBPACK_IMPORTED_MODULE_4__.Chart, {
        className: "googlesitekit-chart__inner",
        chartEvents: combinedChartEvents,
        chartLanguage: (0,_js_util__WEBPACK_IMPORTED_MODULE_19__.getLocale)(),
        chartType: chartType,
        chartVersion: _constants__WEBPACK_IMPORTED_MODULE_14__.CHART_VERSION,
        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_21__.jsx)(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_10__["default"], {
        style: _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_10__.NOTICE_STYLE.OVERLAY
      }), !!dateMarkersInRange.length && dateMarkersInRange.map((dateMarker, index) => {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_DateMarker__WEBPACK_IMPORTED_MODULE_13__["default"], {
          id: `${instanceID}-${index}`,
          text: dateMarker.text
        }, `googlesitekit-chart__date-marker--${instanceID}-${index}`);
      }), children]
    })
  });
}
GoogleChart.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node),
  chartEvents: prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
    eventName: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
    callback: (prop_types__WEBPACK_IMPORTED_MODULE_3___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_3___default().oneOf(['LineChart', 'PieChart']).isRequired,
  data: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().array),
  dateMarkers: prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
    /**
     * The date to mark on the chart, in the format `'YYYY-MM-DD'`.
     */
    date: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string).isRequired,
    /**
     * Text to display in a tooltip when the date marker is hovered.
     */
    text: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string)
  })),
  getChartWrapper: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  height: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  loaded: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  loadingHeight: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  loadingWidth: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  onMouseOut: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  onMouseOver: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  onReady: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  onSelect: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  selectedStats: prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_3___default().number)),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  options: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
};
GoogleChart.defaultProps = {
  ...react_google_charts__WEBPACK_IMPORTED_MODULE_4__.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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_components_GenericErrorHandlerActions__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/GenericErrorHandlerActions */ "./js/components/GenericErrorHandlerActions.js");
/* harmony import */ var _js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/notifications/CTA */ "./js/components/notifications/CTA.js");
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Root/ViewContextContext */ "./js/components/Root/ViewContextContext.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 _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __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_2__.Component {
  constructor(props) {
    super(props);
    this.state = {
      error: null,
      info: null
    };
    this.onErrorClick = this.onErrorClick.bind(this);
  }
  componentDidCatch(error, info) {
    globalThis.console.error('Google Charts error:', error, info);
    this.setState({
      error,
      info
    });
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.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_9__.jsx)("div", {
      className: "googlesitekit-googlechart-error-handler",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_5__["default"], {
        description: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__["default"], {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_9__.jsx)(_js_components_GenericErrorHandlerActions__WEBPACK_IMPORTED_MODULE_4__["default"], {
            message: error.message,
            componentStack: info.componentStack
          })]
        }),
        onErrorClick: this.onErrorClick,
        onClick: this.onErrorClick,
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Error in Google Chart', 'google-site-kit'),
        error: true
      })
    });
  }
}
GoogleChartErrorHandler.contextType = _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_6__["default"];
GoogleChartErrorHandler.propTypes = {
  /** @ignore */
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___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 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_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_use_observer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-use-observer */ "../node_modules/react-use-observer/es/useMutationObserver.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* 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_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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.js");
/* harmony import */ var _js_hooks_useGlobalTrackingEffect__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useGlobalTrackingEffect */ "./js/hooks/useGlobalTrackingEffect.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _DashboardNavigation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./DashboardNavigation */ "./js/components/DashboardNavigation/index.js");
/* harmony import */ var _EntityHeader__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./EntityHeader */ "./js/components/EntityHeader.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var _Logo__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Logo */ "./js/components/Logo.js");
/* harmony import */ var _notifications_LegacyNotifications__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./notifications/LegacyNotifications */ "./js/components/notifications/LegacyNotifications.js");
/* harmony import */ var _notifications_Notifications__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./notifications/Notifications */ "./js/components/notifications/Notifications.js");
/* harmony import */ var _UserMenu__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./UserMenu */ "./js/components/UserMenu/index.js");
/* harmony import */ var _ViewOnlyMenu__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./ViewOnlyMenu */ "./js/components/ViewOnlyMenu/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__ = __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_9__["default"])();
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__["default"])();
  (0,_js_hooks_useGlobalTrackingEffect__WEBPACK_IMPORTED_MODULE_10__.useGlobalTrackingEffect)();
  const dashboardURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getAdminURL('googlesitekit-dashboard'));
  const isAuthenticated = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).isAuthenticated());
  const [subHeaderRef, subHeaderMutation] = (0,react_use_observer__WEBPACK_IMPORTED_MODULE_2__["default"])({
    childList: true
  });
  const hasSubheader = !!subHeaderMutation.target?.childElementCount;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.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_21__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_12__.Grid, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_12__.Row, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_12__.Cell, {
            smSize: 1,
            mdSize: 2,
            lgSize: 4,
            className: "googlesitekit-header__logo",
            alignMiddle: true,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_15__["default"], {
              "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Go to dashboard', 'google-site-kit'),
              className: "googlesitekit-header__logo-link",
              href: dashboardURL,
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_Logo__WEBPACK_IMPORTED_MODULE_16__["default"], {})
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_12__.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_21__.jsx)(_ViewOnlyMenu__WEBPACK_IMPORTED_MODULE_20__["default"], {}), isAuthenticated && !isViewOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_UserMenu__WEBPACK_IMPORTED_MODULE_19__["default"], {})]
          })]
        })
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("div", {
      className: "googlesitekit-subheader",
      ref: subHeaderRef,
      children: subHeader
    }), showNavigation && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_DashboardNavigation__WEBPACK_IMPORTED_MODULE_13__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_EntityHeader__WEBPACK_IMPORTED_MODULE_14__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_notifications_LegacyNotifications__WEBPACK_IMPORTED_MODULE_17__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_notifications_Notifications__WEBPACK_IMPORTED_MODULE_18__["default"], {
      areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_8__.NOTIFICATION_AREAS.HEADER
    })]
  });
}
Header.displayName = 'Header';
Header.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  subHeader: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
  showNavigation: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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_2__ = __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_2__.jsx)("li", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-list-divider', className),
    role: "separator"
  });
}
Divider.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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_2__ = __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_2__.jsxs)("div", {
    className: itemClassName,
    children: [icon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: iconClassName,
      children: icon
    }), label && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
      className: labelClassName,
      children: label
    }), description && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("span", {
      className: descriptionClassName,
      children: description
    }), trailing && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.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_2__.jsx)("li", {
    id: id,
    className: listClassName || undefined,
    role: listRole,
    children: hasAction ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("button", {
      type: "button",
      className: "googlesitekit-header-menu__item-button",
      onClick: onClick,
      children: content
    }) : content
  });
}
MenuItem.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),
  isInteractive: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  icon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  trailing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  itemClassName: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  iconClassName: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  labelClassName: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  descriptionClassName: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  trailingClassName: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __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_1__.jsx)("li", {
    id: id,
    className: className,
    role: role,
    children: children
  });
}
MenuSection.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  role: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _MenuSection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./MenuSection */ "./js/components/HeaderMenu/MenuSection.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __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_2__.jsxs)(_MenuSection__WEBPACK_IMPORTED_MODULE_1__["default"], {
    className: className,
    children: [heading, children]
  });
}
MenuWithHeading.propTypes = {
  heading: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __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_1__.jsx)("span", {
    className: "googlesitekit-icon-wrapper",
    style: {
      marginLeft,
      marginRight
    },
    children: children
  });
}
IconWrapper.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
  marginLeft: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
  marginRight: (prop_types__WEBPACK_IMPORTED_MODULE_0___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/InViewProvider/index.js"
/*!***********************************************!*\
  !*** ./js/components/InViewProvider/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 */   Consumer: () => (/* binding */ Consumer),
/* harmony export */   Provider: () => (/* binding */ Provider),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _InViewContext__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./InViewContext */ "./js/components/InViewProvider/InViewContext.js");
/**
 * In-view Provider component.
 *
 * 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.
 */

/**
 * Internal dependencies
 */

const {
  Consumer,
  Provider
} = _InViewContext__WEBPACK_IMPORTED_MODULE_0__["default"];
const InViewProvider = Provider;
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InViewProvider);

/***/ },

/***/ "./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_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__);
/* harmony import */ var react_joyride__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-joyride */ "../node_modules/react-joyride/dist/index.mjs");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useInterval.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _Portal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Portal */ "./js/components/Portal.js");
/* harmony import */ var _TourTooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./TourTooltip */ "./js/components/TourTooltip.js");
/* harmony import */ var _TourTooltips__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./TourTooltips */ "./js/components/TourTooltips.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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 = () => {},
    floaterProps = {}
  } = props;
  function checkIfTargetExists() {
    return !!globalThis.document.querySelector(target);
  }
  const [targetExists, setTargetExists] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(checkIfTargetExists);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.useBreakpoint)();
  const isMobileTablet = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_TABLET;
  const [shouldRun, setShouldRun] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(true);
  const previousIsMobileTabletRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(isMobileTablet);
  (0,react_use__WEBPACK_IMPORTED_MODULE_2__["default"])(() => {
    if (checkIfTargetExists()) {
      setTargetExists(true);
    }
  },
  // An delay of null will stop the interval.
  targetExists ? null : 250);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    // eslint-disable-next-line sitekit/function-declaration-consistency
    let disconnect = () => {};
    if (typeof globalThis.ResizeObserver === 'function') {
      const targetElement = globalThis.document.querySelector(target);
      if (targetElement) {
        const resizeObserver = new ResizeObserver(() => {
          // Dispatch a window resize event to trigger the tooltip to reposition.
          globalThis.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_3__.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,
    floaterProps
  }];

  // 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_1__.EVENTS.TOUR_START:
        onTourStart();
        globalThis.document.body.classList.add('googlesitekit-showing-tooltip');
        break;
      case react_joyride__WEBPACK_IMPORTED_MODULE_1__.EVENTS.TOUR_END:
        onTourEnd();
        globalThis.document.body.classList.remove('googlesitekit-showing-tooltip');
        break;
      case react_joyride__WEBPACK_IMPORTED_MODULE_1__.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_1__.EVENTS.TOOLTIP:
        onView();
        break;
    }
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Portal__WEBPACK_IMPORTED_MODULE_5__["default"], {
    slug: slug,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(react_joyride__WEBPACK_IMPORTED_MODULE_1__["default"], {
      callback: callback,
      disableOverlay: disableOverlay,
      spotlightPadding: 0,
      floaterProps: _TourTooltips__WEBPACK_IMPORTED_MODULE_7__.floaterProps,
      locale: joyrideLocale,
      steps: steps,
      styles: {
        ..._TourTooltips__WEBPACK_IMPORTED_MODULE_7__.joyrideStyles,
        ...styles,
        options: {
          ..._TourTooltips__WEBPACK_IMPORTED_MODULE_7__.joyrideStyles.options,
          ...styles?.options
        },
        spotlight: {
          ..._TourTooltips__WEBPACK_IMPORTED_MODULE_7__.joyrideStyles.spotlight,
          ...styles?.spotlight
        }
      },
      tooltipComponent: _TourTooltip__WEBPACK_IMPORTED_MODULE_6__["default"],
      run: shouldRun,
      disableScrolling: true
    })
  });
}
JoyrideTooltip.propTypes = {
  title: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.node,
  content: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.string,
  disableOverlay: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.bool,
  dismissLabel: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.string,
  target: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.string.isRequired,
  onDismiss: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.func,
  onShow: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.func,
  className: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.string,
  styles: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.object,
  slug: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.string,
  placement: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.string,
  onView: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.func,
  floaterProps: prop_types__WEBPACK_IMPORTED_MODULE_0__.PropTypes.object
};

/***/ },

/***/ "./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_0__ = __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_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_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.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_hooks_useFeature__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.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 _svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/icons/pencil-alt.svg */ "./svg/icons/pencil-alt.svg");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _hooks_useChangeMetricsFeatureTourEffect__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./hooks/useChangeMetricsFeatureTourEffect */ "./js/components/KeyMetrics/hooks/useChangeMetricsFeatureTourEffect.js");
/* harmony import */ var _SetupCompletedSurveyTrigger__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./SetupCompletedSurveyTrigger */ "./js/components/KeyMetrics/SetupCompletedSurveyTrigger.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __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_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getKeyMetrics());
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_6__.useFeature)('setupFlowRefresh');
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI);
  const openMetricsSelectionPanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    setValue(_constants__WEBPACK_IMPORTED_MODULE_10__.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_11__.useChangeMetricsFeatureTourEffect)({
    renderChangeMetricLink
  });
  if (!renderChangeMetricLink) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
      className: "googlesitekit-widget-area__cta-link googlesitekit-km-change-metrics-cta",
      onClick: openMetricsSelectionPanel,
      leadingIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_9__["default"], {
        width: 22,
        height: 22
      }),
      secondary: true,
      linkButton: true,
      children: setupFlowRefreshEnabled ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select metrics', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change metrics', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_SetupCompletedSurveyTrigger__WEBPACK_IMPORTED_MODULE_12__["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 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_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 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_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/icons/check-2.svg */ "./svg/icons/check-2.svg");
/* harmony import */ var _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/icons/star-fill.svg */ "./svg/icons/star-fill.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_3__.KEY_METRICS_GROUP_CURRENT.SLUG]: _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_5__["default"],
  [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_GROUP_SUGGESTED.SLUG]: _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_6__["default"]
};
function Chip({
  slug,
  label,
  isActive,
  onClick,
  hasNewBadge = false,
  selectedCount = 0
}) {
  const Icon = icons[slug] || _js_components_Null__WEBPACK_IMPORTED_MODULE_4__["default"];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.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_7__.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_7__.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_7__.jsx)("span", {
      className: "googlesitekit-chip-tab-group__chip-item-new-dot"
    })]
  });
}
Chip.propTypes = {
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  isActive: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  hasNewBadge: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  selectedCount: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* 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_KeyMetrics_MetricsSelectionPanel_MetricItem__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricsSelectionPanel/MetricItem */ "./js/components/KeyMetrics/MetricsSelectionPanel/MetricItem.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 _svg_graphics_key_metrics_no_selected_items_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/graphics/key-metrics-no-selected-items.svg */ "./svg/graphics/key-metrics-no-selected-items.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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_5__.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_5__.jsx)(_js_components_KeyMetrics_MetricsSelectionPanel_MetricItem__WEBPACK_IMPORTED_MODULE_2__["default"], {
        slug: slug,
        savedItemSlugs: savedItemSlugs,
        isNewlyDetected: isNewlyDetected,
        ...activeMetricItems[slug]
      }, slug);
    }), !Object.keys(activeMetricItems).length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      className: "googlesitekit-chip-tab-group__graphic",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_svg_graphics_key_metrics_no_selected_items_svg__WEBPACK_IMPORTED_MODULE_4__["default"], {
        height: 250
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No metrics were selected yet', 'google-site-kit')
      })]
    })]
  });
}
TabContent.propTypes = {
  activeMetricItems: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  newlyDetectedMetrics: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* 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 _js_components_Null__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/check-2.svg */ "./svg/icons/check-2.svg");
/* harmony import */ var _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/icons/star-fill.svg */ "./svg/icons/star-fill.svg");
/* harmony import */ var _Chip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Chip */ "./js/components/KeyMetrics/ChipTabGroup/Chip.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_2__.KEY_METRICS_GROUP_CURRENT.SLUG]: _svg_icons_check_2_svg__WEBPACK_IMPORTED_MODULE_4__["default"],
  [_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_2__.KEY_METRICS_GROUP_SUGGESTED.SLUG]: _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_5__["default"]
};
function TabItems({
  containerRef,
  isMobileBreakpoint,
  chipItemRows,
  allGroups,
  isActive,
  onChipChange,
  selectedCounts,
  newlyDetectedMetrics,
  activeGroupIndex
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
    className: "googlesitekit-chip-tab-group__tab-items",
    ref: containerRef,
    children: [!isMobileBreakpoint && chipItemRows.map(row => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "googlesitekit-chip-tab-group__tab-items-row",
      children: row.map(group => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_Chip__WEBPACK_IMPORTED_MODULE_6__["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_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.TabBar, {
      activeIndex: activeGroupIndex,
      handleActiveIndexUpdate: index => onChipChange(null, index),
      children: allGroups.map((group, index) => {
        const Icon = icons[group.SLUG] || _js_components_Null__WEBPACK_IMPORTED_MODULE_3__["default"];
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Tab, {
          "aria-label": group.LABEL,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.jsx)("span", {
            className: "googlesitekit-chip-tab-group__chip-item-new-dot"
          })]
        }, index);
      })
    })]
  });
}
TabItems.propTypes = {
  containerRef: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  isMobileBreakpoint: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  chipItemRows: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
  allGroups: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
  isActive: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  onChipChange: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  selectedCounts: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  newlyDetectedMetrics: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  activeGroupIndex: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_compose__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useCurrentlyActiveEvents__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useCurrentlyActiveEvents */ "./js/components/KeyMetrics/hooks/useCurrentlyActiveEvents.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useFilteredKeyMetrics__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useFilteredKeyMetrics */ "./js/components/KeyMetrics/hooks/useFilteredKeyMetrics.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useKeyMetricsGroups__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useKeyMetricsGroups */ "./js/components/KeyMetrics/hooks/useKeyMetricsGroups.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useNewBadgeEvents__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useNewBadgeEvents */ "./js/components/KeyMetrics/hooks/useNewBadgeEvents.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useOverflowingTabs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useOverflowingTabs */ "./js/components/KeyMetrics/hooks/useOverflowingTabs.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_14__ = __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_15__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _TabContent__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./TabContent */ "./js/components/KeyMetrics/ChipTabGroup/TabContent.js");
/* harmony import */ var _TabItems__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./TabItems */ "./js/components/KeyMetrics/ChipTabGroup/TabItems.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __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_1__.useRef)();
  const [isActive, setIsActive] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.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_1__.useState)(0);
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_12__.useBreakpoint)();
  const isMobileBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_12__.BREAKPOINT_SMALL;
  const [selectedMetrics] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_13__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_SELECTED);
  const [effectiveSelectionValue, setEffectiveSelection] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_13__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.EFFECTIVE_SELECTION);
  const effectiveSelection = effectiveSelectionValue || emptyArray;
  const [unstagedSelectionValue, setUnstagedSelection] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_13__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.UNSTAGED_SELECTION);
  const unstagedSelection = unstagedSelectionValue || emptyArray;
  const isUserInputCompleted = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER).isUserInputCompleted());
  const currentlyActiveEvents = (0,_js_components_KeyMetrics_hooks_useCurrentlyActiveEvents__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const isGA4Connected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_14__.MODULE_SLUG_ANALYTICS_4));
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!isGA4Connected) {
      return [];
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getDetectedEvents();
  });
  const answerBasedMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER).getAnswerBasedMetrics(null, [...(currentlyActiveEvents || []), ...(detectedEvents || [])]));
  const {
    keyMetricsGroups,
    dynamicGroups
  } = (0,_js_components_KeyMetrics_hooks_useKeyMetricsGroups__WEBPACK_IMPORTED_MODULE_6__["default"])({
    detectedEvents,
    currentlyActiveEvents,
    isUserInputCompleted,
    answerBasedMetrics
  });
  const allGroups = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => [...dynamicGroups, ...keyMetricsGroups], [dynamicGroups, keyMetricsGroups]);
  const newBadgeEvents = (0,_js_components_KeyMetrics_hooks_useNewBadgeEvents__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const conversionReportingEventWidgets = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!isGA4Connected) {
      return [];
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getKeyMetricsConversionEventWidgets();
  });
  const {
    selectedCounts,
    activeMetricItems,
    newlyDetectedMetrics
  } = (0,_js_components_KeyMetrics_hooks_useFilteredKeyMetrics__WEBPACK_IMPORTED_MODULE_5__["default"])({
    allMetricItems,
    isActive,
    effectiveSelection,
    answerBasedMetrics,
    selectedMetrics,
    newBadgeEvents,
    conversionReportingEventWidgets
  });
  const resetUnstagedSelection = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    setEffectiveSelection([...effectiveSelection, ...unstagedSelection]);
    setUnstagedSelection([]);
  }, [effectiveSelection, unstagedSelection, setEffectiveSelection, setUnstagedSelection]);
  const onChipChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.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_2__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_UI).getValue(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_3__.KEY_METRICS_SELECTION_PANEL_OPENED_KEY));
  const isSelectionPanelOpenPrevious = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_0__["default"])(isSelectionPanelOpen);
  const newlyDetectedMetricsKeys = Object.keys(newlyDetectedMetrics);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.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_3__.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_3__.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_8__["default"])({
    containerRef,
    isMobileBreakpoint,
    isSelectionPanelOpen,
    isSelectionPanelOpenPrevious
  });
  const chipItemRows = [[...dynamicGroups, ...keyMetricsGroups.slice(0, 2)], [...keyMetricsGroups.slice(2)]];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)("div", {
    className: "googlesitekit-chip-tab-group",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_TabItems__WEBPACK_IMPORTED_MODULE_17__["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_18__.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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useActivateModuleCallback */ "./js/hooks/useActivateModuleCallback.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _GhostCardGreenSVG__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./GhostCardGreenSVG */ "./js/components/KeyMetrics/GhostCardGreenSVG.js");
/* harmony import */ var _GhostCardRedSVG__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./GhostCardRedSVG */ "./js/components/KeyMetrics/GhostCardRedSVG.js");
/* harmony import */ var _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./key-metrics-widgets */ "./js/components/KeyMetrics/key-metrics-widgets.js");
/* harmony import */ var _MetricTileHeader__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./MetricTileHeader */ "./js/components/KeyMetrics/MetricTileHeader.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __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 isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const handleConnectModule = (0,_js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_8__["default"])(moduleSlug);
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).getModule(moduleSlug));
  const Icon = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).getModuleIcon(moduleSlug));
  const widgets = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_WIDGETS).getWidgets(_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_7__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY) || []);
  const moduleWidgets = widgets.filter(widget => widget.modules.includes(moduleSlug));
  const firstWidget = _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_12__.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_14__.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_14__.jsx)(_MetricTileHeader__WEBPACK_IMPORTED_MODULE_13__["default"], {
      title: firstWidget?.title,
      infoTooltip: firstWidget?.description,
      loading: false
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", {
      className: "googlesitekit-km-widget-tile__body",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div", {
        className: "googlesitekit-km-connect-module-cta-tile",
        children: [Icon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", {
          className: "googlesitekit-km-connect-module-cta-tile__icon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(Icon, {
            width: "32",
            height: "32"
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div", {
          className: "googlesitekit-km-connect-module-cta-tile__content",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("p", {
            className: "googlesitekit-km-connect-module-cta-tile__text",
            children: combinedMetrics ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: module name */
            (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s is disconnected, some of your metrics can’t be displayed', 'google-site-kit'), module.name) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: module name */
            (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s is disconnected, metric can’t be displayed', 'google-site-kit'), module.name)
          }), !isViewOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
            onClick: handleConnectModule,
            secondary: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: module name */
            (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Connect %s', 'google-site-kit'), module.name)
          })]
        })]
      })
    }), combinedMetrics && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", {
        className: "googlesitekit-km-connect-module-cta-tile__ghost-card",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_GhostCardGreenSVG__WEBPACK_IMPORTED_MODULE_10__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", {
        className: "googlesitekit-km-connect-module-cta-tile__ghost-card",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_GhostCardGreenSVG__WEBPACK_IMPORTED_MODULE_10__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", {
        className: "googlesitekit-km-connect-module-cta-tile__ghost-card",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_GhostCardRedSVG__WEBPACK_IMPORTED_MODULE_11__["default"], {})
      })]
    })]
  });
}
ConnectModuleCTATile.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./js/components/KeyMetrics/ConversionReportingDashboardSubtleNotification.js"
/*!************************************************************************************!*\
  !*** ./js/components/KeyMetrics/ConversionReportingDashboardSubtleNotification.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 */ ConversionReportingDashboardSubtleNotification)
/* 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__);
/* 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_Notice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ConversionReportingDashboardSubtleNotification 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 ConversionReportingDashboardSubtleNotification({
  description,
  ctaLabel,
  handleCTAClick,
  isSaving = false,
  onDismiss,
  dismissCTALabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Maybe later', 'google-site-kit')
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_2__["default"], {
    type: "new",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New key metrics were added!', 'google-site-kit'),
    description: description,
    dismissButton: {
      label: dismissCTALabel,
      onClick: onDismiss
    },
    ctaButton: {
      label: ctaLabel,
      onClick: handleCTAClick,
      inProgress: isSaving,
      disabled: isSaving
    }
  });
}
ConversionReportingDashboardSubtleNotification.propTypes = {
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  handleCTAClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  isSaving: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onDismiss: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  dismissCTALabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
};

/***/ },

/***/ "./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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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 _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");
/**
 * 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_1__["default"])(/* translators: %s: get help text. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Trouble getting access? <HelpLink />', 'google-site-kit'), {
    HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
      href: linkURL,
      external: true,
      hideExternalIndicator: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Get help', 'google-site-kit')
    })
  });
}
GetHelpLink.propTypes = {
  linkURL: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_0__ = __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_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/MediaErrorHandler */ "./js/components/MediaErrorHandler/index.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_0__.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_4__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
    fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_3__["default"], {
      width: "100%",
      height: "90px"
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__["default"], {
      errorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to load graphic', 'google-site-kit'),
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.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_0__ = __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_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/MediaErrorHandler */ "./js/components/MediaErrorHandler/index.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_0__.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_4__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Suspense, {
    fallback: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_3__["default"], {
      width: "100%",
      height: "90px"
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_MediaErrorHandler__WEBPACK_IMPORTED_MODULE_2__["default"], {
      errorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to load graphic', 'google-site-kit'),
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 _MetricTileError__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./MetricTileError */ "./js/components/KeyMetrics/MetricTileError.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 InsufficientPermissionsError(props) {
  const {
    moduleSlug,
    onRetry,
    infoTooltip,
    headerText
  } = props;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const helpLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getErrorTroubleshootingLinkURL({
    code: `${moduleSlug}_insufficient_permissions`
  }));
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEventOnce)(`${viewContext}_kmw`, 'insufficient_permissions_error');
  }, [viewContext]);
  const retry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_kmw`, 'insufficient_permissions_error_retry');
    onRetry?.();
  }, [onRetry, viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_MetricTileError__WEBPACK_IMPORTED_MODULE_9__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Insufficient permissions', 'google-site-kit'),
    headerText: headerText,
    infoTooltip: infoTooltip,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "googlesitekit-report-error-actions",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Permissions updated? <a>Retry</a>', 'google-site-kit'), {
          a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
            onClick: retry
          })
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You’ll need to contact your administrator. <a>Learn more</a>', 'google-site-kit'), {
          a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
            href: helpLink,
            external: true,
            hideExternalIndicator: true
          })
        })
      })]
    })
  });
}
InsufficientPermissionsError.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  headerText: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  infoTooltip: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useIntersection.js");
/* 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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/AdminScreenTooltip */ "./js/components/AdminScreenTooltip/index.js");
/* harmony import */ var _js_components_Banner__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Banner */ "./js/components/Banner/index.tsx");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.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_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_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.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 _js_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* 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 _svg_graphics_banner_conversions_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/svg/graphics/banner-conversions-setup-cta.svg?url */ "./svg/graphics/banner-conversions-setup-cta.svg?url");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _hooks_useDisplayCTAWidget__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./hooks/useDisplayCTAWidget */ "./js/components/KeyMetrics/hooks/useDisplayCTAWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__ = __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_2__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__["default"])();
  const trackEventCategory = `${viewContext}_kmw-cta-notification`;
  const displayCTAWidget = (0,_hooks_useDisplayCTAWidget__WEBPACK_IMPORTED_MODULE_19__["default"])();
  const ctaLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getAdminURL('googlesitekit-user-input'));
  const fullScreenSelectionLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getAdminURL('googlesitekit-metric-selection'));
  const isNavigatingToCTALink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => ctaLink && select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_LOCATION).isNavigatingTo(ctaLink));
  const intersectionEntry = (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(trackingRef, {
    threshold: 0.25
  });
  const [hasBeenInView, setHasBeenInView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const inView = !!intersectionEntry?.intersectionRatio;
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (!inView || hasBeenInView) {
      return;
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.trackEvent)(`${viewContext}_kmw-cta-notification`, 'view_notification');
    triggerSurvey('view_kmw_setup_cta', {
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_14__.WEEK_IN_SECONDS
    });
    setHasBeenInView(true);
  }, [inView, hasBeenInView, viewContext, triggerSurvey]);
  const tooltipSettings = {
    tooltipSlug: _constants__WEBPACK_IMPORTED_MODULE_18__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You can always set up goals in Settings later', 'google-site-kit'),
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_3__.__)('Got it', 'google-site-kit')
  };
  const showTooltip = (0,_js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_5__.useShowTooltip)(tooltipSettings);
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_UI);
  const handleDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(async () => {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.trackEvent)(trackEventCategory, 'dismiss_notification');
    showTooltip();
    setValue('keepKeyMetricsSetupCTAWidgetVisible', false);
    await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_18__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);
  }, [trackEventCategory, showTooltip, setValue, dismissItem]);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_LOCATION);
  const openMetricsSelectionPanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(async () => {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.trackEvent)(trackEventCategory, 'confirm_pick_own_metrics');
    setValue('keepKeyMetricsSetupCTAWidgetVisible', true);
    await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_18__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);
    navigateTo(fullScreenSelectionLink);
  }, [trackEventCategory, setValue, dismissItem, navigateTo, fullScreenSelectionLink]);
  const onGetTailoredMetricsClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(async () => {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.trackEvent)(trackEventCategory, 'confirm_get_tailored_metrics');
    setValue('keepKeyMetricsSetupCTAWidgetVisible', true);
    await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_18__.KEY_METRICS_SETUP_CTA_WIDGET_SLUG);
    navigateTo(ctaLink);
  }, [trackEventCategory, setValue, dismissItem, navigateTo, ctaLink]);
  if (!displayCTAWidget) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(WidgetNull, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Banner__WEBPACK_IMPORTED_MODULE_6__["default"], {
      ref: trackingRef,
      className: "googlesitekit-banner--setup-cta",
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Get personalized suggestions for user interaction metrics based on your goals', 'google-site-kit'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_3__.__)('Maybe later', 'google-site-kit'),
        onClick: handleDismiss
      },
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_17__["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_20__.jsxs)("div", {
        className: "googlesitekit-widget-key-metrics-footer",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Interested in specific metrics?', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_7__["default"], {
          onClick: openMetricsSelectionPanel,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Select your own metrics', 'google-site-kit')
        })]
      })
    })
  });
}
KeyMetricsSetupCTAWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_15__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_13__.MODULE_SLUG_ANALYTICS_4
})(KeyMetricsSetupCTAWidget));

/***/ },

/***/ "./js/components/KeyMetrics/LostEventsSubtleNotification.js"
/*!******************************************************************!*\
  !*** ./js/components/KeyMetrics/LostEventsSubtleNotification.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 */ LostEventsSubtleNotification)
/* harmony export */ });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __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/@wordpress/element/build-module/create-interpolate-element.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 _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * LostEventsSubtleNotification 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 LostEventsSubtleNotification({
  onSelectMetricsCallback,
  onDismissCallback
}) {
  const lostEventsDocumentationURL = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["default"])(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getDocumentationLinkURL('unavailable-metrics-data'));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"], {
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.WARNING,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Unavailable metrics data', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('We couldn’t detect any events for some of your metrics in over 90 days. You can select other metrics for your dashboard. <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: lostEventsDocumentationURL,
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Learn more about unavailable metric data', 'google-site-kit'),
        external: true
      })
    }),
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it', 'google-site-kit'),
      onClick: onDismissCallback
    },
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Select metrics', 'google-site-kit'),
      onClick: onSelectMetricsCallback
    }
  });
}
LostEventsSubtleNotification.propTypes = {
  ..._js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"].propTypes
};

/***/ },

/***/ "./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_InfoTooltip__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var _js_components_notifications_CTA__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/notifications/CTA */ "./js/components/notifications/CTA.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_1__["default"], {
      title: title,
      headerText: headerText,
      headerContent: infoTooltip && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_0__["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_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__);
/* harmony import */ var _js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* 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_VisuallyHidden__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/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");
/**
 * 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_4__.jsxs)("div", {
    className: "googlesitekit-km-widget-tile__title-container",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.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_4__.jsx)(_js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__["default"], {
        title: infoTooltip
      })
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__["default"], {
      title: infoTooltip
    })]
  });
}
MetricTileHeader.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  infoTooltip: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element)]),
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/ChangeBadge */ "./js/components/ChangeBadge.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_2__.expandNumFmtOptions)(metricValueFormat);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_MetricTileWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-km-widget-tile--numeric",
    ...props,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "googlesitekit-km-widget-tile__metric-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "googlesitekit-km-widget-tile__metric",
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.numFmt)(metricValue, formatOptions)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
        className: "googlesitekit-km-widget-tile__subtext",
        children: subText
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      className: "googlesitekit-km-widget-tile__metric-change-container",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.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_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)]),
  metricValueFormat: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)]),
  subtext: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  previousValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
  currentValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
};

/***/ },

/***/ "./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_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__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __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_1__.jsx)("p", {
    className: "googlesitekit-km-widget-tile__table-plain-text",
    children: content
  });
}
MetricTileTablePlainText.propTypes = {
  content: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/ChangeBadge */ "./js/components/ChangeBadge.tsx");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_2__.expandNumFmtOptions)(metricValueFormat);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_MetricTileWrapper__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-km-widget-tile--text",
    ...props,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "googlesitekit-km-widget-tile__metric-container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "googlesitekit-km-widget-tile__metric",
        children: metricValue
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
        className: "googlesitekit-km-widget-tile__subtext",
        children: subText
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
      className: "googlesitekit-km-widget-tile__metric-change-container",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_1__["default"], {
        previousValue: previousValue,
        currentValue: currentValue,
        isAbsolute: formatOptions?.style === 'percent'
      })
    })]
  });
}
MetricTileText.propTypes = {
  metricValue: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)]),
  subtext: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  previousValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number),
  currentValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/ReportErrorActions */ "./js/components/ReportErrorActions.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_util_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _GetHelpLink__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./GetHelpLink */ "./js/components/KeyMetrics/GetHelpLink.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 _MetricTileError__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./MetricTileError */ "./js/components/KeyMetrics/MetricTileError.js");
/* harmony import */ var _MetricTileHeader__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./MetricTileHeader */ "./js/components/KeyMetrics/MetricTileHeader.js");
/* harmony import */ var _MetricTileLoader__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./MetricTileLoader */ "./js/components/KeyMetrics/MetricTileLoader.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __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_10__.KEY_METRICS_WIDGETS[widgetSlug]?.title,
    infoTooltip = _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_10__.KEY_METRICS_WIDGETS[widgetSlug]?.infoTooltip || _key_metrics_widgets__WEBPACK_IMPORTED_MODULE_10__.KEY_METRICS_WIDGETS[widgetSlug]?.description
  } = props;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const hasInsufficientPermissionsReportError = error ? (0,lodash__WEBPACK_IMPORTED_MODULE_1__.castArray)(error).some(_js_util_errors__WEBPACK_IMPORTED_MODULE_8__.isInsufficientPermissionsError) : false;
  const trackRetryEvent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_kmw`, 'data_loading_error_retry');
  }, [viewContext]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    if (!!error) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_kmw`, 'data_loading_error');
    }
  }, [viewContext, error]);
  if (error) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_MetricTileError__WEBPACK_IMPORTED_MODULE_11__["default"], {
      title: hasInsufficientPermissionsReportError ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Insufficient permissions', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Data loading failed', 'google-site-kit'),
      headerText: title,
      infoTooltip: infoTooltip,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_5__["default"], {
        moduleSlug: moduleSlug,
        error: error,
        onRetry: trackRetryEvent,
        GetHelpLink: hasInsufficientPermissionsReportError ? _GetHelpLink__WEBPACK_IMPORTED_MODULE_9__["default"] : undefined,
        getHelpClassName: "googlesitekit-error-retry-text"
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-km-widget-tile', className),
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_MetricTileHeader__WEBPACK_IMPORTED_MODULE_12__["default"], {
        title: title,
        infoTooltip: infoTooltip,
        loading: loading
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div", {
        className: "googlesitekit-km-widget-tile__body",
        children: [loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_MetricTileLoader__WEBPACK_IMPORTED_MODULE_13__["default"], {}), !loading && children]
      })]
    })
  });
}
MetricTileWrapper.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().elementType).isRequired,
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  infoTooltip: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().element)]),
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_2___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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/SelectionPanel */ "./js/components/SelectionPanel/index.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_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __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_3__.useSelect)(select => {
    const {
      getModule
    } = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES);
    const widget = select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.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, setSelectedMetrics] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_SELECTED);
  const [, setUnstagedSelection] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_SELECTION_FORM, _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_4__.UNSTAGED_SELECTION);
  const onCheckboxChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(event => {
    const currentlySelectedMetrics = event.target.checked ? selectedMetrics.concat([slug]) : selectedMetrics.filter(selectedMetric => selectedMetric !== slug);
    setSelectedMetrics(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.
    setUnstagedSelection(currentlySelectedMetrics);
  }, [slug, selectedMetrics, setSelectedMetrics, setUnstagedSelection]);
  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_9__.jsx)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_5__.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_9__.jsx)("div", {
      className: "googlesitekit-selection-panel-item-error",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: module names. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._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_2__.__)(' and ', 'google-site-kit')))
    })
  });
}
MetricItem.propTypes = {
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  isNewlyDetected: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_0__ = __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_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/surveys/SurveyViewTrigger */ "./js/components/surveys/SurveyViewTrigger.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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __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_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).isKeyMetricsSetupCompleted());
  const isKeyMetricsSetupCompletedBy = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getKeyMetricsSetupCompletedBy());
  const currentUserID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getID());
  if (!isKeyMetricsSetupCompleted) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_2__["default"], {
      triggerID: "view_kmw",
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_5__.WEEK_IN_SECONDS
    }), isKeyMetricsSetupCompletedBy === currentUserID && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_surveys_SurveyViewTrigger__WEBPACK_IMPORTED_MODULE_2__["default"], {
      triggerID: "view_kmw_setup_completed",
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_5__.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_BACK_NOTICE_SLUG: () => (/* binding */ KEY_METRICS_BACK_NOTICE_SLUG),
/* 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_BACK_NOTICE_SLUG = 'key-metrics-back-notice';
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_0__ = __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_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/feature-tours/shared-key-metrics */ "./js/feature-tours/shared-key-metrics.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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_util_welcome_modal__WEBPACK_IMPORTED_MODULE_6__ = __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.
 */

/**
 * WordPress 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_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getKeyMetricsSetupCompletedBy());
  const currentUserID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getID());
  const {
    triggerOnDemandTour,
    dismissTour
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefresh');
  const isTourDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isTourDismissed(_js_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_2__["default"].slug));
  const isUserEligibleForTour = Number.isInteger(keyMetricsSetupCompletedBy) && Number.isInteger(currentUserID) && keyMetricsSetupCompletedBy > 0 && currentUserID !== keyMetricsSetupCompletedBy;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (setupFlowRefreshEnabled && (0,_js_util_welcome_modal__WEBPACK_IMPORTED_MODULE_6__.isInitialWelcomeModalActive)()) {
      if (isTourDismissed === false) {
        dismissTour(_js_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_2__["default"].slug);
      }
      return;
    }
    if (renderChangeMetricLink && isUserEligibleForTour) {
      triggerOnDemandTour(_js_feature_tours_shared_key_metrics__WEBPACK_IMPORTED_MODULE_2__["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.ts");
/**
 * 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_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/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_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_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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_search_console_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/search-console/constants */ "./js/modules/search-console/constants.js");
/* harmony import */ var _js_modules_search_console_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/search-console/datastore/constants */ "./js/modules/search-console/datastore/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_1__.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_1__.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_7__.MODULE_SLUG_SEARCH_CONSOLE, _js_modules_search_console_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_SEARCH_CONSOLE);
    const analyticsDataAvailableOnLoad = isModuleDataAvailableOnLoad(select, _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.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_4__.CORE_MODULES).isModuleConnected(slug)) {
    const {
      isGatheringData,
      isDataAvailableOnLoad
    } = select(storeName);
    isGatheringData();
    return isDataAvailableOnLoad();
  }
  return false;
}

/***/ },

/***/ "./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutAfterInitialDetection.js"
/*!*******************************************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutAfterInitialDetection.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 */ useDisplayNewEventsCalloutAfterInitialDetection)
/* 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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * Determines whether the new events callout should be displayed to the user.
 *
 * 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 new events callout should be displayed.
 *
 * @since 1.144.0
 *
 * @param {Object}  options                                     Options object.
 * @param {boolean} options.haveNewConversionEventsAfterDismiss If there are new events detected after callout was dismissed.
 * @return {boolean} Whether the new events callout should be displayed.
 */
function useDisplayNewEventsCalloutAfterInitialDetection({
  haveNewConversionEventsAfterDismiss
}) {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const isKeyMetricsSetupCompleted = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).isKeyMetricsSetupCompleted();
    const haveConversionEventsWithDifferentMetrics = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).haveConversionEventsWithDifferentMetrics();
    return isKeyMetricsSetupCompleted && haveConversionEventsWithDifferentMetrics && haveNewConversionEventsAfterDismiss;
  });
}

/***/ },

/***/ "./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForTailoredMetrics.js"
/*!****************************************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForTailoredMetrics.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 */ useDisplayNewEventsCalloutForTailoredMetrics)
/* 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.ts");
/**
 * Determines whether the initial new events callout should be displayed to the tailored metrics user.
 *
 * 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 initial new events callout should be displayed.
 *
 * @since 1.144.0
 *
 * @param {Object}  options                                     Options object.
 * @param {boolean} options.haveNewConversionEventsAfterDismiss If there are new events detected after callout was dismissed.
 * @return {boolean} Whether the initial new events callout should be displayed.
 */
function useDisplayNewEventsCalloutForTailoredMetrics({
  haveNewConversionEventsAfterDismiss
}) {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const {
      isUserInputCompleted: getIsUserInputCompleted,
      getUserPickedMetrics,
      getUserInputSettings,
      getID
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER);
    const hasUserPickedMetrics = getUserPickedMetrics();
    const isUserInputCompleted = getIsUserInputCompleted();
    const userInputSettings = getUserInputSettings();
    const sitePurposeAnsweredBy = userInputSettings?.purpose?.answeredBy;
    const currentUserID = getID();
    const haveConversionReportingEventsForTailoredMetrics = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).haveConversionEventsForTailoredMetrics({
      useNewEvents: true
    });
    return !hasUserPickedMetrics?.length && isUserInputCompleted && haveConversionReportingEventsForTailoredMetrics && haveNewConversionEventsAfterDismiss &&
    // Ensure that the user who last added or edited the site purpose answer
    // sees the callout to automatically add the new conversion reporting metrics via the CTA.
    sitePurposeAnsweredBy === currentUserID;
  });
}

/***/ },

/***/ "./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForUserPickedMetrics.js"
/*!******************************************************************************************!*\
  !*** ./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForUserPickedMetrics.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 */ useDisplayNewEventsCalloutForUserPickedMetrics)
/* 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_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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * Determines whether the initial new events callout should be displayed to the user with manually-selected metrics.
 *
 * 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 initial new events callout should be displayed.
 *
 * @since 1.144.0
 *
 * @param {Object}  options                                     Options object.
 * @param {boolean} options.haveNewConversionEventsAfterDismiss If there are new events detected after callout was dismissed.
 * @return {boolean} Whether the initial new events callout should be displayed.
 */
function useDisplayNewEventsCalloutForUserPickedMetrics({
  haveNewConversionEventsAfterDismiss
}) {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    const hasUserPickedMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getUserPickedMetrics();
    const hasConversionEventsForUserPickedMetrics = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4).haveConversionEventsForUserPickedMetrics({
      useNewEvents: true
    });
    const isKeyMetricsSetupCompleted = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).isKeyMetricsSetupCompleted();
    return hasUserPickedMetrics?.length && isKeyMetricsSetupCompleted && hasConversionEventsForUserPickedMetrics && haveNewConversionEventsAfterDismiss;
  });
}

/***/ },

/***/ "./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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__ = __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_0__.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_1__.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_1__.KEY_METRICS_GROUP_CURRENT.SLUG && effectiveSelection.includes(metricItemSlug)) {
        activeMetricItems[metricItemSlug] = allMetricItems[metricItemSlug];
      }
      if (isActive === _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_1__.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) {
          newlyDetectedMetrics[metricGroup] = [...(newlyDetectedMetrics[metricGroup] ?? []), 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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * 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_2__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD].filter(item => detectedEvents?.includes(item) || currentlyActiveEvents?.includes(item));
  const hasSellingProductsGroup = [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.ENUM_CONVERSION_EVENTS.ADD_TO_CART, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.ENUM_CONVERSION_EVENTS.PURCHASE].filter(item => detectedEvents?.includes(item) || currentlyActiveEvents?.includes(item));
  const keyMetricsGroups = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_0__.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.ts");
/**
 * 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_0__ = __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_2__ = __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_2__.useDebounce)(maybeCutOffLastTabItem, 50);
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["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_9__["default"]),
/* harmony export */   InsufficientPermissionsError: () => (/* reexport safe */ _InsufficientPermissionsError__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   KeyMetricsBackNotice: () => (/* reexport safe */ _KeyMetricsBackNotice__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   KeyMetricsSetupCTAWidget: () => (/* reexport safe */ _KeyMetricsSetupCTAWidget__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   MetricTileNumeric: () => (/* reexport safe */ _MetricTileNumeric__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   MetricTileTable: () => (/* reexport safe */ _MetricTileTable__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   MetricTileTablePlainText: () => (/* reexport safe */ _MetricTileTablePlainText__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   MetricTileText: () => (/* reexport safe */ _MetricTileText__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   MetricTileWrapper: () => (/* reexport safe */ _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_8__["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 _KeyMetricsBackNotice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./KeyMetricsBackNotice */ "./js/components/KeyMetrics/KeyMetricsBackNotice.tsx");
/* harmony import */ var _KeyMetricsSetupCTAWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./KeyMetricsSetupCTAWidget */ "./js/components/KeyMetrics/KeyMetricsSetupCTAWidget.js");
/* harmony import */ var _MetricTileNumeric__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./MetricTileNumeric */ "./js/components/KeyMetrics/MetricTileNumeric.js");
/* harmony import */ var _MetricTileTable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MetricTileTable */ "./js/components/KeyMetrics/MetricTileTable.tsx");
/* harmony import */ var _MetricTileTablePlainText__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./MetricTileTablePlainText */ "./js/components/KeyMetrics/MetricTileTablePlainText.js");
/* harmony import */ var _MetricTileText__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./MetricTileText */ "./js/components/KeyMetrics/MetricTileText.js");
/* harmony import */ var _MetricTileWrapper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./MetricTileWrapper */ "./js/components/KeyMetrics/MetricTileWrapper.js");
/* harmony import */ var _ChipTabGroup__WEBPACK_IMPORTED_MODULE_9__ = __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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shouldDisplayWidgetWithConversionEvent */ "./js/components/KeyMetrics/shouldDisplayWidgetWithConversionEvent.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);
}

/**
 * Key metric tile configurations, keyed by metric slug.
 *
 * Each entry configures how the metric appears in the selection panel and on the
 * dashboard (`title`, `description`, `infoTooltip`, `metadata`, and the various
 * display predicates).
 *
 * A metric's PDF export configuration lives in `key-metrics-pdf-tiles.js`,
 * keyed by the same slug, so this module never imports a widget component.
 *
 * - `pdfTile.TileComponent`: the `@react-pdf/renderer` component for the tile,
 *   wrapped with `lazyWithPreload` so this module stays free of the PDF renderer
 *   on the dashboard bundle. It receives the tile `title` plus the fields
 *   returned by `getTileData`.
 * - `pdfTile.getTileData( { registry, dates, signal } )`: resolves the report(s)
 *   the tile needs and returns the normalised data the `TileComponent` consumes,
 *   or `null` when the export is canceled.
 *
 * Entries without a `pdfTile` field do not render in the PDF and are skipped.
 *
 * @since 1.184.0 Added the optional `pdfTile` field.
 */
const KEY_METRICS_WIDGETS = {
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_2__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.KM_ANALYTICS_POPULAR_PRODUCTS) || select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getProductPostType(),
    displayInWidgetArea: shouldDisplayWidgetWithCustomDimensions,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_CONTENT_PERFORMANCE.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_VISITORS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_GENERATING_LEADS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_GENERATING_LEADS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_GROUP_SELLING_PRODUCTS.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_4__.KEY_METRICS_GROUP_DRIVING_TRAFFIC.SLUG
    }
  },
  [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.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_5__.shouldDisplayWidgetWithConversionEvent,
    displayInList: _shouldDisplayWidgetWithConversionEvent__WEBPACK_IMPORTED_MODULE_5__.shouldDisplayWidgetWithConversionEvent,
    metadata: {
      group: _constants__WEBPACK_IMPORTED_MODULE_4__.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.ts");
/**
 * 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/KeyMetrics/utils.js"
/*!*******************************************!*\
  !*** ./js/components/KeyMetrics/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 */   conversionReportingDetectedEventsTracking: () => (/* binding */ conversionReportingDetectedEventsTracking)
/* 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__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * Key Metrics utility functions.
 *
 * 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 conversionReportingDetectedEventsTracking({
  shouldShowInitialCalloutForTailoredMetrics,
  shouldShowCalloutForUserPickedMetrics,
  shouldShowCalloutForNewEvents,
  userPickedMetrics
}, viewContext, eventName) {
  let category = '';

  // Handle internal tracking or the initial detection of events with tailored KMW selection.
  if (shouldShowInitialCalloutForTailoredMetrics) {
    category = `${viewContext}_kmw-tailored-conversion-events-detected-notification`;
  }

  // Handle internal tracking or the initial detection of events with manual KMW selection.
  if (shouldShowCalloutForUserPickedMetrics) {
    category = `${viewContext}_kmw-manual-conversion-events-detected-notification`;
  }

  // Handle internal tracking for new events with manual KMW selection.
  if (shouldShowCalloutForNewEvents && userPickedMetrics?.length) {
    category = `${viewContext}_kmw-manual-new-conversion-events-detected-notification`;
  }

  // Handle internal tracking for new events with tailored KMW selection.
  if (shouldShowCalloutForNewEvents && !userPickedMetrics?.length) {
    category = `${viewContext}_kmw-tailored-new-conversion-events-detected-notification`;
  }
  if (category) {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.trackEvent)(category, eventName, 'conversion_reporting');
  }
}
conversionReportingDetectedEventsTracking.propTypes = {
  shouldShowInitialCalloutForTailoredMetrics: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool).isRequired,
  shouldShowCalloutForUserPickedMetrics: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool).isRequired,
  shouldShowCalloutForNewEvents: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool).isRequired,
  userPickedMetrics: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  viewContext: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  eventName: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./js/components/LeanCTABanner.js"
/*!****************************************!*\
  !*** ./js/components/LeanCTABanner.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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * LeanCTABanner 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
 */


const LeanCTABanner = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(({
  className,
  children,
  Icon,
  SVGGraphic
}, ref) => {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    ref: ref,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-lean-cta-banner', className),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "googlesitekit-lean-cta-banner__body",
      children: [Icon && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "googlesitekit-lean-cta-banner__body-icon",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Icon, {
          width: "32",
          height: "32"
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "googlesitekit-lean-cta-banner__body-content",
        children: children
      })]
    }), SVGGraphic && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-lean-cta-banner__graphic",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(SVGGraphic, {})
    })]
  });
});
LeanCTABanner.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node).isRequired,
  Icon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType),
  SVGGraphic: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (LeanCTABanner);

/***/ },

/***/ "./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_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_router_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-router-dom */ "../node_modules/react-router-dom/esm/react-router-dom.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _svg_icons_arrow_inverse_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/icons/arrow-inverse.svg */ "./svg/icons/arrow-inverse.svg");
/* harmony import */ var _svg_icons_arrow_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/icons/arrow.svg */ "./svg/icons/arrow.svg");
/* harmony import */ var _svg_icons_back_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/icons/back.svg */ "./svg/icons/back.svg");
/* harmony import */ var _svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/icons/external.svg */ "./svg/icons/external.svg");
/* harmony import */ var _IconWrapper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./IconWrapper */ "./js/components/IconWrapper.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __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_3__.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_2__.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_4__._x)('(opens in a new tab)', 'screen reader text', 'google-site-kit');
    }
    if (type === BUTTON_DISABLED) {
      labelSuffix = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__._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_10__.jsx)(_svg_icons_back_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
      width: 14,
      height: 14
    });
  }
  if (external && !hideExternalIndicator) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_8__["default"], {
      width: 14,
      height: 14
    });
  }
  if (arrow && !inverse) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_svg_icons_arrow_svg__WEBPACK_IMPORTED_MODULE_6__["default"], {
      width: 14,
      height: 14
    });
  }
  if (arrow && inverse) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_svg_icons_arrow_inverse_svg__WEBPACK_IMPORTED_MODULE_5__["default"], {
      width: 14,
      height: 14
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.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_10__.jsx)(_IconWrapper__WEBPACK_IMPORTED_MODULE_9__["default"], {
      marginRight: 5,
      children: leadingIconToUse
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
      className: "googlesitekit-cta-link__contents",
      children: children
    }), !!trailingIconToUse && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_IconWrapper__WEBPACK_IMPORTED_MODULE_9__["default"], {
      marginLeft: 5,
      children: trailingIconToUse
    })]
  });
});
Link.propTypes = {
  arrow: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  back: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  caps: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  danger: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  hideExternalIndicator: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  inverse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  leadingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  linkButton: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  noFlex: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  small: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  standalone: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  to: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* 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");
/**
 * 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_2__.jsx)(_PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["default"], {
      ...previewBlockProps
    });
  }
  return children;
}
LoadingWrapper.propTypes = {
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  ..._PreviewBlock__WEBPACK_IMPORTED_MODULE_1__["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: "25",
      width: "25"
    }), /*#__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: "29",
      width: "100"
    }), /*#__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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_1__.Component {
  constructor(props) {
    super(props);
    this.state = {
      error: null
    };
  }
  componentDidCatch(error, info) {
    globalThis.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_4__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__["default"], {
      message: errorMessage
    });
  }
}
MediaErrorHandler.defaultProps = {
  errorMessage: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to load media', 'google-site-kit')
};
MediaErrorHandler.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
  errorMessage: (prop_types__WEBPACK_IMPORTED_MODULE_0___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 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_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 _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _svg_icons_warning_svg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/svg/icons/warning.svg */ "./svg/icons/warning.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_2__["default"])(ModalDialog);
  const describedByID = `googlesitekit-dialog-description-${instanceID}`;
  const hasProvides = !!(provides && provides.length);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.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_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.DialogTitle, {
      children: [danger && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_svg_icons_warning_svg__WEBPACK_IMPORTED_MODULE_6__["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_7__.jsx)("p", {
      className: "mdc-dialog__lead",
      children: subtitle
    }) : [], /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.DialogContent, {
      children: [hasProvides && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
        id: describedByID,
        className: "mdc-dialog__provides",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("ul", {
          className: "mdc-list mdc-list--underlined mdc-list--non-interactive",
          children: provides.map(attribute => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("li", {
            className: "mdc-list-item",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
              className: "mdc-list-item__text",
              children: attribute
            })
          }, attribute))
        })
      }), notes.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("section", {
        className: "mdc-dialog__notes",
        children: notes.map((Note, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("p", {
          className: "mdc-dialog__note",
          children: [typeof Note === 'string' && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)(/* translators: %s is replaced with some sub-note text. */
          (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('<strong>Note:</strong> %s', 'google-site-kit'), Note), {
            strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("strong", {})
          }), typeof Note === 'function' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Note, {})]
        }, `note-${index}`))
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.DialogFooter, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.Button, {
        className: "mdc-dialog__cancel-button",
        onClick: handleCancel,
        tertiary: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Cancel', 'google-site-kit')
      }), buttonLink ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.Button, {
        href: buttonLink,
        onClick: handleConfirm,
        target: "_blank",
        danger: danger,
        children: confirmButton
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.SpinnerButton, {
        onClick: handleConfirm,
        danger: danger,
        disabled: inProgress,
        isSaving: inProgress,
        children: confirmButton || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Disconnect', 'google-site-kit')
      })]
    })]
  });
}
ModalDialog.displayName = 'Dialog';
ModalDialog.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  dialogActive: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  handleDialog: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  handleConfirm: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func).isRequired,
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  onClose: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  provides: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)),
  confirmButton: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  notes: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType)])),
  danger: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  small: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  medium: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  buttonLink: (prop_types__WEBPACK_IMPORTED_MODULE_1___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 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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 _Badge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Badge */ "./js/components/Badge.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_7__.jsx)(_Badge__WEBPACK_IMPORTED_MODULE_5__["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_3__.__)('New', 'google-site-kit'),
    hasLeftSpacing: hasLeftSpacing
  });
  if (!tooltipTitle) {
    return badgeComponent;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Tooltip, {
    tooltipClassName: "googlesitekit-new-badge__tooltip",
    title: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
      children: [tooltipTitle, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
        href: learnMoreLink,
        onClick: onLearnMoreClick,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_1___default().string),
  learnMoreLink: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  forceOpen: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onLearnMoreClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  hasLeftSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  hasNoSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_1___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 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_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 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_external_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/external.svg */ "./svg/icons/external.svg");
/* 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
 */



function CTAButton({
  label,
  disabled,
  inProgress,
  onClick,
  href,
  external = false,
  hideExternalIndicator = false,
  tertiary = false
}) {
  let trailingIconToUse;
  if (external && !hideExternalIndicator) {
    trailingIconToUse = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_svg_icons_external_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
      width: 14,
      height: 14
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.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,
    tertiary: tertiary,
    children: label
  });
}
CTAButton.propTypes = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  inProgress: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  hideExternalIndicator: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  tertiary: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* harmony import */ var _svg_icons_check_fill_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/svg/icons/check-fill.svg */ "./svg/icons/check-fill.svg");
/* harmony import */ var _svg_icons_info_circle_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/icons/info-circle.svg */ "./svg/icons/info-circle.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 _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/warning-notice.svg */ "./svg/icons/warning-notice.svg");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __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_5__.NOTICE_TYPES.NEW]: _svg_icons_star_fill_svg__WEBPACK_IMPORTED_MODULE_3__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.SUCCESS]: _svg_icons_check_fill_svg__WEBPACK_IMPORTED_MODULE_1__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.INFO]: _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_4__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.INFO_CIRCLE]: _svg_icons_info_circle_svg__WEBPACK_IMPORTED_MODULE_2__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.WARNING]: _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_4__["default"],
  [_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.ERROR]: _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_4__["default"]
};
function Icon({
  type
}) {
  const IconComponent = typeIconMap[type] || _svg_icons_warning_notice_svg__WEBPACK_IMPORTED_MODULE_4__["default"];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(IconComponent, {
    width: 24,
    height: 24
  });
}
Icon.propTypes = {
  type: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(Object.values(_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES))
};

/***/ },

/***/ "./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_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__);
/* harmony import */ var _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/BannerNotification */ "./js/googlesitekit/notifications/components/layout/BannerNotification.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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 {?boolean}   props.ctaInProgress       Whether the CTA button is in progress. 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,
  ctaInProgress,
  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_2__.HOUR_IN_SECONDS
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_1__["default"], {
    notificationID: id,
    type: _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_1__.TYPES.WARNING,
    titleIcon: titleIcon ? titleIcon : undefined,
    title: title,
    description: content,
    learnMoreLink: learnMoreURL ? {
      label: learnMoreLabel,
      href: learnMoreURL
    } : undefined,
    ctaButton: {
      label: ctaLabel,
      href: ctaURL,
      onClick: onCTAClick,
      inProgress: ctaInProgress,
      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_0___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  content: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  ctaTarget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  ctaURL: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  dismissible: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  dismissLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  learnMoreLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  learnMoreURL: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  onCTAClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  ctaInProgress: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onDismissClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  gaTrackingEventArgs: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* 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");
/**
 * 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_2__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Checkbox, {
    ...checkboxProps,
    children: label
  });
}
LayoutDefault.propTypes = {
  checkboxProps: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  label: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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_3__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Checkbox, {
      ...checkboxProps,
      children: title
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-opt-in__description",
      children: description
    })]
  });
}
LayoutStacked.propTypes = {
  checkboxProps: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___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 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* 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_components_Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.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_tracking__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/tracking */ "./js/util/tracking/index.js");
/* harmony import */ var _LayoutDefault__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./LayoutDefault */ "./js/components/OptIn/LayoutDefault.js");
/* harmony import */ var _LayoutStacked__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./LayoutStacked */ "./js/components/OptIn/LayoutStacked.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __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_2__.useState)();
  const enabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).isTrackingEnabled());
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getErrorForAction('setTrackingEnabled', [!enabled]));
  const {
    setTrackingEnabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const handleOptIn = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(async isChecked => {
    const {
      response,
      error: responseError
    } = await setTrackingEnabled(isChecked);
    if (!responseError) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_10__.toggleTracking)(response.enabled);
      if (response.enabled) {
        (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(trackEventCategory || viewContext, trackEventAction);
      }
    } else {
      setChecked(enabled);
    }
  }, [enabled, setTrackingEnabled, trackEventCategory, trackEventAction, viewContext]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (enabled !== undefined && checked === undefined) {
      setChecked(enabled);
    }
  }, [enabled, checked]);
  const debouncedHandleOptIn = (0,_js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_8__.useDebounce)(handleOptIn, 300);
  const handleCheck = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(event => {
    const isChecked = event.target.checked;
    setChecked(isChecked);
    debouncedHandleOptIn(isChecked);
  }, [debouncedHandleOptIn]);
  const labelTitle = title ?? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span", {
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Help us improve Site Kit by sharing anonymous usage data.', 'google-site-kit')
  });
  const labelDescription = description ?? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('<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_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
      href: "https://policies.google.com/privacy",
      external: true
    }, "link"),
    span: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("span", {})
  });
  const checkboxProps = {
    id,
    name,
    value: '1',
    checked,
    onChange: handleCheck,
    loading: enabled === undefined
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.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_13__.jsx)(_LayoutStacked__WEBPACK_IMPORTED_MODULE_12__["default"], {
      checkboxProps: checkboxProps,
      title: labelTitle,
      description: labelDescription
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_LayoutDefault__WEBPACK_IMPORTED_MODULE_11__["default"], {
      checkboxProps: checkboxProps,
      label: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
        children: [labelTitle, " ", labelDescription]
      })
    }), error?.message && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
      className: "googlesitekit-error-text",
      children: error?.message
    })]
  });
}
OptIn.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  layout: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf([DEFAULT_LAYOUT, STACKED_LAYOUT]),
  trackEventCategory: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_NewBadge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/NewBadge */ "./js/components/NewBadge.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _CTAButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CTAButton */ "./js/components/OverlayCard/CTAButton.js");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Description */ "./js/components/OverlayCard/Description.js");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./DismissButton */ "./js/components/OverlayCard/DismissButton.js");
/* harmony import */ var _Title__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Title */ "./js/components/OverlayCard/Title.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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_3__.useBreakpoint)();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [breakpoint !== _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.BREAKPOINT_SMALL && GraphicDesktop && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
      className: "googlesitekit-overlay-card__graphic",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(GraphicDesktop, {})
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "googlesitekit-overlay-card__body",
      children: [newBadge && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
        className: "googlesitekit-overlay-card__badge",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_NewBadge__WEBPACK_IMPORTED_MODULE_2__["default"], {
          hasNoSpacing: true
        })
      }), title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Title__WEBPACK_IMPORTED_MODULE_7__["default"], {
        children: title
      }), description && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_Description__WEBPACK_IMPORTED_MODULE_5__["default"], {
        children: description
      })]
    }), (ctaButton || dismissButton) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "googlesitekit-overlay-card__actions",
      children: [dismissButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_DismissButton__WEBPACK_IMPORTED_MODULE_6__["default"], {
        ...dismissButton
      }), ctaButton && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_CTAButton__WEBPACK_IMPORTED_MODULE_4__["default"], {
        ...ctaButton
      })]
    }), breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.BREAKPOINT_SMALL && GraphicMobile && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(GraphicMobile, {})]
  });
}
Body.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
    ..._DismissButton__WEBPACK_IMPORTED_MODULE_6__.buttonProps,
    href: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
    target: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
    trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element)
  }),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
    ..._DismissButton__WEBPACK_IMPORTED_MODULE_6__.buttonProps
  }),
  GraphicDesktop: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType),
  GraphicMobile: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType),
  newBadge: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* 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 _DismissButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DismissButton */ "./js/components/OverlayCard/DismissButton.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_1__.Button, {
    ...otherProps,
    children: label
  });
}
CTAButton.propTypes = {
  ..._DismissButton__WEBPACK_IMPORTED_MODULE_2__.buttonProps,
  href: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  target: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __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_1__.jsx)("p", {
    className: "googlesitekit-overlay-card__description",
    children: children
  });
}
Description.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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_1__.__)('Maybe later', 'google-site-kit'),
  onClick,
  disabled
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
    onClick: onClick,
    disabled: disabled,
    tertiary: true,
    children: label
  });
}
const buttonProps = {
  label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* 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");
/**
 * 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
 */


/**
 * Internal dependencies
 */


function Title({
  children
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_1__["default"], {
    as: "h3",
    size: "medium",
    type: "title",
    className: "googlesitekit-overlay-card__title",
    children: children
  });
}
Title.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_0__ = __webpack_require__(/*! @material-ui/core */ "../node_modules/@material-ui/core/esm/Slide/Slide.js");
/* 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_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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _Body__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Body */ "./js/components/OverlayCard/Body.js");
/* harmony import */ var _DismissButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./DismissButton */ "./js/components/OverlayCard/DismissButton.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __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,
    disableAnimation,
    ...cardProps
  } = props;
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.useBreakpoint)();
  if (!visible) {
    return null;
  }
  const body = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-overlay-card', className),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_Body__WEBPACK_IMPORTED_MODULE_4__["default"], {
      ...cardProps
    })
  });
  if (breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_3__.BREAKPOINT_SMALL || disableAnimation) {
    return body;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_0__["default"], {
    direction: "up",
    in: visible,
    children: body
  });
}
OverlayCard.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object)]),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
    ..._DismissButton__WEBPACK_IMPORTED_MODULE_5__.buttonProps,
    href: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
    target: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
    trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object)
  }),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape(_DismissButton__WEBPACK_IMPORTED_MODULE_5__.buttonProps),
  GraphicDesktop: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().elementType),
  GraphicMobile: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().elementType),
  newBadge: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  visible: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  disableAnimation: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)
};
OverlayCard.defaultProps = {
  visible: 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 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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEffectOnce.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __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_2__.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_3__.createPortal)(children, element);
}
Portal.propTypes = {
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___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 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_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 _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");
/**
 * 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_2__.useBreakpoint)();
  const blockDimensions = {
    width: {
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_SMALL]: smallWidth,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_TABLET]: tabletWidth,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_DESKTOP]: desktopWidth,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_XLARGE]: desktopWidth
    },
    height: {
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_SMALL]: smallHeight,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_TABLET]: tabletHeight,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_DESKTOP]: desktopHeight,
      [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_XLARGE]: desktopWidth
    }
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.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_3__.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_1___default().string),
  width: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  height: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  shape: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  padding: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  smallWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  smallHeight: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  tabletWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  tabletHeight: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  desktopWidth: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  desktopHeight: (prop_types__WEBPACK_IMPORTED_MODULE_1___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 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_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 _PreviewBlock__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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_3__.jsx)("div", {
      className: "googlesitekit-preview-table__row",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_PreviewBlock__WEBPACK_IMPORTED_MODULE_2__["default"], {
        width: "100%",
        height: rowHeight + 'px'
      })
    }, 'table-row-' + x));
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.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_1___default().number),
  rowHeight: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  padding: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};
PreviewTable.defaultProps = {
  rows: 11,
  rowHeight: 35,
  padding: false
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PreviewTable);

/***/ },

/***/ "./js/components/ProgressIndicator.js"
/*!********************************************!*\
  !*** ./js/components/ProgressIndicator.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 */ ProgressIndicator)
/* 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_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_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ProgressIndicator 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 ProgressIndicator({
  currentSegment = 0,
  totalSegments = 0,
  className
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
    style: {
      // The first segment is the initial stub segment with a fixed width of 46px.
      gridTemplateColumns: `46px repeat(${totalSegments || 1}, 1fr)`
    },
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-progress-indicator', className),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-progress-indicator__segment')
    }), totalSegments > 0 && Array.from(Array(currentSegment + 1).keys()).map(segmentIndex => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-progress-indicator__segment', {
        'googlesitekit-progress-indicator__segment--final': currentSegment + 1 === totalSegments
      })
    }, segmentIndex))]
  });
}
ProgressIndicator.propTypes = {
  currentSegment: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  // Index of the current segment.
  totalSegments: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
};

/***/ },

/***/ "./js/components/RecoverableModules.js"
/*!*********************************************!*\
  !*** ./js/components/RecoverableModules.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 */ RecoverableModules)
/* 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__);
/* 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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _notifications_CTA__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./notifications/CTA */ "./js/components/notifications/CTA.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * RecoverableModules 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 RecoverableModules({
  moduleSlugs
}) {
  const moduleNames = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const modules = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).getModules();
    if (modules === undefined) {
      return undefined;
    }
    return moduleSlugs.map(moduleSlug => modules[moduleSlug].name);
  });
  if (moduleNames === undefined) {
    return null;
  }
  const description = moduleNames.length === 1 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Module name */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s data was previously shared by an admin who no longer has access. Please contact another admin to restore it.', 'google-site-kit'), moduleNames[0]) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: List of module names */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The data for the following modules was previously shared by an admin who no longer has access: %s. Please contact another admin to restore it.', 'google-site-kit'), moduleNames.join((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__._x)(', ', 'Recoverable modules', 'google-site-kit')));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_notifications_CTA__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Data Unavailable', 'google-site-kit'),
    description: description
  });
}
RecoverableModules.propTypes = {
  moduleSlugs: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)).isRequired
};

/***/ },

/***/ "./js/components/RefocusableModalDialog.js"
/*!*************************************************!*\
  !*** ./js/components/RefocusableModalDialog.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_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__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js");
/* 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_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 _ModalDialog__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./ModalDialog */ "./js/components/ModalDialog.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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
 */



// Use a singleton variable to store the clicked element before any dialog opens.
// We need to do this at the module level since the component may not be mounted
// when the user initiates an action that will open the dialog.

let previouslyClickedElement = null;

// Set up a global event listener to capture the clicked element before any dialog opens.
// This needs to happen at the module level to ensure it's set up before any user interaction.
function setupFocusTracker() {
  if (typeof globalThis === 'undefined' || !globalThis.document || globalThis._googlesitekitModalFocusTrackerInitialized) {
    return;
  }
  function captureActiveElementOnClick(event) {
    // Store the clicked (or keyboard-activated) element when user clicks.
    // This will be the element that was clicked right before the dialog opens.
    const nearestParentButtonOrAnchor = event.target.closest('button, a, input');
    if (nearestParentButtonOrAnchor && !nearestParentButtonOrAnchor.classList.contains('mdc-dialog__cancel-button')) {
      previouslyClickedElement = nearestParentButtonOrAnchor;
    }
  }
  globalThis.document.addEventListener('mousedown', captureActiveElementOnClick);
  globalThis.document.addEventListener('keydown', event => {
    if (event.key === 'Enter' || event.key === ' ') {
      captureActiveElementOnClick(event);
    }
  });
  globalThis._googlesitekitModalFocusTrackerInitialized = true;
}
setupFocusTracker();
function RefocusableModalDialog({
  dialogActive = false,
  refocusQuerySelector = null,
  ...modalDialogProps
}) {
  const handleElementRefocus = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    setTimeout(() => {
      const elementToFocus = refocusQuerySelector ? document.querySelector(refocusQuerySelector) : previouslyClickedElement;
      if (elementToFocus && document.body.contains(elementToFocus)) {
        elementToFocus.focus();
      }
      if (!refocusQuerySelector) {
        previouslyClickedElement = null;
      }
    });
  }, [refocusQuerySelector]);
  const previousDialogActive = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])(dialogActive);
  // Handle re-focus of the button which triggered the modal.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (previousDialogActive === true && dialogActive === false) {
      handleElementRefocus();
    }
    return () => {
      // In majority of cases the modal is conditionally rendered, so dialogActive
      // will not be passed, as component will be unmounted/removed from the DOM.
      handleElementRefocus();
    };
  }, [previousDialogActive, dialogActive, handleElementRefocus]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_ModalDialog__WEBPACK_IMPORTED_MODULE_4__["default"], {
    dialogActive: dialogActive,
    ...modalDialogProps
  });
}
RefocusableModalDialog.propTypes = {
  dialogActive: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  refocusQuerySelector: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  ...googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Dialog.propTypes
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RefocusableModalDialog);

/***/ },

/***/ "./js/components/ReportError.js"
/*!**************************************!*\
  !*** ./js/components/ReportError.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 */ ReportError)
/* 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/remove-query-args.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__);
/* 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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_util_insufficient_permissions_error_description__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/insufficient-permissions-error-description */ "./js/util/insufficient-permissions-error-description.js");
/* harmony import */ var _js_util_purify__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/purify */ "./js/util/purify.js");
/* harmony import */ var _ErrorNotice__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ErrorNotice */ "./js/components/ErrorNotice.tsx");
/* harmony import */ var _notifications_CTA__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./notifications/CTA */ "./js/components/notifications/CTA.js");
/* harmony import */ var _ReportErrorActions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ReportErrorActions */ "./js/components/ReportErrorActions.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ReportError 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 ReportError({
  moduleSlug,
  error,
  onRetry,
  onRequestAccess
}) {
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES).getModule(moduleSlug));
  const errors = Array.isArray(error) ? error : [error];
  let title;
  function getMessage(err) {
    if ((0,_js_util_errors__WEBPACK_IMPORTED_MODULE_8__.isInsufficientPermissionsError)(err)) {
      if (isViewOnly) {
        title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: module name */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Access lost to %s', 'google-site-kit'), module?.name);
        return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: module name */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('The administrator sharing this module with you has lost access to the %s service, so you won’t be able to see stats from it on the Site Kit dashboard. You can contact them or another administrator to restore access.', 'google-site-kit'), module?.name);
      }
      title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: module name */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Insufficient permissions in %s', 'google-site-kit'), module?.name);
      return (0,_js_util_insufficient_permissions_error_description__WEBPACK_IMPORTED_MODULE_9__.getInsufficientPermissionsErrorDescription)(err.message, module);
    }
    return (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_8__.getReportErrorMessage)(err);
  }
  const uniqueErrors = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.uniqWith)(errors.map(err => ({
    ...err,
    message: getMessage(err),
    // The `code` parameter contains a session ID which can vary
    // between requests, so we ignore it for comparison below.
    // To use the original `reconnectURL` elsewhere, use `err.data.reconnectURL`.
    reconnectURL: err.data?.reconnectURL ? (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_4__.removeQueryArgs)(err.data.reconnectURL, 'code') : undefined
  })), (errorA, errorB) => errorA.message === errorB.message && errorA.reconnectURL === errorB.reconnectURL);
  const hasInsufficientPermissionsError = errors.some(err => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_8__.isInsufficientPermissionsError)(err));
  if (!hasInsufficientPermissionsError && uniqueErrors.length === 1) {
    title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: module name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Data error in %s', 'google-site-kit'), module?.name);
  } else if (!hasInsufficientPermissionsError && uniqueErrors.length > 1) {
    title = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: module name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Data errors in %s', 'google-site-kit'), module?.name);
  }
  const description = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: uniqueErrors.map(errorForNotice => {
      const reconnectURL = errorForNotice?.data?.reconnectURL;
      return reconnectURL ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_ErrorNotice__WEBPACK_IMPORTED_MODULE_11__["default"], {
        error: errorForNotice,
        message: errorForNotice.message
      }, errorForNotice.message) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("p", {
        children: _js_util_purify__WEBPACK_IMPORTED_MODULE_10__.purify.sanitize(errorForNotice.message, {
          // Ensures no HTML tags are passed as they would be
          // escaped by React and appear as strings.
          ALLOWED_TAGS: []
        })
      }, errorForNotice.message);
    })
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_notifications_CTA__WEBPACK_IMPORTED_MODULE_12__["default"], {
    title: title,
    description: description,
    error: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_ReportErrorActions__WEBPACK_IMPORTED_MODULE_13__["default"], {
      moduleSlug: moduleSlug,
      error: error,
      onRetry: onRetry,
      onRequestAccess: onRequestAccess
    })
  });
}
ReportError.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  error: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object)]).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  onRequestAccess: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
};

/***/ },

/***/ "./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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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 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_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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _Link__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Link */ "./js/components/Link.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __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_8__["default"])();
  const storeName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_MODULES).getModuleStoreName(moduleSlug));
  const requestAccessURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.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_5__.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_9__.isErrorRetryable)(err, err.selectorData) && err.selectorData.name === 'getReport');
  const showRetry = !!retryableErrors.length;
  const errorTroubleshootingLinkURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
    const err = {
      ...(showRetry ? retryableErrors[0] : errors[0])
    };
    if ((0,_js_util_errors__WEBPACK_IMPORTED_MODULE_9__.isInsufficientPermissionsError)(err)) {
      err.code = `${moduleSlug}_insufficient_permissions`;
    }
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getErrorTroubleshootingLinkURL(err);
  });
  const dispatch = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)();
  const hasInsufficientPermissionsError = errors.some(err => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_9__.isInsufficientPermissionsError)(err));
  const handleRetry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.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_11__.jsxs)("div", {
    className: "googlesitekit-report-error-actions",
    children: [showRequestAccessURL && (typeof RequestAccessButton === 'function' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(RequestAccessButton, {
      requestAccessURL: requestAccessURL
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
      onClick: onRequestAccess,
      href: requestAccessURL,
      target: "_blank",
      danger: buttonVariant === 'danger',
      tertiary: buttonVariant === 'tertiary',
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Request access', 'google-site-kit')
    })), showRetry && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
      children: [typeof RetryButton === 'function' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(RetryButton, {
        handleRetry: handleRetry
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
        onClick: handleRetry,
        danger: buttonVariant === 'danger',
        tertiary: buttonVariant === 'tertiary',
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Retry', 'google-site-kit')
      }), !hideGetHelpLink && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Retry didn’t work? <HelpLink />', 'google-site-kit'), {
          HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_10__["default"], {
            href: errorTroubleshootingLinkURL,
            external: true,
            hideExternalIndicator: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Get help', 'google-site-kit')
          })
        })
      })]
    }), !showRetry && !hideGetHelpLink && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
      className: getHelpClassName,
      children: typeof GetHelpLink === 'function' ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(GetHelpLink, {
        linkURL: errorTroubleshootingLinkURL
      }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_10__["default"], {
        href: errorTroubleshootingLinkURL,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Get help', 'google-site-kit')
      })
    })]
  });
}
ReportErrorActions.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  error: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)]).isRequired,
  GetHelpLink: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType),
  hideGetHelpLink: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  buttonVariant: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  onRequestAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  getHelpClassName: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  RequestAccessButton: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType),
  RetryButton: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/icon/index.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/library/check.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/library/stack.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");
/**
 * 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_2__.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_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_7__.Button, {
    "aria-label": copied ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_8__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"], {
      className: "mdc-button__icon",
      icon: copied ? _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"] : _wordpress_icons__WEBPACK_IMPORTED_MODULE_6__["default"]
    }),
    children: copied ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Copied to clipboard', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Copy error contents', 'google-site-kit')
  });
}
ReportErrorButton.propTypes = {
  message: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  componentStack: (prop_types__WEBPACK_IMPORTED_MODULE_1___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 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 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_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _GatheringDataNotice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./GatheringDataNotice */ "./js/components/GatheringDataNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_4__.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_7__.jsxs)("div", {
    className: className,
    children: [tabbedLayout && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.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_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.Tab, {
        "aria-label": title,
        focusOnActivate: false,
        children: [title, badge]
      }, title))
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.jsxs)("thead", {
          className: "googlesitekit-table__head",
          children: [hasBadges && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("tr", {
            className: "googlesitekit-table__head-badges",
            children: columns.map(({
              badge,
              primary,
              className: columnClassName,
              columnHeaderClassName
            }, colIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_7__.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_7__.jsx)("span", {
                className: "googlesitekit-table__head-item-title",
                children: title
              })
            }, `googlesitekit-table__head-row-${colIndex}`))
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("tbody", {
          className: "googlesitekit-table__body",
          children: [gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("tr", {
            className: "googlesitekit-table__body-row googlesitekit-table__body-row--no-data",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("td", {
              className: "googlesitekit-table__body-item",
              colSpan: contentColumns.length,
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_6__["default"], {})
            })
          }), !gatheringData && !rows?.length && ZeroState && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("tr", {
            className: "googlesitekit-table__body-row googlesitekit-table__body-row--no-data",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("td", {
              className: "googlesitekit-table__body-item",
              colSpan: contentColumns.length,
              children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(ZeroState, {})
            })
          }), !gatheringData && rows.slice(0, limit).map((row, rowIndex) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_7__.jsx)("td", {
                className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-table__body-item', columnClassName),
                children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
                  className: "googlesitekit-table__body-item-content",
                  children: [Component && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_3___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_3___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_3___default().array), (prop_types__WEBPACK_IMPORTED_MODULE_3___default().object)])).isRequired,
  columns: prop_types__WEBPACK_IMPORTED_MODULE_3___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_3___default().shape({
    title: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
    description: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
    primary: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
    className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
    field: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
    Component: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().elementType),
    badge: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().node)
  })).isRequired,
  className: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().string),
  limit: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().number),
  zeroState: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().func),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool),
  tabbedLayout: (prop_types__WEBPACK_IMPORTED_MODULE_3___default().bool)
};

/***/ },

/***/ "./js/components/ReportZero.js"
/*!*************************************!*\
  !*** ./js/components/ReportZero.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 */ ReportZero)
/* 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__);
/* 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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _notifications_CTA__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./notifications/CTA */ "./js/components/notifications/CTA.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ReportZero 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 ReportZero({
  moduleSlug
}) {
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).getModule(moduleSlug));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_notifications_CTA__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Module name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s Gathering Data', 'google-site-kit'), module?.name),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Module name */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s data is not yet available, please check back later', 'google-site-kit'), module?.name)
  });
}
ReportZero.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./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 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_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 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");
/**
 * 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_3__.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_3__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.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_1___default().node),
  checked: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  onChange: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  value: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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 _js_components_SideSheet__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/SideSheet */ "./js/components/SideSheet.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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('');

  // Use a function for `initialFocus` so focus-trap resolves the element at
  // activation time. Returning `false` when no match is present falls back
  // to the first focusable element in the trap, avoiding the
  // "refers to no known node" error when items haven't rendered yet.
  const initialFocusSelector = classNameSelector ? `${classNameSelector} .googlesitekit-selection-panel-item .googlesitekit-selection-box input` : '.googlesitekit-selection-panel-item .googlesitekit-selection-box input';
  function initialFocus() {
    return document.querySelector(initialFocusSelector) || false;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_SideSheet__WEBPACK_IMPORTED_MODULE_2__["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_1___default().node),
  isOpen: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  isLoading: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  closePanel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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_2__ = __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_2__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-selection-panel__content', className),
    children: children
  });
}
SelectionPanelContent.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
};

/***/ },

/***/ "./js/components/SelectionPanel/SelectionPanelError.js"
/*!*************************************************************!*\
  !*** ./js/components/SelectionPanel/SelectionPanelError.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 */ SelectionPanelError)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.tsx");
/* harmony import */ var _js_util_geometry__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util/geometry */ "./js/util/geometry.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Selection Panel Error
 *
 * 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 SelectionPanelError({
  error,
  noPrefix = true,
  skipRetryMessage = true
}) {
  const noticeRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)();

  // Scroll the metric item (normally the last item in the panel)
  // being overlapped by the error.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (error) {
      const currentFocusedElement = globalThis.document.activeElement;
      if (currentFocusedElement && currentFocusedElement.closest('.googlesitekit-selection-panel-item') && (0,_js_util_geometry__WEBPACK_IMPORTED_MODULE_3__.elementsOverlap)(noticeRef.current, currentFocusedElement)) {
        currentFocusedElement.scrollIntoView();
      }
    }
  }, [error]);
  if (!error) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
    ref: noticeRef,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_2__["default"], {
      className: "googlesitekit-notice--square googlesitekit-notice--side-panel",
      error: error,
      noPrefix: noPrefix,
      skipRetryMessage: skipRetryMessage
    })
  });
}
SelectionPanelError.propTypes = {
  error: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
    message: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
  }),
  noPrefix: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  skipRetryMessage: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __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_2__.useState)(null);
  const [wasSaved, setWasSaved] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isFetchingSyncAvailableAudiences());
  const haveSettingsChanged = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useMemo)(() => {
    // Arrays need to be sorted to match in `isEqual`.
    return !(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isEqual)((0,_js_util__WEBPACK_IMPORTED_MODULE_9__.safelySort)(selectedItemSlugs), (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.safelySort)(savedItemSlugs));
  }, [savedItemSlugs, selectedItemSlugs]);
  const currentButtonText = savedItemSlugs?.length > 0 && haveSettingsChanged ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Apply changes', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Save selection', 'google-site-kit');
  const onSaveClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.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_2__.useCallback)(() => {
    closePanel();
    onCancel();
  }, [closePanel, onCancel]);
  const [prevIsOpen, setPrevIsOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.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_10__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_7__["default"], {
    width: "89px",
    height: "20px"
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
    className: "googlesitekit-selection-panel-footer__item-count",
    children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.sprintf)(/* translators: 1: Number of selected items. 2: Maximum number of items that can be selected. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('%1$d selected <MaxCount>(up to %2$d)</MaxCount>', 'google-site-kit'), selectedItemCount, maxSelectedItemCount), {
      MaxCount: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
        className: "googlesitekit-selection-panel-footer__item-count--max-count"
      })
    })
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("footer", {
    className: "googlesitekit-selection-panel-footer",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "googlesitekit-selection-panel-footer__content",
      children: [itemCountElement, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
        className: "googlesitekit-selection-panel-footer__actions",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.Button, {
          onClick: onCancelClick,
          disabled: isBusy,
          tertiary: true,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Cancel', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.SpinnerButton, {
          onClick: onSaveClick,
          isSaving: isBusy,
          disabled: selectedItemCount < minSelectedItemCount || selectedItemCount > maxSelectedItemCount || isBusy || !isOpen && wasSaved,
          children: finalButtonText || currentButtonText
        })]
      })]
    })
  });
}
SelectionPanelFooter.propTypes = {
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
  selectedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().array),
  saveSettings: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  minSelectedItemCount: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  maxSelectedItemCount: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  isBusy: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onSaveSuccess: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  isOpen: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  closePanel: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* 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 _svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/svg/icons/close.svg */ "./svg/icons/close.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_4__.jsxs)("header", {
    className: "googlesitekit-selection-panel-header",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "googlesitekit-selection-panel-header__row",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.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_4__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_1__["default"], {
        className: "googlesitekit-selection-panel-header__close",
        onClick: onCloseClick,
        linkButton: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_3__["default"], {
          width: "15",
          height: "15"
        })
      })]
    }), children]
  });
}
SelectionPanelHeader.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  onCloseClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* 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_Badge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Badge */ "./js/components/Badge.js");
/* harmony import */ var _js_components_SelectionBox__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/SelectionBox */ "./js/components/SelectionBox.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_4__.jsxs)("div", {
    className: "googlesitekit-selection-panel-item",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)(_js_components_SelectionBox__WEBPACK_IMPORTED_MODULE_3__["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_4__.jsx)("span", {
        className: "googlesitekit-selection-panel-item__subtitle",
        children: subtitle
      }), description, children]
    }), isNewlyDetected && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Badge__WEBPACK_IMPORTED_MODULE_2__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New', 'google-site-kit')
    }), suffix && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      className: "googlesitekit-selection-panel-item__suffix",
      children: suffix
    })]
  });
}
SelectionPanelItem.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  isItemSelected: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  isItemDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onCheckboxChange: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  subtitle: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  suffix: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  badge: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  isNewlyDetected: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __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_2__.__)('Current selection', 'google-site-kit'),
  availableItemsTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_3__.jsx)(ItemComponent, {
      slug: slug,
      savedItemSlugs: savedItemSlugs,
      ...items[slug]
    }, slug));
  }
  const availableUnsavedItemsCount = Object.keys(availableUnsavedItems).length;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.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_3__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
        className: "googlesitekit-selection-panel-items__subheading",
        children: currentSelectionTitle
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "googlesitekit-selection-panel-items__subsection",
        children: renderItems(availableSavedItems)
      }), availableUnsavedItemsCount > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
        className: "googlesitekit-selection-panel-items__subheading",
        children: availableItemsTitle
      })]
    }), availableUnsavedItemsCount > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-selection-panel-items__subsection",
      children: renderItems(availableUnsavedItems)
    }), notice]
  });
}
SelectionPanelItems.propTypes = {
  currentSelectionTitle: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  availableItemsTitle: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array),
  availableSavedItems: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  availableUnsavedItems: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  ItemComponent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType),
  notice: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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_use__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useKey.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.mjs");
/* harmony import */ var _Portal__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./Portal */ "./js/components/Portal.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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 = globalThis.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_5__.useRef)();
  const [sideSheetTopOffset, setSideSheetTopOffset] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(0);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.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_3__["default"])(sideSheetRef, handleClickAway);
  (0,react_use__WEBPACK_IMPORTED_MODULE_4__["default"])(event => isOpen && _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_6__.ESCAPE === event.keyCode, closeSheet);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)(_Portal__WEBPACK_IMPORTED_MODULE_7__["default"], {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.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_8__.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_8__.jsx)("span", {
      className: "googlesitekit-side-sheet-overlay"
    })]
  });
}
SideSheet.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  isOpen: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  isLoading: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
  closeSheet: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
  focusTrapOptions: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object)
};

/***/ },

/***/ "./js/components/Sparkline.js"
/*!************************************!*\
  !*** ./js/components/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_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__);
/* harmony import */ var _GoogleChart__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GoogleChart */ "./js/components/GoogleChart/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Sparkline 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 Sparkline({
  change,
  data,
  invertChangeColor,
  loadingHeight
}) {
  if (!data) {
    return null;
  }
  const colors = [];
  const green = 'green';
  const red = 'red';
  if (change === null) {
    // Use green color by default if the change can't be determined.
    colors.push(green);
  } else {
    const positiveColor = !invertChangeColor ? green : red;
    const negativeColor = !invertChangeColor ? red : green;
    colors.push(0 <= (parseFloat(change) || 0) ? positiveColor : negativeColor);
  }
  const chartOptions = {
    title: '',
    backgroundColor: 'transparent',
    curveType: 'line',
    width: '100%',
    height: '50',
    enableInteractivity: false,
    chartArea: {
      height: '100%',
      width: '100%'
    },
    legend: {
      position: 'none'
    },
    axisFontSize: 0,
    hAxis: {
      baselineColor: 'none',
      ticks: []
    },
    vAxis: {
      baselineColor: 'none',
      ticks: []
    },
    axes: [],
    colors
  };

  // If the line is flat (zero change), we need to adjust it so
  // it sits in line visually with the other graphs.
  if (!data.slice(1).some(row => row[1] > 0)) {
    chartOptions.vAxis.minValue = 0;
    chartOptions.vAxis.maxValue = 1;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
    className: "googlesitekit-analytics-sparkline-chart-wrap",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_GoogleChart__WEBPACK_IMPORTED_MODULE_1__["default"], {
      chartType: "LineChart",
      data: data,
      loadingHeight: loadingHeight,
      options: chartOptions
    })
  });
}
Sparkline.propTypes = {
  invertChangeColor: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  loadingHeight: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
};
Sparkline.defaultProps = {
  invertChangeColor: false,
  loadingHeight: '46px'
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Sparkline);

/***/ },

/***/ "./js/components/Spinner.js"
/*!**********************************!*\
  !*** ./js/components/Spinner.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_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__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Spinner 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
 */


/**
 * A single module. Keeps track of its own active state and settings.
 */

function Spinner({
  isSaving,
  style = {}
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
    className: "spinner",
    style: {
      display: isSaving ? 'inline-block' : 'none',
      float: 'none',
      marginTop: '0',
      visibility: 'visible',
      ...style
    }
  });
}
Spinner.propTypes = {
  isSaving: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  style: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Spinner);

/***/ },

/***/ "./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_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__);
/* 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 _Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./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");
/**
 * 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_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getGoogleSupportURL({
    path,
    query,
    hash
  }));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
    ...otherProps,
    href: supportURL
  });
}
SupportLink.propTypes = {
  path: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  query: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  hash: (prop_types__WEBPACK_IMPORTED_MODULE_0___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 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_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_use__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useEvent.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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_4__.useState)(false);
  const scrollRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)();
  const debouncedScrollCheck = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.debounce)(setIsScrolling, 100);
  (0,react_use__WEBPACK_IMPORTED_MODULE_3__["default"])('resize', debouncedScrollCheck);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.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_5__.jsx)("div", {
    onScroll: (0,lodash__WEBPACK_IMPORTED_MODULE_1__.debounce)(setIsScrolling, 100),
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-table-overflow', {
      'googlesitekit-table-overflow--gradient': isScrolling
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
      ref: scrollRef,
      className: "googlesitekit-table-overflow__container",
      children: children
    })
  });
}
TableOverflowContainer.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___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_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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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_util_create_incremental_array_by_size__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/create-incremental-array-by-size */ "./js/util/create-incremental-array-by-size.js");
/* harmony import */ var _svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/icons/close.svg */ "./svg/icons/close.svg");
/* harmony import */ var _Typography__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __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_6__.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_9__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-tour-tooltip', step.className, {
      'googlesitekit-tour-tooltip--no-title': !step.title,
      'googlesitekit-tour-tooltip--setupFlowRefresh': setupFlowRefreshEnabled
    }),
    ...tooltipProps,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)((_material_react_card__WEBPACK_IMPORTED_MODULE_0___default()), {
      className: "googlesitekit-tooltip-card",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
        className: "googlesitekit-tooltip-body",
        children: [step.title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_Typography__WEBPACK_IMPORTED_MODULE_8__["default"], {
          as: "h2",
          className: "googlesitekit-tooltip-title",
          size: "medium",
          type: "title",
          children: step.title
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
          className: "googlesitekit-tooltip-content",
          children: step.content
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_material_react_card__WEBPACK_IMPORTED_MODULE_0__.CardActions, {
        className: "googlesitekit-tooltip-actions",
        children: [!setupFlowRefreshEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("ul", {
          className: "googlesitekit-tooltip-indicators",
          children: indicatorArray.map(indicatorIndex => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("li", {
            className: getIndicatorClassName(indicatorIndex)
          }, `indicator-${indicatorIndex}`))
        }), setupFlowRefreshEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("p", {
          className: "googlesitekit-tooltip-steps",
          children: size > 1 && `${index + 1} / ${size}`
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
          className: "googlesitekit-tooltip-buttons",
          children: [index !== 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.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_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.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_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
        className: "googlesitekit-tooltip-close",
        icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_svg_icons_close_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
          width: closeIconSize,
          height: closeIconSize
        }),
        onClick: closeProps.onClick,
        "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_2___default().object).isRequired,
  closeProps: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object).isRequired,
  index: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number).isRequired,
  isLastStep: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool).isRequired,
  primaryProps: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object).isRequired,
  size: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().number).isRequired,
  step: prop_types__WEBPACK_IMPORTED_MODULE_2___default().shape({
    content: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
    title: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
    cta: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_2___default().element), (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)]),
    className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string)
  }).isRequired,
  tooltipProps: (prop_types__WEBPACK_IMPORTED_MODULE_2___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 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__);
/* harmony import */ var react_joyride__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-joyride */ "../node_modules/react-joyride/dist/index.mjs");
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/features */ "./js/features/index.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.js");
/* harmony import */ var _js_util_tracking__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/tracking */ "./js/util/tracking/index.js");
/* harmony import */ var _TourTooltip__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./TourTooltip */ "./js/components/TourTooltip.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __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_5__.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_3__.__)('Back', 'google-site-kit'),
  close: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Close', 'google-site-kit'),
  last: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Got it', 'google-site-kit'),
  next: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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)'
    }
  }
};
const defaultStepOptions = {
  disableBeacon: true,
  isFixed: true,
  placement: 'auto'
};
const responsiveStepOptions = {
  placement: 'top',
  offset: 0
};

// 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_4__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_UI);
  const {
    dismissTour,
    receiveCurrentTour
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
  const registry = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useRegistry)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__.useBreakpoint)();
  const stepIndex = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_UI).getValue(stepKey) || 0);
  const run = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    const notDismissedOrRepeatable = isRepeatable || select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).isTourDismissed(tourID) === false;
    return select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__.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_1__.ACTIONS.PREV ? -1 : 1);
    globalThis.document.body.classList.remove(getStepClassName(index));
    if (steps[newStepIndex]) {
      globalThis.document.body.classList.add(getStepClassName(newStepIndex));
    }
    return setValue(stepKey, newStepIndex);
  }
  function startTour() {
    globalThis.document.body.classList.add('googlesitekit-showing-feature-tour', `googlesitekit-showing-feature-tour--${tourID}`, getStepClassName(stepIndex));
    setValue(runKey, true);
  }
  function endTour() {
    globalThis.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]) {
      globalThis.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_1__.EVENTS.TOOLTIP && lifecycle === react_joyride__WEBPACK_IMPORTED_MODULE_1__.LIFECYCLE.TOOLTIP) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(eventCategory, GA_ACTIONS.VIEW, stepNumber);
    } else if (action === react_joyride__WEBPACK_IMPORTED_MODULE_1__.ACTIONS.CLOSE && lifecycle === react_joyride__WEBPACK_IMPORTED_MODULE_1__.LIFECYCLE.COMPLETE) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(eventCategory, GA_ACTIONS.DISMISS, stepNumber);
    } else if (action === react_joyride__WEBPACK_IMPORTED_MODULE_1__.ACTIONS.NEXT && status === react_joyride__WEBPACK_IMPORTED_MODULE_1__.STATUS.FINISHED && type === react_joyride__WEBPACK_IMPORTED_MODULE_1__.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_11__.trackEvent)(eventCategory, GA_ACTIONS.COMPLETE, stepNumber);
    }
    if (lifecycle !== react_joyride__WEBPACK_IMPORTED_MODULE_1__.LIFECYCLE.COMPLETE || status === react_joyride__WEBPACK_IMPORTED_MODULE_1__.STATUS.FINISHED) {
      return;
    }
    if (action === react_joyride__WEBPACK_IMPORTED_MODULE_1__.ACTIONS.PREV) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(eventCategory, GA_ACTIONS.PREV, stepNumber);
    }
    if (action === react_joyride__WEBPACK_IMPORTED_MODULE_1__.ACTIONS.NEXT) {
      (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(eventCategory, GA_ACTIONS.NEXT, stepNumber);
    }
  }

  /**
   * Scrolls the step into view.
   *
   * @since 1.179.0
   *
   * @param {Object} step The step object.
   */
  function scrollStepIntoView(step) {
    let element = step.target;
    if ('string' === typeof step.target) {
      element = globalThis.document.querySelector(step.target);
    }
    if (!(element instanceof Element)) {
      return;
    }
    const tooltip = document.querySelector('.__floater');
    if (!tooltip) {
      return;
    }
    const elementRect = element.getBoundingClientRect();
    const tooltipRect = tooltip.getBoundingClientRect();
    const elementBottom = window.scrollY + elementRect.bottom;
    const elementTop = window.scrollY + elementRect.top;
    const tooltipBottom = window.scrollY + tooltipRect.bottom;
    const tooltipTop = window.scrollY + tooltipRect.top;
    const bottom = Math.max(elementBottom, tooltipBottom);
    const top = Math.min(elementTop, tooltipTop);
    const combinedHeight = bottom - top;
    const windowHeight = window.innerHeight;
    const scrollMargin = 8; // Minimum distance from the viewport edge when scrolling a tooltip into view.
    const wpAdminBarHeight = (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_10__.getWordPressAdminBarHeight)();
    const stepCenteredWindowHeight = combinedHeight + wpAdminBarHeight + scrollMargin * 2;
    const stepCenteredScrollTo = top + combinedHeight / 2 - windowHeight / 2 - wpAdminBarHeight / 2;

    // If the entire step fits within the viewport, with some spacing, center the step in the viewport.
    if (windowHeight > stepCenteredWindowHeight) {
      window.scrollTo({
        behavior: 'smooth',
        top: stepCenteredScrollTo
      });
    }
    // If the entire step doesnt fit, but the tooltip is outside the target, scroll the tooltip into view.
    else if (top === tooltipTop || bottom === tooltipBottom) {
      tooltip.style.scrollMarginBlock = `${scrollMargin}px`;
      tooltip.scrollIntoView({
        behavior: 'smooth',
        block: top === tooltipTop ? 'start' : 'end'
      });
    }
    // If the entire step doesnt fit and the tooltip is inside the target, scroll the target into view.
    else {
      element.style.scrollMarginBlock = `${scrollMargin}px`;
      element.scrollIntoView({
        behavior: 'smooth',
        block: 'start'
      });
    }
  }

  /**
   * 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_1__.ACTIONS.CLOSE;
    const shouldChangeStep = !hasCloseAction && [react_joyride__WEBPACK_IMPORTED_MODULE_1__.EVENTS.STEP_AFTER, react_joyride__WEBPACK_IMPORTED_MODULE_1__.EVENTS.TARGET_NOT_FOUND].includes(type);
    const isFinishedOrSkipped = [react_joyride__WEBPACK_IMPORTED_MODULE_1__.STATUS.FINISHED, react_joyride__WEBPACK_IMPORTED_MODULE_1__.STATUS.SKIPPED].includes(status);
    const shouldCloseFromButtonClick = hasCloseAction && type === react_joyride__WEBPACK_IMPORTED_MODULE_1__.EVENTS.STEP_AFTER;
    const shouldEndTour = isFinishedOrSkipped || shouldCloseFromButtonClick;

    // Center the target in the viewport when transitioning to the step.
    if (react_joyride__WEBPACK_IMPORTED_MODULE_1__.EVENTS.STEP_BEFORE === type) {
      scrollStepIntoView(step);
    }
    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_2__["default"])(startTour);
  const parsedSteps = steps.map(step => step.isResponsive && breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__.BREAKPOINT_SMALL ? {
    ...defaultStepOptions,
    ...step,
    ...responsiveStepOptions,
    floaterProps: {
      ...step.floaterProps,
      target: step.target
    } // The floater's target is overridden to match the step's target to make it positioned above its corresponding widget. This makes the floater's position consistent in the screen during the tour.
  } : {
    ...defaultStepOptions,
    ...step
  });

  // Flip tooltips before they're obscured by the admin bar.
  const floaterOptions = {
    ...floaterProps.options,
    flip: {
      ...floaterProps.options?.flip,
      padding: {
        bottom: 0,
        top: (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_10__.getWordPressAdminBarHeight)()
      }
    }
  };

  // Customize floater props based on feature flag.
  const floaterStyles = setupFlowRefreshEnabled ? {
    ...floaterProps.styles,
    floater: {
      filter: 'drop-shadow(rgba(0, 0, 0, 0.25) 0px 4px 16px)'
    }
  } : floaterProps.styles;
  const customFloaterProps = {
    ...floaterProps,
    options: floaterOptions,
    styles: floaterStyles
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(react_joyride__WEBPACK_IMPORTED_MODULE_1__["default"], {
    callback: handleJoyrideCallback,
    floaterProps: customFloaterProps,
    locale: joyrideLocale,
    run: run,
    stepIndex: stepIndex,
    steps: parsedSteps,
    styles: joyrideStyles,
    tooltipComponent: _TourTooltip__WEBPACK_IMPORTED_MODULE_12__["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_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)).isRequired,
  tourID: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  gaEventCategory: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)]).isRequired,
  isRepeatable: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  callback: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./constants */ "./js/components/Typography/constants.js");
/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! . */ "./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");
/**
 * 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_1__.useBreakpoint)();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(___WEBPACK_IMPORTED_MODULE_3__["default"], {
    as: "p",
    type: type,
    size: size || (breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_1__.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_0___default().oneOf(_constants__WEBPACK_IMPORTED_MODULE_2__.VALID_TYPES),
  size: prop_types__WEBPACK_IMPORTED_MODULE_0___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 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_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 _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 Typography({
  className,
  type,
  size,
  as: Component = 'span',
  children,
  ...props
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Component, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-typography', className, {
      [`googlesitekit-typography--${type}`]: type && _constants__WEBPACK_IMPORTED_MODULE_2__.VALID_TYPES.includes(type),
      [`googlesitekit-typography--${size}`]: size && _constants__WEBPACK_IMPORTED_MODULE_2__.VALID_SIZES.includes(size)
    }),
    ...props,
    children: children
  });
}
Typography.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  type: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(_constants__WEBPACK_IMPORTED_MODULE_2__.VALID_TYPES),
  size: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(_constants__WEBPACK_IMPORTED_MODULE_2__.VALID_SIZES),
  as: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___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_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.mjs");
/* 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 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_components_email_reporting_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/email-reporting/constants */ "./js/components/email-reporting/constants.ts");
/* harmony import */ var _js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/HeaderMenu */ "./js/components/HeaderMenu/index.js");
/* harmony import */ var _js_components_ModalDialog__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/ModalDialog */ "./js/components/ModalDialog.js");
/* harmony import */ var _js_components_Portal__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/Portal */ "./js/components/Portal.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 _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_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_hooks_useFeature__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/hooks/useKeyCodesInside */ "./js/hooks/useKeyCodesInside.js");
/* harmony import */ var _js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_disconnect_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/svg/icons/disconnect.svg */ "./svg/icons/disconnect.svg");
/* harmony import */ var _svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/svg/icons/manage-email-reports.svg */ "./svg/icons/manage-email-reports.svg");
/* harmony import */ var _svg_icons_manage_sites_svg__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/svg/icons/manage-sites.svg */ "./svg/icons/manage-sites.svg");
/* harmony import */ var _Details__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Details */ "./js/components/UserMenu/Details.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./utils */ "./js/components/UserMenu/utils.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__ = __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 setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_15__.useFeature)('setupFlowRefresh');
  const [showProgress] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_18__["default"])('showProgress');
  const isInitialSetupFlow = setupFlowRefreshEnabled && showProgress === 'true';
  const proxyPermissionsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__.CORE_SITE).getProxyPermissionsURL());
  const userEmail = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).getEmail());
  const userPicture = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).getPicture());
  const userFullName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).getFullName());
  const postDisconnectURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.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_16__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_20__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isAutoCreatingCustomDimensionsForAudience');
  const {
    isTooltipVisible = false,
    className
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.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_1__.useState)(false);
  const [menuOpen, setMenuOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const menuWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  const menuButtonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_19__["default"])();
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_LOCATION);
  const showManageEmailReports = !isInitialSetupFlow;
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])(menuWrapperRef, () => setMenuOpen(false));
  (0,_js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_17__.useKeyCodesInside)([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__.ESCAPE, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_3__.TAB], menuWrapperRef, () => {
    setMenuOpen(false);
    // Reinstate menu button focus when menu is closed.
    menuButtonRef.current?.focus();
  });
  const handleClose = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    toggleDialog(false);
    setMenuOpen(false);
  }, [toggleDialog, setMenuOpen]);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_UI);
  const handleMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (!menuOpen) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_21__.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_1__.useCallback)(() => {
    toggleDialog(!dialogActive);
    setMenuOpen(false);
  }, [dialogActive]);
  const handleMenuItemSelect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async (_index, event) => {
    const {
      detail: {
        item
      }
    } = event;
    switch (item?.id) {
      case 'manage-sites':
        if (proxyPermissionsURL) {
          await (0,_js_util__WEBPACK_IMPORTED_MODULE_21__.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_6__.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_1__.useCallback)(async () => {
    // Close the modal.
    toggleDialog(false);
    await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_10__.clearCache)();
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_21__.trackEvent)(`${viewContext}_headerbar_usermenu`, 'disconnect_user');

    // Navigate back to the splash screen to reconnect.
    navigateTo(postDisconnectURL);
  }, [postDisconnectURL, navigateTo, viewContext]);
  if (!userEmail) {
    return null;
  }
  const accountLabel = (0,_utils__WEBPACK_IMPORTED_MODULE_26__.getAccountLabel)(userFullName, userEmail);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.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_27__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.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_27__.jsx)("i", {
          className: "mdc-button__icon mdc-button__account",
          "aria-hidden": "true",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("img", {
            className: "mdc-button__icon--image",
            src: userPicture,
            alt: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_2__.__)('Account', 'google-site-kit'),
        tooltipEnterDelayInMS: 500,
        customizedTooltip: isAutoCreatingCustomDimensionsForAudience ? null : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)("span", {
          "aria-label": accountLabel,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("strong", {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Google Account', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("br", {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("br", {}), userFullName, userFullName && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)("br", {}), userEmail]
        }),
        text: true,
        tooltip: true
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Menu, {
        className: "googlesitekit-user-menu",
        menuOpen: menuOpen,
        onSelected: handleMenuItemSelect,
        id: "user-menu",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.MenuSection, {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_Details__WEBPACK_IMPORTED_MODULE_25__["default"], {})
        }), showManageEmailReports && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.MenuItem, {
          id: "manage-email-reports",
          icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_23__["default"], {
            width: "24"
          }),
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_27__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.MenuItem, {
          id: "manage-sites",
          icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_svg_icons_manage_sites_svg__WEBPACK_IMPORTED_MODULE_24__["default"], {
            width: "24"
          }),
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_27__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.MenuItem, {
          id: "disconnect",
          icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_svg_icons_disconnect_svg__WEBPACK_IMPORTED_MODULE_22__["default"], {
            width: "24"
          }),
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_27__.jsx)(_js_components_Portal__WEBPACK_IMPORTED_MODULE_9__["default"], {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_js_components_ModalDialog__WEBPACK_IMPORTED_MODULE_8__["default"], {
        dialogActive: dialogActive,
        handleConfirm: handleUnlinkConfirm,
        handleCancel: handleClose,
        onClose: handleClose,
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Disconnect', 'google-site-kit'),
        subtitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_2__.__)('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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 _js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.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_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/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__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __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_11__["default"])();
  const canAuthenticate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.PERMISSION_AUTHENTICATE));
  const proxySetupURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getProxySetupURL());
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getDocumentationLinkURL('dashboard-sharing');
  });
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_LOCATION);
  const onButtonClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_7__.setItem)('start_user_setup', true), (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.trackEvent)(`${viewContext}_headerbar_viewonly`, 'start_user_setup', proxySetupURL ? 'proxy' : 'custom-oauth')]);
    navigateTo(proxySetupURL);
  }, [proxySetupURL, navigateTo, viewContext]);
  const onLinkClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.trackEvent)(`${viewContext}_headerbar_viewonly`, 'click_learn_more_link');
  }, [viewContext]);
  const description = canAuthenticate ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("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_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)("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_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
      href: documentationURL,
      onClick: onLinkClick,
      "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Learn more about dashboard sharing', 'google-site-kit'),
      external: true
    })
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
      className: "googlesitekit-view-only-menu__signin",
      children: description
    }), canAuthenticate && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
      onClick: onButtonClick,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._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_0__ = __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 _js_components_email_reporting_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/email-reporting/constants */ "./js/components/email-reporting/constants.ts");
/* harmony import */ var _js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/HeaderMenu */ "./js/components/HeaderMenu/index.js");
/* harmony import */ var _js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit-data */ "./js/googlesitekit-data.ts");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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 _svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/icons/manage-email-reports.svg */ "./svg/icons/manage-email-reports.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __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_5__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_UI);
  const hasEmailReportingDataAccess = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
    const viewableModules = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.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_9__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__.Divider, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_4__.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_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        className: "googlesitekit-view-only-menu__email-reporting-item",
        onClick: () => setValue(_js_components_email_reporting_constants__WEBPACK_IMPORTED_MODULE_3__.USER_SETTINGS_SELECTION_PANEL_OPENED_KEY, true),
        icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span", {
          className: "googlesitekit-view-only-menu__email-reporting-item--icon",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_svg_icons_manage_email_reports_svg__WEBPACK_IMPORTED_MODULE_8__["default"], {
            width: "24"
          })
        }),
        tertiary: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("span", {
          className: "googlesitekit-view-only-menu__email-reporting-item--name",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_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__);
/* 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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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_1__.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_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).getModule(module) || {});
  const Icon = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).getModuleIcon(module));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("li", {
    className: "googlesitekit-view-only-menu__service",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      className: "googlesitekit-view-only-menu__service--icon",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(Icon, {
        height: 26
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      className: "googlesitekit-view-only-menu__service--name",
      children: name
    }), canAuthenticate && owner?.login && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      className: "googlesitekit-view-only-menu__service--owner",
      children: owner.login
    })]
  });
}
Service.propTypes = {
  module: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _Service__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Service */ "./js/components/ViewOnlyMenu/Service.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __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_2__.jsx)("ul", {
    children: viewableModules.map(moduleSlug => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_Service__WEBPACK_IMPORTED_MODULE_1__["default"], {
      module: moduleSlug
    }, moduleSlug))
  });
}
SharedServices.propTypes = {
  viewableModules: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___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_0__ = __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 _js_components_Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_OptIn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/OptIn */ "./js/components/OptIn/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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_4__["default"])();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_OptIn__WEBPACK_IMPORTED_MODULE_3__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Help us improve Site Kit', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_5__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["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 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_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* 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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.mjs");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/HeaderMenu */ "./js/components/HeaderMenu/index.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_ViewOnlyMenu_ManageEmailReports__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/ViewOnlyMenu/ManageEmailReports */ "./js/components/ViewOnlyMenu/ManageEmailReports.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useKeyCodesInside */ "./js/hooks/useKeyCodesInside.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_view_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/svg/icons/view.svg */ "./svg/icons/view.svg");
/* harmony import */ var _Description__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Description */ "./js/components/ViewOnlyMenu/Description.js");
/* harmony import */ var _SharedServices__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./SharedServices */ "./js/components/ViewOnlyMenu/SharedServices.js");
/* harmony import */ var _Tracking__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Tracking */ "./js/components/ViewOnlyMenu/Tracking.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __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 [menuOpen, setMenuOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const menuWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__["default"])();
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(menuWrapperRef, () => setMenuOpen(false));
  (0,_js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_11__.useKeyCodesInside)([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__.ESCAPE, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__.TAB], menuWrapperRef, () => setMenuOpen(false));
  const toggleMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    if (!menuOpen) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_headerbar`, 'open_viewonly');
    }
    setMenuOpen(!menuOpen);
  }, [menuOpen, viewContext]);
  const canAuthenticate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.PERMISSION_AUTHENTICATE));
  const viewableModules = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER).getViewableModules());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.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_18__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.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_18__.jsx)("span", {
        className: "mdc-button__icon",
        "aria-hidden": "true",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_svg_icons_view_svg__WEBPACK_IMPORTED_MODULE_14__["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_3__.__)('View only', 'google-site-kit'),
      tooltipEnterDelayInMS: 500,
      text: true,
      tooltip: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('View only', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.Menu, {
      menuOpen: menuOpen,
      onSelected: toggleMenu,
      id: "view-only-menu",
      nonInteractive: true,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.MenuSection, {
        className: "googlesitekit-view-only-menu__list-item googlesitekit-view-only-menu__description",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_Description__WEBPACK_IMPORTED_MODULE_15__["default"], {})
      }), Array.isArray(viewableModules) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.MenuWithHeading, {
        className: "googlesitekit-view-only-menu__list-item",
        heading: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_8__["default"], {
          as: "h4",
          size: "medium",
          type: "label",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Shared services', 'google-site-kit')
        }),
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_SharedServices__WEBPACK_IMPORTED_MODULE_16__["default"], {
          viewableModules: viewableModules
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_ViewOnlyMenu_ManageEmailReports__WEBPACK_IMPORTED_MODULE_9__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.Divider, {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_HeaderMenu__WEBPACK_IMPORTED_MODULE_7__.MenuSection, {
        className: "googlesitekit-view-only-menu__list-item",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_Tracking__WEBPACK_IMPORTED_MODULE_17__["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 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_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_2__ = __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_2__.jsx)("span", {
    ...otherProps,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('screen-reader-text', className),
    children: children
  });
}
VisuallyHidden.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)
};
VisuallyHidden.defaultProps = {
  className: ''
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (VisuallyHidden);

/***/ },

/***/ "./js/components/conversion-tracking/ConfirmDisableConversionTrackingDialog.js"
/*!*************************************************************************************!*\
  !*** ./js/components/conversion-tracking/ConfirmDisableConversionTrackingDialog.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 */ ConfirmDisableConversionTrackingDialog)
/* 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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.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 _js_components_RefocusableModalDialog__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/RefocusableModalDialog */ "./js/components/RefocusableModalDialog.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __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 ConfirmDisableConversionTrackingDialog({
  onConfirm,
  onCancel
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const subtitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('By disabling plugin conversion tracking, you will no longer have access to:', 'google-site-kit');
  const provides = [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Performance of your Ad campaigns', 'google-site-kit'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Tracking additional conversion-related events via Analytics', 'google-site-kit')];
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.trackEvent)(`${viewContext}`, 'ect_view_modal');
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_RefocusableModalDialog__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-settings-module__confirm-disconnect-modal",
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Disable plugin conversion tracking', 'google-site-kit'),
    subtitle: subtitle,
    handleConfirm: onConfirm,
    handleCancel: onCancel,
    onClose: onCancel,
    provides: provides,
    confirmButton: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Disable', 'google-site-kit'),
    dialogActive: true,
    danger: true
  });
}
ConfirmDisableConversionTrackingDialog.propTypes = {
  onConfirm: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired
};

/***/ },

/***/ "./js/components/conversion-tracking/ConversionTrackingToggle.js"
/*!***********************************************************************!*\
  !*** ./js/components/conversion-tracking/ConversionTrackingToggle.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 */ ConversionTrackingToggle)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.tsx");
/* harmony import */ var _js_components_LoadingWrapper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/LoadingWrapper */ "./js/components/LoadingWrapper.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_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _ConfirmDisableConversionTrackingDialog__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConfirmDisableConversionTrackingDialog */ "./js/components/conversion-tracking/ConfirmDisableConversionTrackingDialog.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 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 ConversionTrackingToggle({
  children,
  loading
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const [saveError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  const [showConfirmDialog, setShowConfirmDialog] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const isConversionTrackingEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).isConversionTrackingEnabled());
  const isSaving = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).isFetchingSaveConversionTrackingSettings());
  const {
    setConversionTrackingEnabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_LoadingWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
      loading: loading,
      width: "180px",
      height: "21.3px",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
        className: "googlesitekit-module-settings-group__switch",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Switch, {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Plugin conversion tracking', 'google-site-kit'),
          checked: isConversionTrackingEnabled,
          disabled: isSaving || loading,
          onClick: () => {
            // If Conversion Tracking is currently enabled, show a confirmation
            // dialog warning users about the impact of disabling it.
            if (isConversionTrackingEnabled) {
              (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}`, 'ect_disable');
              setShowConfirmDialog(true);
            } else {
              (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}`, 'ect_enable');

              // Conversion Tracking is not currently enabled, so this toggle
              // enables it.
              setConversionTrackingEnabled(true);
            }
          },
          hideLabel: false
        })
      })
    }), !!saveError && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_5__["default"], {
      message: saveError.message
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_LoadingWrapper__WEBPACK_IMPORTED_MODULE_6__["default"], {
      className: "googlesitekit-settings-conversion-tracking-switch-description--loading",
      loading: loading,
      width: "750px",
      height: "42px",
      smallWidth: "386px",
      smallHeight: "84px",
      tabletWidth: "540px",
      tabletHeight: "84px",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("p", {
        className: "googlesitekit-module-settings-group__helper-text",
        children: children
      })
    }), showConfirmDialog && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_ConfirmDisableConversionTrackingDialog__WEBPACK_IMPORTED_MODULE_10__["default"], {
      onConfirm: () => {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}`, 'ect_confirm_disable');
        setConversionTrackingEnabled(false);
        setShowConfirmDialog(false);
      },
      onCancel: () => {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}`, 'ect_cancel_disable');
        setShowConfirmDialog(false);
      }
    })]
  });
}
ConversionTrackingToggle.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./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/google-tag-gateway/GoogleTagGatewayToggle.js"
/*!********************************************************************!*\
  !*** ./js/components/google-tag-gateway/GoogleTagGatewayToggle.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 */ GoogleTagGatewayToggle)
/* 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_1__ = __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 _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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _js_components_Badge__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Badge */ "./js/components/Badge.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/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_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Google Tag Gateway Toggle 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 SubtleNotificationWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_14__["default"])(_js_components_Notice__WEBPACK_IMPORTED_MODULE_9__["default"]);
function GoogleTagGatewayToggle({
  className
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__["default"])();
  const isGoogleTagGatewayEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_SITE).isGoogleTagGatewayEnabled());
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_SITE).isFetchingGetGTGServerRequirementStatus());
  const hasMetServerRequirements = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => {
    const {
      isGTGHealthy,
      isScriptAccessEnabled
    } = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_SITE);
    return isGTGHealthy() !== false && isScriptAccessEnabled() !== false;
  });
  const {
    fetchGetGTGServerRequirementStatus,
    setGoogleTagGatewayEnabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_SITE);
  const learnMoreURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_SITE).getDocumentationLinkURL('google-tag-gateway-introduction');
  });
  const serverRequirementsLearnMoreURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_SITE).getDocumentationLinkURL('google-tag-gateway-server-requirements');
  });

  // Fetch the server requirement status on mount.
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(fetchGetGTGServerRequirementStatus);
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    const action = isGoogleTagGatewayEnabled ? 'deactivate_google_tag_gateway' : 'activate_google_tag_gateway';
    (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_gtg-settings-toggle`, action).finally(() => {
      setGoogleTagGatewayEnabled(!isGoogleTagGatewayEnabled);
    });
  }, [isGoogleTagGatewayEnabled, setGoogleTagGatewayEnabled, viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-google-tag-gateway-toggle', className),
    children: [isLoading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.ProgressBar, {
      className: "googlesitekit-google-tag-gateway-toggle__progress",
      small: true
    }), !isLoading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("div", {
      className: "googlesitekit-module-settings-group__switch",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.Switch, {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Google tag gateway for advertisers', 'google-site-kit'),
        checked: !!isGoogleTagGatewayEnabled && hasMetServerRequirements,
        disabled: !hasMetServerRequirements,
        onClick: handleClick,
        hideLabel: false
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div", {
        className: "googlesitekit-google-tag-gateway-toggle__switch-badge",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Badge__WEBPACK_IMPORTED_MODULE_7__["default"], {
          className: "googlesitekit-badge--beta",
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Beta', 'google-site-kit'),
          hasLeftSpacing: true
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("p", {
      className: "googlesitekit-module-settings-group__helper-text",
      children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Your tag data will be sent through your own domain to improve data quality and help you recover measurement signals. <a>Learn more</a>', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_8__["default"], {
          href: learnMoreURL,
          onClick: () => {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_gtg-settings-toggle`, 'click_learn_more_link');
          },
          "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Learn more about Google tag gateway for advertisers', 'google-site-kit'),
          external: true
        })
      })
    }), !isLoading && !hasMetServerRequirements && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(SubtleNotificationWithIntersectionObserver, {
      type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_10__.NOTICE_TYPES.WARNING,
      title: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Your server’s current settings prevent Google tag gateway for advertisers from working. To enable it, please contact your hosting provider and request access to external resources and plugin files. <a>Learn more</a>', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_8__["default"], {
          href: serverRequirementsLearnMoreURL,
          onClick: () => {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_gtg-settings-toggle-disabled`, 'click_learn_more_link');
          },
          "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Learn more about Google tag gateway for advertisers server requirements', 'google-site-kit'),
          external: true
        })
      }),
      variant: "warning",
      onInView: () => {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.trackEvent)(`${viewContext}_gtg-settings-toggle-disabled`, 'view_notice');
      }
    })]
  });
}

/***/ },

/***/ "./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_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_use__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useClickAway.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.mjs");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__);
/* 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_feature_tours_hooks_useWelcomeTour__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/feature-tours/hooks/useWelcomeTour */ "./js/feature-tours/hooks/useWelcomeTour.ts");
/* 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 _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useKeyCodesInside */ "./js/hooks/useKeyCodesInside.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/adsense/constants */ "./js/modules/adsense/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__ = __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_17__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_search_console_datastore_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/search-console/datastore/constants */ "./js/modules/search-console/datastore/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_adsense_help_svg__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/svg/icons/adsense-help.svg */ "./svg/icons/adsense-help.svg");
/* harmony import */ var _svg_icons_compass_svg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/svg/icons/compass.svg */ "./svg/icons/compass.svg");
/* harmony import */ var _svg_icons_documentation_svg__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/svg/icons/documentation.svg */ "./svg/icons/documentation.svg");
/* harmony import */ var _svg_icons_feedback_svg__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/svg/icons/feedback.svg */ "./svg/icons/feedback.svg");
/* harmony import */ var _svg_icons_help_svg__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/svg/icons/help.svg */ "./svg/icons/help.svg");
/* harmony import */ var _svg_icons_support_svg__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @/svg/icons/support.svg */ "./svg/icons/support.svg");
/* harmony import */ var _HelpMenuLink__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./HelpMenuLink */ "./js/components/help/HelpMenuLink.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__ = __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,
  showFeatureTour = false
}) {
  const [menuOpen, setMenuOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(false);
  const menuWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__["default"])();
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_12__.useFeature)('setupFlowRefresh');
  (0,react_use__WEBPACK_IMPORTED_MODULE_2__["default"])(menuWrapperRef, () => setMenuOpen(false));
  (0,_js_hooks_useKeyCodesInside__WEBPACK_IMPORTED_MODULE_13__.useKeyCodesInside)([_wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__.ESCAPE, _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_5__.TAB], menuWrapperRef, () => setMenuOpen(false));
  const adSenseModuleActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_MODULES).isModuleActive(_js_modules_adsense_constants__WEBPACK_IMPORTED_MODULE_15__.MODULE_SLUG_ADSENSE));
  const showFeatureTourMenuItem = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => {
    if (!showFeatureTour || !setupFlowRefreshEnabled) {
      return false;
    }
    const analyticsConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4);
    if (analyticsConnected) {
      return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_17__.MODULES_ANALYTICS_4).isGatheringData() === false;
    }
    return select(_js_modules_search_console_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_SEARCH_CONSOLE).isGatheringData() === false;
  }, [showFeatureTour, setupFlowRefreshEnabled]);
  const handleMenu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
    if (!menuOpen) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_19__.trackEvent)(`${viewContext}_headerbar`, 'open_helpmenu');
    }
    setMenuOpen(!menuOpen);
  }, [menuOpen, viewContext]);
  const handleMenuSelected = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
    setMenuOpen(false);
  }, []);
  const fixCommonIssuesURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getDocumentationLinkURL('fix-common-issues');
  });
  const {
    triggerOnDemandTour
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER);
  const welcomeTour = (0,_js_feature_tours_hooks_useWelcomeTour__WEBPACK_IMPORTED_MODULE_8__.useWelcomeTour)();
  const handleStartFeatureTour = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
    triggerOnDemandTour(welcomeTour);
  }, [triggerOnDemandTour, welcomeTour]);
  const menuItems = [{
    gaEventLabel: 'fix_common_issues',
    href: fixCommonIssuesURL,
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Fix common issues', 'google-site-kit')
  }, {
    gaEventLabel: 'documentation',
    href: 'https://sitekit.withgoogle.com/documentation/',
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_4__.__)('Get support', 'google-site-kit')
  }, ...(adSenseModuleActive ? [{
    gaEventLabel: 'adsense_help',
    href: 'https://support.google.com/adsense/',
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_27__.jsx)(_svg_icons_documentation_svg__WEBPACK_IMPORTED_MODULE_22__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_27__.jsx)(_svg_icons_support_svg__WEBPACK_IMPORTED_MODULE_25__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Get free support', 'google-site-kit')
  }, ...(showFeatureTourMenuItem ? [{
    gaEventLabel: 'start_tour',
    onClick: handleStartFeatureTour,
    icon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsx)(_svg_icons_compass_svg__WEBPACK_IMPORTED_MODULE_21__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_27__.jsx)(_svg_icons_feedback_svg__WEBPACK_IMPORTED_MODULE_23__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_27__.jsx)(_svg_icons_adsense_help_svg__WEBPACK_IMPORTED_MODULE_20__["default"], {
      width: 24,
      height: 24
    }),
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Get help with AdSense', 'google-site-kit')
  }] : [])];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.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_27__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__.Button, {
      "aria-controls": "googlesitekit-help-menu",
      "aria-expanded": menuOpen,
      "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_27__.jsx)(_svg_icons_help_svg__WEBPACK_IMPORTED_MODULE_24__["default"], {
        width: "20",
        height: "20"
      }),
      onClick: handleMenu,
      tooltipEnterDelayInMS: 500,
      text: true
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_27__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__.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_27__.jsx)(_HelpMenuLink__WEBPACK_IMPORTED_MODULE_26__["default"], {
        ...item
      }, index))]
    })]
  });
}
HelpMenu.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  showFeatureTour: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};

/***/ },

/***/ "./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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __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_4__["default"])();
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_3__.useFeature)('setupFlowRefresh');
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    onClick?.();
    if (gaEventLabel) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.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_6__.jsx)("li", {
    className: "googlesitekit-help-menu-link mdc-list-item",
    role: "none",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_2__["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_0___default().node).isRequired,
  href: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  gaEventLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (HelpMenuLink);

/***/ },

/***/ "./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 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_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 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_Typography__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __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_5__.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_5__.jsxs)("div", {
      className: "googlesitekit-cta__header",
      children: [headerText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_4__["default"], {
        as: "h2",
        size: "small",
        type: "label",
        className: "googlesitekit-cta__header_text",
        children: headerText
      }), headerContent]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      className: "googlesitekit-cta__body",
      children: [title && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_4__["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_5__.jsx)("p", {
        className: "googlesitekit-cta__description",
        children: description
      }), description && typeof description !== 'string' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
        className: "googlesitekit-cta__description",
        children: description
      }), ctaLabel && ctaType === 'button' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        "aria-label": ariaLabel,
        href: ctaLink,
        onClick: onClick,
        children: ctaLabel
      }), ctaLabel && ctaType === 'link' && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["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_1___default().string).isRequired,
  headerText: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)]),
  ctaLink: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  ctaLinkExternal: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  ctaType: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  'aria-label': (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  error: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  headerContent: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_NotificationFromServer__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/NotificationFromServer */ "./js/components/NotificationFromServer.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_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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,
  ctaURL,
  ctaTarget,
  ...props
}) {
  const [inProgress, setInProgress] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const {
    dismissNotification,
    acceptNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE);
  const {
    dismissNotification: dismissFromQueue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_NOTIFICATIONS);
  const onCTAClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async event => {
    // If `ctaURL` is present, the CTA is rendered as a link with `href`,
    // which navigates immediately on click. Prevent that so we can mark the
    // notification as accepted and dismiss it from the queue before
    // navigating manually below.
    if (ctaURL) {
      event.preventDefault();
    }
    setInProgress(true);
    const {
      error
    } = await acceptNotification(id);
    if (!error) {
      // Dismiss here rather than via `dismissOnClick` on the CTA in
      // `NotificationFromServer` > `BannerNotification`, because
      // `BannerNotification` runs `dismissOnClick` only after `onClick`
      // completes—and this handler navigates at the end of `onClick`.
      await dismissFromQueue(id, {
        expiresInSeconds: _js_util__WEBPACK_IMPORTED_MODULE_7__.HOUR_IN_SECONDS
      });
    }
    setInProgress(false);
    if (error || !ctaURL) {
      return;
    }
    if (ctaTarget === '_blank') {
      window.open(ctaURL, '_blank');
      return;
    }
    window.location.assign(ctaURL);
  }, [id, acceptNotification, dismissFromQueue, ctaURL, ctaTarget]);
  const onDismissClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    await dismissNotification(id);
  }, [id, dismissNotification]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_NotificationFromServer__WEBPACK_IMPORTED_MODULE_4__["default"], {
    onCTAClick: onCTAClick,
    onDismissClick: onDismissClick,
    ctaInProgress: inProgress,
    ...props,
    id: id,
    ctaURL: ctaURL,
    ctaTarget: ctaTarget
  });
}
CoreSiteBannerNotification.propTypes = {
  content: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  ctaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  ctaTarget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  ctaURL: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  dismissLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  dismissible: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  gaTrackingEventArgs: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  learnMoreLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  learnMoreURL: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};
CoreSiteBannerNotification.defaultProps = {
  content: '',
  ctaLabel: '',
  ctaTarget: '',
  ctaURL: '',
  dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_0__ = __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_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_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/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_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _CoreSiteBannerNotification__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CoreSiteBannerNotification */ "./js/components/notifications/CoreSiteBannerNotification.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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_6__["default"])();
  const [surveysHaveLoaded, setSurveysHaveLoaded] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const [hasSurveys, setHasSurveys] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_0__.useRef)(Date.now()); // eslint-disable-line sitekit/no-direct-date

  const surveys = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.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_0__.useState)([]);
  const {
    registerNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_NOTIFICATIONS);
  const notifications = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getNotifications());
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    const timer = setTimeout(() => {
      if (!hasSurveys) {
        setSurveysHaveLoaded(true);
      }
    }, MAX_SECONDS_FOR_SURVEY * 1000);
    return () => {
      clearTimeout(timer);
    };
  }, [hasSurveys]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_0__.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_8__.jsx)(Notification, {
            gaTrackingEventArgs: gaTrackingEventArgs,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_CoreSiteBannerNotification__WEBPACK_IMPORTED_MODULE_7__["default"], {
              ...notification,
              gaTrackingEventArgs: gaTrackingEventArgs
            })
          });
        },
        priority: notification.priority,
        areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_4__.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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_3__ = __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_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/Notification */ "./js/googlesitekit/notifications/components/Notification/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */







const NOTIFICATION_ID = 'internal-server-error';
function InternalServerError() {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.useBreakpoint)();
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).getInternalServerError());

  // Scroll to the notification when the error is present.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!error) {
      return;
    }
    globalThis.scrollTo({
      top: (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_6__.getNavigationalScrollTop)(`#${NOTIFICATION_ID}`, breakpoint),
      behavior: 'smooth'
    });
  }, [error, breakpoint]);
  if (!error) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_googlesitekit_notifications_components_Notification__WEBPACK_IMPORTED_MODULE_4__["default"], {
    id: NOTIFICATION_ID,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_3__["default"], {
      notificationID: NOTIFICATION_ID,
      type: _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_3__.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_0__ = __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_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useDashboardType */ "./js/hooks/useDashboardType.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _CoreSiteBannerNotifications__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./CoreSiteBannerNotifications */ "./js/components/notifications/CoreSiteBannerNotifications.js");
/* harmony import */ var _InternalServerError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./InternalServerError */ "./js/components/notifications/InternalServerError.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_4__["default"])();
  const dashboardType = (0,_js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_3__["default"])();
  const isAuthenticated = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).isAuthenticated());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_InternalServerError__WEBPACK_IMPORTED_MODULE_6__["default"], {}), !viewOnly && dashboardType === _js_hooks_useDashboardType__WEBPACK_IMPORTED_MODULE_3__.DASHBOARD_TYPE_MAIN && isAuthenticated && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_CoreSiteBannerNotifications__WEBPACK_IMPORTED_MODULE_5__["default"], {})]
  });
}

/***/ },

/***/ "./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_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__);
/* 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_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/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_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 _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");
/**
 * 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_2__.NOTIFICATION_GROUPS.DEFAULT
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const queuedNotifications = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.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_6__.jsx)(ActiveNotification, {
    ...props
  });
}
Notifications.propTypes = {
  viewContext: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  areaSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
};

/***/ },

/***/ "./js/components/notifications/useRetriableNotificationDismissButtonLabel.js"
/*!***********************************************************************************!*\
  !*** ./js/components/notifications/useRetriableNotificationDismissButtonLabel.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 */ useRetriableNotificationDismissButtonLabel)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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__);
/**
 * `useRetriableNotificationDismissButtonLabel` 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.
 */

/**
 * WordPress dependencies
 */



/**
 * Custom hook to generate the dismiss button label for "retriable"
 * notifications.
 *
 * When the main CTA for retriable notifications is clicked, it is "dismissed"
 * and the dismissalCount for that notification is incremented. This causes the
 * isNotificationDismissalFinal() selector to return true momentarily when the
 * dismissal count reaches its limit. This then causes the "Maybe later" label
 * to momentarily change to "Don't show again" before the notification is
 * dismissed. This hook uses local state to ensure that the dismiss button
 * label is computed only once, so that the label doesn't change after
 * the CTA is clicked.
 *
 * @since 1.174.0
 *
 * @param {Object}  options                  Options for the hook.
 * @param {boolean} options.isDismissalFinal Whether the dismissal is final or
 *                                           not.
 * @return {string} The button label text.
 */
function useRetriableNotificationDismissButtonLabel({
  isDismissalFinal
} = {}) {
  const [dismissLabel] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true === isDismissalFinal ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Don’t show again', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Maybe later', 'google-site-kit'));
  return dismissLabel;
}

/***/ },

/***/ "./js/components/settings/EntityOwnershipChangeNotice.js"
/*!***************************************************************!*\
  !*** ./js/components/settings/EntityOwnershipChangeNotice.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 */ EntityOwnershipChangeNotice)
/* 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__);
/* 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_components_Notice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_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_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EntityOwnershipChangeNotice 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 EntityOwnershipChangeNotice({
  slug
}) {
  const slugs = Array.isArray(slug) ? slug : [slug];
  const storeNames = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const {
      getModuleStoreName,
      getSharedRoles
    } = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES);
    return slugs
    // Filter out modules that don't have any shared roles.
    .filter(currentSlug => {
      return !!getSharedRoles(currentSlug)?.length;
    }).reduce((acc, currentSlug) => {
      const storeName = getModuleStoreName(currentSlug);
      if (storeName) {
        return {
          ...acc,
          [currentSlug]: storeName
        };
      }
      return acc;
    }, {});
  });
  const haveOwnedSettingsChanged = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => Object.keys(storeNames).reduce((acc, currentSlug) => {
    const storeName = storeNames[currentSlug];
    const moduleOwnerID = select(storeName)?.getOwnerID();
    const loggedInUserID = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getID();
    const haveSettingsChanged = select(storeName)?.haveOwnedSettingsChanged();
    if (haveSettingsChanged && moduleOwnerID !== loggedInUserID) {
      acc[currentSlug] = haveSettingsChanged;
    }
    return acc;
  }, {}));
  const haveModulesChanged = Object.values(haveOwnedSettingsChanged).some(hasChanged => hasChanged);
  const moduleNames = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    return Object.keys(haveOwnedSettingsChanged).reduce((acc, moduleSlug) => {
      const module = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES).getModule(moduleSlug);
      if (module) {
        acc.push(module.name);
      }
      return acc;
    }, []);
  });
  if (!haveModulesChanged) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-notice--bottom-margin",
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.WARNING,
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: module name. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('By clicking confirm changes, you’re granting other users view-only access to data from %s via your Google account. You can always manage this later in the dashboard sharing settings.', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.listFormat)(moduleNames))
  });
}
EntityOwnershipChangeNotice.propTypes = {
  slug: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string))]).isRequired
};

/***/ },

/***/ "./js/components/settings/SettingsGroup.js"
/*!*************************************************!*\
  !*** ./js/components/settings/SettingsGroup.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 */ SettingsGroup)
/* 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_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 _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");
/**
 * SettingsInactiveModules 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 SettingsGroup({
  title,
  children,
  className
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-module-settings-group', className),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
      as: "h4",
      size: "medium",
      type: "title",
      children: title
    }), children]
  });
}
SettingsGroup.propTypes = {
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node).isRequired,
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)
};

/***/ },

/***/ "./js/components/settings/SettingsStatuses.js"
/*!****************************************************!*\
  !*** ./js/components/settings/SettingsStatuses.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 */ SettingsStatuses)
/* 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__);
/* 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 _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");
/**
 * SettingsStatuses 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 SettingsStatuses({
  statuses
}) {
  if (!statuses || statuses.length === 0) {
    return null;
  }
  function renderStatus(status) {
    if (status === undefined) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "googlesitekit-settings-module__meta-item-data",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {})
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("p", {
      className: "googlesitekit-settings-module__meta-item-data",
      children: status ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Enabled', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Disabled', 'google-site-kit')
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
    className: "googlesitekit-settings-module__meta-items",
    children: statuses.map(({
      label,
      status
    }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-item",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_3__["default"], {
        as: "h5",
        size: "medium",
        type: "label",
        className: "googlesitekit-settings-module__meta-item-type",
        children: label
      }), renderStatus(status)]
    }, label))
  });
}
SettingsStatuses.propTypes = {
  statuses: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf(prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
    label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
    status: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf([undefined, true, false])
  }))
};

/***/ },

/***/ "./js/components/setup/ExitSetup.js"
/*!******************************************!*\
  !*** ./js/components/setup/ExitSetup.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 */ ExitSetup)
/* 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__);
/* 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_googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit-components */ "./js/googlesitekit-components.ts");
/* harmony import */ var _js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit-data */ "./js/googlesitekit-data.ts");
/* 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_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ExitSetup component for SetupUsingProxyWithSignIn.
 *
 * 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 ExitSetup({
  gaTrackingEventArgs,
  url
}) {
  const adminURL = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.untrailingslashit)(select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getAdminURL());
  });
  const {
    navigateTo
  } = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_LOCATION);
  async function handleClick() {
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(gaTrackingEventArgs.category, gaTrackingEventArgs.action, gaTrackingEventArgs.label);
    navigateTo(url ? (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.untrailingslashit)(url) : adminURL);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
    onClick: handleClick,
    tertiary: true,
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Exit setup', 'google-site-kit')
  });
}
ExitSetup.propTypes = {
  gaTrackingEventArgs: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  url: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
};

/***/ },

/***/ "./js/components/setup/ModuleSetupFooter.js"
/*!**************************************************!*\
  !*** ./js/components/setup/ModuleSetupFooter.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 */ ModuleSetupFooter)
/* 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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 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_components_Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useForwardableParams__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useForwardableParams */ "./js/hooks/useForwardableParams.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModuleSetupFooter 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 ModuleSetupFooter({
  module,
  onCancel,
  onComplete
}) {
  const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const forwardableParams = (0,_js_hooks_useForwardableParams__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const settingsPageURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getAdminURL('googlesitekit-settings', forwardableParams));
  const isSetupBlocked = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(module?.storeName)?.isSetupBlocked?.());
  const canSubmitChanges = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_MODULES).canSubmitChanges(module?.slug));
  const onCompleteSubmit = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(async () => {
    setIsSaving(true);
    await onComplete();
    setIsSaving(false);
  }, [setIsSaving, onComplete]);
  if (!module) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-setup__footer', `googlesitekit-setup__footer--${module?.slug}`),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_10__.Grid, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_10__.Row, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_10__.Cell, {
          smSize: 2,
          mdSize: 4,
          lgSize: 6,
          alignMiddle: true,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
            id: `setup-${module.slug}-cancel`,
            href: settingsPageURL,
            onClick: onCancel,
            children: isSetupBlocked ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Back', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Cancel', 'google-site-kit')
          })
        }), onComplete && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_10__.Cell, {
          smSize: 2,
          mdSize: 4,
          lgSize: 6,
          alignRight: true,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.SpinnerButton, {
            id: `setup-${module.slug}-complete`,
            onClick: onCompleteSubmit,
            disabled: !canSubmitChanges || isSaving,
            isSaving: isSaving,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Complete Setup', 'google-site-kit')
          })
        })]
      })
    })
  });
}
ModuleSetupFooter.propTypes = {
  module: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
    slug: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
    storeName: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired
  }).isRequired,
  onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func).isRequired,
  onComplete: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
};

/***/ },

/***/ "./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_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__);
/* harmony import */ var _js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __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_2__.jsxs)("div", {
    className: "googlesitekit-setup__step-hint",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("p", {
      children: leadingText
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_1__["default"], {
      tooltipClassName: "googlesitekit-setup__step-hint-tooltip",
      title: tooltipText
    })]
  });
}
StepHint.propTypes = {
  leadingText: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element)]).isRequired,
  tooltipText: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___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 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __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.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


function SurveyViewTrigger({
  triggerID,
  ttl = 0
}) {
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    triggerSurvey(triggerID, {
      ttl
    });
  }, [triggerID, ttl, triggerSurvey]);
  return null;
}
SurveyViewTrigger.propTypes = {
  triggerID: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  ttl: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
};

/***/ },

/***/ "./js/components/user-input/util/constants.js"
/*!****************************************************!*\
  !*** ./js/components/user-input/util/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 */   FORM_USER_INPUT_QUESTION_NUMBER: () => (/* binding */ FORM_USER_INPUT_QUESTION_NUMBER),
/* harmony export */   FORM_USER_INPUT_QUESTION_SNAPSHOT: () => (/* binding */ FORM_USER_INPUT_QUESTION_SNAPSHOT),
/* harmony export */   USER_INPUT_CURRENTLY_EDITING_KEY: () => (/* binding */ USER_INPUT_CURRENTLY_EDITING_KEY),
/* harmony export */   USER_INPUT_LEGACY_SITE_PURPOSE_DISMISSED_ITEM_KEY: () => (/* binding */ USER_INPUT_LEGACY_SITE_PURPOSE_DISMISSED_ITEM_KEY),
/* harmony export */   USER_INPUT_MAX_ANSWERS: () => (/* binding */ USER_INPUT_MAX_ANSWERS),
/* harmony export */   USER_INPUT_PURPOSE_TO_CONVERSION_EVENTS_MAPPING: () => (/* binding */ USER_INPUT_PURPOSE_TO_CONVERSION_EVENTS_MAPPING),
/* harmony export */   USER_INPUT_QUESTIONS_GOALS: () => (/* binding */ USER_INPUT_QUESTIONS_GOALS),
/* harmony export */   USER_INPUT_QUESTIONS_LIST: () => (/* binding */ USER_INPUT_QUESTIONS_LIST),
/* harmony export */   USER_INPUT_QUESTIONS_PURPOSE: () => (/* binding */ USER_INPUT_QUESTIONS_PURPOSE),
/* harmony export */   USER_INPUT_QUESTION_POST_FREQUENCY: () => (/* binding */ USER_INPUT_QUESTION_POST_FREQUENCY),
/* harmony export */   getUserInputAnswers: () => (/* binding */ getUserInputAnswers),
/* harmony export */   getUserInputAnswersDescription: () => (/* binding */ getUserInputAnswersDescription),
/* harmony export */   getUserInputQuestions: () => (/* binding */ getUserInputQuestions)
/* 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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * User Input Answers.
 *
 * 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 USER_INPUT_QUESTIONS_PURPOSE = 'purpose';
const USER_INPUT_QUESTION_POST_FREQUENCY = 'postFrequency';
const USER_INPUT_QUESTIONS_GOALS = 'goals';
const USER_INPUT_QUESTIONS_LIST = [USER_INPUT_QUESTIONS_PURPOSE, USER_INPUT_QUESTION_POST_FREQUENCY, USER_INPUT_QUESTIONS_GOALS];
const USER_INPUT_MAX_ANSWERS = {
  [USER_INPUT_QUESTIONS_PURPOSE]: 1,
  [USER_INPUT_QUESTION_POST_FREQUENCY]: 1,
  [USER_INPUT_QUESTIONS_GOALS]: 3
};
const USER_INPUT_CURRENTLY_EDITING_KEY = 'googlesitekit-user-input-currently-editing';
const FORM_USER_INPUT_QUESTION_NUMBER = 'user_input_question_number';
const FORM_USER_INPUT_QUESTION_SNAPSHOT = 'user_input_question_snapshot';
const USER_INPUT_LEGACY_SITE_PURPOSE_DISMISSED_ITEM_KEY = 'user-input-legacy-site-purpose-dismissed-item';
const USER_INPUT_PURPOSE_TO_CONVERSION_EVENTS_MAPPING = {
  publish_blog: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM],
  publish_news: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM],
  monetize_content: [],
  sell_products_or_service: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.PURCHASE, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.ADD_TO_CART],
  sell_products: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.PURCHASE, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.ADD_TO_CART],
  provide_services: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM],
  share_portfolio: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM],
  other: []
};

/**
 * Gets available questions for user input settings.
 *
 * @since 1.139.0
 * @private
 *
 * @return {Object} Questions object.
 */
function getUserInputQuestions() {
  const description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Based on your answer, Site Kit will suggest the metrics you see on your dashboard to help you track how close you’re getting to your specific goals', 'google-site-kit');
  return [{
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('What is the main purpose of this site?', 'google-site-kit'),
    description
  }, {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('How often do you create new content for this site?', 'google-site-kit'),
    description
  }, {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('What are your top 3 goals for this site?', 'google-site-kit'),
    description
  }];
}

/**
 * Gets available answers for user input settings.
 *
 * @since 1.20.0
 * @private
 *
 * @return {Object} Answers object.
 */
function getUserInputAnswers() {
  return {
    USER_INPUT_ANSWERS_PURPOSE: {
      sell_products_or_service: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sell products or services', 'google-site-kit'),
      sell_products: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sell products', 'google-site-kit'),
      provide_services: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Provide services', 'google-site-kit'),
      monetize_content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Monetize content', 'google-site-kit'),
      publish_blog: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Publish a blog', 'google-site-kit'),
      publish_news: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Publish news content', 'google-site-kit'),
      share_portfolio: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Portfolio or business card', 'google-site-kit'),
      other: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Other', 'google-site-kit')
    },
    USER_INPUT_ANSWERS_POST_FREQUENCY: {
      never: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Never', 'google-site-kit'),
      daily: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Daily', 'google-site-kit'),
      weekly: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Weekly', 'google-site-kit'),
      monthly: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Monthly', 'google-site-kit'),
      other: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Other', 'google-site-kit')
    },
    USER_INPUT_ANSWERS_GOALS: {
      retaining_visitors: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Retain visitors, turn them into loyal readers or customers', 'google-site-kit'),
      improving_performance: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Improve speed and performance', 'google-site-kit'),
      finding_new_topics: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Find new topics to write about that connect with my audience', 'google-site-kit'),
      growing_audience: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Grow my audience', 'google-site-kit'),
      expanding_business: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Expand my business into new cities, states or markets', 'google-site-kit'),
      generating_revenue: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Generate more revenue', 'google-site-kit'),
      generating_leads: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Generate leads', 'google-site-kit'),
      help_better_rank: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Help my content rank in a better position in Google search results', 'google-site-kit'),
      understanding_content_performance: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Understand which content is performing best', 'google-site-kit'),
      encourage_to_post: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Encouragement to post more frequently', 'google-site-kit'),
      other: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Other', 'google-site-kit')
    }
  };
}

/**
 * Gets available answer descriptions for user input settings.
 *
 * @since 1.139.0
 * @private
 *
 * @return {Object} Answer descriptions object.
 */
function getUserInputAnswersDescription() {
  return {
    USER_INPUT_ANSWERS_PURPOSE: {
      sell_products_or_service: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('E.g. selling products like devices, apparel, equipment, etc. or offering services like courses, consulting, tutoring, etc.', 'google-site-kit'),
      sell_products: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('E.g. selling devices, apparel, equipment, etc.', 'google-site-kit'),
      provide_services: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('E.g. offering courses, consulting, tutoring, etc.', 'google-site-kit'),
      monetize_content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Using display ads, affiliate links, sponsored content, etc.', 'google-site-kit'),
      publish_blog: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Writing on a topic you’re passionate about, no focus on monetizing content', 'google-site-kit'),
      publish_news: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('E.g. local news, investigative pieces, interviews, etc.', 'google-site-kit'),
      share_portfolio: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('My website represents me or my company', 'google-site-kit'),
      other: undefined
    }
  };
}

/***/ },

/***/ "./js/feature-tours/constants.js"
/*!***************************************!*\
  !*** ./js/feature-tours/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 */   WELCOME_TOUR: () => (/* binding */ WELCOME_TOUR)
/* harmony export */ });
/**
 * Feature tour constants.
 *
 * 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.
 */

const WELCOME_TOUR = {
  WITH_ANALYTICS: 'welcome-with-analytics',
  WITHOUT_ANALYTICS: 'welcome-without-analytics'
};

/***/ },

/***/ "./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/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(globalThis?._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/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.185.0"}_${globalThis._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 = globalThis[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 = globalThis[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) {
      globalThis.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) {
      globalThis.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) {
      globalThis.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/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/components-gm2/Button/MaybeTooltip.js"
/*!****************************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Button/MaybeTooltip.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 */ MaybeTooltip)
/* 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__);
/* harmony import */ var _js_googlesitekit_components_gm2_Tooltip__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/components-gm2/Tooltip */ "./js/googlesitekit/components-gm2/Tooltip.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MaybeTooltip 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 MaybeTooltip({
  children,
  disabled = false,
  tooltip = false,
  tooltipTitle = null,
  hasIconOnly = false,
  tooltipEnterDelayInMS = 100
}) {
  if (!disabled && (tooltip && tooltipTitle || hasIconOnly && tooltipTitle)) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_googlesitekit_components_gm2_Tooltip__WEBPACK_IMPORTED_MODULE_1__["default"], {
      title: tooltipTitle,
      enterDelay: tooltipEnterDelayInMS,
      children: children
    });
  }
  return children;
}
MaybeTooltip.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node).isRequired,
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  tooltip: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  tooltipTitle: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element)]),
  hasIconOnly: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  tooltipEnterDelayInMS: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number)
};

/***/ },

/***/ "./js/googlesitekit/components-gm2/Button/SemanticButton.js"
/*!******************************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Button/SemanticButton.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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SemanticButton 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
 */


const SemanticButton = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(({
  children,
  href,
  text,
  className,
  danger,
  disabled,
  target,
  'aria-label': ariaLabel,
  inverse,
  tertiary,
  callout,
  calloutStyle,
  ...extraProps
}, ref) => {
  // Use a button if disabled, even if a href is provided to ensure expected behavior.
  const ButtonTag = href && !disabled ? 'a' : 'button';
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(ButtonTag, {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-button', className, {
      'mdc-button--raised': !text && !tertiary && !callout,
      'mdc-button--danger': danger,
      'mdc-button--inverse': inverse,
      'mdc-button--tertiary': tertiary,
      'mdc-button--callout': callout,
      'mdc-button--callout-primary': callout || calloutStyle === 'primary',
      'mdc-button--callout-warning': calloutStyle === 'warning',
      'mdc-button--callout-error': calloutStyle === 'error'
    }),
    href: disabled ? undefined : href,
    ref: ref,
    disabled: !!disabled,
    "aria-label": ariaLabel,
    target: target || '_self',
    role: 'a' === ButtonTag ? 'button' : undefined,
    ...extraProps,
    children: children
  });
});
SemanticButton.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  text: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  danger: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  target: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  'aria-label': (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  inverse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  tertiary: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  callout: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  calloutStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['primary', 'warning', 'error'])
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (SemanticButton);

/***/ },

/***/ "./js/googlesitekit/components-gm2/Button/index.js"
/*!*********************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Button/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 _react_hook_merged_ref__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hook/merged-ref */ "../node_modules/@react-hook/merged-ref/dist/module/index.js");
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _MaybeTooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MaybeTooltip */ "./js/googlesitekit/components-gm2/Button/MaybeTooltip.js");
/* harmony import */ var _SemanticButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SemanticButton */ "./js/googlesitekit/components-gm2/Button/SemanticButton.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Button 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 = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(({
  children,
  href = null,
  text = false,
  className = '',
  danger = false,
  disabled = false,
  target,
  icon = null,
  trailingIcon = null,
  'aria-label': ariaLabel,
  title = null,
  customizedTooltip = null,
  tooltip = false,
  inverse = false,
  hideTooltipTitle = false,
  tooltipEnterDelayInMS = 100,
  tertiary = false,
  callout = false,
  calloutStyle = null,
  ...extraProps
}, ref) => {
  const buttonRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(element => {
    if (element !== null) {
      _js_material_components__WEBPACK_IMPORTED_MODULE_4__.MDCRipple.attachTo(element);
    }
  }, []);
  const mergedRefs = (0,_react_hook_merged_ref__WEBPACK_IMPORTED_MODULE_0__["default"])(ref, buttonRef);
  function getAriaLabel() {
    let label = ariaLabel;
    if (target !== '_blank') {
      return label;
    }
    const newTabText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._x)('(opens in a new tab)', 'screen reader text', 'google-site-kit');
    if (typeof children === 'string') {
      label = label || children;
    }
    if (label) {
      return `${label} ${newTabText}`;
    }
    return newTabText;
  }
  const tooltipTitle = !hideTooltipTitle ? title || customizedTooltip || ariaLabel : null;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_MaybeTooltip__WEBPACK_IMPORTED_MODULE_5__["default"], {
    disabled: disabled,
    tooltip: tooltip,
    tooltipTitle: tooltipTitle,
    hasIconOnly: !!icon && children === undefined,
    tooltipEnterDelayInMS: tooltipEnterDelayInMS,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(_SemanticButton__WEBPACK_IMPORTED_MODULE_6__["default"], {
      href: href,
      disabled: disabled,
      className: className,
      danger: danger,
      text: text,
      tertiary: tertiary,
      inverse: inverse,
      callout: callout,
      calloutStyle: calloutStyle,
      ref: mergedRefs,
      "aria-label": getAriaLabel(),
      target: target || '_self',
      ...extraProps,
      children: [icon, children && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
        className: "mdc-button__label",
        children: children
      }), trailingIcon]
    })
  });
});
Button.propTypes = {
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  href: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  text: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  danger: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  icon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
  trailingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  customizedTooltip: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
  tooltip: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  inverse: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  hideTooltipTitle: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  callout: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  calloutStyle: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['primary', 'warning', 'error'])
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Button);

/***/ },

/***/ "./js/googlesitekit/components-gm2/Chip.js"
/*!*************************************************!*\
  !*** ./js/googlesitekit/components-gm2/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 _material_react_chips__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material/react-chips */ "../node_modules/@material/react-chips/dist/index.js");
/* harmony import */ var _material_react_chips__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_material_react_chips__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_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_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Chip 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
 */




function Chip({
  id,
  label,
  onClick,
  selected,
  className,
  CheckMark = _material_react_chips__WEBPACK_IMPORTED_MODULE_0__.ChipCheckmark,
  disabled,
  ...props
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_material_react_chips__WEBPACK_IMPORTED_MODULE_0__.Chip, {
    chipCheckmark: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(CheckMark, {}),
    "data-chip-id": id,
    id: id,
    label: label,
    onClick: event => {
      if (disabled) {
        return;
      }
      onClick?.(event);
    },
    selected: selected,
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-chip', className, {
      'googlesitekit-chip--disabled': disabled
    }),
    ...props
  });
}
Chip.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string).isRequired,
  label: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string).isRequired,
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
  selected: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  CheckMark: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().elementType)
};

/***/ },

/***/ "./js/googlesitekit/components-gm2/CircularProgress.js"
/*!*************************************************************!*\
  !*** ./js/googlesitekit/components-gm2/CircularProgress.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 */ CircularProgress)
/* harmony export */ });
/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material-ui/core */ "../node_modules/@material-ui/core/esm/CircularProgress/CircularProgress.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * CircularProgress 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 CircularProgress(props) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_0__["default"], {
    ...props
  });
}

/***/ },

/***/ "./js/googlesitekit/components-gm2/Menu.js"
/*!*************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Menu.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_hook_merged_ref__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-hook/merged-ref */ "../node_modules/@react-hook/merged-ref/dist/module/index.js");
/* 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_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_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Menu 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 Menu = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.forwardRef)(({
  children,
  className,
  menuOpen,
  menuItems,
  onSelected,
  nonInteractive,
  id
}, ref) => {
  const [menu, setMenu] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useState)(null);
  const menuRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(null);
  const mergedRefs = (0,_react_hook_merged_ref__WEBPACK_IMPORTED_MODULE_0__["default"])(ref, menuRef);
  const handleMenuSelected = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(event => {
    const {
      detail: {
        index
      }
    } = event;
    onSelected(index, event);
  }, [onSelected]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    if (!menuRef?.current) {
      // Return noop cleanup function to satisfy consistent-return rule.
      return () => {};
    }
    const menuComponent = new _js_material_components__WEBPACK_IMPORTED_MODULE_4__.MDCMenu(menuRef.current);
    menuComponent.listen('MDCMenu:selected', handleMenuSelected);
    menuComponent.quickOpen = true;
    setMenu(menuComponent);
    return () => {
      menuComponent.unlisten('MDCMenu:selected', handleMenuSelected);
      menuComponent.destroy();
    };
  }, [menuRef, handleMenuSelected, nonInteractive]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useEffect)(() => {
    if (menu) {
      menu.open = menuOpen;
      menu.setDefaultFocusState(1);
    }
  }, [menu, menuOpen]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('mdc-menu', 'mdc-menu-surface', className),
    ref: mergedRefs,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("ul", {
      "aria-hidden": !menuOpen,
      "aria-orientation": "vertical",
      className: classnames__WEBPACK_IMPORTED_MODULE_1___default()('mdc-list', {
        'mdc-list--non-interactive': nonInteractive
      }),
      id: id,
      role: "menu",
      tabIndex: "-1",
      children: [!children && menuItems.map((item, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("li", {
        className: "mdc-list-item",
        role: "menuitem",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("span", {
          className: "mdc-list-item__text",
          children: item
        })
      }, index)), children]
    })
  });
});
Menu.displayName = 'Menu';
Menu.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  menuOpen: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool).isRequired,
  menuItems: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().array),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string).isRequired,
  onSelected: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
  nonInteractive: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)
};
Menu.defaultProps = {
  onSelected: () => {},
  nonInteractive: false
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Menu);

/***/ },

/***/ "./js/googlesitekit/components-gm2/ProgressBar.js"
/*!********************************************************!*\
  !*** ./js/googlesitekit/components-gm2/ProgressBar.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 */ ProgressBar)
/* 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_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 _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");
/**
 * ProgressBar 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 ProgressBar({
  className,
  small,
  compress,
  indeterminate,
  height,
  verticalSpacing,
  mobileVerticalSpacing,
  tabletVerticalSpacing,
  desktopVerticalSpacing,
  progress
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.useBreakpoint)();
  let progressBarVerticalSpacing = verticalSpacing;
  if (_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_SMALL === breakpoint && mobileVerticalSpacing !== undefined) {
    progressBarVerticalSpacing = mobileVerticalSpacing;
  } else if (_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_TABLET === breakpoint && tabletVerticalSpacing !== undefined) {
    progressBarVerticalSpacing = tabletVerticalSpacing;
  } else if ((_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_XLARGE === breakpoint || _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_2__.BREAKPOINT_DESKTOP === breakpoint) && desktopVerticalSpacing !== undefined) {
    progressBarVerticalSpacing = desktopVerticalSpacing;
  }
  let margin;
  if (progressBarVerticalSpacing !== undefined) {
    margin = progressBarVerticalSpacing === 0 ? 0 : Math.round(progressBarVerticalSpacing / 2);
  }

  // Use width on the primary bar so the inner bar can be styled freely (e.g., border-radius).
  // Clamp keeps the percentage valid. CSS rejects negative widths.
  let primaryBarStyle;
  if (!indeterminate) {
    const clamped = Math.max(0, Math.min(1, progress || 0));
    primaryBarStyle = {
      transform: 'none',
      width: `${clamped * 100}%`
    };
  } else if (progress) {
    primaryBarStyle = {
      transform: `scaleX(${progress})`
    };
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    role: "progressbar",
    style: {
      marginTop: margin,
      marginBottom: margin,
      ...(height && {
        height: `${height}px`
      })
    },
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-linear-progress', className, {
      'mdc-linear-progress--indeterminate': indeterminate,
      'mdc-linear-progress--small': small,
      'mdc-linear-progress--compress': compress
    }),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "mdc-linear-progress__buffering-dots"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "mdc-linear-progress__buffer"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "mdc-linear-progress__bar mdc-linear-progress__primary-bar",
      style: primaryBarStyle,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
        className: "mdc-linear-progress__bar-inner"
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "mdc-linear-progress__bar mdc-linear-progress__secondary-bar",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("span", {
        className: "mdc-linear-progress__bar-inner"
      })
    })]
  });
}
ProgressBar.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  small: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  compress: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  indeterminate: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  progress: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  height: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  verticalSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  mobileVerticalSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  tabletVerticalSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  desktopVerticalSpacing: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)
};
ProgressBar.defaultProps = {
  className: '',
  small: false,
  compress: false,
  indeterminate: true,
  progress: 0,
  height: 4
};

/***/ },

/***/ "./js/googlesitekit/components-gm2/Radio.js"
/*!**************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Radio.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 */ Radio)
/* 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Radio 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 Radio(props) {
  const {
    id,
    name,
    value,
    checked = false,
    disabled = false,
    children,
    tabIndex,
    onKeyDown = null,
    onClick = null,
    onChange = null,
    alignLeft = false,
    description
  } = props;
  const formFieldRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(element => {
    if (element !== null) {
      const formField = new _js_material_components__WEBPACK_IMPORTED_MODULE_3__.MDCFormField(element);
      const radioElement = element.querySelector('.mdc-radio');
      if (radioElement) {
        formField.input = new _js_material_components__WEBPACK_IMPORTED_MODULE_3__.MDCRadio(radioElement);
      }
    }
  }, []);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
    className: "mdc-form-field",
    ref: formFieldRef,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-radio', {
        'mdc-radio--disabled': disabled,
        'mdc-radio--align-left': alignLeft
      }),
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("input", {
        className: "mdc-radio__native-control",
        onClick: onClick,
        onKeyDown: onKeyDown,
        type: "radio",
        id: id,
        name: name,
        value: value,
        checked: checked,
        disabled: disabled,
        tabIndex: tabIndex,
        onChange: onChange,
        readOnly: true
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
        className: "mdc-radio__background",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          className: "mdc-radio__outer-circle"
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
          className: "mdc-radio__inner-circle"
        })]
      })]
    }), !description && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label", {
      htmlFor: id,
      children: children
    }), description && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsxs)("div", {
      className: "mdc-radio__content",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("label", {
        htmlFor: id,
        children: children
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("div", {
        className: "mdc-radio__description",
        children: description
      })]
    })]
  });
}
Radio.propTypes = {
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  onKeyDown: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  onChange: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  value: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  checked: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  tabIndex: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)
};

/***/ },

/***/ "./js/googlesitekit/components-gm2/Select.js"
/*!***************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Select.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 */ Select)
/* harmony export */ });
/* harmony import */ var _material_react_select__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material/react-select */ "../node_modules/@material/react-select/dist/index.js");
/* harmony import */ var _material_react_select__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_material_react_select__WEBPACK_IMPORTED_MODULE_0__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Select 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 Select({
  id,
  helperText,
  ...props
}) {
  // For accessibility, provide a generated id fallback if an id
  // is not supplied. Adding an id is mandatory because otherwise the label
  // is not able to associate with the select.
  const idFallback = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])(Select, 'googlesitekit-select');
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)((_material_react_select__WEBPACK_IMPORTED_MODULE_0___default()), {
    id: id || idFallback,
    helperText: !!helperText ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_material_react_select__WEBPACK_IMPORTED_MODULE_0__.SelectHelperText, {
      children: helperText
    }) : undefined,
    ...props
  });
}

/***/ },

/***/ "./js/googlesitekit/components-gm2/SpinnerButton.js"
/*!**********************************************************!*\
  !*** ./js/googlesitekit/components-gm2/SpinnerButton.js ***!
  \**********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   SPINNER_POSITION: () => (/* binding */ SPINNER_POSITION),
/* harmony export */   "default": () => (/* binding */ SpinnerButton)
/* 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_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 _Button__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Button */ "./js/googlesitekit/components-gm2/Button/index.js");
/* harmony import */ var _CircularProgress__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./CircularProgress */ "./js/googlesitekit/components-gm2/CircularProgress.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 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
 */



const SPINNER_POSITION = {
  BEFORE: 'before',
  AFTER: 'after'
};
function SpinnerButton(props) {
  const {
    className,
    onClick = () => {},
    isSaving = false,
    spinnerPosition = SPINNER_POSITION.AFTER,
    ...restProps
  } = props;
  const definedProps = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.pickBy)(restProps, value => value !== undefined);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Button__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()(className, 'googlesitekit-button-icon--spinner', {
      'googlesitekit-button-icon--spinner__running': isSaving,
      'googlesitekit-button-icon--spinner__before': spinnerPosition === SPINNER_POSITION.BEFORE,
      'googlesitekit-button-icon--spinner__after': spinnerPosition === SPINNER_POSITION.AFTER
    }),
    icon: isSaving && spinnerPosition === SPINNER_POSITION.BEFORE ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_CircularProgress__WEBPACK_IMPORTED_MODULE_4__["default"], {
      size: 14
    }) : undefined,
    trailingIcon: isSaving && spinnerPosition === SPINNER_POSITION.AFTER ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_CircularProgress__WEBPACK_IMPORTED_MODULE_4__["default"], {
      size: 14
    }) : undefined,
    onClick: onClick,
    ...definedProps
  });
}
SpinnerButton.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
  isSaving: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  spinnerPosition: prop_types__WEBPACK_IMPORTED_MODULE_2___default().oneOf(Object.values(SPINNER_POSITION))
};

/***/ },

/***/ "./js/googlesitekit/components-gm2/Switch.js"
/*!***************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Switch.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_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 _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/keycodes */ "../node_modules/@wordpress/keycodes/build-module/index.mjs");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * 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 Switch({
  onClick,
  label,
  checked,
  disabled,
  hideLabel
}) {
  const instanceID = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["default"])(Switch);
  const switchRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(element => {
    if (element !== null) {
      _js_material_components__WEBPACK_IMPORTED_MODULE_5__.MDCSwitch.attachTo(element);
    }
  }, []);
  const onKeyDown = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(event => {
    if (typeof onClick === 'function' && _wordpress_keycodes__WEBPACK_IMPORTED_MODULE_4__.ENTER === event.keyCode) {
      onClick(event);
    }
  }, [onClick]);
  const id = `googlesitekit-switch-${instanceID}`;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      "aria-checked": checked ? 'true' : 'false',
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('mdc-switch', {
        'mdc-switch--checked': checked,
        'mdc-switch--disabled': disabled
      }),
      onClick: onClick,
      onKeyDown: onKeyDown,
      role: "switch",
      ref: switchRef,
      tabIndex: 0,
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
        className: "mdc-switch__track",
        children: "\xA0"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
        className: "mdc-switch__thumb-underlay",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("div", {
          className: "mdc-switch__thumb",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("input", {
            type: "checkbox",
            id: id,
            className: "mdc-switch__native-control",
            role: "switch",
            checked: checked,
            disabled: disabled,
            readOnly: true
          })
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("label", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
        'screen-reader-only': hideLabel
      }),
      htmlFor: id,
      children: label
    })]
  });
}
Switch.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node).isRequired,
  checked: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  hideLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};
Switch.defaultProps = {
  checked: false,
  disabled: false,
  hideLabel: true
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Switch);

/***/ },

/***/ "./js/googlesitekit/components-gm2/TextField.js"
/*!******************************************************!*\
  !*** ./js/googlesitekit/components-gm2/TextField.js ***!
  \******************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   HelperText: () => (/* reexport safe */ _material_react_text_field__WEBPACK_IMPORTED_MODULE_0__.HelperText),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _material_react_text_field__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material/react-text-field */ "../node_modules/@material/react-text-field/dist/index.js");
/* harmony import */ var _material_react_text_field__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_material_react_text_field__WEBPACK_IMPORTED_MODULE_0__);
/* 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 _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TextField 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 TextField({
  className,
  name,
  label,
  noLabel,
  outlined,
  textarea,
  leadingIcon,
  trailingIcon,
  helperText,
  id,
  inputType,
  value,
  size,
  maxLength,
  tabIndex,
  disabled,
  onChange,
  onKeyDown
}) {
  // For accessibility, provide a generated id fallback if an id
  // is not supplied. Adding an id is mandatory because otherwise the label
  // is not able to associate with the input.
  const idFallback = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["default"])(TextField, 'googlesitekit-textfield');
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)((_material_react_text_field__WEBPACK_IMPORTED_MODULE_0___default()), {
    className: className,
    name: name,
    label: label,
    noLabel: noLabel,
    outlined: outlined,
    textarea: textarea,
    leadingIcon: leadingIcon,
    trailingIcon: trailingIcon,
    helperText: helperText && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_material_react_text_field__WEBPACK_IMPORTED_MODULE_0__.HelperText, {
      persistent: true,
      children: helperText
    }),
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_material_react_text_field__WEBPACK_IMPORTED_MODULE_0__.Input, {
      id: id || idFallback,
      inputType: inputType,
      value: value,
      size: size,
      maxLength: maxLength,
      tabIndex: tabIndex,
      disabled: disabled,
      onChange: onChange,
      onKeyDown: onKeyDown
    })
  });
}
TextField.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  name: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  noLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  outlined: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  textarea: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  leadingIcon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element),
  trailingIcon: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element)]),
  helperText: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  id: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  inputType: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  value: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)]),
  size: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  maxLength: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  tabIndex: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().number), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string)]),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onChange: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  onKeyDown: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
};

/**
 * The HelperText component is exported as a named export here because
 * it is being used as a standalone component in the
 * SurveyQuestionMultiSelect component.
 */

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

/***/ },

/***/ "./js/googlesitekit/components-gm2/Tooltip.js"
/*!****************************************************!*\
  !*** ./js/googlesitekit/components-gm2/Tooltip.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 */ Tooltip)
/* harmony export */ });
/* harmony import */ var _material_ui_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material-ui/core */ "../node_modules/@material-ui/core/esm/Tooltip/Tooltip.js");
/* 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_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_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Tooltip 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
 */


function Tooltip({
  children,
  popperClassName,
  tooltipClassName,
  onOpen,
  onClose,
  ...props
}) {
  const isOpen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useRef)(false);
  const handleOpen = onOpen ? () => {
    // This fixes a bug where the `onOpen` callback is called when the tooltip is already open.
    if (isOpen.current) {
      return;
    }
    isOpen.current = true;
    onOpen?.();
  } : undefined;
  const handleClose = onOpen ? () => {
    isOpen.current = false;
    onClose?.();
  } : onClose;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_material_ui_core__WEBPACK_IMPORTED_MODULE_0__["default"], {
    classes: {
      popper: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-tooltip-popper', popperClassName),
      tooltip: classnames__WEBPACK_IMPORTED_MODULE_1___default()('googlesitekit-tooltip', tooltipClassName)
    },
    onOpen: handleOpen,
    onClose: handleClose,
    ...props,
    arrow: true,
    children: children
  });
}
Tooltip.propTypes = {
  children: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().node),
  popperClassName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  tooltipClassName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  onOpen: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func),
  onClose: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().func)
};

/***/ },

/***/ "./js/googlesitekit/components-gm2/index.js"
/*!**************************************************!*\
  !*** ./js/googlesitekit/components-gm2/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 _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 _material_react_select__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material/react-select */ "../node_modules/@material/react-select/dist/index.js");
/* harmony import */ var _material_react_select__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_material_react_select__WEBPACK_IMPORTED_MODULE_1__);
/* harmony import */ var _material_react_tab__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material/react-tab */ "../node_modules/@material/react-tab/dist/index.js");
/* harmony import */ var _material_react_tab__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_material_react_tab__WEBPACK_IMPORTED_MODULE_2__);
/* harmony import */ var _material_react_tab_bar__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @material/react-tab-bar */ "../node_modules/@material/react-tab-bar/dist/index.js");
/* harmony import */ var _material_react_tab_bar__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_material_react_tab_bar__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _Button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Button */ "./js/googlesitekit/components-gm2/Button/index.js");
/* harmony import */ var _Checkbox__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./Checkbox */ "./js/googlesitekit/components-gm2/Checkbox.tsx");
/* harmony import */ var _Chip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./Chip */ "./js/googlesitekit/components-gm2/Chip.js");
/* harmony import */ var _CircularProgress__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./CircularProgress */ "./js/googlesitekit/components-gm2/CircularProgress.js");
/* harmony import */ var _Menu__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./Menu */ "./js/googlesitekit/components-gm2/Menu.js");
/* harmony import */ var _Popper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Popper */ "./js/googlesitekit/components-gm2/Popper.tsx");
/* harmony import */ var _ProgressBar__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ProgressBar */ "./js/googlesitekit/components-gm2/ProgressBar.js");
/* harmony import */ var _Radio__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Radio */ "./js/googlesitekit/components-gm2/Radio.js");
/* harmony import */ var _Select__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./Select */ "./js/googlesitekit/components-gm2/Select.js");
/* harmony import */ var _SpinnerButton__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./SpinnerButton */ "./js/googlesitekit/components-gm2/SpinnerButton.js");
/* harmony import */ var _Switch__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Switch */ "./js/googlesitekit/components-gm2/Switch.js");
/* harmony import */ var _TextField__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./TextField */ "./js/googlesitekit/components-gm2/TextField.js");
/* harmony import */ var _Tooltip__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./Tooltip */ "./js/googlesitekit/components-gm2/Tooltip.js");
/**
 * Google Site Kit 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.
 */

/**
 * External dependencies
 */





/**
 * Internal dependencies
 */













const Components = {
  Button: _Button__WEBPACK_IMPORTED_MODULE_4__["default"],
  Checkbox: _Checkbox__WEBPACK_IMPORTED_MODULE_5__["default"],
  Chip: _Chip__WEBPACK_IMPORTED_MODULE_6__["default"],
  CircularProgress: _CircularProgress__WEBPACK_IMPORTED_MODULE_7__["default"],
  Dialog: (_material_react_dialog__WEBPACK_IMPORTED_MODULE_0___default()),
  DialogTitle: _material_react_dialog__WEBPACK_IMPORTED_MODULE_0__.DialogTitle,
  DialogContent: _material_react_dialog__WEBPACK_IMPORTED_MODULE_0__.DialogContent,
  DialogFooter: _material_react_dialog__WEBPACK_IMPORTED_MODULE_0__.DialogFooter,
  HelperText: _TextField__WEBPACK_IMPORTED_MODULE_15__.HelperText,
  Menu: _Menu__WEBPACK_IMPORTED_MODULE_8__["default"],
  Option: _material_react_select__WEBPACK_IMPORTED_MODULE_1__.Option,
  Popper: _Popper__WEBPACK_IMPORTED_MODULE_9__["default"],
  ProgressBar: _ProgressBar__WEBPACK_IMPORTED_MODULE_10__["default"],
  Radio: _Radio__WEBPACK_IMPORTED_MODULE_11__["default"],
  Select: _Select__WEBPACK_IMPORTED_MODULE_12__["default"],
  SpinnerButton: _SpinnerButton__WEBPACK_IMPORTED_MODULE_13__["default"],
  SPINNER_POSITION: _SpinnerButton__WEBPACK_IMPORTED_MODULE_13__.SPINNER_POSITION,
  Switch: _Switch__WEBPACK_IMPORTED_MODULE_14__["default"],
  Tab: (_material_react_tab__WEBPACK_IMPORTED_MODULE_2___default()),
  TabBar: (_material_react_tab_bar__WEBPACK_IMPORTED_MODULE_3___default()),
  TextField: _TextField__WEBPACK_IMPORTED_MODULE_15__["default"],
  Tooltip: _Tooltip__WEBPACK_IMPORTED_MODULE_16__["default"]
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (Components);

/***/ },

/***/ "./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_SITE_GOALS: () => (/* binding */ ANCHOR_ID_SITE_GOALS),
/* 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_SITE_GOALS = 'site-goals';
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-requirements/index.js"
/*!*****************************************************!*\
  !*** ./js/googlesitekit/data-requirements/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 */   requireAudienceSegmentationWidgetHidden: () => (/* binding */ requireAudienceSegmentationWidgetHidden),
/* harmony export */   requireCanActivateModule: () => (/* binding */ requireCanActivateModule),
/* harmony export */   requireCanViewSharedModule: () => (/* binding */ requireCanViewSharedModule),
/* harmony export */   requireIsAuthenticated: () => (/* binding */ requireIsAuthenticated),
/* harmony export */   requireIsAuthenticatedUser: () => (/* binding */ requireIsAuthenticatedUser),
/* harmony export */   requireItemDismissed: () => (/* binding */ requireItemDismissed),
/* harmony export */   requireModuleAccess: () => (/* binding */ requireModuleAccess),
/* harmony export */   requireModuleActive: () => (/* binding */ requireModuleActive),
/* harmony export */   requireModuleConnected: () => (/* binding */ requireModuleConnected),
/* harmony export */   requireModuleGatheringData: () => (/* binding */ requireModuleGatheringData),
/* harmony export */   requireModuleOwnership: () => (/* binding */ requireModuleOwnership),
/* harmony export */   requireScope: () => (/* binding */ requireScope)
/* 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_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.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
 */




/**
 * Returns a function that checks if the current user has the given scope.
 *
 * @since 1.166.0
 *
 * @param {string} scope Scope to check.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the current user has the given scope.
 */
function requireScope(scope) {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getAuthentication();
    return select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).hasScope(scope);
  };
}

/**
 * Returns a function that checks if the current user is authenticated.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} Whether or not the current user is authenticated.
 */
function requireIsAuthenticated() {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getAuthentication();
    return true === select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).isAuthenticated();
  };
}

/**
 * Returns a function that checks if the current user can view the given shared module.
 *
 * @since 1.166.0
 *
 * @param {string} slug Module slug to test.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the current user can view the given shared module.
 */
function requireCanViewSharedModule(slug) {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getCapabilities();
    return select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).canViewSharedModule(slug);
  };
}

/**
 * Returns a function that checks if the given module is active.
 *
 * @since 1.170.0
 *
 * @param {string} slug Module slug to test.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the given module is active or not.
 */
function requireModuleActive(slug) {
  return async function ({
    resolveSelect
  }) {
    return true === (await resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).isModuleActive(slug));
  };
}

/**
 * Returns a function that checks if the given module is connected.
 *
 * @since 1.166.0
 *
 * @param {string} slug Module slug to test.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the given module is connected or not.
 */
function requireModuleConnected(slug) {
  return async function ({
    resolveSelect
  }) {
    return true === (await resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).isModuleConnected(slug));
  };
}

/**
 * Returns a function that checks if the current user is the owner of the given module.
 *
 * @since 1.166.0
 *
 * @param {string} slug Module slug to test.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the given module is owned by the current user or not.
 */
function requireModuleOwnership(slug) {
  return async ({
    resolveSelect
  }) => true === (await resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).hasModuleOwnership(slug));
}

/**
 * Returns a function that checks if the current user has access to the given module.
 *
 * @since 1.166.0
 *
 * @param {string} slug Module slug to test.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the current user has access to the given module or not.
 */
function requireModuleAccess(slug) {
  return async ({
    resolveSelect
  }) => true === (await resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).hasModuleAccess(slug));
}

/**
 * Returns a function that checks if the given item is dismissed.
 *
 * @since 1.166.0
 *
 * @param {string} item Dismissible item ID.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the given item is dismissed or not.
 */
function requireItemDismissed(item) {
  return async ({
    resolveSelect
  }) => true === (await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).isItemDismissed(item));
}

/**
 * Returns a function that checks if the audience segmentation widget is hidden.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the widget is hidden or not.
 */
function requireAudienceSegmentationWidgetHidden() {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getUserAudienceSettings();
    return true === select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).isAudienceSegmentationWidgetHidden();
  };
}

/**
 * Returns a function that checks if the given module'sdatastore is gathering data.
 *
 * @since 1.170.0
 *
 * @param {string} datastoreSlug Datastore slug to test.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the given datastore is gathering data or not.
 */
function requireModuleGatheringData(datastoreSlug) {
  return async ({
    resolveSelect
  }) => true === (await resolveSelect(datastoreSlug).isGatheringData());
}

/**
 * Returns a function that checks if the current user is authenticated.
 *
 * @since 1.174.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the current user is authenticated or not.
 */
function requireIsAuthenticatedUser() {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getAuthentication();
    return true === select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).isAuthenticated();
  };
}

/**
 * Returns a function that checks if the current user can activate the given module.
 *
 * @since 1.170.0
 *
 * @param {string} slug Module slug to test.
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the current user can activate the given module or not.
 */
function requireCanActivateModule(slug) {
  return async ({
    resolveSelect
  }) => true === (await resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).canActivateModule(slug));
}

/***/ },

/***/ "./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 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 _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/factory.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 _js_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/**
 * 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
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


const SET_ERROR_FOR_SELECTOR = 'SET_ERROR_FOR_SELECTOR';
const SET_ERROR_FOR_ACTION = 'SET_ERROR_FOR_ACTION';
const CLEAR_SELECTOR_ERROR = 'CLEAR_SELECTOR_ERROR';
const CLEAR_SELECTOR_ERRORS = 'CLEAR_SELECTOR_ERRORS';
const CLEAR_ACTION_ERROR = 'CLEAR_ACTION_ERROR';
const CLEAR_ACTION_ERRORS = 'CLEAR_ACTION_ERRORS';
function generateErrorKey(baseName, args) {
  if (args && Array.isArray(args)) {
    const stringifiedArgs = args.map(item => {
      return 'object' === typeof item ? (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.stringifyObject)(item) : item;
    });
    return `${baseName}::${md5__WEBPACK_IMPORTED_MODULE_1___default()(JSON.stringify(stringifiedArgs))}`;
  }
  return baseName;
}
const actions = {
  /**
   * Sets an error for a selector.
   *
   * @since 1.179.0
   *
   * @param {Object}      error        Error object.
   * @param {string}      selectorName Selector name.
   * @param {Array.<any>} [args]       Arguments passed to selector (default `[]`).
   * @return {Object} Redux-style action.
   */
  setErrorForSelector(error, selectorName, args = []) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(error, 'error is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(selectorName, 'selectorName is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(args && Array.isArray(args), 'args must be an array.');
    return {
      type: SET_ERROR_FOR_SELECTOR,
      payload: {
        error,
        baseName: selectorName,
        args
      }
    };
  },
  /**
   * Sets an error for an action.
   *
   * @since 1.179.0
   *
   * @param {Object}      error      Error object.
   * @param {string}      actionName Action name.
   * @param {Array.<any>} [args]     Arguments passed to action (default `[]`).
   * @return {Object} Redux-style action.
   */
  setErrorForAction(error, actionName, args = []) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(error, 'error is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(actionName, 'actionName is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(args && Array.isArray(args), 'args must be an array.');
    return {
      type: SET_ERROR_FOR_ACTION,
      payload: {
        error,
        baseName: actionName,
        args
      }
    };
  },
  /**
   * Clears the error for a given selector name and args.
   *
   * @since 1.179.0
   *
   * @param {string}      selectorName Selector name.
   * @param {Array.<any>} [args]       Arguments passed to selector (default `[]`).
   * @return {Object} Redux-style action.
   */
  clearSelectorError(selectorName, args = []) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(selectorName, 'selectorName is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(args && Array.isArray(args), 'args must be an array.');
    return {
      type: CLEAR_SELECTOR_ERROR,
      payload: {
        baseName: selectorName,
        args
      }
    };
  },
  /**
   * Clears all selector errors, optionally filtered by selector name.
   *
   * @since 1.179.0
   *
   * @param {string} [selectorName] Optional selector name to clear errors for.
   * @return {Object} Redux-style action.
   */
  clearSelectorErrors(selectorName) {
    return {
      type: CLEAR_SELECTOR_ERRORS,
      payload: {
        baseName: selectorName
      }
    };
  },
  /**
   * Clears the error for a given action name and args.
   *
   * @since 1.179.0
   *
   * @param {string}      actionName Action name.
   * @param {Array.<any>} [args]     Arguments passed to action (default `[]`).
   * @return {Object} Redux-style action.
   */
  clearActionError(actionName, args = []) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(actionName, 'actionName is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(args && Array.isArray(args), 'args must be an array.');
    return {
      type: CLEAR_ACTION_ERROR,
      payload: {
        baseName: actionName,
        args
      }
    };
  },
  /**
   * Clears all action errors, optionally filtered by action name.
   *
   * @since 1.179.0
   *
   * @param {string} [actionName] Optional action name to clear errors for.
   * @return {Object} Redux-style action.
   */
  clearActionErrors(actionName) {
    return {
      type: CLEAR_ACTION_ERRORS,
      payload: {
        baseName: actionName
      }
    };
  }
};
function createErrorStore(storeName) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(storeName, 'storeName must be defined.');
  const initialState = {
    selectorErrors: {},
    selectorErrorArgs: {},
    actionErrors: {},
    actionErrorArgs: {}
  };

  /**
   * Sets an error within a given slice of the error state.
   *
   * @since 1.179.0
   *
   * @param {Object} state        Data store's state.
   * @param {string} errorsKey    Key of the slice's errors object on state.
   * @param {string} errorArgsKey Key of the slice's error args object on state.
   * @param {Object} payload      Action payload with `baseName`, `args`, and `error`.
   */
  function setErrorInSlice(state, errorsKey, errorArgsKey, payload) {
    const {
      baseName,
      args,
      error
    } = payload;
    const key = generateErrorKey(baseName, args);
    state[errorsKey] = state[errorsKey] || {};
    state[errorArgsKey] = state[errorArgsKey] || {};
    state[errorsKey][key] = error;
    state[errorArgsKey][key] = args;
  }

  /**
   * Clears the error for a specific (baseName, args) pair within a given slice.
   *
   * @since 1.179.0
   *
   * @param {Object}      state        Data store's state.
   * @param {string}      errorsKey    Key of the slice's errors object on state.
   * @param {string}      errorArgsKey Key of the slice's error args object on state.
   * @param {string}      baseName     Selector or action name.
   * @param {Array.<any>} args         Arguments passed to the selector or action.
   */
  function clearErrorInSlice(state, errorsKey, errorArgsKey, baseName, args) {
    const key = generateErrorKey(baseName, args);
    state[errorsKey] = state[errorsKey] || {};
    state[errorArgsKey] = state[errorArgsKey] || {};
    delete state[errorsKey][key];
    delete state[errorArgsKey][key];
  }

  /**
   * Clears all errors within a given slice, optionally filtered by baseName.
   *
   * When `baseName` is provided, every error keyed under that baseName
   * (regardless of args) is cleared. When omitted, the entire slice is wiped.
   *
   * @since 1.179.0
   *
   * @param {Object} state        Data store's state.
   * @param {string} errorsKey    Key of the slice's errors object on state.
   * @param {string} errorArgsKey Key of the slice's error args object on state.
   * @param {string} [baseName]   Optional selector or action name to filter by.
   */
  function clearErrorsInSlice(state, errorsKey, errorArgsKey, baseName) {
    if (baseName) {
      state[errorsKey] = state[errorsKey] || {};
      state[errorArgsKey] = state[errorArgsKey] || {};
      for (const key in state[errorsKey]) {
        if (key === baseName || key.startsWith(`${baseName}::`)) {
          delete state[errorsKey][key];
          delete state[errorArgsKey][key];
        }
      }
    } else {
      state[errorsKey] = {};
      state[errorArgsKey] = {};
    }
  }
  const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, {
    type,
    payload
  }) => {
    switch (type) {
      case SET_ERROR_FOR_SELECTOR:
        {
          setErrorInSlice(state, 'selectorErrors', 'selectorErrorArgs', payload);
          break;
        }
      case SET_ERROR_FOR_ACTION:
        {
          setErrorInSlice(state, 'actionErrors', 'actionErrorArgs', payload);
          break;
        }
      case CLEAR_SELECTOR_ERROR:
        {
          const {
            baseName,
            args
          } = payload;
          clearErrorInSlice(state, 'selectorErrors', 'selectorErrorArgs', baseName, args);
          break;
        }
      case CLEAR_SELECTOR_ERRORS:
        {
          const {
            baseName
          } = payload;
          clearErrorsInSlice(state, 'selectorErrors', 'selectorErrorArgs', baseName);
          break;
        }
      case CLEAR_ACTION_ERROR:
        {
          const {
            baseName,
            args
          } = payload;
          clearErrorInSlice(state, 'actionErrors', 'actionErrorArgs', baseName, args);
          break;
        }
      case CLEAR_ACTION_ERRORS:
        {
          const {
            baseName
          } = payload;
          clearErrorsInSlice(state, 'actionErrors', 'actionErrorArgs', baseName);
          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.');
      const {
        selectorErrors
      } = state;
      return selectorErrors[generateErrorKey(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.');
      const {
        actionErrors
      } = state;
      return actionErrors[generateErrorKey(actionName, 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.selectorErrors), ...Object.values(state.actionErrors)]);
      return Array.from(errorsSet);
    },
    /**
     * Gets the meta-data for a given selector error object, or null if the error is not found.
     *
     * Returns meta-data in the format:
     *
     * ```
     *	{
     *		baseName: <string>,
     *		args: <Array>
     *	}
     * ```
     *
     * @since 1.84.0
     * @since 1.179.0 Renamed from `getMetaDataForError` and limited to the selector error slice.
     *
     * @param {Object} state Data store's state.
     * @param {Object} error Error object.
     * @return {Object|null} Meta-data for the given selector error object, or null if the error is not found.
     */
    getMetaDataForSelectorError(state, error) {
      const selectorKey = Object.keys(state.selectorErrors).find(errorKey => state.selectorErrors[errorKey] === error);
      if (selectorKey) {
        const baseName = selectorKey.substring(0, selectorKey.indexOf('::'));
        return {
          baseName,
          args: state.selectorErrorArgs[selectorKey]
        };
      }
      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_2__.createRegistrySelector)(select => function (state, error) {
      const metaData = select(storeName).getMetaDataForSelectorError(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 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 _create_error_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/* harmony import */ var _transform_case__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./transform-case */ "./js/googlesitekit/data/transform-case.js");
/**
 * 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() {}

/**
 * Separates the fetch options from the rest of the `fetchX` action arguments.
 *
 * A caller passes the fetch options as the last argument, such as
 * `fetchGetReport( options, { signal } )`. The fetch options control how the
 * request runs, such as `{ signal }` to cancel it. The params control what the
 * request asks for. This helper keeps the fetch options out of `argsToParams`
 * and the error key, so the params and the fetch options stay separate.
 *
 * This helper reads the fetch options from a last argument that is a plain
 * object with a `signal` key. A last argument of `undefined` means the
 * caller passes no fetch options. So a resolver can always pass its
 * `fetchOptions` argument, with or without a value. A store's own params
 * must not use a `signal` key, because the helper finds the fetch options
 * by that key.
 *
 * @since 1.182.0
 *
 * @param {Array} args All arguments passed to the generated `fetchX` action.
 * @return {Object} An object with `fetchArgs`, the arguments that build the
 *                  params, and `fetchOptions`, the fetch options, or `undefined`
 *                  when the caller passes none.
 */
function separateFetchOptionsFromArgs(args) {
  const lastArg = args[args.length - 1];
  if ((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(lastArg) && 'signal' in lastArg) {
    return {
      fetchArgs: args.slice(0, -1),
      fetchOptions: lastArg
    };
  }

  // A resolver always passes its `fetchOptions` argument here, so the
  // last argument can be `undefined`. Drop it. The call then keeps the
  // same error key as a call without the argument.
  if (args.length && lastArg === undefined) {
    return {
      fetchArgs: args.slice(0, -1),
      fetchOptions: undefined
    };
  }
  return {
    fetchArgs: args,
    fetchOptions: undefined
  };
}

// 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 {
  clearSelectorError,
  clearActionError,
  setErrorForSelector,
  setErrorForAction
} = _create_error_store__WEBPACK_IMPORTED_MODULE_4__.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
 * @since 1.182.0 Accept an optional fetch options object on the generated `fetchX` action, such as `{ signal }` to cancel the request, and pass it to `controlCallback` as a second argument.
 * @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 send the API request. Receives two arguments. The
 *                                          first is the params object that `argsToParams` builds from the action
 *                                          arguments. The second is the fetch options, such as `{ signal }` to cancel
 *                                          the request, or `undefined` when the caller passes none.
 * @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.
 * @param {boolean}  [args.isAction]        Optional. When true, errors from this fetch store are stored as action
 *                                          errors (via `setErrorForAction`). Default is false, which stores errors as
 *                                          selector errors (via `setErrorForSelector`). Set to true for fetch stores
 *                                          that serve action-based operations rather than data-fetching selectors.
 * @return {Object} Partial store object with properties 'actions', 'controls', 'reducer', 'resolvers', and 'selectors'.
 */
function createFetchStore({
  baseName,
  controlCallback,
  reducerCallback = defaultReducerCallback,
  argsToParams = defaultArgsToParams,
  validateParams = defaultValidateParams,
  isAction = false
}) {
  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_5__.camelCaseToPascalCase)(baseName);
  const constantBaseName = (0,_transform_case__WEBPACK_IMPORTED_MODULE_5__.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, fetchOptions) {
    let response;
    let error;
    yield {
      payload: {
        params
      },
      type: START_FETCH
    };
    const clearError = isAction ? clearActionError : clearSelectorError;
    yield clearError(baseName, args);
    try {
      response = yield {
        payload: {
          params,
          fetchOptions
        },
        type: FETCH
      };
      yield actions[receiveCreator](response, params);
      yield {
        payload: {
          params
        },
        type: FINISH_FETCH
      };
    } catch (fetchError) {
      error = fetchError;
      const setError = isAction ? setErrorForAction : setErrorForSelector;
      yield setError(error, baseName, args);
      yield {
        payload: {
          params
        },
        type: CATCH_FETCH
      };
    }
    return {
      response,
      error
    };
  }
  const actions = {
    [fetchCreator](...args) {
      // Separate the fetch options, such as `{ signal }`, from the
      // arguments that build the params. The control passes the fetch
      // options to `controlCallback` as a second argument.
      const {
        fetchArgs,
        fetchOptions
      } = separateFetchOptionsFromArgs(args);
      const params = argsToParams(...fetchArgs);
      // 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, fetchArgs, fetchOptions);
    },
    [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, payload.fetchOptions);
    }
  };
  const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, {
    type,
    payload
  }) => {
    switch (type) {
      case START_FETCH:
        {
          const {
            params
          } = payload;
          state[isFetching] = state[isFetching] || {};
          state[isFetching][(0,_js_util__WEBPACK_IMPORTED_MODULE_3__.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_3__.stringifyObject)(params)] = false;
          return state;
        }
      case CATCH_FETCH:
        {
          const {
            params
          } = payload;
          state[isFetching] = state[isFetching] || {};
          state[isFetching][(0,_js_util__WEBPACK_IMPORTED_MODULE_3__.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_3__.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 _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.js");
/* harmony import */ var _create_fetch_store__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/* harmony import */ var _transform_case__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./transform-case */ "./js/googlesitekit/data/transform-case.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils */ "./js/googlesitekit/data/utils.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 {
  clearActionError,
  setErrorForAction
} = _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__.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_5__.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_5__.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.');
    },
    isAction: true
  });

  // 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 clearActionError('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 setErrorForAction(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_7__.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_6__.camelCaseToPascalCase)(slug);
    const constantSlug = (0,_transform_case__WEBPACK_IMPORTED_MODULE_6__.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_7__.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/create-snapshot-store.js"
/*!********************************************************!*\
  !*** ./js/googlesitekit/data/create-snapshot-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 */   createSnapshotStore: () => (/* binding */ createSnapshotStore),
/* harmony export */   getStoresWithSnapshots: () => (/* binding */ getStoresWithSnapshots),
/* harmony export */   restoreAllSnapshots: () => (/* binding */ restoreAllSnapshots),
/* harmony export */   snapshotAllStores: () => (/* binding */ snapshotAllStores)
/* 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_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_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");
/**
 * Provides a datastore for snapshotting and restoring state.
 *
 * 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 CREATE_SNAPSHOT = 'CREATE_SNAPSHOT';
const DELETE_SNAPSHOT = 'DELETE_SNAPSHOT';
const RESTORE_SNAPSHOT = 'RESTORE_SNAPSHOT';
const SET_STATE_FROM_SNAPSHOT = 'SET_STATE_FROM_SNAPSHOT';

/**
 * Creates a store object that includes actions and controls for restoring/creating state snapshots.
 *
 * @since 1.9.0
 * @since 1.163.0 Added the ability to pick specific parts of the state to save in the snapshot.
 * @private
 *
 * @param {string}          storeName                The name of the store to snapshot in the cache.
 * @param {Object}          [options]                Optional configuration object.
 * @param {string|string[]} [options.keysToSnapshot] Property path(s) to pick from state when creating snapshots.
 * @return {Object} The snapshot store object.
 */
function createSnapshotStore(storeName, {
  keysToSnapshot
} = {}) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(storeName, 'storeName is required to create a snapshot store.');
  const initialState = {};
  const actions = {
    /**
     * Deletes a snapshot of state for a storeName, using our cache API.
     *
     * @since 1.9.0
     * @private
     *
     * @return {boolean} Cache deletion response.
     */
    *deleteSnapshot() {
      const cacheResult = yield {
        payload: {},
        type: DELETE_SNAPSHOT
      };
      return cacheResult;
    },
    /**
     * Restores a snapshot of state for a storeName, if available, using our cache API.
     *
     * @since 1.9.0
     * @private
     *
     * @param {Object}  [options]                   Options object.
     * @param {boolean} [options.clearAfterRestore] Whether or not to delete snapshot after restore. Default: true.
     * @return {boolean} Cache restoration response.
     */
    *restoreSnapshot(options = {}) {
      const {
        clearAfterRestore = true
      } = options;
      const {
        cacheHit,
        value
      } = yield {
        payload: {},
        type: RESTORE_SNAPSHOT
      };
      if (cacheHit) {
        yield {
          payload: {
            snapshot: value
          },
          type: SET_STATE_FROM_SNAPSHOT
        };
        if (clearAfterRestore) {
          yield {
            payload: {},
            type: DELETE_SNAPSHOT
          };
        }
      }
      return cacheHit;
    },
    /**
     * Creates a snapshot of the current state of this store, using our cache API.
     *
     * @since 1.9.0
     * @private
     *
     * @return {boolean} Cache write response.
     */
    *createSnapshot() {
      const cacheResult = yield {
        payload: {},
        type: CREATE_SNAPSHOT
      };
      return cacheResult;
    }
  };
  const controls = {
    [DELETE_SNAPSHOT]: () => {
      return (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.deleteItem)(`datastore::cache::${storeName}`);
    },
    [CREATE_SNAPSHOT]: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistryControl)(registry => () => {
      const state = registry.stores[storeName].store.getState();
      const stateToSnapshot = keysToSnapshot?.length > 0 ? (0,lodash__WEBPACK_IMPORTED_MODULE_1__.pick)(state, keysToSnapshot) : state;
      return (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.setItem)(`datastore::cache::${storeName}`, stateToSnapshot);
    }),
    [RESTORE_SNAPSHOT]: () => {
      // Only get snapshots made within the last hour.
      return (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_3__.getItem)(`datastore::cache::${storeName}`, _js_util__WEBPACK_IMPORTED_MODULE_4__.HOUR_IN_SECONDS);
    }
  };
  function reducer(state = initialState, {
    type,
    payload
  }) {
    // eslint-disable-line no-shadow
    switch (type) {
      case SET_STATE_FROM_SNAPSHOT:
        {
          const {
            snapshot
          } = payload;
          // Exclude any top-level errors from the restored state.
          // eslint-disable-next-line no-unused-vars
          const {
            error,
            ...newState
          } = snapshot;

          // If only a part of the state has been added to the snapshot, then
          // we should update the initial state with partial data restored
          // from the snapshot.
          if (keysToSnapshot?.length > 0) {
            return {
              ...state,
              ...newState
            };
          }
          return newState;
        }
      default:
        {
          return state;
        }
    }
  }
  return {
    initialState,
    actions,
    controls,
    reducer
  };
}

/**
 * Inspects a registry to find all stores that support our snapshot features.
 *
 * @since 1.9.0
 * @private
 *
 * @param {wp.data.registry} registry Optional. Registry object to inspect for stores that support state restoration. Defaults to `googlesitekit.data`.
 * @return {Object} The snapshot store object.
 */
function getStoresWithSnapshots(registry = (googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default())) {
  return Object.values(registry.stores).filter(store => {
    return Object.keys(store.getActions()).includes('restoreSnapshot');
  });
}

/**
 * Creates snapshots of all supporting stores.
 *
 * @since 1.9.0
 * @private
 *
 * @param {wp.data.registry} [registry] Optional. Registry object to inspect for stores that support state restoration. Defaults to `googlesitekit.data`.
 * @return {Promise} Promise resolves once all snapshots have been taken.
 */
function snapshotAllStores(registry = (googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default())) {
  return Promise.all(getStoresWithSnapshots(registry).map(store => {
    return store.getActions().createSnapshot();
  }));
}

/**
 * Restores state for all snapshots that support it.
 *
 * Only restores snapshots for stores that have `restoreSnapshot` action, and
 * clears the snapshot afterward, so more stores will not be restored unless
 * a snapshot was saved on the last pageview.
 *
 * @since 1.9.0
 * @private
 *
 * @param {wp.data.registry} [registry] Optional. Registry object to inspect for stores that support state restoration. Defaults to `googlesitekit.data`.
 * @return {Promise} Promise resolves once all snapshots have been restored.
 */
function restoreAllSnapshots(registry = (googlesitekit_data__WEBPACK_IMPORTED_MODULE_2___default())) {
  return Promise.all(getStoresWithSnapshots(registry).map(store => {
    return store.getActions().restoreSnapshot();
  }));
}

/***/ },

/***/ "./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_1__["default"]),
/* harmony export */   combineStores: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.combineStores),
/* harmony export */   commonActions: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.commonActions),
/* harmony export */   commonControls: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.commonControls),
/* harmony export */   commonStore: () => (/* reexport safe */ _utils__WEBPACK_IMPORTED_MODULE_11__.commonStore),
/* harmony export */   controls: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_8__.controls),
/* harmony export */   createReducer: () => (/* reexport safe */ _create_reducer__WEBPACK_IMPORTED_MODULE_10__.createReducer),
/* harmony export */   createRegistryControl: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_7__.createRegistryControl),
/* harmony export */   createRegistrySelector: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_7__.createRegistrySelector),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   useDispatch: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   useInViewSelect: () => (/* reexport safe */ _js_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_9__.useInViewSelect),
/* harmony export */   useRegistry: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   useSelect: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   withDispatch: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   withSelect: () => (/* reexport safe */ _wordpress_data__WEBPACK_IMPORTED_MODULE_3__["default"])
/* harmony export */ });
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/registry-provider/context.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/registry-provider/use-registry.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/with-select/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/with-dispatch/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-select/index.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/registry.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/factory.js");
/* harmony import */ var _wordpress_data__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/controls.js");
/* harmony import */ var _js_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useInViewSelect */ "./js/hooks/useInViewSelect.js");
/* harmony import */ var _create_reducer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./create-reducer */ "./js/googlesitekit/data/create-reducer.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ "./js/googlesitekit/data/utils.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
 * @since 1.178.0 Updated types to include `registerGenericStore` function.
 *
 * @typedef {Object} WPDataRegistry
 * @property {Function} registerGenericStore Given a namespace key and settings
 *                                           object, registers a new generic
 *                                           store.
 * @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_6__.createRegistry)({}, globalThis.wp?.data);

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

// Attach our custom, useInViewSelect hook to the registry so third-party
// developers can use it.
Data.useInViewSelect = _js_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_9__.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_8__.controls;
Data.createRegistryControl = _wordpress_data__WEBPACK_IMPORTED_MODULE_7__.createRegistryControl;
Data.createRegistrySelector = _wordpress_data__WEBPACK_IMPORTED_MODULE_7__.createRegistrySelector;
Data.useSelect = _wordpress_data__WEBPACK_IMPORTED_MODULE_5__["default"];
Data.useDispatch = _wordpress_data__WEBPACK_IMPORTED_MODULE_0__["default"];
Data.useRegistry = _wordpress_data__WEBPACK_IMPORTED_MODULE_2__["default"];
Data.withSelect = _wordpress_data__WEBPACK_IMPORTED_MODULE_3__["default"];
Data.withDispatch = _wordpress_data__WEBPACK_IMPORTED_MODULE_4__["default"];
Data.RegistryProvider = _wordpress_data__WEBPACK_IMPORTED_MODULE_1__["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/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 */   getGlobalData: () => (/* binding */ getGlobalData)
/* 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 memize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! memize */ "../node_modules/memize/index.js");
/* harmony import */ var memize__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(memize__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_2___default()(selectors => (0,lodash__WEBPACK_IMPORTED_MODULE_1__.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);
  };
}

/**
 * Gets a global data object by path.
 *
 * Returns a deep clone to avoid mutating the original object.
 *
 * @since 1.183.0
 *
 * @param {string} path      Path to a value in the global object.
 * @param {Object} [_global] Optional. The global object to use. Default is `global`.
 * @return {*} The value at the path in the global data object.
 * @throws {Error} If the value is not found / undefined.
 */
function getGlobalData(path, _global = globalThis) {
  const value = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.get)(_global, path);
  if (value === undefined) {
    throw new Error(`Global data value not found at path ${path}.`);
  }
  return (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(value);
}

/***/ },

/***/ "./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 */   FORCED_IN_VIEW_WIDGET_AREAS: () => (/* binding */ FORCED_IN_VIEW_WIDGET_AREAS)
/* 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';
const FORCED_IN_VIEW_WIDGET_AREAS = 'forced-in-view-widget-areas';

/***/ },

/***/ "./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 */   INITIAL_SETUP_NOTIFICATION_TIMEOUT_SLUG: () => (/* binding */ INITIAL_SETUP_NOTIFICATION_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';
const INITIAL_SETUP_NOTIFICATION_TIMEOUT_SLUG = 'initial-setup-notification-timeout';

/***/ },

/***/ "./js/googlesitekit/modules/create-gathering-data-store.js"
/*!*****************************************************************!*\
  !*** ./js/googlesitekit/modules/create-gathering-data-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 */   createGatheringDataStore: () => (/* binding */ createGatheringDataStore)
/* 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 _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/**
 * Factory function to create gathering data store.
 *
 * 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 RECEIVE_GATHERING_DATA = 'RECEIVE_GATHERING_DATA';
const RECEIVE_DATA_AVAILABLE_ON_LOAD = 'RECEIVE_DATA_AVAILABLE_ON_LOAD';
const WAIT_FOR_DATA_AVAILABILITY_STATE = 'WAIT_FOR_DATA_AVAILABILITY_STATE';

/**
 * Creates a store object that includes actions and selectors for gathering data state for a module.
 *
 * @since 1.96.0
 * @private
 *
 * @param {string}   moduleSlug                  Slug of the module that the store is for.
 * @param {Object}   args                        Arguments to configure the store.
 * @param {string}   args.storeName              Store name to use.
 * @param {boolean}  args.dataAvailable          Data available on load.
 * @param {Function} args.selectDataAvailability Selector to determine data availability.
 *                                               This is a function that should return a boolean, or undefined while resolving.
 *                                               Since logic to determine data availability is different for every module,
 *                                               this selector must be provided by the module. If the data availability can
 *                                               not be determined, the selector should return null.
 * @return {Object} The gathering data store object.
 */
function createGatheringDataStore(moduleSlug, {
  storeName,
  dataAvailable = false,
  selectDataAvailability
} = {}) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof moduleSlug && moduleSlug, 'module slug is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof storeName && storeName, 'store name is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('boolean' === typeof dataAvailable, 'dataAvailable must be a boolean.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()('function' === typeof selectDataAvailability, 'selectDataAvailability must be a function.');
  const fetchSaveDataAvailableStateStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__.createFetchStore)({
    baseName: 'saveDataAvailableState',
    controlCallback: () => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.set)('modules', moduleSlug, 'data-available'),
    isAction: true
  });
  const initialState = {
    dataAvailableOnLoad: dataAvailable,
    gatheringData: undefined
  };
  const actions = {
    /* eslint-disable-next-line sitekit/jsdoc-no-unnamed-boolean-params */
    /**
     * Receives gathering data state.
     *
     * @since 1.96.0
     * @private
     *
     * @param {boolean} gatheringData Gathering data.
     * @return {Object} Redux-style action.
     */
    receiveIsGatheringData(gatheringData) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()('boolean' === typeof gatheringData, 'gatheringData must be a boolean.');
      return {
        payload: {
          gatheringData
        },
        type: RECEIVE_GATHERING_DATA
      };
    },
    /* eslint-disable-next-line sitekit/jsdoc-no-unnamed-boolean-params */
    /**
     * Receives data available on load state.
     *
     * This action was added to easily manipulate the state for
     * JS tests and Storybook / VRT scenarios.
     *
     * @since 1.110.0
     * @private
     *
     * @param {boolean} dataAvailableOnLoad Gathering data.
     * @return {Object} Redux-style action.
     */
    receiveIsDataAvailableOnLoad(dataAvailableOnLoad) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()('boolean' === typeof dataAvailableOnLoad, 'dataAvailableOnLoad must be a boolean.');
      return {
        payload: {
          dataAvailableOnLoad
        },
        type: RECEIVE_DATA_AVAILABLE_ON_LOAD
      };
    }
  };
  const controls = {
    [WAIT_FOR_DATA_AVAILABILITY_STATE]: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistryControl)(registry => () => {
      function dataAvailabityDetermined() {
        return registry.select(storeName).selectDataAvailability() !== undefined;
      }
      if (dataAvailabityDetermined()) {
        return true;
      }
      return new Promise(resolve => {
        const unsubscribe = registry.subscribe(() => {
          if (dataAvailabityDetermined()) {
            unsubscribe();
            resolve(true);
          }
        });
      });
    })
  };
  const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state = initialState, {
    type,
    payload
  }) => {
    switch (type) {
      case RECEIVE_GATHERING_DATA:
        state.gatheringData = payload.gatheringData;
        break;
      case RECEIVE_DATA_AVAILABLE_ON_LOAD:
        state.dataAvailableOnLoad = payload.dataAvailableOnLoad;
        break;
      default:
        break;
    }
  });
  const resolvers = {
    *isGatheringData() {
      const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();

      // If the gatheringData flag is already set, return early.
      if (registry.select(storeName).isGatheringData() !== undefined) {
        return;
      }
      const dataAvailableOnLoad = registry.select(storeName).isDataAvailableOnLoad();

      // If dataAvailableOnLoad is true, set gatheringData to false and do nothing else.
      if (dataAvailableOnLoad) {
        yield actions.receiveIsGatheringData(false);
        return;
      }
      yield {
        payload: {},
        type: WAIT_FOR_DATA_AVAILABILITY_STATE
      };
      const dataAvailability = registry.select(storeName).selectDataAvailability();
      yield actions.receiveIsGatheringData(!dataAvailability);
      if (dataAvailability) {
        yield fetchSaveDataAvailableStateStore.actions.fetchSaveDataAvailableState();
      }
    }
  };
  const selectors = {
    /**
     * Determines whether data is available for the module.
     *
     * @since 1.96.0
     * @since 1.107.0 Returns null if the data availability can not be determined.
     *
     * @return {boolean|undefined|null} Returns TRUE if data is available, otherwise FALSE.
     *                                  If the request is still being resolved, returns undefined.
     *                                  If the data availability can not be determined, returns null.
     */
    selectDataAvailability,
    /**
     * Checks if data is available on load.
     *
     * @since 1.96.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.
     */
    isDataAvailableOnLoad(state) {
      return state.dataAvailableOnLoad;
    },
    /**
     * Determines whether the module is still gathering data or not.
     *
     * @todo Review the name of this selector to a less confusing one.
     * @since 1.96.0
     *
     * @param {Object} state Data store's state.
     * @return {boolean|undefined} Returns TRUE if gathering data, otherwise FALSE. If the request is still being resolved, returns undefined.
     */
    isGatheringData(state) {
      return state.gatheringData;
    }
  };
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchSaveDataAvailableStateStore, {
    actions,
    controls,
    initialState,
    reducer,
    resolvers,
    selectors
  });
}

/***/ },

/***/ "./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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useHasBeenViewed */ "./js/googlesitekit/notifications/hooks/useHasBeenViewed.js");
/* harmony import */ var _js_hooks_useLatestIntersection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useLatestIntersection */ "./js/hooks/useLatestIntersection.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_6__["default"])(observeRef, {
    threshold
  });
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_UI);
  const {
    markNotificationSeen
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_NOTIFICATIONS);
  const isInView = !!intersectionEntry?.isIntersecting;
  const viewed = (0,_js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_5__.useHasBeenViewed)(id);
  const timeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  function clearExistingTimeout() {
    if (timeoutRef.current) {
      clearTimeout(timeoutRef.current);
    }
  }
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.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_5__.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_0___default().string),
  observeRef: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  threshold: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _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_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useHasBeenViewed */ "./js/googlesitekit/notifications/hooks/useHasBeenViewed.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _ViewedStateObserver__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ViewedStateObserver */ "./js/googlesitekit/notifications/components/Notification/ViewedStateObserver.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 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_1__.useRef)();
  const viewed = (0,_js_googlesitekit_notifications_hooks_useHasBeenViewed__WEBPACK_IMPORTED_MODULE_4__.useHasBeenViewed)(id);
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_5__["default"])(id, gaTrackingEventArgs?.category, {
    viewAction: gaTrackingEventArgs?.viewAction
  });
  const [isViewedOnce, setIsViewedOnce] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const viewedDates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_NOTIFICATIONS).getNotificationSeenDates(id));
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_NOTIFICATIONS);

  // Track view once and check if notification should be dismissed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.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_7__.jsxs)("section", {
    id: id,
    ref: ref,
    className: className,
    children: [children, !viewed && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_ViewedStateObserver__WEBPACK_IMPORTED_MODULE_6__["default"], {
      id: id,
      observeRef: ref,
      threshold: 0.5
    })]
  });
}
Notification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  gaTrackingEventArgs: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
    category: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
    viewAction: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
    label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
    value: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
  }),
  children: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node),
  onView: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};

/***/ },

/***/ "./js/googlesitekit/notifications/components/common/LearnMoreLink.js"
/*!***************************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/common/LearnMoreLink.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 */ LearnMoreLink)
/* 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__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 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 LearnMoreLink({
  id,
  label,
  url,
  ariaLabel,
  gaTrackingEventArgs,
  external = true,
  ...otherProps
}) {
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_2__["default"])(id);
  function handleLearnMore(event) {
    event.persist();
    trackEvents.clickLearnMore(gaTrackingEventArgs?.label, gaTrackingEventArgs?.value);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_1__["default"], {
    onClick: handleLearnMore,
    href: url,
    "aria-label": ariaLabel,
    external: external,
    ...otherProps,
    children: label
  });
}
LearnMoreLink.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  url: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  ariaLabel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  gaTrackingEventArgs: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({
    label: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
    value: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
  }),
  external: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./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_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 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_Banner__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Banner */ "./js/components/Banner/index.tsx");
/* harmony import */ var _js_components_Banner_CTAButton__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Banner/CTAButton */ "./js/components/Banner/CTAButton.tsx");
/* harmony import */ var _js_components_Banner_DismissButton__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Banner/DismissButton */ "./js/components/Banner/DismissButton.tsx");
/* harmony import */ var _js_components_Banner_LearnMoreLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Banner/LearnMoreLink */ "./js/components/Banner/LearnMoreLink.tsx");
/* 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_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* 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 _svg_graphics_banner_warning_svg_url__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/svg/graphics/banner-warning.svg?url */ "./svg/graphics/banner-warning.svg?url");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __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_8__["default"])(notificationID, gaTrackingEventArgs?.category);
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.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_11__["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_12__.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_12__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_9__.Grid, {
      className: "googlesitekit-page-content",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_9__.Row, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_9__.Cell, {
          size: 12,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Banner__WEBPACK_IMPORTED_MODULE_3__["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_1___default().string).isRequired,
  type: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(Object.values(TYPES)),
  titleIcon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)]),
  learnMoreLink: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(_js_components_Banner_LearnMoreLink__WEBPACK_IMPORTED_MODULE_6__["default"].propTypes),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(_js_components_Banner_DismissButton__WEBPACK_IMPORTED_MODULE_5__["default"].propTypes),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(_js_components_Banner_CTAButton__WEBPACK_IMPORTED_MODULE_4__["default"].propTypes),
  gaTrackingEventArgs: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
    category: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
    label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
    value: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)
  })
};

/***/ },

/***/ "./js/googlesitekit/notifications/components/layout/SetupCTA.js"
/*!**********************************************************************!*\
  !*** ./js/googlesitekit/notifications/components/layout/SetupCTA.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 */ SetupCTA)
/* 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Banner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Banner */ "./js/components/Banner/index.tsx");
/* harmony import */ var _js_components_Banner_CTAButton__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Banner/CTAButton */ "./js/components/Banner/CTAButton.tsx");
/* harmony import */ var _js_components_Banner_DismissButton__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Banner/DismissButton */ "./js/components/Banner/DismissButton.tsx");
/* harmony import */ var _js_components_Banner_LearnMoreLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Banner/LearnMoreLink */ "./js/components/Banner/LearnMoreLink.tsx");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupCTA 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
 */



/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */










function SetupCTA({
  notificationID,
  title,
  description,
  errorText,
  helpText,
  learnMoreLink,
  dismissButton,
  ctaButton,
  svg,
  footer,
  gaTrackingEventArgs,
  waitingProgress,
  ...props
}) {
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_10__["default"])(notificationID, gaTrackingEventArgs?.category);
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.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);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: [!!waitingProgress && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.ProgressBar, {
      className: "googlesitekit-banner__progress-bar",
      ...waitingProgress
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget-context', {
        'googlesitekit-widget-context--with-progress-bar': !!waitingProgress
      }),
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_11__.Grid, {
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_11__.Row, {
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_11__.Cell, {
            size: 12,
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Banner__WEBPACK_IMPORTED_MODULE_5__["default"], {
              className: "googlesitekit-banner--setup-cta",
              title: title,
              description: description,
              errorText: errorText,
              helpText: helpText,
              learnMoreLink: learnMoreLink && {
                ...learnMoreLink,
                onClick: handleLearnMoreClickWithTrackEvent
              },
              dismissButton: dismissButton && {
                ...dismissButton,
                onClick: handleDismissWithTrackEvent
              },
              ctaButton: ctaButton && {
                ...ctaButton,
                onClick: handleCTAClickWithTrackEvent
              },
              svg: svg,
              footer: footer,
              ...props
            })
          })
        })
      })
    })]
  });
}
SetupCTA.propTypes = {
  notificationID: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  description: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node)]),
  errorText: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  helpText: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  learnMoreLink: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(_js_components_Banner_LearnMoreLink__WEBPACK_IMPORTED_MODULE_8__["default"].propTypes),
  dismissButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(_js_components_Banner_DismissButton__WEBPACK_IMPORTED_MODULE_7__["default"].propTypes),
  ctaButton: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(_js_components_Banner_CTAButton__WEBPACK_IMPORTED_MODULE_6__["default"].propTypes),
  svg: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
    desktop: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType),
    mobile: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType),
    tablet: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType),
    verticalPosition: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['top', 'center', 'bottom'])
  }),
  footer: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().node),
  gaTrackingEventArgs: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({
    category: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
    label: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
    value: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number)
  }),
  waitingProgress: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.ProgressBar.propTypes)
};

/***/ },

/***/ "./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,
  // The welcome modal and the Site Goals intro modal have their own priority
  // values, distinct from the `SETUP_CTA_HIGH`/`SETUP_CTA_LOW` group, so that
  // ordering between the two modals does not depend on the other overlays that
  // share that group. The welcome modal takes precedence and is shown first.
  // TODO: Refactor holistically in #12653.
  SETUP_CTA_WELCOME_MODAL: 130,
  SETUP_CTA_SITE_GOALS_INTRO_MODAL: 140,
  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',
  SPLASH_CONTENT: 'notification-area-splash-content'
};
const NOTIFICATION_GROUPS = {
  DEFAULT: 'default',
  SETUP_CTAS: 'setup-ctas',
  // Overlay modals shown during the initial setup flow (the Welcome modal and
  // the Site Goals intro modal). Kept in their own group so they render even
  // when the setup CTAs / feature-introduction overlays are suppressed on the
  // first dashboard landing.
  SETUP_MODALS: 'setup-modals'
};

/***/ },

/***/ "./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.
 */

/**
 * Internal dependencies
 */

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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __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_1__["default"])();
  const eventCategory = category ?? `${viewContext}_${id}`;
  const view = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(eventCategory, viewAction, ...args);
  }, [eventCategory, viewAction]);
  const confirm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(eventCategory, confirmAction, ...args);
  }, [eventCategory, confirmAction]);
  const dismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(eventCategory, dismissAction, ...args);
  }, [eventCategory, dismissAction]);
  const clickLearnMore = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((...args) => {
    return (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.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/WPDashboardReportError.js"
/*!***********************************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WPDashboardReportError.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 */ WPDashboardReportError)
/* 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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useLifecycles.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-instance-id/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__);
/* harmony import */ var _js_components_ReportError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/ReportError */ "./js/components/ReportError.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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WPDashboardReportError 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 WPDashboardReportError({
  moduleSlug,
  error
}) {
  const errorInstanceID = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["default"])(WPDashboardReportError, 'WPDashboardReportError');
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI);
  const errorMessage = error.message;
  const selectInstanceID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI).getValue(`WPDashboardReportError-${moduleSlug}-${errorMessage}`));
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    setValue(`WPDashboardReportError-${moduleSlug}-${errorMessage}`, errorInstanceID);
  }, () => {
    setValue(`WPDashboardReportError-${moduleSlug}-${errorMessage}`, undefined);
  });
  if (selectInstanceID !== errorInstanceID) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_ReportError__WEBPACK_IMPORTED_MODULE_4__["default"], {
    moduleSlug: moduleSlug,
    error: error
  });
}
WPDashboardReportError.propTypes = {
  moduleSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  error: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired
};

/***/ },

/***/ "./js/googlesitekit/widgets/components/WidgetNull.js"
/*!***********************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WidgetNull.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 */ WidgetNull)
/* 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__);
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WidgetNull 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
 */



// This doesn't need to change.

const metadata = {};

// The supported props must match `Null` (except `widgetSlug`).
function WidgetNull({
  widgetSlug
}) {
  (0,_js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_2__["default"])(widgetSlug, _js_components_Null__WEBPACK_IMPORTED_MODULE_1__["default"], metadata);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Null__WEBPACK_IMPORTED_MODULE_1__["default"], {});
}
WidgetNull.propTypes = {
  widgetSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  ..._js_components_Null__WEBPACK_IMPORTED_MODULE_1__["default"].propTypes
};

/***/ },

/***/ "./js/googlesitekit/widgets/components/WidgetRecoverableModules.js"
/*!*************************************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WidgetRecoverableModules.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 */ WidgetRecoverableModules)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_RecoverableModules__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/RecoverableModules */ "./js/components/RecoverableModules.js");
/* harmony import */ var _js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/widgets/hooks/useWidgetStateEffect */ "./js/googlesitekit/widgets/hooks/useWidgetStateEffect.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WidgetRecoverableModules 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
 */



// The supported props must match `RecoverableModules` (except `widgetSlug`).

function WidgetRecoverableModules({
  widgetSlug,
  moduleSlugs,
  ...props
}) {
  const metadata = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    // Here we serialize to `moduleSlug` for compatibility with the logic in
    // `combineWidgets()`. In future we may wish to take a less "hacky" approach.
    // See https://github.com/google/site-kit-wp/issues/5376#issuecomment-1165771399.
    moduleSlug: [...moduleSlugs].sort().join(','),
    // We also store `moduleSlugs` in the metadata in order for it to be passed back
    // into RecoverableModules as a prop.
    // See https://github.com/google/site-kit-wp/blob/c272c20eddcca61aae24c9812b6b11dbc15ec673/assets/js/googlesitekit/widgets/components/WidgetAreaRenderer.js#L171.
    moduleSlugs
  }), [moduleSlugs]);
  (0,_js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_3__["default"])(widgetSlug, _js_components_RecoverableModules__WEBPACK_IMPORTED_MODULE_2__["default"], metadata);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_RecoverableModules__WEBPACK_IMPORTED_MODULE_2__["default"], {
    moduleSlugs: moduleSlugs,
    ...props
  });
}
WidgetRecoverableModules.propTypes = {
  widgetSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  ..._js_components_RecoverableModules__WEBPACK_IMPORTED_MODULE_2__["default"].propTypes
};

/***/ },

/***/ "./js/googlesitekit/widgets/components/WidgetReportError.js"
/*!******************************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WidgetReportError.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 */ WidgetReportError)
/* 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__);
/* harmony import */ var _js_components_ReportError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/ReportError */ "./js/components/ReportError.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WidgetReportError 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
 */


// eslint-disable-next-line no-unused-vars

function WidgetReportError({
  widgetSlug,
  ...props
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_ReportError__WEBPACK_IMPORTED_MODULE_1__["default"], {
    ...props
  });
}
WidgetReportError.propTypes = {
  widgetSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  ..._js_components_ReportError__WEBPACK_IMPORTED_MODULE_1__["default"].propTypes
};

/***/ },

/***/ "./js/googlesitekit/widgets/components/WidgetReportZero.js"
/*!*****************************************************************!*\
  !*** ./js/googlesitekit/widgets/components/WidgetReportZero.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 */ WidgetReportZero)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_ReportZero__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/ReportZero */ "./js/components/ReportZero.js");
/* harmony import */ var _js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/widgets/hooks/useWidgetStateEffect */ "./js/googlesitekit/widgets/hooks/useWidgetStateEffect.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WidgetReportZero 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
 */



// The supported props must match `ReportZero` (except `widgetSlug`).

function WidgetReportZero({
  widgetSlug,
  moduleSlug,
  ...props
}) {
  const metadata = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => ({
    moduleSlug
  }), [moduleSlug]);
  (0,_js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_3__["default"])(widgetSlug, _js_components_ReportZero__WEBPACK_IMPORTED_MODULE_2__["default"], metadata);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_ReportZero__WEBPACK_IMPORTED_MODULE_2__["default"], {
    moduleSlug: moduleSlug,
    ...props
  });
}
WidgetReportZero.propTypes = {
  widgetSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  ..._js_components_ReportZero__WEBPACK_IMPORTED_MODULE_2__["default"].propTypes
};

/***/ },

/***/ "./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_SITE_GOALS_PRIMARY: () => (/* binding */ AREA_MAIN_DASHBOARD_SITE_GOALS_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 */   AREA_MAIN_DASHBOARD_TRAFFIC_READER_REVENUE_MANAGER: () => (/* binding */ AREA_MAIN_DASHBOARD_TRAFFIC_READER_REVENUE_MANAGER),
/* 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_SITE_GOALS_PRIMARY = 'mainDashboardSiteGoalsPrimary';
const AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY = 'mainDashboardTrafficPrimary';
const AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION = 'mainDashboardTrafficAudienceSegmentation';
const AREA_MAIN_DASHBOARD_TRAFFIC_READER_REVENUE_MANAGER = 'mainDashboardTrafficReaderRevenueManager';
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_SITE_GOALS_PRIMARY,
  AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY,
  AREA_MAIN_DASHBOARD_TRAFFIC_READER_REVENUE_MANAGER,
  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_SITE_GOALS: () => (/* binding */ CONTEXT_MAIN_DASHBOARD_SITE_GOALS),
/* 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_SITE_GOALS = 'mainDashboardSiteGoals';
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_SITE_GOALS,
  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/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_0__ = __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_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __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_1__.useDispatch)(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_WIDGETS);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    setWidgetState(widgetSlug, Component, metadata);
    return () => {
      unsetWidgetState(widgetSlug, Component, metadata);
    };
  }, [widgetSlug, Component, metadata, setWidgetState, unsetWidgetState]);
}

/***/ },

/***/ "./js/googlesitekit/widgets/util/combine-widgets.js"
/*!**********************************************************!*\
  !*** ./js/googlesitekit/widgets/util/combine-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 */   combineWidgets: () => (/* binding */ combineWidgets)
/* 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 _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./js/googlesitekit/widgets/util/constants.js");
/**
 * Widgets combination 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
 */

function stateAndRowMatch(stateA, stateB, rowA, rowB) {
  return rowA === rowB && (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isEqual)(stateA, stateB);
}

/**
 * Determines whether all the widgets in a given area should be combined.
 *
 * The given widgets in an area can all be combined if they are
 * all from the same module and they are all in the same special
 * state (see #3225).
 *
 * @since 1.34.0
 *
 * @param {Array.<Object>} widgets      List of widgets.
 * @param {Object}         widgetStates Map of widget slug and their
 *                                      state (either an object with
 *                                      `Component` and `metadata`, or
 *                                      `null`).
 * @return {boolean} 			Whether all the widgets should be combined.
 */
function shouldCombineAllWidgets(widgets, widgetStates) {
  const states = {};
  for (let index = 0; index < widgets.length; index++) {
    const widget = widgets[index];
    const widgetState = widgetStates?.[widget.slug];
    const state = widgetState?.Component;
    const module = widgetState?.metadata?.moduleSlug;
    const isSpecialState = _constants__WEBPACK_IMPORTED_MODULE_1__.SPECIAL_WIDGET_STATES.includes(state);
    if (!state || !module || !isSpecialState) {
      return false;
    }
    if (states[module]) {
      if (states[module] !== state) {
        // We have a widget from a given module in a different state from the others.
        return false;
      }
    } else {
      states[module] = state;
    }
  }
  if (Object.keys(states).length > 1) {
    // We have multiple modules, so the widgets can't be combined.
    return false;
  }
  return true;
}

/*
 * Combines consecutive widgets with similar states within the same row.
 *
 * @since 1.25.0
 *
 * @param {Array.<Object>} widgets             List of widgets.
 * @param {Object}         widgetStates        Map of widget slug and their
 *                                             state (either an object with
 *                                             `Component` and `metadata`, or
 *                                             `null`).
 * @param {Object}         layout              Layout arguments from
 *                                             	`getWidgetLayout()`.
 * @param {Array.<number>} layout.columnWidths List of column widths for each
 *                                             widget.
 * @param {Array.<number>} layout.rowIndexes   List of row indexes for each
 *                                             widget.
 * @return {Object} Object with `overrideComponents` property, both of which are a
 * 					list with one item for each widget. Every `overrideComponents`
 * 					entry is either an object with `Component` and `metadata`, or
 * 					`null` (similar to the `widgetStates` parameter).
 */
function combineWidgets(widgets, widgetStates, {
  columnWidths,
  rowIndexes
}) {
  const overrideComponents = [];
  const gridColumnWidths = [...columnWidths];
  if (!widgets?.length) {
    return {
      gridColumnWidths,
      overrideComponents
    };
  }
  let currentState = null;
  let currentRowIndex = -1;
  let columnWidthsBuffer = [];
  if (shouldCombineAllWidgets(widgets, widgetStates)) {
    // All the widgets have the same state, so we should only render one and hide the rest.
    const hiddenRows = Array.from({
      length: widgets.length - 1
    }).fill(0);
    // Since all the components are the same, we can just pick the first.
    const overrideComponent = widgetStates[widgets[0].slug];
    return {
      overrideComponents: [overrideComponent],
      gridColumnWidths: [12,
      // Full width row.
      ...hiddenRows]
    };
  }
  widgets.forEach((widget, index) => {
    overrideComponents.push(null);
    currentState = widgetStates[widget.slug];
    currentRowIndex = rowIndexes[index];

    // If the current widget has a special state...
    if (currentState) {
      if (stateAndRowMatch(currentState, widgetStates[widgets[index + 1]?.slug], currentRowIndex, rowIndexes[index + 1])) {
        // If the current widget state and row index match the next
        // state and row index, hide the widget entirely. Only the last
        // similar instance will be rendered in this case.
        columnWidthsBuffer.push(columnWidths[index]);
        // Mark this column as width = 0, so we can hide it
        gridColumnWidths[index] = 0;
      } else if (columnWidthsBuffer.length > 0) {
        // If the state and row index do not match the next ones and
        // there are already similar instances (from previous
        // iterations), this is the last similar instance, so the
        // combined version will need to be displayed instead of the
        // widget. The combined version will use the common Component
        // and pass all common metadata as props.
        columnWidthsBuffer.push(columnWidths[index]);

        // Get total (desktop) column width. For tablet and phone,
        // the component should span the full width as by definition
        // it is at least a "half" widget wide (which has that behavior).
        const combinedColumnWidth = columnWidthsBuffer.reduce((sum, columnWidth) => sum + columnWidth, 0);
        overrideComponents[index] = currentState;

        // This final column should have the combined width
        gridColumnWidths[index] = combinedColumnWidth;

        // Reset the columnWidthsBuffer variable.
        columnWidthsBuffer = [];
      }
    }
  });
  return {
    gridColumnWidths,
    overrideComponents
  };
}

/***/ },

/***/ "./js/googlesitekit/widgets/util/constants.js"
/*!****************************************************!*\
  !*** ./js/googlesitekit/widgets/util/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 */   HIDDEN_CLASS: () => (/* binding */ HIDDEN_CLASS),
/* harmony export */   SPECIAL_WIDGET_STATES: () => (/* binding */ SPECIAL_WIDGET_STATES),
/* harmony export */   WIDTH_GRID_COUNTER_MAP: () => (/* binding */ WIDTH_GRID_COUNTER_MAP)
/* harmony export */ });
/* harmony import */ var _js_components_RecoverableModules__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/RecoverableModules */ "./js/components/RecoverableModules.js");
/* harmony import */ var _js_components_ReportZero__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/ReportZero */ "./js/components/ReportZero.js");
/* harmony import */ var _js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/**
 * Widgets layout 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.
 */

/**
 * Internal dependencies
 */



const WIDTH_GRID_COUNTER_MAP = {
  [_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.WIDGET_WIDTHS.QUARTER]: 3,
  [_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.WIDGET_WIDTHS.HALF]: 6,
  [_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.WIDGET_WIDTHS.FULL]: 12
};
const HIDDEN_CLASS = 'googlesitekit-hidden';
const SPECIAL_WIDGET_STATES = [_js_components_ReportZero__WEBPACK_IMPORTED_MODULE_1__["default"], _js_components_RecoverableModules__WEBPACK_IMPORTED_MODULE_0__["default"]];

/***/ },

/***/ "./js/googlesitekit/widgets/util/get-widget-component-props.js"
/*!*********************************************************************!*\
  !*** ./js/googlesitekit/widgets/util/get-widget-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 */   getWidgetComponentProps: () => (/* binding */ getWidgetComponentProps),
/* harmony export */   withWPDashboardWidgetComponentProps: () => (/* binding */ withWPDashboardWidgetComponentProps),
/* harmony export */   withWidgetComponentProps: () => (/* binding */ withWidgetComponentProps)
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_googlesitekit_widgets_components_Widget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/Widget */ "./js/googlesitekit/widgets/components/Widget.tsx");
/* harmony import */ var _js_googlesitekit_widgets_components_WidgetNull__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetNull */ "./js/googlesitekit/widgets/components/WidgetNull.js");
/* harmony import */ var _js_googlesitekit_widgets_components_WidgetRecoverableModules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetRecoverableModules */ "./js/googlesitekit/widgets/components/WidgetRecoverableModules.js");
/* harmony import */ var _js_googlesitekit_widgets_components_WidgetReportError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetReportError */ "./js/googlesitekit/widgets/components/WidgetReportError.js");
/* harmony import */ var _js_googlesitekit_widgets_components_WidgetReportZero__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetReportZero */ "./js/googlesitekit/widgets/components/WidgetReportZero.js");
/* harmony import */ var _js_googlesitekit_widgets_components_WPDashboardReportError__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WPDashboardReportError */ "./js/googlesitekit/widgets/components/WPDashboardReportError.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Widgets component props 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
 */







/**
 * Widget props type.
 *
 * @since 1.179.0
 *
 * @typedef {Object} WidgetComponentProps
 * @property {string} widgetSlug The widget's slug.
 * @property {WPComponent} Widget The Widget component scoped to the widget instance.
 * @property {WPComponent} WidgetRecoverableModules The WidgetRecoverableModules component scoped to the widget instance.
 * @property {WPComponent} WidgetReportZero The WidgetReportZero component scoped to the widget instance.
 * @property {WPComponent} WidgetReportError The WidgetReportError component scoped to the widget instance.
 * @property {WPComponent} WidgetNull The WidgetNull component scoped to the widget instance.
 */

/**
 * Gets the props to pass to a widget's component.
 *
 * @since 1.25.0
 * @since 1.107.0 Added `widgetSlug` to the returned props.
 *
 * @param {string} widgetSlug The widget's slug.
 * @return {WidgetComponentProps} Props to pass to the widget component.
 */

const getWidgetComponentProps = memize__WEBPACK_IMPORTED_MODULE_0___default()(widgetSlug => {
  // Scope widget-specific components to the widget instance so that the
  // component does not need to (re-)specify the widget slug.
  return {
    widgetSlug,
    Widget: withWidgetSlug(widgetSlug)(_js_googlesitekit_widgets_components_Widget__WEBPACK_IMPORTED_MODULE_2__["default"]),
    WidgetRecoverableModules: withWidgetSlug(widgetSlug)(_js_googlesitekit_widgets_components_WidgetRecoverableModules__WEBPACK_IMPORTED_MODULE_4__["default"]),
    WidgetReportZero: withWidgetSlug(widgetSlug)(_js_googlesitekit_widgets_components_WidgetReportZero__WEBPACK_IMPORTED_MODULE_6__["default"]),
    WidgetReportError: withWidgetSlug(widgetSlug)(_js_googlesitekit_widgets_components_WidgetReportError__WEBPACK_IMPORTED_MODULE_5__["default"]),
    WidgetNull: withWidgetSlug(widgetSlug)(_js_googlesitekit_widgets_components_WidgetNull__WEBPACK_IMPORTED_MODULE_3__["default"])
  };
});
function withWidgetSlug(widgetSlug) {
  return WrappedComponent => {
    const WithWidgetSlug = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.forwardRef)((props, ref) => {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(WrappedComponent, {
        ...props,
        ref: ref,
        widgetSlug: widgetSlug
      });
    });
    WithWidgetSlug.displayName = 'WithWidgetSlug';
    if (WrappedComponent.displayName || WrappedComponent.name) {
      WithWidgetSlug.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return WithWidgetSlug;
  };
}

/**
 * Gets the props and passes them to the widget's component through a HOC.
 *
 * @since 1.26.0
 *
 * @param {string} widgetSlug The slug of the widget.
 * @return {Function} Enhancing function that adds the getWidgetComponentProps to the passed component.
 */
function withWidgetComponentProps(widgetSlug) {
  const widgetComponentProps = getWidgetComponentProps(widgetSlug);
  return WrappedComponent => {
    function DecoratedComponent(props) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(WrappedComponent, {
        ...props,
        ...widgetComponentProps
      });
    }
    DecoratedComponent.displayName = 'WithWidgetComponentProps';
    if (WrappedComponent.displayName || WrappedComponent.name) {
      DecoratedComponent.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return DecoratedComponent;
  };
}

/**
 * Gets the props and passes them to the WP Dashboard widget's component through a HOC.
 *
 * @since 1.114.0
 *
 * @param {string} widgetSlug The slug of the widget.
 * @return {Function} Enhancing function that adds the WP Dashboard specific
 *                    props to the passed component.
 */
function withWPDashboardWidgetComponentProps(widgetSlug) {
  return WrappedComponent => {
    function DecoratedComponent(props) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(WrappedComponent, {
        ...props,
        WPDashboardReportError: withWidgetSlug(widgetSlug)(_js_googlesitekit_widgets_components_WPDashboardReportError__WEBPACK_IMPORTED_MODULE_7__["default"])
      });
    }
    DecoratedComponent.displayName = 'WithWPDashboardWidgetComponentProps';
    if (WrappedComponent.displayName || WrappedComponent.name) {
      DecoratedComponent.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return DecoratedComponent;
  };
}

/***/ },

/***/ "./js/googlesitekit/widgets/util/get-widget-layout.js"
/*!************************************************************!*\
  !*** ./js/googlesitekit/widgets/util/get-widget-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 */   getWidgetLayout: () => (/* binding */ getWidgetLayout)
/* harmony export */ });
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constants */ "./js/googlesitekit/widgets/util/constants.js");
/* harmony import */ var _is_inactive_widget_state__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-inactive-widget-state */ "./js/googlesitekit/widgets/util/is-inactive-widget-state.js");
/**
 * Widgets layout 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
 */



/**
 * Adjusts column widths to better fit into the current row knowing that the default sizes don't fill the row completely.
 *
 * @since 1.21.0
 *
 * @param {Array.<number>} columnWidths Current column widths.
 * @param {number}         counter      Current counter.
 * @return {Array} Array where the first element is the updated list of column
 *                 widths, and the second element is the resulting counter
 *                 after the update.
 */
function resizeColumns(columnWidths, counter) {
  // Safeguard: counter must always be 9 for this to work.
  if (counter !== 9) {
    return [columnWidths, counter];
  }
  columnWidths = [...columnWidths];

  // Start counting backwards from the last item.
  let index = columnWidths.length - 1;

  // Go back until counter is 0. The i >= 0 check is an extra safeguard that, with
  // correct usage should never apply, but is still useful to avoid infinite loops
  // if the function was used incorrectly.
  while (counter !== 0 && index >= 0) {
    // Replace the 3-column width with a 4-column width, or the 6-column
    // width with an 8-column width so that the overall row expands from
    // 9 to the full 12 columns.
    if (columnWidths[index] === 3) {
      counter -= 3;
      columnWidths[index] = 4; // Correct the column width.
    } else if (columnWidths[index] === 6) {
      counter -= 6;
      columnWidths[index] = 8; // Correct the column width.
    }
    index--;
  }
  return [columnWidths, counter];
}

/**
 * Gets an array of sizes that widget can take accounting the current counter value.
 *
 * @since 1.21.0
 *
 * @param {number} counter The current counter.
 * @param {Object} widget  Widget object.
 * @return {Array.<Object>} List of objects with `counter` and `width` properties.
 */
function getWidgetSizes(counter, widget) {
  const widths = Array.isArray(widget.width) ? widget.width : [widget.width];
  return widths.map(width => ({
    counter: counter + _constants__WEBPACK_IMPORTED_MODULE_0__.WIDTH_GRID_COUNTER_MAP[width],
    width
  }));
}

/**
 * Gets the first active widget in a list of widgets, after a specified offset,
 * based on a set of widget states specifying which widgets are inactive.
 *
 * @since 1.28.0
 * @private
 *
 * @param {number}         offset       The current index offset.
 * @param {Array.<Object>} widgets      List of widgets.
 * @param {Array.<Object>} widgetStates List of widget states.
 * @return {Object|null} Object representing the next active widget from the widgets array,
 * or null if no more active widgets exist.
 */
function getNextActiveWidget(offset, widgets, widgetStates) {
  while (++offset < widgets.length) {
    if (!(0,_is_inactive_widget_state__WEBPACK_IMPORTED_MODULE_1__.isInactiveWidgetState)(widgetStates[widgets[offset].slug])) {
      return widgets[offset];
    }
  }
  return null;
}

/**
 * Gets widget class names as well as column widths and row indexes for an area.
 *
 * @since 1.25.0
 *
 * @param {Array.<Object>} widgets      List of widgets.
 * @param {Array.<Object>} widgetStates List of widget states.
 * @return {Object} Object with `columnWidths` and `rowIndexes`
 *                  properties, each of which is an array with one item for
 *                  each active widget.
 */
function getWidgetLayout(widgets, widgetStates) {
  let columnWidths = [];
  const rowIndexes = [];
  if (!widgets?.length) {
    return {
      columnWidths,
      rowIndexes
    };
  }
  let counter = 0;
  let rowIndex = 0;
  function ascending({
    counter: a
  }, {
    counter: b
  }) {
    return a - b;
  }
  function descending({
    counter: a
  }, {
    counter: b
  }) {
    return b - a;
  }
  function fitIntoRow({
    counter: width
  }) {
    return width <= 12;
  }
  widgets.forEach((widget, index) => {
    // If a widget is inactive, we set null / 0 values and don't need to calculate a layout.

    if ((0,_is_inactive_widget_state__WEBPACK_IMPORTED_MODULE_1__.isInactiveWidgetState)(widgetStates[widget.slug])) {
      columnWidths.push(0);
      rowIndexes.push(rowIndex);
      return;
    }

    // Get available sizes for the current widget to select the most appropriate width for the current row.
    let sizes = getWidgetSizes(counter, widget);

    // Get the next active widget to help determine the best width for this widget.
    const nextActiveWidget = getNextActiveWidget(index, widgets, widgetStates);
    if (
    // If it is the last widget in the entire widget area.
    null === nextActiveWidget ||
    // Or the next widget can't fit into the current row anyway, then we can try to use alternative sizes.
    getWidgetSizes(sizes.sort(ascending)[0].counter, nextActiveWidget).filter(fitIntoRow).length === 0) {
      // We need to check whether we have a size that can fit into the row and if so, try to get it.
      const hasSizeThatCanFitIntoRow = sizes.some(fitIntoRow);
      if (hasSizeThatCanFitIntoRow) {
        // Sort available sizes to have the descending order.
        sizes = sizes.sort(descending);
        // Filter out only those sizes that fit into the current row.
        sizes = sizes.filter(fitIntoRow);
      }
    }

    // Grab the width of the first size in the sizes list, it's either the default one or the best suiting to the current row.
    const width = sizes[0].width;

    // Populate row index for the widget. The value may be corrected further below.
    rowIndexes.push(rowIndex);

    // Increase column counter based on width.
    counter += _constants__WEBPACK_IMPORTED_MODULE_0__.WIDTH_GRID_COUNTER_MAP[width];

    // If counter is going above 12, this widget is too wide for the current row.
    // So it's going to be the first widget in the next row instead.
    if (counter > 12) {
      counter -= _constants__WEBPACK_IMPORTED_MODULE_0__.WIDTH_GRID_COUNTER_MAP[width];

      // Correct the previously added row index for this widget as it
      // will end up in the following row.
      rowIndexes[index]++;

      // If the column count without the overflowing widget is exactly 9, expand
      // the widths of these widgets slightly to fill the entire 12 columns.
      if (counter === 9) {
        [columnWidths, counter] = resizeColumns(columnWidths, counter);
      }

      // See above, initial counter for the next row of widgets.
      counter = _constants__WEBPACK_IMPORTED_MODULE_0__.WIDTH_GRID_COUNTER_MAP[width];
      rowIndex++;
    } else if (counter === 12) {
      // Or if the counter is exactly 12, the next widget is going to be in a new row.
      counter = 0;
      rowIndex++;
    }

    // Actually set the columnWidth for the current widget. This must be set after
    // potentially resizing, since in that case this will be the overflowing
    // widget which should NOT be adjusted because it will be in the next row.
    columnWidths.push(_constants__WEBPACK_IMPORTED_MODULE_0__.WIDTH_GRID_COUNTER_MAP[width]);
  });
  if (counter === 9) {
    [columnWidths, counter] = resizeColumns(columnWidths, counter);
  }
  return {
    columnWidths,
    rowIndexes
  };
}

/***/ },

/***/ "./js/googlesitekit/widgets/util/index.js"
/*!************************************************!*\
  !*** ./js/googlesitekit/widgets/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 */   HIDDEN_CLASS: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.HIDDEN_CLASS),
/* harmony export */   SPECIAL_WIDGET_STATES: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.SPECIAL_WIDGET_STATES),
/* harmony export */   WIDTH_GRID_COUNTER_MAP: () => (/* reexport safe */ _constants__WEBPACK_IMPORTED_MODULE_3__.WIDTH_GRID_COUNTER_MAP),
/* harmony export */   combineWidgets: () => (/* reexport safe */ _combine_widgets__WEBPACK_IMPORTED_MODULE_1__.combineWidgets),
/* harmony export */   getWidgetComponentProps: () => (/* reexport safe */ _get_widget_component_props__WEBPACK_IMPORTED_MODULE_2__.getWidgetComponentProps),
/* harmony export */   getWidgetLayout: () => (/* reexport safe */ _get_widget_layout__WEBPACK_IMPORTED_MODULE_0__.getWidgetLayout),
/* harmony export */   isInactiveWidgetState: () => (/* reexport safe */ _is_inactive_widget_state__WEBPACK_IMPORTED_MODULE_5__.isInactiveWidgetState),
/* harmony export */   normalizeWidgetModules: () => (/* reexport safe */ _widget_modules__WEBPACK_IMPORTED_MODULE_4__.normalizeWidgetModules),
/* harmony export */   withWPDashboardWidgetComponentProps: () => (/* reexport safe */ _get_widget_component_props__WEBPACK_IMPORTED_MODULE_2__.withWPDashboardWidgetComponentProps),
/* harmony export */   withWidgetComponentProps: () => (/* reexport safe */ _get_widget_component_props__WEBPACK_IMPORTED_MODULE_2__.withWidgetComponentProps)
/* harmony export */ });
/* harmony import */ var _get_widget_layout__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-widget-layout */ "./js/googlesitekit/widgets/util/get-widget-layout.js");
/* harmony import */ var _combine_widgets__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./combine-widgets */ "./js/googlesitekit/widgets/util/combine-widgets.js");
/* harmony import */ var _get_widget_component_props__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-widget-component-props */ "./js/googlesitekit/widgets/util/get-widget-component-props.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/googlesitekit/widgets/util/constants.js");
/* harmony import */ var _widget_modules__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./widget-modules */ "./js/googlesitekit/widgets/util/widget-modules.js");
/* harmony import */ var _is_inactive_widget_state__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is-inactive-widget-state */ "./js/googlesitekit/widgets/util/is-inactive-widget-state.js");
/**
 * Widgets API 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.
 */








/***/ },

/***/ "./js/googlesitekit/widgets/util/is-inactive-widget-state.js"
/*!*******************************************************************!*\
  !*** ./js/googlesitekit/widgets/util/is-inactive-widget-state.js ***!
  \*******************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isInactiveWidgetState: () => (/* binding */ isInactiveWidgetState)
/* harmony export */ });
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/**
 * Is inactive widget 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.
 */

/**
 * Internal dependencies
 */


/**
 * Combines consecutive widgets with similar states within the same row.
 *
 * @since 1.28.0
 *
 * @param {Object|null} widgetState Widget state (either an object with `Component` and `metadata`, or `null`).
 * @return {boolean} True if widget is inactive, otherwise false.
 */
function isInactiveWidgetState(widgetState) {
  return !!widgetState && widgetState.Component === _js_components_Null__WEBPACK_IMPORTED_MODULE_0__["default"];
}

/***/ },

/***/ "./js/googlesitekit/widgets/util/widget-modules.js"
/*!*********************************************************!*\
  !*** ./js/googlesitekit/widgets/util/widget-modules.js ***!
  \*********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   normalizeWidgetModules: () => (/* binding */ normalizeWidgetModules)
/* harmony export */ });
/**
 * Widget's modules utility.
 *
 * 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.
 */

/**
 * Normalizes widget's modules by converting it to an array and filtering out all non-string values.
 *
 * @since 1.71.0
 *
 * @param {string|Array.<string>} modules Widget's mdoules.
 * @return {Array.<string>} Widget's modules list.
 */
function normalizeWidgetModules(modules) {
  return (Array.isArray(modules) ? modules : [modules]).filter(module => typeof module === 'string' && module.length > 0);
}

/***/ },

/***/ "./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_0__ = __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_api_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.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_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_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_util_tracking__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util/tracking */ "./js/util/tracking/index.js");
/* harmony import */ var _useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __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.
 * @param {Object} [options]  Optional. Activation options with `redirectQueryArgs`.
 * @return {Function|null} Callback to activate module, null if the module doesn't exist or the user can't manage options.
 */
function useActivateModuleCallback(moduleSlug, options = {}) {
  const viewContext = (0,_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES).getModule(moduleSlug));
  const canManageOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.PERMISSION_MANAGE_OPTIONS));
  const {
    activateModule
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_LOCATION);
  const {
    setInternalServerError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE);
  const activateModuleCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    const {
      error,
      response
    } = await activateModule(moduleSlug, options);
    if (!error) {
      await (0,_js_util_tracking__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_widget-activation-cta`, 'activate_module', moduleSlug);
      await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_2__.setItem)('module_setup', moduleSlug, {
        ttl: 300
      });
      navigateTo(response.moduleReauthURL);
    } else {
      setInternalServerError({
        id: `${moduleSlug}-setup-error`,
        description: error.message
      });
    }
  }, [activateModule, moduleSlug, options, navigateTo, setInternalServerError, viewContext]);
  if (!module?.name || !canManageOptions) {
    return null;
  }
  return activateModuleCallback;
}

/***/ },

/***/ "./js/hooks/useCompleteModuleActivationCallback.js"
/*!*********************************************************!*\
  !*** ./js/hooks/useCompleteModuleActivationCallback.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 */ useCompleteModuleActivationCallback)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_location_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/**
 * `useCompleteModuleActivationCallback` 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 navigate users to the module's authentication URL.
 *
 * Returns null if the module doesn't exist or the user can't manage options.
 *
 * @since 1.73.0
 *
 * @param {string} moduleSlug Module slug.
 * @return {Function|null} Callback that navigates to a module's reauth URL, null if the module doesn't exist or the user can't manage options.
 */
function useCompleteModuleActivationCallback(moduleSlug) {
  const canManageOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.PERMISSION_MANAGE_OPTIONS));
  const moduleStoreName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).getModuleStoreName(moduleSlug));
  const adminReauthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(moduleStoreName)?.getAdminReauthURL());
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_LOCATION);
  const completeModuleActivationCallback = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => navigateTo(adminReauthURL), [adminReauthURL, navigateTo]);
  if (!adminReauthURL || !canManageOptions) {
    return null;
  }
  return completeModuleActivationCallback;
}

/***/ },

/***/ "./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 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 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 _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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_FeaturesProvider_FeaturesContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/FeaturesProvider/FeaturesContext */ "./js/components/FeaturesProvider/FeaturesContext.js");
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_2__ = __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_0__.useContext)(_js_components_FeaturesProvider_FeaturesContext__WEBPACK_IMPORTED_MODULE_1__["default"]);
  return (0,_js_features__WEBPACK_IMPORTED_MODULE_2__.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_0__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/components/use-dispatch/use-dispatch.js");
/* 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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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");
/**
 * 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
 * @since 1.180.0 Update the hook to return a function to set the value in addition to the value itself.
 *
 * @param {string} formName The name of the form.
 * @param {string} key      The key of the form field.
 * @return {Array} An array containing the value and a function to update it.
 */
function useFormValue(formName, key) {
  const {
    setValues
  } = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_0__["default"])(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_FORMS);

  /**
   * Sets the value of the form field in question.
   *
   * @since 1.180.0
   *
   * @param {string|number|boolean|Array|Object|undefined} value The value of the form field.
   */
  const setValue = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(value => {
    setValues(formName, {
      [key]: value
    });
  }, [setValues, formName, key]);
  const value = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["default"])(select => {
    const {
      getValue
    } = select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_FORMS);
    return getValue(formName, key);
  }, [formName, key]);
  return [value, setValue];
}

/***/ },

/***/ "./js/hooks/useForwardableParams.js"
/*!******************************************!*\
  !*** ./js/hooks/useForwardableParams.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 */ useForwardableParams)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.js");
/**
 * `useForwardableParams` 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.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */


/**
 * Gets splash/auth params that should be forwarded to dashboard URLs.
 *
 * @since 1.174.0
 *
 * @return {Object} Forwardable query params.
 */
function useForwardableParams() {
  const [notification] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_1__["default"])('notification');
  const [panel] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_1__["default"])('panel');

  // `useMemo` is used here to avoid unnecessary re-renders of
  // components that consume this hook when the query params
  // haven't changed.
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useMemo)(() => {
    const params = {};
    if (notification) {
      params.notification = notification;
    }
    if (panel) {
      params.panel = panel;
    }
    return params;
  }, [notification, panel]);
}

/***/ },

/***/ "./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_0__ = __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_api_cache__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/api/cache */ "./js/googlesitekit/api/cache.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_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");
/* harmony import */ var _useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./useViewContext */ "./js/hooks/useViewContext.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_6__["default"])();
  const isUsingProxy = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).isUsingProxy());
  const setupErrorMessage = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getSetupErrorMessage());
  const setupFlowRefreshEnabled = (0,_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefresh');
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (setupFlowRefreshEnabled) {
      return;
    }
    async function trackEvents() {
      const startUserSetup = await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_2__.getItem)('start_user_setup');
      const startSiteSetup = await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_2__.getItem)('start_site_setup');
      if (startUserSetup.cacheHit) {
        await (0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_2__.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_2__.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_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useUpdateEffect.js");
/* 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 _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_3__ = __webpack_require__(/*! @/js/components/InViewProvider/InViewContext */ "./js/components/InViewProvider/InViewContext.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __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_3__["default"]);
  const [hasBeenInViewOnce, setHasBeenInViewOnce] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const resetCount = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["default"])(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI).getInViewResetCount());
  const forceInView = (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_1__["default"])(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.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_0__["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_0__ = __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_2__ = __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_2__.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_0__["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 globalThis.IntersectionObserver === 'function') {
      function handler(entries) {
        setIntersectionObserverEntry(entries[entries.length - 1]);
      }
      const observer = new globalThis.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/add-query-args.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.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 = globalThis) {
  const [value, setValue] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.getQueryArg)(_global.location.href, key) || initialValue);
  function onSetValue(newValue) {
    setValue(newValue);
    const url = new URL(_global.location.href);
    const {
      hash
    } = url;
    url.hash = '';
    const newURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.addQueryArgs)(url.href, {
      [key]: newValue
    }) + hash;
    _global.history.replaceState(null, '', newURL);
  }
  return [value, onSetValue];
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (useQueryArg);

/***/ },

/***/ "./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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_1__ = __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
 */


/**
 * Internal 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_0__.useContext)(_js_components_Root_ViewContextContext__WEBPACK_IMPORTED_MODULE_1__["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/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_8__.Cell),
/* harmony export */   Dialog: () => (/* reexport default from dynamic */ _material_react_dialog__WEBPACK_IMPORTED_MODULE_5___default.a),
/* harmony export */   DialogContent: () => (/* reexport safe */ _material_react_dialog__WEBPACK_IMPORTED_MODULE_5__.DialogContent),
/* harmony export */   DialogFooter: () => (/* reexport safe */ _material_react_dialog__WEBPACK_IMPORTED_MODULE_5__.DialogFooter),
/* harmony export */   Grid: () => (/* reexport safe */ _layout__WEBPACK_IMPORTED_MODULE_8__.Grid),
/* harmony export */   MDCCheckbox: () => (/* reexport safe */ _material_checkbox__WEBPACK_IMPORTED_MODULE_0__.MDCCheckbox),
/* harmony export */   MDCDialog: () => (/* reexport safe */ _material_dialog__WEBPACK_IMPORTED_MODULE_1__.MDCDialog),
/* harmony export */   MDCFormField: () => (/* reexport safe */ _material_form_field__WEBPACK_IMPORTED_MODULE_2__.MDCFormField),
/* harmony export */   MDCMenu: () => (/* reexport safe */ _material_menu__WEBPACK_IMPORTED_MODULE_3__.MDCMenu),
/* harmony export */   MDCRadio: () => (/* reexport safe */ _material_radio__WEBPACK_IMPORTED_MODULE_4__.MDCRadio),
/* harmony export */   MDCRipple: () => (/* reexport safe */ _material_ripple__WEBPACK_IMPORTED_MODULE_6__.MDCRipple),
/* harmony export */   MDCSwitch: () => (/* reexport safe */ _material_switch__WEBPACK_IMPORTED_MODULE_7__.MDCSwitch),
/* harmony export */   Row: () => (/* reexport safe */ _layout__WEBPACK_IMPORTED_MODULE_8__.Row)
/* harmony export */ });
/* harmony import */ var _material_checkbox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @material/checkbox */ "../node_modules/@material/checkbox/component.js");
/* harmony import */ var _material_dialog__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @material/dialog */ "../node_modules/@material/dialog/component.js");
/* harmony import */ var _material_form_field__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @material/form-field */ "../node_modules/@material/form-field/component.js");
/* harmony import */ var _material_menu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @material/menu */ "../node_modules/@material/menu/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_react_dialog__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @material/react-dialog */ "../node_modules/@material/react-dialog/dist/index.js");
/* harmony import */ var _material_react_dialog__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_material_react_dialog__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var _material_ripple__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @material/ripple */ "../node_modules/@material/ripple/component.js");
/* harmony import */ var _material_switch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @material/switch */ "../node_modules/@material/switch/component.js");
/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./layout */ "./js/material-components/layout/index.ts");
/**
 * 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/modules/ads/constants.js"
/*!*************************************!*\
  !*** ./js/modules/ads/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_ADS: () => (/* binding */ MODULE_SLUG_ADS)
/* harmony export */ });
/**
 * Ads 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_ADS = 'ads';

/***/ },

/***/ "./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/analytics-4/components/DashboardMainEffectComponent.js"
/*!***************************************************************************!*\
  !*** ./js/modules/analytics-4/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_modules_analytics_4_hooks_useCreateCustomDimensionForAudienceEffect__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useCreateCustomDimensionForAudienceEffect */ "./js/modules/analytics-4/hooks/useCreateCustomDimensionForAudienceEffect.js");
/* harmony import */ var _js_modules_analytics_4_hooks_useCreateCustomDimensionsEffect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useCreateCustomDimensionsEffect */ "./js/modules/analytics-4/hooks/useCreateCustomDimensionsEffect.js");
/* harmony import */ var _js_modules_analytics_4_hooks_useSyncGoogleTagEffect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useSyncGoogleTagEffect */ "./js/modules/analytics-4/hooks/useSyncGoogleTagEffect.js");
/**
 * DashboardMainEffectComponent 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.
 */

/**
 * Internal dependencies
 */



function DashboardMainEffectComponent() {
  (0,_js_modules_analytics_4_hooks_useCreateCustomDimensionForAudienceEffect__WEBPACK_IMPORTED_MODULE_0__["default"])();
  (0,_js_modules_analytics_4_hooks_useCreateCustomDimensionsEffect__WEBPACK_IMPORTED_MODULE_1__["default"])();
  (0,_js_modules_analytics_4_hooks_useSyncGoogleTagEffect__WEBPACK_IMPORTED_MODULE_2__["default"])();
  return null;
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceAreaFooter.js"
/*!*************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceAreaFooter.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 */ AudienceAreaFooter)
/* 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_SourceLink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* 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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceAreaFooter 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 AudienceAreaFooter() {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates());
  const sourceLinkURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getServiceReportURL('audiences', {
      dates
    });
  });
  const isAnalyticsConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4));
  if (!isAnalyticsConnected) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_2__["default"], {
    className: "googlesitekit-audience-widget__source",
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Analytics', 'Service name', 'google-site-kit'),
    href: sourceLinkURL,
    external: true
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceErrorModal.js"
/*!*************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceErrorModal.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 */ AudienceErrorModal)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Portal__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Portal */ "./js/components/Portal.js");
/* harmony import */ var _js_components_RefocusableModalDialog__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/RefocusableModalDialog */ "./js/components/RefocusableModalDialog.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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Segmentation AudienceErrorModal 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 AudienceErrorModal({
  apiErrors,
  hasOAuthError,
  inProgress,
  title,
  description,
  trackEventCategory,
  onCancel = () => {},
  onRetry = () => {}
}) {
  const errors = Array.isArray(apiErrors) ? apiErrors : [apiErrors];
  const helpLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getErrorTroubleshootingLinkURL({
    code: 'analytics-4_insufficient_permissions'
  }));
  const requestAccessURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceEntityAccessURL());
  const errorTroubleshootingLinkURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getErrorTroubleshootingLinkURL({
    code: 'access_denied'
  }));
  if (!errors.length && !hasOAuthError) {
    return null;
  }
  const hasInsufficientPermissionsError = errors.some(error => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_10__.isInsufficientPermissionsError)(error));
  function handleConfirm() {
    let action;
    if (hasOAuthError) {
      action = 'auth_error_retry';
    } else if (hasInsufficientPermissionsError) {
      action = 'insufficient_permissions_error_request_access';
    } else {
      action = 'setup_error_retry';
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(trackEventCategory, action).finally(() => {
      if (!hasInsufficientPermissionsError) {
        onRetry();
      }
    });
  }
  function handleCancel() {
    let action;
    if (hasOAuthError) {
      action = 'auth_error_cancel';
    } else if (hasInsufficientPermissionsError) {
      action = 'insufficient_permissions_error_cancel';
    } else {
      action = 'setup_error_cancel';
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(trackEventCategory, action).finally(onCancel);
  }
  let errorTitle, errorDescription, confirmButton, buttonLink;
  if (hasOAuthError) {
    errorTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Analytics update failed', 'google-site-kit');
    errorDescription = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Setup was interrupted because you did not grant the necessary permissions. <HelpLink />', 'google-site-kit'), {
      HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: errorTroubleshootingLinkURL,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Get help', 'google-site-kit')
      })
    });
    confirmButton = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Retry', 'google-site-kit');
  } else if (hasInsufficientPermissionsError) {
    errorTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Insufficient permissions', 'google-site-kit');
    errorDescription = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You’ll need to contact your administrator. Trouble getting access? <HelpLink />', 'google-site-kit'), {
      HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: helpLink,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Get help', 'google-site-kit')
      })
    });
    confirmButton = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Request access', 'google-site-kit');
    buttonLink = requestAccessURL;
  } else {
    errorTitle = title || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Failed to set up visitor groups', 'google-site-kit');
    errorDescription = description || (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Oops! Something went wrong. Retry enabling groups.', 'google-site-kit');
    confirmButton = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Retry', 'google-site-kit');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Portal__WEBPACK_IMPORTED_MODULE_5__["default"], {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_RefocusableModalDialog__WEBPACK_IMPORTED_MODULE_6__["default"], {
      buttonLink: buttonLink,
      title: errorTitle,
      subtitle: errorDescription,
      handleConfirm: handleConfirm,
      confirmButton: confirmButton,
      handleCancel: handleCancel,
      onOpen: () => {
        let action;
        if (hasOAuthError) {
          action = 'auth_error';
        } else if (hasInsufficientPermissionsError) {
          action = 'insufficient_permissions_error';
        } else {
          action = 'setup_error';
        }
        (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(trackEventCategory, action);
      },
      onClose: onCancel,
      inProgress: inProgress,
      refocusQuerySelector: "#audience_segmentation_setup_cta-notification .googlesitekit-banner__cta",
      danger: true,
      dialogActive: true
    })
  });
}
AudienceErrorModal.propTypes = {
  apiErrors: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)]),
  hasOAuthError: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  inProgress: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  trackEventCategory: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  onCancel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/ErrorWidgetContent.js"
/*!*********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/ErrorWidgetContent.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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_Typography__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _svg_graphics_audience_segmentation_error_full_width_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/graphics/audience-segmentation-error-full-width.svg */ "./svg/graphics/audience-segmentation-error-full-width.svg");
/* harmony import */ var _ErrorWidgetDetails__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ErrorWidgetDetails */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/ErrorWidgetDetails.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ErrorWidgetContent 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 ErrorWidgetContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({
  Widget,
  errors,
  onRetry,
  onRequestAccess,
  showRetryButton,
  failedAudiences
}, ref) => {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.useBreakpoint)();
  const isMobileBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_SMALL;
  const isTabletBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_TABLET;
  const hasInsufficientPermissionsError = errors.some(_js_util_errors__WEBPACK_IMPORTED_MODULE_6__.isInsufficientPermissionsError);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Widget, {
    ref: ref,
    className: "googlesitekit-audience-segmentation-error-widget",
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Grid, {
      className: "googlesitekit-audience-segmentation-error__widget-primary-cell",
      collapsed: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Row, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          smSize: 6,
          mdSize: 8,
          lgSize: 7,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_3__["default"], {
            as: "h3",
            type: "title",
            size: "large",
            children: hasInsufficientPermissionsError ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Insufficient permissions', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Your visitor groups data loading failed', 'google-site-kit')
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
            className: "googlesitekit-widget-audience-segmentation-error__actions",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_ErrorWidgetDetails__WEBPACK_IMPORTED_MODULE_8__["default"], {
              failedAudiences: failedAudiences,
              showRetryButton: showRetryButton,
              onRetry: onRetry,
              onRequestAccess: onRequestAccess,
              errors: errors,
              hasInsufficientPermissionsError: hasInsufficientPermissionsError
            })
          })]
        }), !isMobileBreakpoint && !isTabletBreakpoint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          className: "googlesitekit-widget-audience-segmentation-error__svg-wrapper",
          smSize: 6,
          mdSize: 3,
          lgSize: 5,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_svg_graphics_audience_segmentation_error_full_width_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
            width: "233px"
          })
        }), isTabletBreakpoint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          className: "googlesitekit-widget-audience-segmentation-error__svg-wrapper",
          mdSize: 8,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_svg_graphics_audience_segmentation_error_full_width_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
            width: "233px"
          })
        }), isMobileBreakpoint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          className: "googlesitekit-widget-audience-segmentation-error__svg-wrapper",
          smSize: 8,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_svg_graphics_audience_segmentation_error_full_width_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
            width: "233px"
          })
        })]
      })
    })
  });
});
ErrorWidgetContent.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  errors: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  onRequestAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  showRetryButton: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  failedAudiences: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string))
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ErrorWidgetContent);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/ErrorWidgetDetails.js"
/*!*********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/ErrorWidgetDetails.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 */ ErrorWidgetDetails)
/* 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__);
/* 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 _js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ReportErrorActions */ "./js/components/ReportErrorActions.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_modules_analytics_4_components_audience_segmentation_dashboard_GetHelpLink__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/GetHelpLink */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/GetHelpLink.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ErrorWidgetDetails 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 ErrorWidgetDetails({
  failedAudiences,
  showRetryButton,
  onRetry,
  onRequestAccess,
  errors,
  hasInsufficientPermissionsError
}) {
  if (failedAudiences?.length) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_4__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Failed to create the following audiences:', 'google-site-kit')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("ul", {
        className: "googlesitekit-widget-audience-segmentation-error__failed-audiences",
        children: failedAudiences.map(audience => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)("li", {
          children: audience
        }, audience))
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        onClick: onRetry,
        danger: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Retry', 'google-site-kit')
      })]
    });
  }
  if (showRetryButton && onRetry) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
      onClick: onRetry,
      danger: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Retry', 'google-site-kit')
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_3__["default"], {
    moduleSlug: "analytics-4",
    error: errors,
    GetHelpLink: hasInsufficientPermissionsError ? _js_modules_analytics_4_components_audience_segmentation_dashboard_GetHelpLink__WEBPACK_IMPORTED_MODULE_5__["default"] : undefined,
    hideGetHelpLink: !hasInsufficientPermissionsError,
    buttonVariant: "danger",
    getHelpClassName: "googlesitekit-error-retry-text",
    onRetry: onRetry,
    onRequestAccess: onRequestAccess
  });
}
ErrorWidgetDetails.propTypes = {
  errors: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  onRequestAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  showRetryButton: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  failedAudiences: prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)),
  hasInsufficientPermissionsError: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/index.js"
/*!********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/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 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/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__);
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_modules_analytics_4_components_audience_segmentation_dashboard_InfoNoticeWidget_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/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__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.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_when_active__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _ErrorWidgetContent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ErrorWidgetContent */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/ErrorWidgetContent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceSegmentationErrorWidget 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 ErrorWidgetContentWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_11__["default"])(_ErrorWidgetContent__WEBPACK_IMPORTED_MODULE_12__["default"]);
function AudienceSegmentationErrorWidget({
  Widget,
  errors,
  onRetry,
  showRetryButton,
  failedAudiences
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI);
  const errorsArray = errors ? (0,lodash__WEBPACK_IMPORTED_MODULE_0__.castArray)(errors) : [];
  const hasInsufficientPermissionsError = errorsArray.some(_js_util_errors__WEBPACK_IMPORTED_MODULE_9__.isInsufficientPermissionsError);
  function handleRetry() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_audiences-all-tiles`, 'data_loading_error_retry').finally(() => {
      setValue(_js_modules_analytics_4_components_audience_segmentation_dashboard_InfoNoticeWidget_constants__WEBPACK_IMPORTED_MODULE_6__.AUDIENCE_INFO_NOTICE_HIDE_UI, false);
      onRetry?.();
    });
  }
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    // Set UI key to hide the info notice.
    setValue(_js_modules_analytics_4_components_audience_segmentation_dashboard_InfoNoticeWidget_constants__WEBPACK_IMPORTED_MODULE_6__.AUDIENCE_INFO_NOTICE_HIDE_UI, true);
  }, [setValue]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(ErrorWidgetContentWithIntersectionObserver, {
    Widget: Widget,
    errors: errorsArray,
    onRetry: handleRetry,
    failedAudiences: failedAudiences,
    onRequestAccess: () => {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_audiences-all-tiles`, 'insufficient_permissions_error_request_access');
    },
    showRetryButton: showRetryButton,
    onInView: () => {
      const action = hasInsufficientPermissionsError ? 'insufficient_permissions_error' : 'data_loading_error';
      (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_audiences-all-tiles`, action);
    }
  });
}
AudienceSegmentationErrorWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired,
  errors: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().object), prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().object))]).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  showRetryButton: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  failedAudiences: prop_types__WEBPACK_IMPORTED_MODULE_1___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_1___default().string))
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_10__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4
})(AudienceSegmentationErrorWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AddGroupNotice.js"
/*!********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AddGroupNotice.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 */ AddGroupNotice)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_InfoNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNotice.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _svg_icons_info_circle_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/icons/info-circle.svg */ "./svg/icons/info-circle.svg");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel Add Group Notice
 *
 * 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 AddGroupNotice() {
  const [twoOrMoreAudiencesSelected, setTwoOrMoreAudiencesSelected] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const isDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isItemDismissed(_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_ADD_GROUP_NOTICE_SLUG));
  const isSelectionPanelOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isFetchingSyncAvailableAudiences());
  const [selectedAudiences] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_SELECTION_FORM, _constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_SELECTED);
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER);
  const onDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    await dismissItem(_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_ADD_GROUP_NOTICE_SLUG);
  }, [dismissItem]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!Array.isArray(selectedAudiences)) {
      return;
    }
    if (selectedAudiences.length > 1) {
      setTwoOrMoreAudiencesSelected(true);
    }

    // If selected items changed to only 1 or less selected audiences
    // reset the value. Otherwise `twoOrMoreAudiencesSelected` always remains `true`.
    // We are checking if selection panel is closed to do that, so notice is not re-surfaced
    // while selection panel is still open.
    if (!isSelectionPanelOpen && selectedAudiences?.length === 1) {
      setTwoOrMoreAudiencesSelected(false);
    }
  }, [selectedAudiences, isSelectionPanelOpen, setTwoOrMoreAudiencesSelected]);
  if (
  // Do not render the notice if the slection panel is dismissed.
  isDismissed ||
  // Has two or more audiences selected.
  twoOrMoreAudiencesSelected ||
  // Items are showing as preview blocks - re-syncing is still in progress.
  isLoading ||
  // There is no audience selected.
  !selectedAudiences?.length) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_InfoNotice__WEBPACK_IMPORTED_MODULE_7__["default"], {
    className: "googlesitekit-audience-selection-panel__add-group-notice",
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('By adding another group to your dashboard, you will be able to compare them and understand which content brings back users from each group', 'google-site-kit'),
    dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it', 'google-site-kit'),
    Icon: _svg_icons_info_circle_svg__WEBPACK_IMPORTED_MODULE_9__["default"],
    onDismiss: onDismiss
  });
}
AddGroupNotice.propTypes = {
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationErrorNotice.js"
/*!*********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationErrorNotice.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 */ AudienceCreationErrorNotice)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_ui_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Segmentation AudienceCreationErrorNotice 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 AudienceCreationErrorNotice({
  apiErrors,
  hasOAuthError
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const errors = Array.isArray(apiErrors) ? apiErrors : [apiErrors];
  const helpLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getErrorTroubleshootingLinkURL({
    code: 'analytics-4_insufficient_permissions'
  }));
  const requestAccessURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getServiceEntityAccessURL());
  const errorTroubleshootingLinkURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getErrorTroubleshootingLinkURL({
    code: 'access_denied'
  }));
  const isOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_14__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));
  const hasErrors = errors.length > 0;
  const hasInsufficientPermissionsError = errors.some(error => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_13__.isInsufficientPermissionsError)(error));

  // Track an event when the notice is viewed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!isOpen || !hasErrors && !hasOAuthError) {
      return;
    }
    let event = 'setup_error';
    if (hasOAuthError) {
      event = 'auth_error';
    } else if (hasInsufficientPermissionsError) {
      event = 'insufficient_permissions_error';
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences`, event);
  }, [hasErrors, hasInsufficientPermissionsError, hasOAuthError, isOpen, viewContext]);
  if (!errors.length && !hasOAuthError) {
    return null;
  }
  let errorTitle, errorDescription;
  if (hasOAuthError) {
    errorDescription = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Setup was interrupted because you didn’t grant the necessary permissions. Click on Create again to retry. If that doesn’t work, <HelpLink />', 'google-site-kit'), {
      HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
        href: errorTroubleshootingLinkURL,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('get help', 'google-site-kit')
      })
    });
  } else if (hasInsufficientPermissionsError) {
    errorTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Insufficient permissions', 'google-site-kit');
    errorDescription = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Contact your administrator. Trouble getting access? <HelpLink />', 'google-site-kit'), {
      HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
        href: helpLink,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Get help', 'google-site-kit')
      })
    });
  } else {
    errorTitle = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Analytics update failed', 'google-site-kit');
    errorDescription = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Click on Create to try again.', 'google-site-kit');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_6__["default"], {
    className: "googlesitekit-audience-creation-error-notice",
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_7__.NOTICE_TYPES.ERROR,
    title: errorTitle,
    description: errorDescription,
    ctaButton: hasInsufficientPermissionsError ? {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Request access', 'google-site-kit'),
      href: requestAccessURL,
      onClick: () => {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences`, 'insufficient_permissions_error_request_access');
      }
    } : undefined,
    hideIcon: true
  });
}
AudienceCreationErrorNotice.propTypes = {
  apiErrors: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([prop_types__WEBPACK_IMPORTED_MODULE_0___default().arrayOf((prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)]),
  hasOAuthError: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationNotice.js"
/*!****************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationNotice.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 */ AudienceCreationNotice)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.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 _js_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_googlesitekit_components_gm2_SpinnerButton__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/components-gm2/SpinnerButton */ "./js/googlesitekit/components-gm2/SpinnerButton.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 _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_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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _AudienceCreationErrorNotice__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./AudienceCreationErrorNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationErrorNotice.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel AudienceCreationNotice 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 AudienceCreationNotice() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_13__["default"])();
  const [isCreatingAudience, setIsCreatingAudience] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
  const siteKitConfigurableAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => {
    const {
      getConfigurableAudiences
    } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4);
    const audiences = getConfigurableAudiences();
    if (undefined === audiences) {
      return undefined;
    }
    if (!audiences.length) {
      return [];
    }
    return audiences.filter(({
      audienceType
    }) => audienceType === 'SITE_KIT_AUDIENCE');
  });
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_UI);
  const isItemDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).isItemDismissed(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_CREATION_NOTICE_SLUG));
  const isEditScopeNoticeDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).isItemDismissed(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_CREATION_EDIT_SCOPE_NOTICE_SLUG));
  const hasAnalytics4EditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.EDIT_SCOPE));
  const isOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));
  function onCloseClick() {
    dismissItem(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_CREATION_NOTICE_SLUG);
  }
  const redirectURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.addQueryArgs)(globalThis.location.href, {
    notification: 'audience_segmentation'
  });
  const {
    setPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER);
  const {
    createAudience,
    syncAvailableAudiences
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4);
  const [isCreatingAudienceFromOAuth, setIsCreatingAudienceFromOAuth] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_12__["default"])(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_CREATION_FORM, 'autoSubmit');
  const [failedAudienceToCreate, setFailedAudienceToCreate] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_12__["default"])(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_CREATION_FORM, 'audienceToCreate');
  const [apiErrors, setApiErrors] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)([]);
  const handleCreateAudience = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async audienceSlug => {
    setIsCreatingAudience(audienceSlug);
    if (!hasAnalytics4EditScope) {
      setIsCreatingAudienceFromOAuth(true);
      setFailedAudienceToCreate(audienceSlug);

      // Set permission scope error to trigger OAuth flow.
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_16__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Additional permissions are required to create a new audience in Analytics.', 'google-site-kit'),
        data: {
          status: 403,
          scopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.EDIT_SCOPE],
          skipModal: true,
          redirectURL
        }
      });
      return;
    }
    setIsCreatingAudienceFromOAuth(false);
    setFailedAudienceToCreate(undefined);
    const {
      error
    } = await createAudience(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.SITE_KIT_AUDIENCE_DEFINITIONS[audienceSlug]);
    if (!!error) {
      setApiErrors([error]);
    } else {
      setApiErrors([]);
    }
    await syncAvailableAudiences();
    setIsCreatingAudience(false);
    if (!error) {
      setValue(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_CREATION_SUCCESS_NOTICE_SLUG, true);
    }
  }, [hasAnalytics4EditScope, createAudience, setIsCreatingAudienceFromOAuth, setFailedAudienceToCreate, syncAvailableAudiences, setPermissionScopeError, redirectURL, setValue]);
  function handleDismissEditScopeNotice() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences`, 'dismiss_oauth_notice').finally(() => {
      dismissItem(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_CREATION_EDIT_SCOPE_NOTICE_SLUG);
    });
  }
  const setupErrorCode = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getSetupErrorCode());
  const hasOAuthError = isCreatingAudienceFromOAuth && setupErrorCode === 'access_denied';
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    async function createAudienceFromOAuth() {
      if (hasAnalytics4EditScope && isCreatingAudienceFromOAuth) {
        setValue(_constants__WEBPACK_IMPORTED_MODULE_18__.AUDIENCE_SELECTION_PANEL_OPENED_KEY, true);
        await handleCreateAudience(failedAudienceToCreate);
      }
    }
    createAudienceFromOAuth();
  }, [failedAudienceToCreate, handleCreateAudience, hasAnalytics4EditScope, isCreatingAudienceFromOAuth, setValue]);

  // Show the notice if the user has no site kit audiences, or has
  // created one, and the user has not dismissed it.
  const shouldShowNotice = !isItemDismissed && siteKitConfigurableAudiences?.length < 2;

  // Track an event when the notice is viewed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (isOpen && shouldShowNotice) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences`, 'view_notice');
    }
  }, [isOpen, shouldShowNotice, viewContext]);

  // Track an event when the OAuth notice is viewed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (isOpen && !hasAnalytics4EditScope && !isEditScopeNoticeDismissed) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences`, 'view_oauth_notice');
    }
  }, [hasAnalytics4EditScope, isEditScopeNoticeDismissed, isOpen, viewContext]);
  if (!shouldShowNotice) {
    return null;
  }
  const siteKitAvailableAudiences = Object.keys(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.SITE_KIT_AUDIENCE_DEFINITIONS).filter(audienceSlug => !siteKitConfigurableAudiences.some(configuredAudience => configuredAudience.audienceSlug === audienceSlug));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsxs)("div", {
    className: "googlesitekit-audience-selection-panel__audience-creation-notice",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)("div", {
      className: "googlesitekit-audience-selection-panel__audience-creation-notice-header",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)("p", {
        className: "googlesitekit-audience-selection-panel__audience-creation-notice-title",
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Create groups suggested by Site Kit', 'google-site-kit')
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsxs)("div", {
      className: "googlesitekit-audience-selection-panel__audience-creation-notice-body",
      children: [siteKitAvailableAudiences && siteKitAvailableAudiences.map(audienceSlug => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsxs)("div", {
        className: "googlesitekit-audience-selection-panel__audience-creation-notice-audience",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsxs)("div", {
          className: "googlesitekit-audience-selection-panel__audience-creation-notice-audience-details",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
            as: "h3",
            type: "title",
            size: "small",
            children: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.SITE_KIT_AUDIENCE_DEFINITIONS[audienceSlug].displayName
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)("p", {
            className: "googlesitekit-audience-selection-panel__audience-creation-notice-audience-description",
            children: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.SITE_KIT_AUDIENCE_DEFINITIONS[audienceSlug].description
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)("div", {
          className: "googlesitekit-audience-selection-panel__audience-creation-notice-audience-button",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)(_js_googlesitekit_components_gm2_SpinnerButton__WEBPACK_IMPORTED_MODULE_8__["default"], {
            spinnerPosition: _js_googlesitekit_components_gm2_SpinnerButton__WEBPACK_IMPORTED_MODULE_8__.SPINNER_POSITION.BEFORE,
            onClick: () => {
              (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences`, 'create_audience', audienceSlug).finally(() => {
                handleCreateAudience(audienceSlug);
              });
            },
            isSaving: isCreatingAudience === audienceSlug,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Create', 'google-site-kit')
          })
        })]
      }, audienceSlug)), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)("div", {
        className: "googlesitekit-audience-selection-panel__audience-creation-notice-dismiss",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
          onClick: onCloseClick,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No thanks', 'google-site-kit')
        })
      })]
    }), !hasAnalytics4EditScope && !isEditScopeNoticeDismissed && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_5__["default"], {
      type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.NOTICE_TYPES.WARNING,
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Creating these groups require more data tracking. You will be directed to update your Analytics property.', 'google-site-kit'),
      dismissButton: {
        onClick: handleDismissEditScopeNotice
      },
      hideIcon: true
    }), (apiErrors.length > 0 || hasOAuthError) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_19__.jsx)(_AudienceCreationErrorNotice__WEBPACK_IMPORTED_MODULE_17__["default"], {
      apiErrors: apiErrors,
      hasOAuthError: hasOAuthError
    })]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationSuccessNotice.js"
/*!***********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationSuccessNotice.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 */ AudienceCreationSuccessNotice)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_check_fill_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/icons/check-fill.svg */ "./svg/icons/check-fill.svg");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Creation Success 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 AudienceCreationSuccessNotice() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI);
  const showSuccessNotice = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_CREATION_SUCCESS_NOTICE_SLUG));
  const isOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));

  // Track an event when the notice is viewed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (isOpen && showSuccessNotice) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences-success`, 'view_notification');
    }
  }, [isOpen, showSuccessNotice, viewContext]);
  if (!showSuccessNotice) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsxs)("div", {
    className: "googlesitekit-audience-selection-panel__success-notice",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "googlesitekit-audience-selection-panel__success-notice-icon",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_svg_icons_check_fill_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
        width: 24,
        height: 24
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("p", {
      className: "googlesitekit-audience-selection-panel__success-notice-message",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Visitor group created successfully!', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)("div", {
      className: "googlesitekit-audience-selection-panel__success-notice-actions",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
        onClick: () => {
          (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_audiences-sidebar-create-audiences-success`, 'dismiss_notification').finally(() => {
            setValue(_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_CREATION_SUCCESS_NOTICE_SLUG, false);
          });
        },
        tertiary: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Got it', 'google-site-kit')
      })
    })]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItem.js"
/*!******************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItem.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 */ AudienceItem)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/BadgeWithTooltip */ "./js/components/BadgeWithTooltip.js");
/* harmony import */ var _js_components_NewBadge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/NewBadge */ "./js/components/NewBadge.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_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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel AudienceItem
 *
 * 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 AudienceItem({
  slug,
  title,
  description,
  subtitle,
  userCount,
  audienceType
}) {
  const newBadgeSlug = `${_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX}${slug}`;
  const [selectedItems, setSelectedItems] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_constants__WEBPACK_IMPORTED_MODULE_11__.AUDIENCE_SELECTION_FORM, _constants__WEBPACK_IMPORTED_MODULE_11__.AUDIENCE_SELECTED);
  const [, setAudienceSelectionChanged] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_constants__WEBPACK_IMPORTED_MODULE_11__.AUDIENCE_SELECTION_FORM, _constants__WEBPACK_IMPORTED_MODULE_11__.AUDIENCE_SELECTION_CHANGED);
  const hasNewBadgeBeenSeen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).hasExpirableItem(newBadgeSlug));
  const isNewBadgeActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).isExpirableItemActive(newBadgeSlug));
  const [siteKitUserCountReportError, otherUserCountReportError] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudienceUserCountReportErrors()) || [];
  const errors = [];
  if (otherUserCountReportError) {
    errors.push(otherUserCountReportError);
  }
  if (siteKitUserCountReportError) {
    errors.push(siteKitUserCountReportError);
  }
  const temporarilyHidden = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).isItemDismissed(`audience-tile-${slug}`));
  const onCheckboxChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(event => {
    setSelectedItems(event.target.checked ? selectedItems.concat([slug]) : selectedItems.filter(selectedItem => selectedItem !== slug));
    setAudienceSelectionChanged(true);
  }, [selectedItems, setSelectedItems, setAudienceSelectionChanged, slug]);

  // Show the new badge if it has not been seen yet, or the badge has been
  // seen and is still active.
  const showNewBadge = 'DEFAULT_AUDIENCE' !== audienceType && (hasNewBadgeBeenSeen === false || isNewBadgeActive);
  const isItemSelected = selectedItems?.includes(slug);
  const id = `audience-selection-checkbox-${slug}`;
  function ItemBadge() {
    if (temporarilyHidden) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_4__["default"], {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Temporarily hidden', 'google-site-kit'),
        tooltipTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Site Kit is collecting data for this group. Once data is available the group will be added to your dashboard.', 'google-site-kit')
      });
    } else if (showNewBadge) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_NewBadge__WEBPACK_IMPORTED_MODULE_5__["default"], {});
    }
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_6__.SelectionPanelItem, {
    id: id,
    slug: slug,
    title: title,
    subtitle: subtitle,
    description: description,
    isItemSelected: isItemSelected,
    onCheckboxChange: onCheckboxChange,
    suffix: errors.length ? '-' : (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(userCount),
    badge: (temporarilyHidden || showNewBadge) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(ItemBadge, {})
  });
}
AudienceItem.propTypes = {
  slug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  subtitle: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  userCount: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired,
  audienceType: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItemPreviewBlock.js"
/*!******************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItemPreviewBlock.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 */ AudienceItemPreviewBlock)
/* 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");
/**
 * AudienceItemPreviewBlock 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.
 */

/**
 * Internal dependencies
 */


function AudienceItemPreviewBlock() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
    className: "googlesitekit-selection-panel__loading",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
      className: "googlesitekit-selection-panel__loading-left",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
        width: "90px",
        height: "20px",
        className: "googlesitekit-selection-panel__loading-item"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
        width: "293px",
        height: "15px",
        className: "googlesitekit-selection-panel__loading-item"
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
      className: "googlesitekit-selection-panel__loading-right",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
        width: "43px",
        height: "20px",
        className: "googlesitekit-selection-panel__loading-item"
      })
    })]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItems.js"
/*!*******************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItems.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 */ AudienceItems)
/* 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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useDeepCompareEffect.js");
/* 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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/SelectionPanel */ "./js/components/SelectionPanel/index.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _AddGroupNotice__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AddGroupNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AddGroupNotice.js");
/* harmony import */ var _AudienceCreationNotice__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./AudienceCreationNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationNotice.js");
/* harmony import */ var _AudienceItem__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./AudienceItem */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItem.js");
/* harmony import */ var _AudienceItemPreviewBlock__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./AudienceItemPreviewBlock */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItemPreviewBlock.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel Audience Items
 *
 * 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 AudienceItems({
  savedItemSlugs = []
}) {
  const [firstView, setFirstView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(true);
  const {
    setExpirableItemTimers
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
  const {
    syncAvailableAudiences
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4);
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const isOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_15__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isFetchingSyncAvailableAudiences());
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (!firstView || !isOpen) {
      return;
    }
    async function syncAudiences() {
      await syncAvailableAudiences();
    }
    setFirstView(false);
    syncAudiences();
  }, [firstView, isOpen, syncAvailableAudiences]);
  const availableAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useInViewSelect)(select => {
    const {
      getConfigurableAudiences,
      getReport,
      getAudiencesUserCountReportOptions,
      getConfigurableSiteKitAndOtherAudiences,
      hasAudiencePartialData
    } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4);
    const audiences = getConfigurableAudiences();
    if (undefined === audiences) {
      return undefined;
    }
    if (!audiences.length) {
      return [];
    }

    // eslint-disable-next-line @wordpress/no-unused-vars-before-return -- We might return before `otherAudiences` is used.
    const [siteKitAudiences, otherAudiences] = getConfigurableSiteKitAndOtherAudiences();
    const isSiteKitAudiencePartialData = hasAudiencePartialData(siteKitAudiences);
    const dateRangeDates = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getDateRangeDates();

    // Get the user count for the available Site Kit audiences using the `newVsReturning` dimension
    // to avoid the partial data state for these audiences.
    const newVsReturningReport = isSiteKitAudiencePartialData && getReport({
      ...dateRangeDates,
      metrics: [{
        name: 'totalUsers'
      }],
      dimensions: [{
        name: 'newVsReturning'
      }],
      reportID: 'audience-segmentation_audience-items_component_newVsReturningReport'
    });

    // Get the user count for the available audiences using the `audienceResourceName` dimension.
    const audienceResourceNameReport = isSiteKitAudiencePartialData === false || isSiteKitAudiencePartialData === true && otherAudiences?.length > 0 ? getReport(getAudiencesUserCountReportOptions(isSiteKitAudiencePartialData ? otherAudiences : audiences)) : {};
    const {
      rows: newVsReturningRows = []
    } = newVsReturningReport || {};
    const {
      rows: audienceResourceNameRows = []
    } = audienceResourceNameReport || {};
    function findAudienceRow(rows, dimensionValue) {
      return rows.find(row => row?.dimensionValues?.[0]?.value === dimensionValue);
    }
    return audiences.map(audience => {
      let audienceRow;
      if (audience.audienceType === 'SITE_KIT_AUDIENCE' && isSiteKitAudiencePartialData) {
        audienceRow = findAudienceRow(newVsReturningRows, audience.audienceSlug === 'new-visitors' ? 'new' : 'returning');
      } else {
        audienceRow = findAudienceRow(audienceResourceNameRows, audience.name);
      }
      return {
        ...audience,
        userCount: Number(audienceRow?.metricValues?.[0]?.value) || 0
      };
    });
  });
  function audiencesListReducer(acc, {
    audienceType,
    description,
    displayName,
    name,
    userCount
  }) {
    let citation = '';
    switch (audienceType) {
      case 'DEFAULT_AUDIENCE':
        citation = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Created by default by Google Analytics', 'google-site-kit');
        description = '';
        break;
      case 'SITE_KIT_AUDIENCE':
        citation = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Created by Site Kit', 'google-site-kit');
        break;
      case 'USER_AUDIENCE':
        citation = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Already exists in your Analytics property', 'google-site-kit');
        break;
    }
    return {
      ...acc,
      [name]: {
        title: displayName,
        subtitle: description,
        description: citation,
        userCount,
        audienceType
      }
    };
  }
  const availableSavedItems = availableAudiences?.filter(({
    name
  }) => savedItemSlugs.includes(name)).reduce(audiencesListReducer, {});
  const availableUnsavedItems = availableAudiences?.filter(({
    name
  }) => !savedItemSlugs.includes(name)).reduce(audiencesListReducer, {});
  const newBadgesToActivate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    if (undefined === availableAudiences) {
      return undefined;
    }
    const {
      hasFinishedResolution,
      hasExpirableItem
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
    if (!hasFinishedResolution('getExpirableItems')) {
      return undefined;
    }
    return availableAudiences.filter(({
      audienceType,
      name
    }) => {
      // Only activate if it is not a default audience, the badge is
      // new and the user is viewing it for the first time.
      return 'DEFAULT_AUDIENCE' !== audienceType && !hasExpirableItem(`${_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX}${name}`);
    }).map(({
      name
    }) => {
      return `${_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX}${name}`;
    });
  });

  // Set an expiry for the new badges so that it is no longer shown after
  // a certain time.
  // `useDeepCompareEffect` is used here instead of `useEffect` because
  // the array reference of `newBadgesToActivate` is not reliable and can
  // cause the effect to unexpectedly run multiple times.
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    if (isOpen &&
    // Only activate when the badge is viewed, i.e. the panel is opened.
    newBadgesToActivate !== undefined && newBadgesToActivate.length) {
      setExpirableItemTimers(newBadgesToActivate.map(slug => ({
        slug,
        expiresInSeconds: _js_util__WEBPACK_IMPORTED_MODULE_10__.WEEK_IN_SECONDS * 4
      })));
    }
  }, [isOpen, setExpirableItemTimers, newBadgesToActivate]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_5__.SelectionPanelItems, {
    availableItemsTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Additional groups', 'google-site-kit'),
    availableSavedItems: availableSavedItems,
    availableUnsavedItems: availableUnsavedItems,
    ItemComponent: isLoading ? _AudienceItemPreviewBlock__WEBPACK_IMPORTED_MODULE_14__["default"] : _AudienceItem__WEBPACK_IMPORTED_MODULE_13__["default"],
    savedItemSlugs: savedItemSlugs,
    notice: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_AddGroupNotice__WEBPACK_IMPORTED_MODULE_11__["default"], {}), !viewOnlyDashboard && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_AudienceCreationNotice__WEBPACK_IMPORTED_MODULE_12__["default"], {})]
    })
  });
}
AudienceItems.propTypes = {
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/Footer.js"
/*!************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/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 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/SelectionPanel */ "./js/components/SelectionPanel/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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel Footer
 *
 * 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 Footer({
  isOpen,
  closePanel,
  savedItemSlugs
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const [selectedItems] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SELECTION_FORM, _constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SELECTED);
  const [, setDismissedItemsErrorSlug] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SELECTION_FORM, _constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SELECTION_DISMISSED_ITEMS_ERROR_SLUG);
  const isSavingSettings = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isSavingUserAudienceSettings());
  const hiddenTileDismissedItems = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => {
    const dismissedItems = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDismissedItems();
    return dismissedItems?.filter(item => item.startsWith('audience-tile-'));
  });
  const availableAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences());
  const {
    saveUserAudienceSettings,
    removeDismissedItems
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
  const {
    getConfiguredAudiences
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
  const saveSettings = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async selectedAudiences => {
    setDismissedItemsErrorSlug(null);
    let {
      error
    } = await saveUserAudienceSettings({
      configuredAudiences: selectedAudiences
    });
    if (!error) {
      // Determine the list of hidden audiences that have been unselected and need their dismissed state to be cleared.
      const hiddenAudienceDismissedItemsToClear = hiddenTileDismissedItems?.filter(item => {
        const audienceResourceName = item.replace('audience-tile-', '');
        return !selectedAudiences.includes(audienceResourceName);
      }) || [];

      // If all configured audiences are hidden, clear the dismissed state for the first one to unhide it
      if (selectedAudiences.every(audienceResourceName => hiddenTileDismissedItems?.includes(`audience-tile-${audienceResourceName}`))) {
        hiddenAudienceDismissedItemsToClear.push(`audience-tile-${selectedAudiences[0]}`);
      }
      if (hiddenAudienceDismissedItemsToClear?.length > 0) {
        ({
          error
        } = await removeDismissedItems(...hiddenAudienceDismissedItemsToClear));
        if (error) {
          setDismissedItemsErrorSlug(error);
        }
      }
    }
    return {
      error
    };
  }, [hiddenTileDismissedItems, removeDismissedItems, saveUserAudienceSettings, setDismissedItemsErrorSlug]);
  const onSaveSuccess = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    const audienceTypeLabels = {
      USER_AUDIENCE: 'user',
      SITE_KIT_AUDIENCE: 'site-kit',
      DEFAULT_AUDIENCE: 'default'
    };

    // Call to the selector within the callback ensures that the latest
    // value is used.
    const configuredAudiences = getConfiguredAudiences();
    const eventLabel = Object.keys(audienceTypeLabels).map(type => {
      const audiencesOfType = configuredAudiences.filter(audienceName => {
        const audience = availableAudiences?.find(({
          name
        }) => audienceName === name);
        return audience?.audienceType === type;
      });
      return `${audienceTypeLabels[type]}:${audiencesOfType.length}`;
    }).join(',');
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_audiences-sidebar`, 'audiences_sidebar_save', eventLabel);
  }, [availableAudiences, getConfiguredAudiences, viewContext]);
  const onCancel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_audiences-sidebar`, 'audiences_sidebar_cancel');
  }, [viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_3__.SelectionPanelFooter, {
    savedItemSlugs: savedItemSlugs,
    selectedItemSlugs: selectedItems,
    saveSettings: saveSettings,
    minSelectedItemCount: _constants__WEBPACK_IMPORTED_MODULE_9__.MIN_SELECTED_AUDIENCES_COUNT,
    maxSelectedItemCount: _constants__WEBPACK_IMPORTED_MODULE_9__.MAX_SELECTED_AUDIENCES_COUNT,
    isBusy: isSavingSettings,
    isOpen: isOpen,
    closePanel: closePanel,
    onSaveSuccess: onSaveSuccess,
    onCancel: onCancel
  });
}
Footer.propTypes = {
  isOpen: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  closePanel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  savedItemSlugs: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/Header.js"
/*!************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/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": () => (/* binding */ Header)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.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_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel Header
 *
 * 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 Header({
  closePanel
}) {
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const adminSettingsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getSiteKitAdminSettingsURL({
    scrollTo: 'visitor-groups'
  }));
  const isSavingSettings = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER).isSavingUserAudienceSettings());
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_LOCATION);
  const onSettingsClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => navigateTo(adminSettingsURL), [adminSettingsURL, navigateTo]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_6__.SelectionPanelHeader, {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Select visitor groups', 'google-site-kit'),
    onCloseClick: closePanel,
    children: !isViewOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__["default"], {
      children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You can deactivate this widget in <link><strong>Settings</strong></link>', 'google-site-kit'), {
        link: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
          onClick: onSettingsClick,
          disabled: isSavingSettings,
          secondary: true
        }),
        strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("strong", {})
      })
    })
  });
}
Header.propTypes = {
  closePanel: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/LearnMoreLink.js"
/*!*******************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/LearnMoreLink.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 */ LearnMoreLink)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel Learn More Link
 *
 * 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 LearnMoreLink() {
  const audienceLearnMoreURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/12799087'
  }));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
    className: "googlesitekit-audience-selection-panel__learn-more",
    children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Learn more about grouping site visitors and audiences in <link><strong>Analytics</strong></link>', 'google-site-kit'), {
      link: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
        href: audienceLearnMoreURL,
        secondary: true,
        external: true
      }),
      strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("strong", {})
    })
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/Panel.js"
/*!***********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/Panel.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 */ Panel)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/SelectionPanel */ "./js/components/SelectionPanel/index.js");
/* 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_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _AudienceCreationSuccessNotice__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./AudienceCreationSuccessNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceCreationSuccessNotice.js");
/* harmony import */ var _AudienceItems__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AudienceItems */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/AudienceItems.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _Footer__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./Footer */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/Footer.js");
/* harmony import */ var _Header__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./Header */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/Header.js");
/* harmony import */ var _LearnMoreLink__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./LearnMoreLink */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/LearnMoreLink.js");
/* harmony import */ var _SaveErrorNotice__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./SaveErrorNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/SaveErrorNotice.js");
/* harmony import */ var _SyncErrorNotice__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./SyncErrorNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/SyncErrorNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel
 *
 * 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 Panel() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const isOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isFetchingSyncAvailableAudiences());
  const savedItemSlugs = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => {
    const {
      getConfigurableAudiences
    } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4);
    const {
      getConfiguredAudiences
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER);
    const configuredAudiences = getConfiguredAudiences() || [];
    const configurableAudiences = getConfigurableAudiences() || [];
    if (!configurableAudiences.length || !configuredAudiences.length) {
      return [];
    }
    return configurableAudiences.filter(({
      name
    }) => configuredAudiences.includes(name)).map(({
      name
    }) => name);
  });
  const [isCreatingAudienceFromOAuth] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_constants__WEBPACK_IMPORTED_MODULE_12__.AUDIENCE_CREATION_FORM, 'autoSubmit');
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_FORMS);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI);
  const onSideSheetOpen = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    setValues(_constants__WEBPACK_IMPORTED_MODULE_12__.AUDIENCE_SELECTION_FORM, {
      [_constants__WEBPACK_IMPORTED_MODULE_12__.AUDIENCE_SELECTED]: savedItemSlugs,
      [_constants__WEBPACK_IMPORTED_MODULE_12__.AUDIENCE_SELECTION_CHANGED]: false
    });
    (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}_audiences-sidebar`, 'audiences_sidebar_view');
  }, [savedItemSlugs, setValues, viewContext]);
  const closePanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    if (isOpen) {
      setValue(_constants__WEBPACK_IMPORTED_MODULE_12__.AUDIENCE_SELECTION_PANEL_OPENED_KEY, false);
      setValue(_constants__WEBPACK_IMPORTED_MODULE_12__.AUDIENCE_CREATION_SUCCESS_NOTICE_SLUG, false);
    }
  }, [setValue, isOpen]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_2__["default"], {
    className: "googlesitekit-audience-selection-panel",
    closePanel: closePanel,
    isOpen: isOpen || isCreatingAudienceFromOAuth,
    isLoading: isLoading,
    onOpen: onSideSheetOpen,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_Header__WEBPACK_IMPORTED_MODULE_14__["default"], {
      closePanel: closePanel
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_js_components_SelectionPanel__WEBPACK_IMPORTED_MODULE_2__.SelectionPanelContent, {
      className: "googlesitekit-audience-selection-panel__content",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_AudienceItems__WEBPACK_IMPORTED_MODULE_11__["default"], {
        savedItemSlugs: savedItemSlugs
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_LearnMoreLink__WEBPACK_IMPORTED_MODULE_15__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_SaveErrorNotice__WEBPACK_IMPORTED_MODULE_16__["default"], {
        savedItemSlugs: savedItemSlugs
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_SyncErrorNotice__WEBPACK_IMPORTED_MODULE_17__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_AudienceCreationSuccessNotice__WEBPACK_IMPORTED_MODULE_10__["default"], {})]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_Footer__WEBPACK_IMPORTED_MODULE_13__["default"], {
      closePanel: closePanel,
      isOpen: isOpen,
      savedItemSlugs: savedItemSlugs
    })]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/RequestAccessButton.js"
/*!*************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/RequestAccessButton.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 */ RequestAccessButton)
/* 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__);
/* 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 _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.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");
/**
 * Audience Selection Panel Request Access Button
 *
 * 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 RequestAccessButton({
  requestAccessURL
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__["default"])();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
    className: "googlesitekit-audience-selection-panel__error-notice-action",
    href: requestAccessURL,
    target: "_blank",
    onClick: () => {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_audiences-sidebar`, 'insufficient_permissions_error_request_access');
    },
    tertiary: true,
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Request access', 'google-site-kit')
  });
}
RequestAccessButton.propTypes = {
  requestAccessURL: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/RetryButton.js"
/*!*****************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/RetryButton.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 */ RetryButton)
/* 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__);
/* 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 _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.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");
/**
 * Audience Selection Panel Retry Button
 *
 * 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 RetryButton({
  handleRetry
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__["default"])();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
    className: "googlesitekit-audience-selection-panel__error-notice-action",
    onClick: () => {
      handleRetry();
      (0,_js_util__WEBPACK_IMPORTED_MODULE_4__.trackEvent)(`${viewContext}_audiences-sidebar`, 'data_loading_error_retry');
    },
    tertiary: true,
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Retry', 'google-site-kit')
  });
}
RetryButton.propTypes = {
  handleRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/SaveErrorNotice.js"
/*!*********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/SaveErrorNotice.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 */ SaveErrorNotice)
/* 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_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_SelectionPanel_SelectionPanelError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/SelectionPanel/SelectionPanelError */ "./js/components/SelectionPanel/SelectionPanelError.js");
/* harmony import */ var _js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit-data */ "./js/googlesitekit-data.ts");
/* 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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel Selected Item Count Error Notice
 *
 * 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 SaveErrorNotice({
  savedItemSlugs
}) {
  const [selectedItems] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SELECTION_FORM, _constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SELECTED);
  const [dismissedItemsError] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SELECTION_FORM, _constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SELECTION_DISMISSED_ITEMS_ERROR_SLUG);
  const audienceSettings = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getUserAudienceSettings());
  const saveError = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getErrorForAction('saveUserAudienceSettings', [{
    ...audienceSettings,
    configuredAudiences: selectedItems
  }]));
  const selectedItemsCount = selectedItems?.length || 0;
  let itemLimitError;
  if (selectedItemsCount < _constants__WEBPACK_IMPORTED_MODULE_8__.MIN_SELECTED_AUDIENCES_COUNT) {
    itemLimitError = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: 1: Minimum number of groups that can be selected. 2: Number of selected groups. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__._n)('Select at least %1$d group (%2$d selected)', 'Select at least %1$d groups (%2$d selected)', _constants__WEBPACK_IMPORTED_MODULE_8__.MIN_SELECTED_AUDIENCES_COUNT, 'google-site-kit'), _constants__WEBPACK_IMPORTED_MODULE_8__.MIN_SELECTED_AUDIENCES_COUNT, selectedItemsCount);
  } else if (selectedItemsCount > _constants__WEBPACK_IMPORTED_MODULE_8__.MAX_SELECTED_AUDIENCES_COUNT) {
    itemLimitError = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: 1: Maximum number of groups that can be selected. 2: Number of selected groups. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Select up to %1$d groups (%2$d selected)', 'google-site-kit'), _constants__WEBPACK_IMPORTED_MODULE_8__.MAX_SELECTED_AUDIENCES_COUNT, selectedItemsCount);
  }
  const haveSettingsChanged = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    // Arrays need to be sorted to match in `isEqual`.
    return !(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isEqual)((0,_js_util__WEBPACK_IMPORTED_MODULE_7__.safelySort)(selectedItems), (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.safelySort)(savedItemSlugs));
  }, [selectedItems, savedItemSlugs]);
  if (!itemLimitError && !saveError && !dismissedItemsError) {
    return null;
  }
  let error = saveError || dismissedItemsError;
  if (haveSettingsChanged && itemLimitError) {
    error = {
      message: itemLimitError
    };
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_SelectionPanel_SelectionPanelError__WEBPACK_IMPORTED_MODULE_3__["default"], {
    error: error
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/SyncErrorNotice.js"
/*!*********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/SyncErrorNotice.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 */ SyncErrorNotice)
/* harmony export */ });
/* 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_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/ReportErrorActions */ "./js/components/ReportErrorActions.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_ui_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _RequestAccessButton__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./RequestAccessButton */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/RequestAccessButton.js");
/* harmony import */ var _RetryButton__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./RetryButton */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/RetryButton.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel Error Notice
 *
 * 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 SyncErrorNotice() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const syncAvailableAudiencesError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getErrorForAction('syncAvailableAudiences'));
  const [siteKitUserCountReportError, otherUserCountReportError] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getAudienceUserCountReportErrors()) || [];
  const helpLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getErrorTroubleshootingLinkURL({
    code: 'analytics-4_insufficient_permissions'
  }));
  const isOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_14__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));
  const {
    clearActionError,
    syncAvailableAudiences
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4);
  const retrySyncAvailableAudiences = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    await clearActionError('syncAvailableAudiences');
    syncAvailableAudiences();
  }, [clearActionError, syncAvailableAudiences]);
  const errors = [];
  if (syncAvailableAudiencesError) {
    errors.push(syncAvailableAudiencesError);
  }
  if (otherUserCountReportError) {
    errors.push(otherUserCountReportError);
  }
  if (siteKitUserCountReportError) {
    errors.push(siteKitUserCountReportError);
  }
  const hasErrors = errors.length > 0;
  const hasInsufficientPermissionsError = errors.some(error => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_13__.isInsufficientPermissionsError)(error));

  // Track an event when the error notice is displayed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!isOpen || !hasErrors) {
      return;
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.trackEvent)(`${viewContext}_audiences-sidebar`, hasInsufficientPermissionsError ? 'insufficient_permissions_error' : 'data_loading_error');
  }, [hasErrors, hasInsufficientPermissionsError, isOpen, viewContext]);
  if (!errors.length) {
    return null;
  }
  const userCountError = [otherUserCountReportError, siteKitUserCountReportError].some(error => !!error);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_5__["default"], {
    className: "googlesitekit-audience-selection-panel__error-notice googlesitekit-notice--error googlesitekit-notice--small googlesitekit-notice--square",
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.NOTICE_TYPES.ERROR,
    description: hasInsufficientPermissionsError ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Insufficient permissions, contact your administrator. Trouble getting access? <HelpLink />', 'google-site-kit'), {
      HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
        href: helpLink,
        external: true,
        hideExternalIndicator: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Get help', 'google-site-kit')
      })
    }) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Data loading failed', 'google-site-kit'),
    actionContent: hasInsufficientPermissionsError || userCountError ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_7__["default"], {
      moduleSlug: "analytics-4",
      error: errors,
      buttonVariant: "danger",
      RequestAccessButton: _RequestAccessButton__WEBPACK_IMPORTED_MODULE_15__["default"],
      RetryButton: _RetryButton__WEBPACK_IMPORTED_MODULE_16__["default"],
      hideGetHelpLink: true
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_RetryButton__WEBPACK_IMPORTED_MODULE_16__["default"], {
      handleRetry: retrySyncAvailableAudiences
    }),
    hideIcon: true
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js"
/*!***************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/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 */   AUDIENCE_ADD_GROUP_NOTICE_SLUG: () => (/* binding */ AUDIENCE_ADD_GROUP_NOTICE_SLUG),
/* harmony export */   AUDIENCE_CREATION_EDIT_SCOPE_NOTICE_SLUG: () => (/* binding */ AUDIENCE_CREATION_EDIT_SCOPE_NOTICE_SLUG),
/* harmony export */   AUDIENCE_CREATION_FORM: () => (/* binding */ AUDIENCE_CREATION_FORM),
/* harmony export */   AUDIENCE_CREATION_NOTICE_SLUG: () => (/* binding */ AUDIENCE_CREATION_NOTICE_SLUG),
/* harmony export */   AUDIENCE_CREATION_SUCCESS_NOTICE_SLUG: () => (/* binding */ AUDIENCE_CREATION_SUCCESS_NOTICE_SLUG),
/* harmony export */   AUDIENCE_SEGMENTATION_SETUP_DISMISSED_SLUG: () => (/* binding */ AUDIENCE_SEGMENTATION_SETUP_DISMISSED_SLUG),
/* harmony export */   AUDIENCE_SELECTED: () => (/* binding */ AUDIENCE_SELECTED),
/* harmony export */   AUDIENCE_SELECTION_CHANGED: () => (/* binding */ AUDIENCE_SELECTION_CHANGED),
/* harmony export */   AUDIENCE_SELECTION_DISMISSED_ITEMS_ERROR_SLUG: () => (/* binding */ AUDIENCE_SELECTION_DISMISSED_ITEMS_ERROR_SLUG),
/* harmony export */   AUDIENCE_SELECTION_FORM: () => (/* binding */ AUDIENCE_SELECTION_FORM),
/* harmony export */   AUDIENCE_SELECTION_PANEL_OPENED_KEY: () => (/* binding */ AUDIENCE_SELECTION_PANEL_OPENED_KEY),
/* harmony export */   MAX_SELECTED_AUDIENCES_COUNT: () => (/* binding */ MAX_SELECTED_AUDIENCES_COUNT),
/* harmony export */   MIN_SELECTED_AUDIENCES_COUNT: () => (/* binding */ MIN_SELECTED_AUDIENCES_COUNT)
/* harmony export */ });
/**
 * AudienceSelectionPanel components - 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 AUDIENCE_ADD_GROUP_NOTICE_SLUG = 'audience-segmentation-add-group-notice';
const AUDIENCE_SELECTION_PANEL_OPENED_KEY = 'googlesitekit-audience-selection-panel-opened';
const AUDIENCE_SELECTION_FORM = 'audience-selection-form';
const AUDIENCE_SELECTED = 'audience-selected';
const AUDIENCE_SELECTION_CHANGED = 'audience-selection-changed';
const AUDIENCE_SELECTION_DISMISSED_ITEMS_ERROR_SLUG = 'audience-selection-dismissed-items-error';
const AUDIENCE_CREATION_NOTICE_SLUG = 'audience-segmentation-creation-notice';
const AUDIENCE_CREATION_SUCCESS_NOTICE_SLUG = 'audience-segmentation-creation-success-notice';
const MIN_SELECTED_AUDIENCES_COUNT = 1;
const MAX_SELECTED_AUDIENCES_COUNT = 3;
const AUDIENCE_CREATION_EDIT_SCOPE_NOTICE_SLUG = 'audience-creation-edit-scope-notice';
const AUDIENCE_SEGMENTATION_SETUP_DISMISSED_SLUG = 'audience-segmentation-setup-dismissed';
const AUDIENCE_CREATION_FORM = 'audience-creation-form';

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/index.js"
/*!***********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/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 */ AudienceSelectionPanel)
/* 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_components_InViewProvider__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/InViewProvider */ "./js/components/InViewProvider/index.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 _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _Panel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Panel */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/Panel.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Selection Panel
 *
 * 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 AudienceSelectionPanel() {
  const isOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_3__.AUDIENCE_SELECTION_PANEL_OPENED_KEY));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_InViewProvider__WEBPACK_IMPORTED_MODULE_1__["default"], {
    value: {
      key: 'AudienceSelectionPanel',
      value: !!isOpen
    },
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_Panel__WEBPACK_IMPORTED_MODULE_4__["default"], {})
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCitiesMetric.js"
/*!****************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCitiesMetric.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 */ AudienceTileCitiesMetric)
/* 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__);
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _AudienceTileNoData__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AudienceTileNoData */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileNoData.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTileCitiesMetric 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 AudienceTileCitiesMetric({
  TileIcon,
  title,
  topCities
}) {
  const validDimensionValues = topCities?.dimensionValues?.filter(Boolean) || [];
  const hasDimensionValues = !!validDimensionValues.length;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
    className: "googlesitekit-audience-segmentation-tile-metric googlesitekit-audience-segmentation-tile-metric--cities",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
      className: "googlesitekit-audience-segmentation-tile-metric__icon",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(TileIcon, {})
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
      className: "googlesitekit-audience-segmentation-tile-metric__container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
        className: "googlesitekit-audience-segmentation-tile-metric__title",
        children: title
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
        className: "googlesitekit-audience-segmentation-tile-metric__content",
        children: [!hasDimensionValues && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_AudienceTileNoData__WEBPACK_IMPORTED_MODULE_2__["default"], {}), hasDimensionValues && validDimensionValues.map((city, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)("div", {
          className: "googlesitekit-audience-segmentation-tile-metric__cities-metric",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
            className: "googlesitekit-audience-segmentation-tile-metric__cities-metric-name",
            children: city?.value
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("div", {
            className: "googlesitekit-audience-segmentation-tile-metric__cities-metric-value",
            children: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.numFmt)(topCities?.metricValues[index]?.value / topCities?.total, {
              style: 'percent',
              maximumFractionDigits: 1
            })
          })]
        }, city?.value))]
      })]
    })]
  });
}
AudienceTileCitiesMetric.propTypes = {
  TileIcon: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  topCities: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingData.js"
/*!******************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingData.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 */ AudienceTileCollectingData)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_graphics_audience_segmentation_collecting_data_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/svg/graphics/audience-segmentation-collecting-data.svg */ "./svg/graphics/audience-segmentation-collecting-data.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTileCollectingData 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 AudienceTileCollectingData() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_svg_graphics_audience_segmentation_collecting_data_svg__WEBPACK_IMPORTED_MODULE_2__["default"], {
      className: "googlesitekit-audience-segmentation-tile__zero-data-image"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)("p", {
      className: "googlesitekit-audience-segmentation-tile__zero-data-description",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit is collecting data for this group.', 'google-site-kit')
    })]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingDataHideable.js"
/*!**************************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingDataHideable.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 */ AudienceTileCollectingDataHideable)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _svg_icons_visibility_svg__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/svg/icons/visibility.svg */ "./svg/icons/visibility.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTileCollectingDataHideable 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 AudienceTileCollectingDataHideable({
  onHideTile
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("p", {
      className: "googlesitekit-audience-segmentation-tile__zero-data-description",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You can hide this group until data is available.', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
      className: "googlesitekit-audience-segmentation-tile-hide-cta",
      onClick: onHideTile,
      leadingIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_svg_icons_visibility_svg__WEBPACK_IMPORTED_MODULE_4__["default"], {
        width: 22,
        height: 22
      }),
      secondary: true,
      linkButton: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Temporarily hide', 'google-site-kit')
    })]
  });
}
AudienceTileCollectingDataHideable.propTypes = {
  onHideTile: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileError/TileErrorContent.js"
/*!**************************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileError/TileErrorContent.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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ReportErrorActions */ "./js/components/ReportErrorActions.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_modules_analytics_4_components_audience_segmentation_dashboard_GetHelpLink__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/GetHelpLink */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/GetHelpLink.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _svg_graphics_analytics_audience_segmentation_tile_error_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/graphics/analytics-audience-segmentation-tile-error.svg */ "./svg/graphics/analytics-audience-segmentation-tile-error.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TileErrorContent 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 TileErrorContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({
  errors,
  onRetry,
  onRequestAccess
}, ref) => {
  const hasInsufficientPermissionsError = errors.some(err => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_6__.isInsufficientPermissionsError)(err));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
    className: "googlesitekit-audience-segmentation-tile-error",
    ref: ref,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
      className: "googlesitekit-audience-segmentation-tile-error__container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_svg_graphics_analytics_audience_segmentation_tile_error_svg__WEBPACK_IMPORTED_MODULE_7__["default"], {
        className: "googlesitekit-audience-segmentation-tile-error__image"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsxs)("div", {
        className: "googlesitekit-audience-segmentation-tile-error__body",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
          className: "googlesitekit-audience-segmentation-tile-error__message",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_4__["default"], {
            as: "h3",
            type: "headline",
            size: "small",
            className: "googlesitekit-audience-segmentation-tile-error__title",
            children: hasInsufficientPermissionsError ? (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')
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("div", {
          className: "googlesitekit-audience-segmentation-tile-error__actions",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_ReportErrorActions__WEBPACK_IMPORTED_MODULE_3__["default"], {
            moduleSlug: "analytics-4",
            error: errors,
            GetHelpLink: hasInsufficientPermissionsError ? _js_modules_analytics_4_components_audience_segmentation_dashboard_GetHelpLink__WEBPACK_IMPORTED_MODULE_5__["default"] : undefined,
            hideGetHelpLink: !hasInsufficientPermissionsError,
            buttonVariant: "danger",
            onRetry: onRetry,
            onRequestAccess: onRequestAccess
          })
        })]
      })]
    })
  });
});
TileErrorContent.propTypes = {
  errors: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  onRequestAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TileErrorContent);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileError/index.js"
/*!***************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileError/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 */ AudienceTileError)
/* 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__);
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.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_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _TileErrorContent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./TileErrorContent */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileError/TileErrorContent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTileError 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 TileErrorContentWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_4__["default"])(_TileErrorContent__WEBPACK_IMPORTED_MODULE_5__["default"]);
function AudienceTileError({
  audienceSlug,
  errors
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__["default"])();
  const hasInsufficientPermissionsError = errors.some(err => (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_3__.isInsufficientPermissionsError)(err));
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(TileErrorContentWithIntersectionObserver, {
    errors: errors,
    onInView: () => {
      const action = hasInsufficientPermissionsError ? 'insufficient_permissions_error' : 'data_loading_error';
      (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(`${viewContext}_audiences-tile`, action, audienceSlug);
    },
    onRetry: () => {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(`${viewContext}_audiences-tile`, 'data_loading_error_retry', audienceSlug);
    },
    onRequestAccess: () => {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(`${viewContext}_audiences-tile`, 'insufficient_permissions_error_request_access', audienceSlug);
    }
  });
}
AudienceTileError.propTypes = {
  audienceSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  errors: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading.js"
/*!***********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading.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 */ AudienceTileLoading)
/* 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");
/**
 * AudienceTileLoading 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.
 */

/**
 * Internal dependencies
 */


function AudienceTileLoading() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsxs)("div", {
    className: "googlesitekit-audience-segmentation-tile-loading",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      width: "100%",
      height: "20px"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      width: "100%",
      height: "52px"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      width: "100%",
      height: "52px"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      width: "100%",
      height: "52px"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      width: "100%",
      height: "52px"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      width: "100%",
      height: "52px"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_0__["default"], {
      width: "100%",
      height: "52px"
    })]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileMetric.js"
/*!**********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileMetric.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 */ AudienceTileMetric)
/* 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__);
/* 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");
/**
 * AudienceTileMetric 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 AudienceTileMetric({
  TileIcon,
  title,
  metricValue,
  Badge,
  metricValueFormat
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
    className: "googlesitekit-audience-segmentation-tile-metric",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: "googlesitekit-audience-segmentation-tile-metric__icon",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(TileIcon, {})
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsxs)("div", {
      className: "googlesitekit-audience-segmentation-tile-metric__container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
        className: "googlesitekit-audience-segmentation-tile-metric__value",
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.numFmt)(metricValue, metricValueFormat)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
        className: "googlesitekit-audience-segmentation-tile-metric__title",
        children: title
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)("div", {
      className: "googlesitekit-audience-segmentation-tile-metric__badge-container",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(Badge, {})
    })]
  });
}
AudienceTileMetric.propTypes = {
  TileIcon: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  metricValue: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired,
  Badge: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  metricValueFormat: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileNoData.js"
/*!**********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileNoData.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 */ AudienceTileNoData)
/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTileNoData 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
 */


function AudienceTileNoData() {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("div", {
    className: "googlesitekit-audience-segmentation-tile__no-data",
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('No data to show yet', 'google-site-kit')
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTilePagesMetric.js"
/*!***************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTilePagesMetric.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 */ AudienceTilePagesMetric)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/BadgeWithTooltip */ "./js/components/BadgeWithTooltip.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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_hooks_useCreateCustomDimension__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension.ts");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _AudienceTilePagesMetricContent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./AudienceTilePagesMetricContent */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTilePagesMetricContent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTilePagesMetric 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 AudienceTilePagesMetric({
  audienceSlug,
  TileIcon,
  title,
  topContent,
  topContentTitles,
  isTopContentPartialData
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_6__.useBreakpoint)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const postTypeDimension = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CUSTOM_DIMENSION_DEFINITIONS.googlesitekit_post_type.parameterName;
  const hasMissingCustomDimension = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).hasCustomDimensions(postTypeDimension));
  const customDimensionError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getCreateCustomDimensionError(postTypeDimension));
  const [isRetryingCustomDimensionCreate] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_7__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isRetrying');
  const [autoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_7__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'autoSubmit');
  const setupErrorCode = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getSetupErrorCode());
  const [isAutoCreatingCustomDimensionsForAudience] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_7__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isAutoCreatingCustomDimensionsForAudience');
  const hasOAuthError = autoSubmit && setupErrorCode === 'access_denied';
  const isMobileBreakpoint = [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_6__.BREAKPOINT_SMALL, _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_6__.BREAKPOINT_TABLET].includes(breakpoint);
  const {
    onCreateCustomDimension,
    isSaving,
    setShowErrorModal
  } = (0,_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_hooks_useCreateCustomDimension__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const shouldShowErrorModal = customDimensionError && !isSaving || isRetryingCustomDimensionCreate && !isAutoCreatingCustomDimensionsForAudience || hasOAuthError;
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    setShowErrorModal(shouldShowErrorModal);
  }, [shouldShowErrorModal, setShowErrorModal]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div", {
    className: "googlesitekit-audience-segmentation-tile-metric googlesitekit-audience-segmentation-tile-metric--top-content",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
      className: "googlesitekit-audience-segmentation-tile-metric__icon",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(TileIcon, {})
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div", {
      className: "googlesitekit-audience-segmentation-tile-metric__container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div", {
        className: "googlesitekit-audience-segmentation-tile-metric__title",
        children: [title, !isMobileBreakpoint && isTopContentPartialData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_4__["default"], {
          className: "googlesitekit-audience-segmentation-partial-data-badge",
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Partial data', 'google-site-kit'),
          onTooltipOpen: () => {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(`${viewContext}_audiences-tile`, 'view_top_content_partial_data_tooltip', audienceSlug);
          },
          tooltipTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Still collecting full data for this timeframe, partial data is displayed for this metric', 'google-site-kit')
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_AudienceTilePagesMetricContent__WEBPACK_IMPORTED_MODULE_12__["default"], {
        topContentTitles: topContentTitles,
        topContent: topContent,
        isTopContentPartialData: isTopContentPartialData,
        hasCustomDimension: !hasMissingCustomDimension,
        onCreateCustomDimension: onCreateCustomDimension,
        isSaving: isSaving
      })]
    })]
  });
}
AudienceTilePagesMetric.propTypes = {
  audienceSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  TileIcon: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  topContent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  topContentTitles: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  isTopContentPartialData: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTilePagesMetricContent.js"
/*!**********************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTilePagesMetricContent.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 */ AudienceTilePagesMetricContent)
/* 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__);
/* 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_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _AudienceTileNoData__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AudienceTileNoData */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileNoData.js");
/* harmony import */ var _CreateCustomDimensionCTA__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./CreateCustomDimensionCTA */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/CreateCustomDimensionCTA.js");
/* harmony import */ var _PartialDataNotice__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./PartialDataNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/PartialDataNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTilePagesMetricContent 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 CreateCustomDimensionCTAWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_10__["default"])(_CreateCustomDimensionCTA__WEBPACK_IMPORTED_MODULE_12__["default"]);
function AudienceTilePagesMetricContent({
  topContentTitles,
  topContent,
  isTopContentPartialData,
  hasCustomDimension,
  onCreateCustomDimension,
  isSaving
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.useBreakpoint)();
  const isMobileBreakpoint = [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.BREAKPOINT_SMALL, _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.BREAKPOINT_TABLET].includes(breakpoint);
  const validDimensionValues = topContent?.dimensionValues?.filter(Boolean) || [];
  const hasDimensionValues = !!validDimensionValues.length;
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
  function handleCreateCustomDimension() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}_audiences-top-content-cta`, 'create_custom_dimension').finally(onCreateCustomDimension);
  }
  function ContentLinkComponent({
    content
  }) {
    const pageTitle = topContentTitles[content?.value];
    const url = content?.value;
    const serviceURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
      return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
        filters: {
          unifiedPagePathScreen: url
        },
        dates
      }) : null;
    });
    if (viewOnlyDashboard) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", {
        className: "googlesitekit-audience-segmentation-tile__top-content-metric-name",
        children: pageTitle
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
      href: serviceURL,
      title: pageTitle,
      external: true,
      hideExternalIndicator: true,
      children: pageTitle
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div", {
    className: "googlesitekit-audience-segmentation-tile-metric__content",
    children: [!hasCustomDimension && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(CreateCustomDimensionCTAWithIntersectionObserver, {
      onClick: handleCreateCustomDimension,
      isSaving: isSaving,
      onInView: () => {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}_audiences-top-content-cta`, 'view_cta');
      }
    }), hasCustomDimension && !hasDimensionValues && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_AudienceTileNoData__WEBPACK_IMPORTED_MODULE_11__["default"], {}), hasCustomDimension && hasDimensionValues && validDimensionValues.map((content, index) => {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)("div", {
        className: "googlesitekit-audience-segmentation-tile-metric__page-metric-container",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(ContentLinkComponent, {
          content: content
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)("div", {
          className: "googlesitekit-audience-segmentation-tile-metric__page-metric-value",
          children: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(topContent?.metricValues[index]?.value)
        })]
      }, content?.value);
    }), isMobileBreakpoint && isTopContentPartialData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_PartialDataNotice__WEBPACK_IMPORTED_MODULE_13__["default"], {
      content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Still collecting full data for this timeframe, partial data is displayed for this metric', 'google-site-kit')
    })]
  });
}
AudienceTilePagesMetricContent.propTypes = {
  topContentTitles: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  topContent: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  isTopContentPartialData: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  hasCustomDimension: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onCreateCustomDimension: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  isSaving: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileZeroData/TileZeroDataContent.js"
/*!********************************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileZeroData/TileZeroDataContent.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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileCollectingData__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingData */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingData.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileCollectingDataHideable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingDataHideable */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCollectingDataHideable.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ZeroDataContent 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 TileZeroDataContent = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({
  Widget,
  audienceSlug,
  title,
  infoTooltip,
  isMobileBreakpoint,
  isTileHideable,
  onHideTile
}, ref) => {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__["default"])();
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(Widget, {
    ref: ref,
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
      className: "googlesitekit-audience-segmentation-tile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
        className: "googlesitekit-audience-segmentation-tile__zero-data-container",
        children: [!isMobileBreakpoint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
          className: "googlesitekit-audience-segmentation-tile__header",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
            className: "googlesitekit-audience-segmentation-tile__header-title",
            children: [title, infoTooltip && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_2__["default"], {
              title: infoTooltip,
              tooltipClassName: "googlesitekit-info-tooltip__content--audience",
              onOpen: () => (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_audiences-tile`, 'view_tile_tooltip', audienceSlug)
            })]
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
          className: "googlesitekit-audience-segmentation-tile__zero-data-content",
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileCollectingData__WEBPACK_IMPORTED_MODULE_4__["default"], {}), isTileHideable && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileCollectingDataHideable__WEBPACK_IMPORTED_MODULE_5__["default"], {
            onHideTile: onHideTile
          })]
        })]
      })
    })
  });
});
TileZeroDataContent.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  audienceSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  infoTooltip: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element)]),
  isMobileBreakpoint: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  isTileHideable: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onHideTile: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (TileZeroDataContent);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileZeroData/index.js"
/*!******************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileZeroData/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 */ AudienceTileZeroData)
/* 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__);
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _TileZeroDataContent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./TileZeroDataContent */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileZeroData/TileZeroDataContent.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTileZeroData 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 TileZeroDataContentWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_3__["default"])(_TileZeroDataContent__WEBPACK_IMPORTED_MODULE_4__["default"]);
function AudienceTileZeroData({
  Widget,
  audienceSlug,
  title,
  infoTooltip,
  isMobileBreakpoint,
  isTileHideable,
  onHideTile
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_1__["default"])();
  function handleHideTile() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(`${viewContext}_audiences-tile`, 'temporarily_hide', audienceSlug).finally(onHideTile);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(TileZeroDataContentWithIntersectionObserver, {
    Widget: Widget,
    audienceSlug: audienceSlug,
    title: title,
    infoTooltip: infoTooltip,
    isMobileBreakpoint: isMobileBreakpoint,
    isTileHideable: isTileHideable,
    onHideTile: handleHideTile,
    onInView: () => {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_2__.trackEvent)(`${viewContext}_audiences-tile`, 'view_tile_collecting_data', audienceSlug);
    }
  });
}
AudienceTileZeroData.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  audienceSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  infoTooltip: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_0___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_0___default().element)]),
  isMobileBreakpoint: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  isTileHideable: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onHideTile: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/CreateCustomDimensionCTA.js"
/*!****************************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/CreateCustomDimensionCTA.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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_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_Typography_P__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Segmentation CreateCustomDimensionCTA 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 CreateCustomDimensionCTA = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.forwardRef)(({
  onClick,
  isSaving
}, ref) => {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
    ref: ref,
    className: "googlesitekit-audience-segmentation-tile-metric__no-data",
    children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No data to show', 'google-site-kit'), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_4__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Update Analytics to track metric', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.SpinnerButton, {
      onClick: onClick,
      isSaving: isSaving,
      disabled: isSaving,
      danger: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Update', 'google-site-kit')
    })]
  });
});
CreateCustomDimensionCTA.propTypes = {
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  isSaving: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CreateCustomDimensionCTA);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/PartialDataNotice.js"
/*!*********************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/PartialDataNotice.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 */ PartialDataNotice)
/* 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__);
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Segmentation PartialDataNotice 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
 */


function PartialDataNotice({
  content
}) {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_1__.jsx)("span", {
    className: "googlesitekit-audience-segmentation-partial-data-notice",
    children: content
  });
}
PartialDataNotice.propTypes = {
  content: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().node)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/index.js"
/*!*********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/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 */ AudienceTile)
/* 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_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 _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_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/BadgeWithTooltip */ "./js/components/BadgeWithTooltip.js");
/* harmony import */ var _js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/ChangeBadge */ "./js/components/ChangeBadge.tsx");
/* harmony import */ var _js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* 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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_audience_metric_icon_cities_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-cities.svg */ "./svg/icons/audience-metric-icon-cities.svg");
/* harmony import */ var _svg_icons_audience_metric_icon_pages_per_visit_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-pages-per-visit.svg */ "./svg/icons/audience-metric-icon-pages-per-visit.svg");
/* harmony import */ var _svg_icons_audience_metric_icon_pageviews_svg__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-pageviews.svg */ "./svg/icons/audience-metric-icon-pageviews.svg");
/* harmony import */ var _svg_icons_audience_metric_icon_top_content_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-top-content.svg */ "./svg/icons/audience-metric-icon-top-content.svg");
/* harmony import */ var _svg_icons_audience_metric_icon_visitors_svg__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-visitors.svg */ "./svg/icons/audience-metric-icon-visitors.svg");
/* harmony import */ var _svg_icons_audience_metric_icon_visits_per_visitor_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/svg/icons/audience-metric-icon-visits-per-visitor.svg */ "./svg/icons/audience-metric-icon-visits-per-visitor.svg");
/* harmony import */ var _AudienceTileCitiesMetric__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./AudienceTileCitiesMetric */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileCitiesMetric.js");
/* harmony import */ var _AudienceTileMetric__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./AudienceTileMetric */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileMetric.js");
/* harmony import */ var _AudienceTilePagesMetric__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./AudienceTilePagesMetric */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTilePagesMetric.js");
/* harmony import */ var _AudienceTileZeroData__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./AudienceTileZeroData */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileZeroData/index.js");
/* harmony import */ var _PartialDataNotice__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./PartialDataNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/PartialDataNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTile 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 AudienceTile({
  audienceSlug,
  title,
  infoTooltip,
  visitors,
  visitsPerVisitor,
  pagesPerVisit,
  pageviews,
  percentageOfTotalPageViews,
  topCities,
  topContent,
  topContentTitles,
  hasInvalidCustomDimensionError,
  Widget,
  audienceResourceName,
  isZeroData,
  isPartialData,
  isTileHideable,
  onHideTile
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_7__.useBreakpoint)();
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const isPropertyPartialData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => {
    const propertyID = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getPropertyID();
    return propertyID && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).isPropertyPartialData(propertyID);
  });
  const isSiteKitAudience = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).isSiteKitAudience(audienceResourceName));
  const isAudiencePartialData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => {
    if (isSiteKitAudience || isPropertyPartialData === undefined) {
      return false;
    }
    return !isPropertyPartialData && audienceResourceName && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).isAudiencePartialData(audienceResourceName);
  }, [isPropertyPartialData, isSiteKitAudience, audienceResourceName]);
  const isTopContentPartialData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => {
    if (isPropertyPartialData === undefined) {
      return false;
    }
    return !isPropertyPartialData && !isAudiencePartialData && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).isCustomDimensionPartialData('googlesitekit_post_type');
  }, [isAudiencePartialData]);
  const postTypeDimensionExists = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).hasCustomDimensions('googlesitekit_post_type'), []);
  const isMobileBreakpoint = [_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_7__.BREAKPOINT_SMALL, _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_7__.BREAKPOINT_TABLET].includes(breakpoint);
  if (isPartialData && isZeroData) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_AudienceTileZeroData__WEBPACK_IMPORTED_MODULE_21__["default"], {
      Widget: Widget,
      audienceSlug: audienceSlug,
      title: title,
      infoTooltip: infoTooltip,
      isMobileBreakpoint: isMobileBreakpoint,
      isTileHideable: isTileHideable,
      onHideTile: onHideTile
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-audience-segmentation-tile', {
        'googlesitekit-audience-segmentation-tile--partial-data': isAudiencePartialData
      }),
      children: [!isMobileBreakpoint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxs)("div", {
        className: "googlesitekit-audience-segmentation-tile__header",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxs)("div", {
          className: "googlesitekit-audience-segmentation-tile__header-title",
          children: [title, infoTooltip && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_6__["default"], {
            title: infoTooltip,
            tooltipClassName: "googlesitekit-info-tooltip__content--audience",
            onOpen: () => (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(`${viewContext}_audiences-tile`, 'view_tile_tooltip', audienceSlug)
          })]
        }), isAudiencePartialData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_BadgeWithTooltip__WEBPACK_IMPORTED_MODULE_4__["default"], {
          className: "googlesitekit-audience-segmentation-partial-data-badge",
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Partial data', 'google-site-kit'),
          tooltipTitle: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Still collecting full data for this timeframe, partial data is displayed for this group', 'google-site-kit'),
          onTooltipOpen: () => {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(`${viewContext}_audiences-tile`, 'view_tile_partial_data_tooltip', audienceSlug);
          }
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxs)("div", {
        className: "googlesitekit-audience-segmentation-tile__metrics",
        children: [isMobileBreakpoint && isAudiencePartialData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_PartialDataNotice__WEBPACK_IMPORTED_MODULE_22__["default"], {
          content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Still collecting full data for this timeframe, partial data is displayed for this group', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_AudienceTileMetric__WEBPACK_IMPORTED_MODULE_19__["default"], {
          TileIcon: _svg_icons_audience_metric_icon_visitors_svg__WEBPACK_IMPORTED_MODULE_16__["default"],
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Visitors', 'google-site-kit'),
          metricValue: visitors.currentValue,
          Badge: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_5__["default"], {
            previousValue: visitors.previousValue,
            currentValue: visitors.currentValue
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_AudienceTileMetric__WEBPACK_IMPORTED_MODULE_19__["default"], {
          TileIcon: _svg_icons_audience_metric_icon_visits_per_visitor_svg__WEBPACK_IMPORTED_MODULE_17__["default"],
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Visits per visitor', 'google-site-kit'),
          metricValue: visitsPerVisitor.currentValue,
          Badge: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_5__["default"], {
            previousValue: visitsPerVisitor.previousValue,
            currentValue: visitsPerVisitor.currentValue
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_AudienceTileMetric__WEBPACK_IMPORTED_MODULE_19__["default"], {
          TileIcon: _svg_icons_audience_metric_icon_pages_per_visit_svg__WEBPACK_IMPORTED_MODULE_13__["default"],
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Pages per visit', 'google-site-kit'),
          metricValue: pagesPerVisit.currentValue,
          Badge: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_5__["default"], {
            previousValue: pagesPerVisit.previousValue,
            currentValue: pagesPerVisit.currentValue
          }),
          metricValueFormat: {
            style: 'decimal',
            maximumFractionDigits: 2
          }
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_AudienceTileMetric__WEBPACK_IMPORTED_MODULE_19__["default"], {
          TileIcon: _svg_icons_audience_metric_icon_pageviews_svg__WEBPACK_IMPORTED_MODULE_14__["default"],
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: is a percentage value such as 33.3%. */
          (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s of total pageviews', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.numFmt)(percentageOfTotalPageViews, {
            style: 'percent',
            maximumFractionDigits: 1
          })),
          metricValue: pageviews.currentValue,
          Badge: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_ChangeBadge__WEBPACK_IMPORTED_MODULE_5__["default"], {
            previousValue: pageviews.previousValue,
            currentValue: pageviews.currentValue
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_AudienceTileCitiesMetric__WEBPACK_IMPORTED_MODULE_18__["default"], {
          TileIcon: _svg_icons_audience_metric_icon_cities_svg__WEBPACK_IMPORTED_MODULE_12__["default"],
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Cities with the most visitors', 'google-site-kit'),
          topCities: topCities
        }), (!isViewOnly || postTypeDimensionExists && !hasInvalidCustomDimensionError) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_AudienceTilePagesMetric__WEBPACK_IMPORTED_MODULE_20__["default"], {
          audienceSlug: audienceSlug,
          TileIcon: _svg_icons_audience_metric_icon_top_content_svg__WEBPACK_IMPORTED_MODULE_15__["default"],
          title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Top content by pageviews', 'google-site-kit'),
          topContentTitles: topContentTitles,
          topContent: topContent,
          isTopContentPartialData: isTopContentPartialData
        })]
      })]
    })
  });
}
AudienceTile.propTypes = {
  audienceSlug: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  title: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  infoTooltip: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOfType([(prop_types__WEBPACK_IMPORTED_MODULE_1___default().string), (prop_types__WEBPACK_IMPORTED_MODULE_1___default().element)]),
  visitors: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  visitsPerVisitor: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  pagesPerVisit: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  pageviews: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  percentageOfTotalPageViews: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().number),
  topCities: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  topContent: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  topContentTitles: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  hasInvalidCustomDimensionError: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired,
  audienceResourceName: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  isZeroData: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  isPartialData: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  isTileHideable: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  onHideTile: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/Body.js"
/*!*********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/index.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/index.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileError__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileError */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileError/index.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTooltipMessage__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTooltipMessage */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTooltipMessage.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_MaybePlaceholderTile__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/MaybePlaceholderTile */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/MaybePlaceholderTile.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.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useAudienceTilesReports__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useAudienceTilesReports */ "./js/modules/analytics-4/hooks/useAudienceTilesReports.js");
/* harmony import */ var _js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/custom-dimensions */ "./js/modules/analytics-4/utils/custom-dimensions.js");
/* harmony import */ var _js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/report-rows-with-set-values */ "./js/modules/analytics-4/utils/report-rows-with-set-values.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTilesWidget 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 hasZeroDataForAudience(report, dimensionName) {
  const audienceData = report?.rows?.find(row => row.dimensionValues?.[0]?.value === dimensionName);
  const totalUsers = audienceData?.metricValues?.[0]?.value || 0;
  return totalUsers === 0;
}
function Body({
  activeTileIndex,
  allTilesError,
  individualTileErrors,
  loading,
  topCitiesReportsLoaded,
  topContentReportsLoaded,
  topContentPageTitlesReportsLoaded,
  visibleAudiences,
  Widget
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.useBreakpoint)();
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const isTabbedBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_TABLET;
  const audiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => {
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
  }, []);

  // An array of audience resource names.
  const configuredAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getConfiguredAudiences(), []);
  const [siteKitAudiences, otherAudiences] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getConfiguredSiteKitAndOtherAudiences()) || [[], []];
  const isSiteKitAudiencePartialData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).hasAudiencePartialData(siteKitAudiences));
  const partialDataStates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => configuredAudiences?.reduce((acc, audienceResourceName) => {
    acc[audienceResourceName] = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).isAudiencePartialData(audienceResourceName);
    return acc;
  }, {}), [configuredAudiences]);
  const {
    report,
    reportError,
    siteKitAudiencesReport,
    totalPageviews,
    totalPageviewsReportError,
    topCitiesReport,
    topContentReport,
    topContentReportErrors,
    topContentPageTitlesReport,
    topContentPageTitlesReportErrors
  } = (0,_js_modules_analytics_4_hooks_useAudienceTilesReports__WEBPACK_IMPORTED_MODULE_13__["default"])({
    isSiteKitAudiencePartialData,
    siteKitAudiences,
    otherAudiences
  });
  function getAudienceTileMetrics(audienceResourceName) {
    const isSiteKitAudience = siteKitAudiences.some(audience => audience.name === audienceResourceName);

    // Get the audience slug (e.g., 'new-visitors', 'returning-visitors').
    const audienceSlug = siteKitAudiences.find(audience => audience.name === audienceResourceName)?.audienceSlug;
    function findMetricsForDateRange(dateRange) {
      let row;
      if (isSiteKitAudience && isSiteKitAudiencePartialData) {
        // Determine the dimension value ('new' or 'returning') for Site Kit audiences.
        const dimensionValue = audienceSlug === 'new-visitors' ? 'new' : 'returning';
        row = siteKitAudiencesReport?.rows?.find(({
          dimensionValues
        }) => dimensionValues?.[0]?.value === dimensionValue && dimensionValues?.[1]?.value === dateRange);
      } else {
        row = report?.rows?.find(({
          dimensionValues
        }) => dimensionValues?.[0]?.value === audienceResourceName && dimensionValues?.[1]?.value === dateRange);
      }
      return [Number(row?.metricValues?.[0]?.value || 0),
      // totalUsers
      Number(row?.metricValues?.[1]?.value || 0),
      // sessionsPerUser
      Number(row?.metricValues?.[2]?.value || 0),
      // screenPageViewsPerSession
      Number(row?.metricValues?.[3]?.value || 0) // screenPageViews
      ];
    }
    const currentMetrics = findMetricsForDateRange('date_range_0');
    const previousMetrics = findMetricsForDateRange('date_range_1');
    return {
      current: currentMetrics,
      previous: previousMetrics
    };
  }
  function getAudienceTileData(audienceResourceName, audienceIndex) {
    const audienceName = audiences?.filter(({
      name
    }) => name === audienceResourceName)?.[0]?.displayName || '';
    const audienceSlug = audiences?.filter(({
      name
    }) => name === audienceResourceName)?.[0]?.audienceSlug || '';
    const {
      current,
      previous
    } = getAudienceTileMetrics(audienceResourceName);
    const visitors = current[0];
    const prevVisitors = previous[0];
    const visitsPerVisitors = current[1];
    const prevVisitsPerVisitors = previous[1];
    const pagesPerVisit = current[2];
    const prevPagesPerVisit = previous[2];
    const pageviews = current[3];
    const prevPageviews = previous[3];
    const topCities = topCitiesReport?.[audienceIndex];
    const topContent = topContentReport?.[audienceIndex];
    const topContentTitles = topContentPageTitlesReport?.[audienceIndex]?.rows?.reduce((acc, row) => {
      acc[row.dimensionValues[0].value] = row.dimensionValues[1].value;
      return acc;
    }, {}) || {};
    const isSiteKitAudience = siteKitAudiences.some(audience => audience.name === audienceResourceName);
    let reportToCheck = report;
    let dimensionValue = audienceResourceName;
    if (isSiteKitAudience && isSiteKitAudiencePartialData) {
      // If it's a Site Kit audience in a partial data state, use the siteKitAudiencesReport.
      reportToCheck = siteKitAudiencesReport;

      // Determine the dimension value ('new' or 'returning') for Site Kit audiences.
      dimensionValue = audienceSlug === 'new-visitors' ? 'new' : 'returning';
    }
    const isZeroData = hasZeroDataForAudience(reportToCheck, dimensionValue);
    const isPartialData = isSiteKitAudience ? false : partialDataStates[audienceResourceName];
    return {
      audienceName,
      audienceSlug,
      visitors,
      prevVisitors,
      visitsPerVisitors,
      prevVisitsPerVisitors,
      pagesPerVisit,
      prevPagesPerVisit,
      pageviews,
      prevPageviews,
      topCities,
      topContent,
      topContentTitles,
      isZeroData,
      isPartialData
    };
  }
  const hasInvalidCustomDimensionError = Object.values(topContentReportErrors).some(_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_14__.isInvalidCustomDimensionError) || Object.values(topContentPageTitlesReportErrors).some(_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_14__.isInvalidCustomDimensionError);
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER);
  const {
    fetchSyncAvailableCustomDimensions
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4);
  const handleDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(audienceResourceName => {
    dismissItem(`audience-tile-${audienceResourceName}`);
  }, [dismissItem]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!isViewOnly && hasInvalidCustomDimensionError) {
      fetchSyncAvailableCustomDimensions();
    }
  }, [fetchSyncAvailableCustomDimensions, hasInvalidCustomDimensionError, isViewOnly]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
    className: "googlesitekit-widget-audience-tiles__body",
    children: [allTilesError && !loading && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_6__["default"], {
      Widget: Widget,
      errors: [...Object.values(individualTileErrors).flat(2), reportError, totalPageviewsReportError]
    }), (allTilesError === false || loading) && visibleAudiences.map((audienceResourceName, index) => {
      // Conditionally render only the selected audience tile on mobile.
      if (isTabbedBreakpoint && index !== activeTileIndex) {
        return null;
      }
      const {
        audienceName,
        audienceSlug,
        visitors,
        prevVisitors,
        visitsPerVisitors,
        prevVisitsPerVisitors,
        pagesPerVisit,
        prevPagesPerVisit,
        pageviews,
        prevPageviews,
        topCities,
        topContent,
        topContentTitles,
        isZeroData,
        isPartialData
      } = getAudienceTileData(audienceResourceName, index);

      // Filter (not set) value from the top countries report if present.
      const filteredTopCitiesRows = topCities?.rows ? (0,_js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_15__.reportRowsWithSetValues)(topCities.rows) : [];

      // Return loading tile if data is not yet loaded.
      if (loading || !topCitiesReportsLoaded?.[audienceResourceName] || !topContentReportsLoaded?.[audienceResourceName] || !topContentPageTitlesReportsLoaded?.[audienceResourceName] || isZeroData === undefined || isPartialData === undefined) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(Widget, {
          noPadding: true,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_9__["default"], {})
        }, audienceResourceName);
      }

      // If errored, skip rendering.
      if (individualTileErrors[audienceResourceName].length > 0) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileError__WEBPACK_IMPORTED_MODULE_8__["default"], {
          audienceSlug: audienceSlug,
          errors: individualTileErrors[audienceResourceName]
        }, audienceResourceName);
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile__WEBPACK_IMPORTED_MODULE_7__["default"], {
        audienceSlug: audienceSlug,
        title: audienceName,
        infoTooltip: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTooltipMessage__WEBPACK_IMPORTED_MODULE_10__["default"], {
          audienceName: audienceName,
          audienceSlug: audienceSlug
        }),
        visitors: {
          currentValue: visitors,
          previousValue: prevVisitors
        },
        visitsPerVisitor: {
          currentValue: visitsPerVisitors,
          previousValue: prevVisitsPerVisitors
        },
        pagesPerVisit: {
          currentValue: pagesPerVisit,
          previousValue: prevPagesPerVisit
        },
        pageviews: {
          currentValue: pageviews,
          previousValue: prevPageviews
        },
        percentageOfTotalPageViews: totalPageviews !== 0 ? pageviews / totalPageviews : 0,
        topCities: {
          dimensionValues: [filteredTopCitiesRows?.[0]?.dimensionValues?.[0], filteredTopCitiesRows?.[1]?.dimensionValues?.[0], filteredTopCitiesRows?.[2]?.dimensionValues?.[0]],
          metricValues: [filteredTopCitiesRows?.[0]?.metricValues?.[0], filteredTopCitiesRows?.[1]?.metricValues?.[0], filteredTopCitiesRows?.[2]?.metricValues?.[0]],
          total: visitors
        },
        topContent: {
          dimensionValues: [topContent?.rows?.[0]?.dimensionValues?.[0], topContent?.rows?.[1]?.dimensionValues?.[0], topContent?.rows?.[2]?.dimensionValues?.[0]],
          metricValues: [topContent?.rows?.[0]?.metricValues?.[0], topContent?.rows?.[1]?.metricValues?.[0], topContent?.rows?.[2]?.metricValues?.[0]]
        },
        topContentTitles: topContentTitles,
        hasInvalidCustomDimensionError: hasInvalidCustomDimensionError,
        Widget: Widget,
        audienceResourceName: audienceResourceName,
        isZeroData: isZeroData,
        isPartialData: isPartialData,
        isTileHideable: visibleAudiences.length > 1,
        onHideTile: () => handleDismiss(audienceResourceName)
      }, audienceResourceName);
    }), !isTabbedBreakpoint && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_MaybePlaceholderTile__WEBPACK_IMPORTED_MODULE_11__["default"], {
      Widget: Widget,
      loading: loading,
      allTilesError: allTilesError,
      visibleAudienceCount: visibleAudiences.length
    })]
  });
}
Body.propTypes = {
  activeTileIndex: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired,
  allTilesError: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool).isRequired,
  individualTileErrors: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool).isRequired,
  topCitiesReportsLoaded: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  topContentReportsLoaded: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  topContentPageTitlesReportsLoaded: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object).isRequired,
  visibleAudiences: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().array).isRequired,
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/Header.js"
/*!***********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/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": () => (/* binding */ Header)
/* harmony export */ });
/* 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 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_InfoTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/InfoTooltip */ "./js/components/InfoTooltip.tsx");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTooltipMessage__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTooltipMessage */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTooltipMessage.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.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTilesWidget Header 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 Header({
  activeTileIndex,
  setActiveTile,
  visibleAudiences
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__["default"])();
  const audiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => {
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
  }, []);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.TabBar
  // Force re-render when the number of audiences change, this is a workaround for a bug in TabBar which maintains an internal list of tabs but doesn't update it when the number of tabs is reduced.
  , {
    className: "googlesitekit-widget-audience-tiles__tabs googlesitekit-tab-bar--start-aligned-high-contrast",
    activeIndex: activeTileIndex,
    handleActiveIndexUpdate: index => setActiveTile(visibleAudiences[index]),
    children: visibleAudiences.map((audienceResourceName, index) => {
      const audienceName = audiences?.filter(({
        name
      }) => name === audienceResourceName)?.[0]?.displayName || '';
      const audienceSlug = audiences?.filter(({
        name
      }) => name === audienceResourceName)?.[0]?.audienceSlug || '';
      const tooltipMessage = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTooltipMessage__WEBPACK_IMPORTED_MODULE_4__["default"], {
        audienceName: audienceName,
        audienceSlug: audienceSlug
      });
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_0__.Tab
      // It's a bit counterintuitive, but we need to use `index` as the key here due to how the internal implementation of TabBar works.
      // Specifically, how it maintains an internal list of tabs and pushes new tabs onto the end of the list when it sees a new child. See the use of pushToTabList in renderTab:
      // https://github.com/material-components/material-components-web-react/blob/04ecb80383e49ff0dea765d5fc0d14a442a73c92/packages/tab-bar/index.tsx#L202-L212
      // If we use `audienceResourceName` as the key, and the list of audiences changes, the TabBar's internal list of tabs may go out of sync with the rendered list
      // and the wrong tab will be selected when switching between audiences.
      , {
        "aria-label": audienceName,
        focusOnActivate: false,
        children: [audienceName, /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_InfoTooltip__WEBPACK_IMPORTED_MODULE_2__["default"], {
          title: tooltipMessage,
          tooltipClassName: "googlesitekit-info-tooltip__content--audience",
          onOpen: () => {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_audiences-tile`, 'view_tile_tooltip', audienceSlug);
          }
        })]
      }, index);
    })
  }, visibleAudiences.length);
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/index.js"
/*!**********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/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 */ AudienceTiles)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_hooks_useCreateCustomDimension__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/hooks/useCreateCustomDimension.ts");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_CustomDimensionErrorModal_tsx__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/CustomDimensionErrorModal.tsx */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/CustomDimensionErrorModal.tsx");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useAudienceTilesReports__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useAudienceTilesReports */ "./js/modules/analytics-4/hooks/useAudienceTilesReports.js");
/* harmony import */ var _js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/custom-dimensions */ "./js/modules/analytics-4/utils/custom-dimensions.js");
/* harmony import */ var _Body__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Body */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/Body.js");
/* harmony import */ var _Header__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./Header */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/Header.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTilesWidget 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 hasZeroDataForAudience(report, dimensionName) {
  const audienceData = report?.rows?.find(row => row.dimensionValues?.[0]?.value === dimensionName);
  const totalUsers = audienceData?.metricValues?.[0]?.value || 0;
  return totalUsers === 0;
}
function AudienceTiles({
  Widget,
  widgetLoading
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.useBreakpoint)();
  const isTabbedBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_4__.BREAKPOINT_TABLET;

  // An array of audience resource names.
  const configuredAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getConfiguredAudiences(), []);
  const audiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => {
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
  }, []);
  const [siteKitAudiences, otherAudiences] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getConfiguredSiteKitAndOtherAudiences()) || [[], []];
  const isSiteKitAudiencePartialData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasAudiencePartialData(siteKitAudiences));
  const {
    report,
    reportLoaded,
    reportError,
    siteKitAudiencesReport,
    siteKitAudiencesReportLoaded,
    siteKitAudiencesReportError,
    totalPageviewsReportLoaded,
    totalPageviewsReportError,
    topCitiesReportsLoaded,
    topCitiesReportErrors,
    topContentReportsLoaded,
    topContentReportErrors,
    topContentPageTitlesReportsLoaded,
    topContentPageTitlesReportErrors
  } = (0,_js_modules_analytics_4_hooks_useAudienceTilesReports__WEBPACK_IMPORTED_MODULE_8__["default"])({
    isSiteKitAudiencePartialData,
    siteKitAudiences,
    otherAudiences
  });
  const individualTileErrors = configuredAudiences?.reduce((acc, audienceResourceName) => {
    acc[audienceResourceName] = [];
    [topCitiesReportErrors, topContentReportErrors, topContentPageTitlesReportErrors].forEach(reportErrors => {
      const error = reportErrors[audienceResourceName];

      // Filter out invalid custom dimension errors which only relate to the "Top content" metric area,
      // as we still want to show the tile in this case.
      if (error && !(0,_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_9__.isInvalidCustomDimensionError)(error)) {
        acc[audienceResourceName].push(error);
      }
    });
    return acc;
  }, {});
  const dismissedItems = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDismissedItems());
  const {
    isDismissingItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER));
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER);

  // useRef to track if the dismissal logic has already been executed.
  const hasDismissed = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)({});
  const [audiencesToClearDismissal, visibleAudiences] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    const toClear = [];
    const visible = [];
    // Filter `configuredAudiences` to ensure only available audiences are included.
    const tempAudiences = configuredAudiences?.slice().filter(audienceResourceName => audiences.some(audience => audience.name === audienceResourceName));
    while (tempAudiences?.length > 0) {
      const audienceResourceName = tempAudiences.shift();
      const isDismissed = dismissedItems?.includes(`audience-tile-${audienceResourceName}`);
      const isSiteKitAudience = siteKitAudiences.some(audience => audience.name === audienceResourceName);
      let reportToCheck = report;
      let dimensionValue = audienceResourceName;
      if (isSiteKitAudience && isSiteKitAudiencePartialData) {
        // If it's a Site Kit audience in a partial data state, use the siteKitAudiencesReport.
        reportToCheck = siteKitAudiencesReport;

        // Get the audience slug (e.g., 'new-visitors', 'returning-visitors').
        const audienceSlug = siteKitAudiences.find(audience => audience.name === audienceResourceName)?.audienceSlug;

        // Determine the dimension value ('new' or 'returning') for Site Kit audiences.
        dimensionValue = audienceSlug === 'new-visitors' ? 'new' : 'returning';
      }
      const isZeroData = hasZeroDataForAudience(reportToCheck, dimensionValue);

      // Check if there are more audiences remaining to be processed.
      const remainingAudiences = tempAudiences.length + visible.length > 0;

      // Skip rendering the tile if it is dismissed, has zero data, and there are still more audiences to render.
      if (isDismissed && isZeroData && remainingAudiences) {
        continue;
      }

      // Collect audiences to re-dismiss if they have data again.
      if (isDismissed && !isZeroData) {
        toClear.push(audienceResourceName);
      }

      // Add audience to visibleAudiences
      visible.push(audienceResourceName);
    }
    return [toClear, visible];
  }, [audiences, configuredAudiences, dismissedItems, isSiteKitAudiencePartialData, report, siteKitAudiences, siteKitAudiencesReport]);
  function checkForAllTilesError() {
    const mainReportErrors = [];
    if (report) {
      mainReportErrors.push(reportError);
    }
    if (siteKitAudiencesReport) {
      mainReportErrors.push(siteKitAudiencesReportError);
    }
    if (mainReportErrors.every(Boolean) || totalPageviewsReportError) {
      return true;
    }
    return configuredAudiences?.every(audienceResourceName => individualTileErrors[audienceResourceName].length > 0);
  }
  const allTilesError = checkForAllTilesError();

  // Re-dismiss with a short expiry time to clear any previously dismissed tiles.
  // This ensures that the tile will reappear when it is populated with data again.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    audiencesToClearDismissal.forEach(audienceResourceName => {
      const itemSlug = `audience-tile-${audienceResourceName}`;
      if (hasDismissed.current[itemSlug]) {
        return;
      }
      dismissItem(itemSlug, {
        expiresInSeconds: 1
      });

      // Mark as dismissed to prevent re-dismissing.
      hasDismissed.current[itemSlug] = true;
    });
  }, [audiencesToClearDismissal, dismissItem, isDismissingItem]);

  // Sync available custom dimensions if there is a custom dimension error.
  const isSyncingAvailableCustomDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isFetchingSyncAvailableCustomDimensions());

  // Ensure the active tile is always correctly selected.
  const [activeTile, setActiveTile] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(visibleAudiences[0]);
  const getAudienceTileIndex = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(audienceResourceName => {
    const index = visibleAudiences.indexOf(audienceResourceName);
    return index === -1 ? 0 : index;
  }, [visibleAudiences]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!visibleAudiences.includes(activeTile)) {
      setActiveTile(visibleAudiences[0]);
    }
  }, [activeTile, visibleAudiences]);
  const activeTileIndex = getAudienceTileIndex(activeTile);
  const {
    showErrorModal
  } = (0,_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_hooks_useCreateCustomDimension__WEBPACK_IMPORTED_MODULE_5__["default"])();

  // Determine loading state.
  const loading = widgetLoading || !reportLoaded || !siteKitAudiencesReportLoaded || !totalPageviewsReportLoaded || !topCitiesReportsLoaded || !topContentReportsLoaded || !topContentPageTitlesReportsLoaded || isSyncingAvailableCustomDimensions;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)(Widget, {
      className: "googlesitekit-widget-audience-tiles",
      noPadding: true,
      children: [allTilesError === false && !loading && isTabbedBreakpoint && visibleAudiences.length > 0 && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Header__WEBPACK_IMPORTED_MODULE_11__["default"], {
        activeTileIndex: activeTileIndex,
        setActiveTile: setActiveTile,
        visibleAudiences: visibleAudiences
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_Body__WEBPACK_IMPORTED_MODULE_10__["default"], {
        activeTileIndex: activeTileIndex,
        allTilesError: allTilesError,
        individualTileErrors: individualTileErrors,
        loading: loading,
        topCitiesReportsLoaded: topCitiesReportsLoaded,
        topContentReportsLoaded: topContentReportsLoaded,
        topContentPageTitlesReportsLoaded: topContentPageTitlesReportsLoaded,
        visibleAudiences: visibleAudiences,
        Widget: Widget
      })]
    }), showErrorModal && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_CustomDimensionErrorModal_tsx__WEBPACK_IMPORTED_MODULE_6__["default"], {})]
  });
}
AudienceTiles.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  widgetLoading: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTooltipMessage.js"
/*!*************************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTooltipMessage.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 */ AudienceTooltipMessage)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTooltipMessage 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 AudienceTooltipMessage({
  audienceSlug,
  audienceName
}) {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getDocumentationLinkURL('visitor-group-insights'));
  const tooltipMessage = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    switch (audienceSlug) {
      case 'new-visitors':
        return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: is the audience name */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('%s are people who visited your site for the first time. Note that under some circumstances it\'s possible for a visitor to be counted in both the "new" and "returning" groups. <link>Learn more</link>', 'google-site-kit'), '<strong>New visitors</strong>'), {
          strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("strong", {}),
          link: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
            href: documentationURL,
            external: true,
            hideExternalIndicator: true
          })
        });
      case 'returning-visitors':
        return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: is the audience name */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('%s are people who have visited your site at least once before. Note that under some circumstances it\'s possible for a visitor to be counted in both the "new" and "returning" groups. <link>Learn more</link>', 'google-site-kit'), '<strong>Returning visitors</strong>'), {
          strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("strong", {}),
          link: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
            href: documentationURL,
            external: true,
            hideExternalIndicator: true
          })
        });
      default:
        return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: is the audience name */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)("%s is an audience that already exists in your Analytics property. Note that it's possible for a visitor to be counted in more than one group. <link>Learn more</link>", 'google-site-kit'), `<strong>${audienceName}</strong>`), {
          strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("strong", {}),
          link: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
            href: documentationURL,
            external: true,
            hideExternalIndicator: true
          })
        });
    }
  }, [audienceSlug, audienceName, documentationURL]);
  return tooltipMessage;
}
AudienceTooltipMessage.propTypes = {
  audienceSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/MaybePlaceholderTile.js"
/*!***********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/MaybePlaceholderTile.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 */ MaybePlaceholderTile)
/* 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__);
/* harmony import */ var _AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AudienceTile/AudienceTileLoading */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading.js");
/* harmony import */ var _PlaceholderTile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./PlaceholderTile */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PlaceholderTile.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MaybePlaceholderTile 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 MaybePlaceholderTile({
  Widget,
  loading,
  allTilesError,
  visibleAudienceCount
}) {
  if ((allTilesError === false || loading) && visibleAudienceCount === 1) {
    if (loading) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(Widget, {
        noPadding: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_1__["default"], {})
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_PlaceholderTile__WEBPACK_IMPORTED_MODULE_2__["default"], {
      Widget: Widget
    });
  }
  return null;
}
MaybePlaceholderTile.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool).isRequired,
  allTilesError: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  visibleAudienceCount: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().number).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PlaceholderTile.js"
/*!******************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PlaceholderTile.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 */ PlaceholderTile)
/* 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_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_Link__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/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_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _svg_graphics_no_audience_banner_graphic_svg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/svg/graphics/no-audience-banner-graphic.svg */ "./svg/graphics/no-audience-banner-graphic.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PlaceholderTile 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 PlaceholderTile({
  Widget
}) {
  const hasConfigurableNonDefaultAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const configuredAudiences = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).getConfiguredAudiences();
    const configurableAudiences = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getConfigurableAudiences();
    return configurableAudiences.some(audience => audience.audienceType !== 'DEFAULT_AUDIENCE' && !configuredAudiences.includes(audience.name));
  });
  const audienceLearnMoreURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/12799087'
  }));
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_UI);
  const AnalyticsLink = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
    href: audienceLearnMoreURL,
    secondary: true,
    external: true
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
    className: "googlesitekit-audience-segmentation-tile-placeholder",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      className: "googlesitekit-audience-segmentation-tile-placeholder__container",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_svg_graphics_no_audience_banner_graphic_svg__WEBPACK_IMPORTED_MODULE_11__["default"], {
        className: "googlesitekit-audience-segmentation-tile-placeholder__image"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
        className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-audience-segmentation-tile-placeholder__body', {
          'googlesitekit-audience-segmentation-tile-placeholder__body--without-selectable-audiences': !hasConfigurableNonDefaultAudiences
        }),
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_5__["default"], {
          as: "h3",
          type: "title",
          size: "small",
          className: "googlesitekit-audience-segmentation-tile-placeholder__title",
          children: hasConfigurableNonDefaultAudiences ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Compare your group to other groups', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Create more visitor groups', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("p", {
          className: "googlesitekit-audience-segmentation-tile-placeholder__description",
          children: hasConfigurableNonDefaultAudiences ? (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('<SelectGroupLink>Select</SelectGroupLink> another group to compare with your current group or learn more about how to group site visitors in <AnalyticsLink>Analytics</AnalyticsLink>', 'google-site-kit'), {
            AnalyticsLink,
            SelectGroupLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
              onClick: () => setValue(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SELECTION_PANEL_OPENED_KEY, true),
              secondary: true
            })
          }) : (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Learn more about how to group site visitors in <AnalyticsLink>Analytics</AnalyticsLink>', 'google-site-kit'), {
            AnalyticsLink
          })
        })]
      })]
    })
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/index.js"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _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_components_WidgetNull__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetNull */ "./js/googlesitekit/widgets/components/WidgetNull.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/index.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_NoAudienceBannerWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget/index.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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./AudienceTile/AudienceTileLoading */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading.js");
/* harmony import */ var _AudienceTiles__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./AudienceTiles */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTiles/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * AudienceTilesWidget 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 AudienceTilesWidget({
  Widget
}) {
  const availableAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    const audiences = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    return audiences?.map(audience => audience.name);
  });
  const configuredAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getConfiguredAudiences());
  const availableAudiencesSynced = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasSyncedAudiences());
  const isSyncingAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isSyncingAudiences());
  const {
    clearActionErrors,
    maybeSyncAvailableAudiences,
    syncAvailableAudiences
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4);
  const isSettingUpAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isSettingUpAudiences());
  const syncAvailableAudiencesError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForAction('syncAvailableAudiences'));
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!availableAudiencesSynced && !isSyncingAudiences && !isSettingUpAudiences) {
      maybeSyncAvailableAudiences();
    }
  }, [availableAudiencesSynced, isSyncingAudiences, isSettingUpAudiences, maybeSyncAvailableAudiences]);
  if (syncAvailableAudiencesError) {
    const insufficientPermissionsError = (0,_js_util_errors__WEBPACK_IMPORTED_MODULE_9__.isInsufficientPermissionsError)(syncAvailableAudiencesError);
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_5__["default"], {
      errors: syncAvailableAudiencesError,
      Widget: Widget,
      onRetry: !insufficientPermissionsError ? async () => {
        await clearActionErrors('syncAvailableAudiences');
        await syncAvailableAudiences();
      } : undefined,
      showRetryButton: !insufficientPermissionsError
    });
  }
  const hasMatchingAudience = configuredAudiences?.some(audience => availableAudiences?.includes(audience));
  if (!hasMatchingAudience) {
    return availableAudiencesSynced ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_NoAudienceBannerWidget__WEBPACK_IMPORTED_MODULE_6__["default"], {
      Widget: Widget,
      WidgetNull: _js_googlesitekit_widgets_components_WidgetNull__WEBPACK_IMPORTED_MODULE_4__["default"]
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(Widget, {
      className: "googlesitekit-widget-audience-tiles",
      noPadding: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsxs)("div", {
        className: "googlesitekit-widget-audience-tiles__body",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(Widget, {
          noPadding: true,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_11__["default"], {})
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(Widget, {
          noPadding: true,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_11__["default"], {})
        })]
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_AudienceTiles__WEBPACK_IMPORTED_MODULE_12__["default"], {
    Widget: Widget,
    widgetLoading: !availableAudiencesSynced || !availableAudiences || !configuredAudiences
  });
}
AudienceTilesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_10__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4
})(AudienceTilesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/ChangeGroupsLink.js"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/ChangeGroupsLink.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 */ ChangeGroupsLink)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.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_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/icons/pencil-alt.svg */ "./svg/icons/pencil-alt.svg");
/* harmony import */ var _AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./AudienceSelectionPanel/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Audience Segmentation ChangeGroupsLink 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 ChangeGroupsLink() {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefresh');
  const availableAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getConfigurableAudiences(), []);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI);
  const openAudiencesSelectionPanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    setValue(_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_SELECTION_PANEL_OPENED_KEY, true);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_audiences-sidebar`, 'change_groups');
  }, [setValue, viewContext]);
  const renderChangeGroupsLink = Array.isArray(availableAudiences) && availableAudiences?.length > 0;
  if (!renderChangeGroupsLink) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-widget-area__cta-link",
    onClick: openAudiencesSelectionPanel,
    leadingIcon: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_svg_icons_pencil_alt_svg__WEBPACK_IMPORTED_MODULE_9__["default"], {
      width: 22,
      height: 22
    }),
    secondary: true,
    linkButton: true,
    children: setupFlowRefreshEnabled ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Select groups', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Change groups', 'google-site-kit')
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/ConnectAnalyticsCTAWidget.js"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/ConnectAnalyticsCTAWidget.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 */ ConnectAnalyticsCTAWidget)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* 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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_LeanCTABanner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/LeanCTABanner */ "./js/components/LeanCTABanner.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useActivateModuleCallback */ "./js/hooks/useActivateModuleCallback.js");
/* harmony import */ var _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _svg_graphics_audience_connect_analytics_cta_graphic_tablet_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/svg/graphics/audience-connect-analytics-cta-graphic-tablet.svg */ "./svg/graphics/audience-connect-analytics-cta-graphic-tablet.svg");
/* harmony import */ var _svg_graphics_audience_connect_analytics_cta_graphic_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/svg/graphics/audience-connect-analytics-cta-graphic.svg */ "./svg/graphics/audience-connect-analytics-cta-graphic.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ConnectAnalyticsCTAWidget 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 ConnectAnalyticsCTAWidget({
  Widget
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_10__.useBreakpoint)();
  const isTabletBreakpoint = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_10__.BREAKPOINT_TABLET;
  const handleConnectModule = (0,_js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4);
  const Icon = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_MODULES).getModuleIcon(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4));
  const content = isTabletBreakpoint ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__["default"], {
    children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Google Analytics is disconnected, your audience metrics can’t be displayed. <a>Connect Google Analytics</a>', 'google-site-kit'), {
      a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
        onClick: handleConnectModule,
        secondary: true
      })
    })
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_7__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Google Analytics is disconnected, your audience metrics can’t be displayed', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_6__["default"], {
      onClick: handleConnectModule,
      secondary: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Connect Google Analytics', 'google-site-kit')
    })]
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_js_components_LeanCTABanner__WEBPACK_IMPORTED_MODULE_5__["default"], {
      Icon: Icon,
      SVGGraphic: isTabletBreakpoint ? _svg_graphics_audience_connect_analytics_cta_graphic_tablet_svg__WEBPACK_IMPORTED_MODULE_12__["default"] : _svg_graphics_audience_connect_analytics_cta_graphic_svg__WEBPACK_IMPORTED_MODULE_13__["default"],
      children: content
    })
  });
}
ConnectAnalyticsCTAWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/GetHelpLink.js"
/*!******************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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 _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");
/**
 * Audience Segmentation Get Help Link 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 GetHelpLink({
  linkURL
}) {
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Contact your administrator. Trouble getting access? <HelpLink />', 'google-site-kit'), {
    HelpLink: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
      href: linkURL,
      external: true,
      hideExternalIndicator: true,
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Get help', 'google-site-kit')
    })
  });
}
GetHelpLink.propTypes = {
  linkURL: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNotice.js"
/*!*****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNotice.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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __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 _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _svg_icons_lightbulb_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/svg/icons/lightbulb.svg */ "./svg/icons/lightbulb.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * InfoNotice 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 InfoNotice = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(({
  className,
  content,
  dismissLabel,
  Icon = _svg_icons_lightbulb_svg__WEBPACK_IMPORTED_MODULE_5__["default"],
  onDismiss
}, ref) => {
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
    ref: ref,
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-audience-segmentation-info-notice', className),
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(Icon, {
      width: "20",
      height: "20"
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)("div", {
      className: "googlesitekit-audience-segmentation-info-notice__body",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_4__["default"], {
        children: content
      }), dismissLabel && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
        onClick: onDismiss,
        className: "googlesitekit-audience-segmentation-info-notice__dismiss",
        tertiary: true,
        children: dismissLabel
      })]
    })]
  });
});
InfoNotice.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  content: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string).isRequired,
  dismissLabel: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  Icon: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType),
  onDismiss: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (InfoNotice);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/constants.js"
/*!*********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/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 */   AUDIENCE_INFO_NOTICES: () => (/* binding */ AUDIENCE_INFO_NOTICES),
/* harmony export */   AUDIENCE_INFO_NOTICE_HIDE_UI: () => (/* binding */ AUDIENCE_INFO_NOTICE_HIDE_UI),
/* harmony export */   AUDIENCE_INFO_NOTICE_SLUG: () => (/* binding */ AUDIENCE_INFO_NOTICE_SLUG)
/* 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__);
/**
 * Constants related to audience segmentation info notices.
 *
 * 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
 */


/**
 * UI key to display audience segmentation info notice.
 *
 * @since 1.135.0
 * @private
 */
const AUDIENCE_INFO_NOTICE_HIDE_UI = 'audience-segmentation-info-notice-ui';

/**
 * Slug for audience segmentation info notice.
 *
 * @since 1.130.0
 * @private
 */
const AUDIENCE_INFO_NOTICE_SLUG = 'audience-segmentation-info-notice';

// Notice slugs: new-visitors, compare-metrics, custom-audiences, purchasers, returning-visitors, compare-new-returning, or compare-cities

/**
 * List of info notices for audiences.
 *
 * @since 1.130.0
 * @private
 */
const AUDIENCE_INFO_NOTICES = [{
  slug: 'new-visitors',
  content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The higher the portion of new visitors you have, the more your audience is growing. Looking at what content brings them to your site may give you insights on how to reach even more people.', 'google-site-kit')
}, {
  slug: 'compare-metrics',
  content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select up to three visitor groups to display on the dashboard and easily compare metrics between them.', 'google-site-kit')
}, {
  slug: 'custom-audiences',
  content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Configure your own custom audiences in Analytics to gain deeper insights into visitor behavior, for example consider creating an “Existing customers” or “Subscribers” segment, depending on what goals you have for your site.', 'google-site-kit')
}, {
  slug: 'purchasers',
  content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Select the Purchasers visitor group to gain insights into which visitors bring the most revenue to your site.', 'google-site-kit')
}, {
  slug: 'returning-visitors',
  content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The more returning visitors your site has, the stronger and more loyal an audience you’re building. Check which content brings people back to your site - it might help you create a strategy to build a community.', 'google-site-kit')
}, {
  slug: 'compare-new-returning',
  content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Compare the ratio of “new” to “returning” visitors – this can give you insights on whether you have more people stopping by as a one-off, or more loyal visitors.', 'google-site-kit')
}, {
  slug: 'compare-cities',
  content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Check the cities which bring you more new vs more returning visitors – there might be new audiences you could engage with in locations you hadn’t thought about.', 'google-site-kit')
}];

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/index.js"
/*!*****************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.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_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_InfoNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNotice.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__ = __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_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* 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_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * InfoNoticeWidget 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 InfoNoticeWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_12__["default"])(_js_modules_analytics_4_components_audience_segmentation_dashboard_InfoNotice__WEBPACK_IMPORTED_MODULE_7__["default"]);
function InfoNoticeWidget({
  Widget,
  WidgetNull
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const availableAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => {
    const audiences = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    return audiences?.map(audience => audience.name);
  }, []);
  const configuredAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getConfiguredAudiences(), []);
  const hasMatchingAudience = configuredAudiences?.some(audience => availableAudiences?.includes(audience));
  const noticesCount = _constants__WEBPACK_IMPORTED_MODULE_13__.AUDIENCE_INFO_NOTICES.length;
  const isDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isPromptDismissed(_constants__WEBPACK_IMPORTED_MODULE_13__.AUDIENCE_INFO_NOTICE_SLUG), []);
  const hideNotice = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_UI).getValue(_constants__WEBPACK_IMPORTED_MODULE_13__.AUDIENCE_INFO_NOTICE_HIDE_UI));
  const dismissCount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getPromptDismissCount(_constants__WEBPACK_IMPORTED_MODULE_13__.AUDIENCE_INFO_NOTICE_SLUG), []);
  const {
    dismissPrompt
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER);
  const onDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (undefined === dismissCount) {
      return;
    }
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_audiences-info-notice`, 'dismiss_notice', _constants__WEBPACK_IMPORTED_MODULE_13__.AUDIENCE_INFO_NOTICES[dismissCount].slug).finally(() => {
      const twoWeeksInSeconds = _js_util__WEBPACK_IMPORTED_MODULE_10__.WEEK_IN_SECONDS * 2;
      const expiry = dismissCount + 1 < noticesCount ? twoWeeksInSeconds : 0;
      dismissPrompt(_constants__WEBPACK_IMPORTED_MODULE_13__.AUDIENCE_INFO_NOTICE_SLUG, {
        expiresInSeconds: expiry
      });
    });
  }, [dismissCount, dismissPrompt, noticesCount, viewContext]);

  // Return null if there are no matching audiences or if the notice has been dismissed.
  if (hasMatchingAudience !== true || isDismissed || dismissCount === undefined || dismissCount >= noticesCount || hideNotice === true) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(WidgetNull, {});
  }
  const {
    slug,
    content
  } = _constants__WEBPACK_IMPORTED_MODULE_13__.AUDIENCE_INFO_NOTICES[dismissCount];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(InfoNoticeWithIntersectionObserver, {
      content: content,
      dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it', 'google-site-kit'),
      onDismiss: onDismiss,
      onInView: () => {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_audiences-info-notice`, 'view_notice', slug);
      }
    })
  });
}
InfoNoticeWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ANALYTICS_4
})(InfoNoticeWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/IntroductoryOverlayNotification.js"
/*!**************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/IntroductoryOverlayNotification.js ***!
  \**************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AUDIENCE_SEGMENTATION_INTRODUCTORY_OVERLAY_NOTIFICATION: () => (/* binding */ AUDIENCE_SEGMENTATION_INTRODUCTORY_OVERLAY_NOTIFICATION),
/* harmony export */   "default": () => (/* binding */ IntroductoryOverlayNotification)
/* 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__);
/* 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_notifications_components_layout_OverlayNotification__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/OverlayNotification */ "./js/googlesitekit/notifications/components/layout/OverlayNotification.tsx");
/* 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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.js");
/* harmony import */ var _svg_graphics_audience_segmentation_introductory_graphic_desktop_svg__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/graphics/audience-segmentation-introductory-graphic-desktop.svg */ "./svg/graphics/audience-segmentation-introductory-graphic-desktop.svg");
/* harmony import */ var _svg_graphics_audience_segmentation_introductory_graphic_mobile_svg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/svg/graphics/audience-segmentation-introductory-graphic-mobile.svg */ "./svg/graphics/audience-segmentation-introductory-graphic-mobile.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * IntroductoryOverlayNotification 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 AUDIENCE_SEGMENTATION_INTRODUCTORY_OVERLAY_NOTIFICATION = 'audienceSegmentationIntroductoryOverlayNotification';
function IntroductoryOverlayNotification({
  id,
  Notification
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_5__.useBreakpoint)();
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_NOTIFICATIONS);
  function scrollToWidgetAndDismissNotification(event) {
    event.preventDefault();
    const widgetAreaClass = '.googlesitekit-widget-area--mainDashboardTrafficAudienceSegmentation';
    setTimeout(() => {
      globalThis.scrollTo({
        top: (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_7__.getNavigationalScrollTop)(widgetAreaClass, breakpoint),
        behavior: 'smooth'
      });
    }, 0);
    dismissNotification(id);
  }
  const gaTrackingEventArgs = {
    category: `${viewContext}_audiences-secondary-user-intro`
  };
  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_3__["default"], {
      notificationID: id,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('New! Visitor groups', 'google-site-kit'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('You can now learn more about your site visitor groups by comparing different metrics.', 'google-site-kit'),
      GraphicDesktop: _svg_graphics_audience_segmentation_introductory_graphic_desktop_svg__WEBPACK_IMPORTED_MODULE_8__["default"],
      GraphicMobile: _svg_graphics_audience_segmentation_introductory_graphic_mobile_svg__WEBPACK_IMPORTED_MODULE_9__["default"],
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Show me', 'google-site-kit'),
        onClick: scrollToWidgetAndDismissNotification
      },
      dismissButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Got it', 'google-site-kit')
      },
      gaTrackingEventArgs: gaTrackingEventArgs
    })
  });
}
IntroductoryOverlayNotification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget/NoAudienceBanner.js"
/*!**********************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget/NoAudienceBanner.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_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_LeanCTABanner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/LeanCTABanner */ "./js/components/LeanCTABanner.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/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_ui_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_graphics_no_audience_banner_graphic_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/svg/graphics/no-audience-banner-graphic.svg */ "./svg/graphics/no-audience-banner-graphic.svg");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * NoAudienceBanner 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 NoAudienceBanner = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.forwardRef)((props, ref) => {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_12__["default"])();
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_13__["default"])();
  const didSetAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_USER).didSetAudiences());
  const Icon = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_MODULES).getModuleIcon(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_15__.MODULE_SLUG_ANALYTICS_4));
  const adminSettingsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getSiteKitAdminSettingsURL({
    scrollTo: 'visitor-groups'
  }));
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_UI);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_LOCATION);
  const eventLabel = didSetAudiences ? 'no-longer-available' : 'none-selected';
  function handleSelectGroups() {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_16__.trackEvent)(`${viewContext}_audiences-no-audiences`, 'select_groups', eventLabel).finally(() => {
      setValue(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_14__.AUDIENCE_SELECTION_PANEL_OPENED_KEY, true);
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_js_components_LeanCTABanner__WEBPACK_IMPORTED_MODULE_4__["default"], {
    ref: ref,
    className: "googlesitekit-no-audience-banner",
    Icon: Icon,
    SVGGraphic: _svg_graphics_no_audience_banner_graphic_svg__WEBPACK_IMPORTED_MODULE_17__["default"],
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsxs)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
      children: [didSetAudiences && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('It looks like your visitor groups aren’t available anymore. <a>Select other groups</a>.', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
          onClick: handleSelectGroups,
          secondary: true
        })
      }), !didSetAudiences && (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You don’t have any visitor groups selected. <a>Select groups</a>.', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
          onClick: handleSelectGroups,
          secondary: true
        })
      })]
    }), !isViewOnly && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_6__["default"], {
      children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You can deactivate this widget in <a>Settings</a>.', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
          onClick: () => {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_16__.trackEvent)(`${viewContext}_audiences-no-audiences`, 'change_settings', eventLabel).finally(() => {
              navigateTo(adminSettingsURL);
            });
          },
          secondary: true
        })
      })
    })]
  });
});
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (NoAudienceBanner);

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget/index.js"
/*!***********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget/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_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__);
/* 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_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/withIntersectionObserver */ "./js/util/withIntersectionObserver.tsx");
/* harmony import */ var _NoAudienceBanner__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./NoAudienceBanner */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget/NoAudienceBanner.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * NoAudienceBannerWidget 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 NoAudienceBannerWithIntersectionObserver = (0,_js_util_withIntersectionObserver__WEBPACK_IMPORTED_MODULE_8__["default"])(_NoAudienceBanner__WEBPACK_IMPORTED_MODULE_9__["default"]);
function NoAudienceBannerWidget({
  Widget,
  WidgetNull
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_3__["default"])();
  const availableAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const audiences = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    return audiences?.map(audience => audience.name);
  });
  const configuredAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getConfiguredAudiences());
  const didSetAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).didSetAudiences());
  const hasNoMatchingAudience = configuredAudiences?.every(audience => Array.isArray(availableAudiences) && !availableAudiences.includes(audience));
  if (!!configuredAudiences && (configuredAudiences?.length === 0 || hasNoMatchingAudience)) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Widget, {
      noPadding: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(NoAudienceBannerWithIntersectionObserver, {
        onInView: () => {
          (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_audiences-no-audiences`, 'view_banner', didSetAudiences ? 'no-longer-available' : 'none-selected');
        }
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(WidgetNull, {});
}
NoAudienceBannerWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_7__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ANALYTICS_4
})(NoAudienceBannerWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/PrimaryUserSetupWidget/index.js"
/*!***********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/PrimaryUserSetupWidget/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 */ PrimaryUserSetupWidget)
/* 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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.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_user_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/index.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationSetupErrorWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupErrorWidget.tsx");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useEnableAudienceGroup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useEnableAudienceGroup */ "./js/modules/analytics-4/hooks/useEnableAudienceGroup.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PrimaryUserSetupWidget 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 PrimaryUserSetupWidget({
  Widget
}) {
  const {
    apiErrors,
    isSaving,
    failedAudiences,
    isAudienceCreationError,
    onEnableGroups
  } = (0,_js_modules_analytics_4_hooks_useEnableAudienceGroup__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const setupFlowRefreshPhase4Enabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__.useFeature)('setupFlowRefreshPhase4');
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER);
  const isSettingUpAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isSettingUpAudiences());
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    if (isSettingUpAudiences) {
      return;
    }
    onEnableGroups();
  });
  if ((apiErrors.length || failedAudiences.length) && !isSaving) {
    if (setupFlowRefreshPhase4Enabled) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationSetupErrorWidget__WEBPACK_IMPORTED_MODULE_6__["default"], {
        Widget: Widget,
        errors: apiErrors,
        onRetry: onEnableGroups,
        isAudienceCreationVariant: isAudienceCreationError,
        onDismiss: () => dismissItem(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_7__.AUDIENCE_SEGMENTATION_SETUP_DISMISSED_SLUG)
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_5__["default"], {
      Widget: Widget,
      errors: apiErrors,
      onRetry: onEnableGroups,
      failedAudiences: failedAudiences,
      showRetryButton: !(0,_js_util_errors__WEBPACK_IMPORTED_MODULE_11__.isInsufficientPermissionsError)(apiErrors[0])
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
    className: "googlesitekit-widget-audience-tiles",
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      className: "googlesitekit-widget-audience-tiles__body",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
        noPadding: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_8__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
        noPadding: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_8__["default"], {})
      })]
    })
  });
}
PrimaryUserSetupWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/SecondaryUserSetupWidget/index.js"
/*!*************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/SecondaryUserSetupWidget/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 */ SecondaryUserSetupWidget)
/* 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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __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 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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* 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_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/index.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationSetupErrorWidget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupErrorWidget.tsx");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/AudienceTile/AudienceTileLoading.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SecondaryUserSetupWidget 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 SecondaryUserSetupWidget({
  Widget
}) {
  const [setupError, setSetupError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(null);
  const setupFlowRefreshPhase4Enabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_5__.useFeature)('setupFlowRefreshPhase4');
  const isSettingUpAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).isSettingUpAudiences());
  const {
    enableSecondaryUserAudienceGroup
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4);
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
  async function handleRetry() {
    setSetupError(null);
    const {
      error
    } = await enableSecondaryUserAudienceGroup();
    if (error) {
      setSetupError(error);
    }
  }
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    if (isSettingUpAudiences) {
      return;
    }
    (async () => {
      const {
        error
      } = await enableSecondaryUserAudienceGroup();
      if (error) {
        setSetupError(error);
      }
    })();
  });
  if (setupError) {
    if (setupFlowRefreshPhase4Enabled) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationSetupErrorWidget__WEBPACK_IMPORTED_MODULE_7__["default"], {
        Widget: Widget,
        errors: setupError,
        onRetry: handleRetry,
        onDismiss: () => dismissItem(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SEGMENTATION_SETUP_DISMISSED_SLUG)
      });
    }
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_6__["default"], {
      Widget: Widget,
      errors: setupError,
      onRetry: handleRetry,
      showRetryButton: !(0,_js_util_errors__WEBPACK_IMPORTED_MODULE_11__.isInsufficientPermissionsError)(setupError)
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
    className: "googlesitekit-widget-audience-tiles",
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsxs)("div", {
      className: "googlesitekit-widget-audience-tiles__body",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
        noPadding: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_9__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Widget, {
        noPadding: true,
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_AudienceTile_AudienceTileLoading__WEBPACK_IMPORTED_MODULE_9__["default"], {})
      })]
    })
  });
}
SecondaryUserSetupWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/SetupCTABanner.js"
/*!*********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/SetupCTABanner.js ***!
  \*********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AUDIENCE_SEGMENTATION_SETUP_CTA_NOTIFICATION: () => (/* binding */ AUDIENCE_SEGMENTATION_SETUP_CTA_NOTIFICATION),
/* 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__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.js");
/* 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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/AdminScreenTooltip */ "./js/components/AdminScreenTooltip/index.js");
/* harmony import */ var _js_components_notifications_useRetriableNotificationDismissButtonLabel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/notifications/useRetriableNotificationDismissButtonLabel */ "./js/components/notifications/useRetriableNotificationDismissButtonLabel.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_googlesitekit_notifications_components_layout_SetupCTA__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/SetupCTA */ "./js/googlesitekit/notifications/components/layout/SetupCTA.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/googlesitekit/widgets/util */ "./js/googlesitekit/widgets/util/index.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceErrorModal__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceErrorModal */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceErrorModal.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__ = __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_17__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useEnableAudienceGroup__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useEnableAudienceGroup */ "./js/modules/analytics-4/hooks/useEnableAudienceGroup.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _svg_graphics_banner_audience_segmentation_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/svg/graphics/banner-audience-segmentation-setup-cta-mobile.svg?url */ "./svg/graphics/banner-audience-segmentation-setup-cta-mobile.svg?url");
/* harmony import */ var _svg_graphics_banner_audience_segmentation_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/svg/graphics/banner-audience-segmentation-setup-cta.svg?url */ "./svg/graphics/banner-audience-segmentation-setup-cta.svg?url");
/* harmony import */ var _SetupSuccessSubtleNotification__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./SetupSuccessSubtleNotification */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/SetupSuccessSubtleNotification.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupCTABanner 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
 */





















const AUDIENCE_SEGMENTATION_SETUP_CTA_NOTIFICATION = 'audience_segmentation_setup_cta-notification';
function SetupCTABanner({
  id,
  Notification
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__["default"])();
  const trackEventCategory = `${viewContext}_audiences-setup-cta-dashboard`;
  const {
    dismissNotification,
    registerNotification,
    pinNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_NOTIFICATIONS);
  const tooltipSettings = {
    tooltipSlug: id,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You can always enable groups in Settings later', 'google-site-kit'),
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('The visitors group section will be added to your dashboard once you set it up.', 'google-site-kit'),
    dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Got it', 'google-site-kit')
  };
  const showTooltip = (0,_js_components_AdminScreenTooltip__WEBPACK_IMPORTED_MODULE_5__.useShowTooltip)(tooltipSettings);
  const isDismissalFinal = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_NOTIFICATIONS).isNotificationDismissalFinal(id));
  const dismissLabel = (0,_js_components_notifications_useRetriableNotificationDismissButtonLabel__WEBPACK_IMPORTED_MODULE_6__["default"])({
    isDismissalFinal
  });
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_13__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_17__.AUDIENCE_SEGMENTATION_SETUP_FORM, 'autoSubmit');
  const [showErrorModal, setShowErrorModal] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const onSuccess = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    registerNotification(_SetupSuccessSubtleNotification__WEBPACK_IMPORTED_MODULE_23__.AUDIENCE_SEGMENTATION_SETUP_SUCCESS_NOTIFICATION, {
      Component: _SetupSuccessSubtleNotification__WEBPACK_IMPORTED_MODULE_23__["default"],
      areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_10__.NOTIFICATION_AREAS.DASHBOARD_TOP
    });
    dismissNotification(id);
  }, [registerNotification, dismissNotification, id]);
  const onError = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    setShowErrorModal(true);
  }, [setShowErrorModal]);
  const onOAuthNavigation = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => pinNotification(id, _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_10__.NOTIFICATION_GROUPS.SETUP_CTAS), [id, pinNotification]);
  const {
    apiErrors,
    failedAudiences,
    isSaving,
    onEnableGroups
  } = (0,_js_modules_analytics_4_hooks_useEnableAudienceGroup__WEBPACK_IMPORTED_MODULE_18__["default"])({
    onSuccess,
    onError,
    onOAuthNavigation
  });
  const {
    clearPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER);
  const {
    setSetupErrorCode
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE);
  const onCancel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    setAutoSubmit(false);
    clearPermissionScopeError();
    setSetupErrorCode(null);
    setShowErrorModal(false);
  }, [clearPermissionScopeError, setSetupErrorCode, setAutoSubmit]);
  const setupErrorCode = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getSetupErrorCode());
  const learnMoreLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getDocumentationLinkURL('visitor-groups'));
  const hasOAuthError = autoSubmit && setupErrorCode === 'access_denied';
  const gaTrackingProps = {
    gaTrackingEventArgs: {
      category: trackEventCategory
    }
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_24__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_24__.jsx)(Notification, {
      ...gaTrackingProps,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_24__.jsx)(_js_googlesitekit_notifications_components_layout_SetupCTA__WEBPACK_IMPORTED_MODULE_9__["default"], {
        notificationID: id,
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Learn how different types of visitors interact with your site', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Understand what brings new visitors to your site and keeps them coming back. Site Kit can now group your site visitors into relevant segments like "new" and "returning". To set up these new groups, Site Kit needs to update your Google Analytics property.', 'google-site-kit'),
        learnMoreLink: {
          href: learnMoreLink
        },
        ctaButton: {
          label: isSaving ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enabling groups', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Enable groups', 'google-site-kit'),
          onClick: onEnableGroups,
          disabled: isSaving,
          inProgress: isSaving
        },
        dismissButton: {
          label: dismissLabel,
          onClick: showTooltip,
          disabled: isSaving,
          dismissOptions: {
            expiresInSeconds: isDismissalFinal ? 0 : 2 * _js_util__WEBPACK_IMPORTED_MODULE_19__.WEEK_IN_SECONDS
          }
        },
        svg: {
          desktop: _svg_graphics_banner_audience_segmentation_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_22__["default"],
          mobile: _svg_graphics_banner_audience_segmentation_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_21__["default"],
          verticalPosition: 'bottom'
        },
        gaTrackingEventArgs: {
          category: trackEventCategory
        }
      })
    }), (showErrorModal || hasOAuthError) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_24__.jsx)(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceErrorModal__WEBPACK_IMPORTED_MODULE_15__["default"], {
      hasOAuthError: hasOAuthError,
      apiErrors: apiErrors.length ? apiErrors : failedAudiences,
      onRetry: onEnableGroups,
      inProgress: isSaving,
      onCancel: hasOAuthError ? onCancel : () => setShowErrorModal(false),
      trackEventCategory: `${viewContext}_audiences-setup`
    })]
  });
}
SetupCTABanner.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_20__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4
}), (0,_js_googlesitekit_widgets_util__WEBPACK_IMPORTED_MODULE_12__.withWidgetComponentProps)('audienceSegmentationSetupCTA'))(SetupCTABanner));

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/SetupSuccessSubtleNotification.js"
/*!*************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/dashboard/SetupSuccessSubtleNotification.js ***!
  \*************************************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   AUDIENCE_SEGMENTATION_SETUP_SUCCESS_NOTIFICATION: () => (/* binding */ AUDIENCE_SEGMENTATION_SETUP_SUCCESS_NOTIFICATION),
/* harmony export */   "default": () => (/* binding */ SetupSuccessSubtleNotification)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_googlesitekit_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/NoticeNotification */ "./js/googlesitekit/notifications/components/layout/NoticeNotification.tsx");
/* 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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_util_scroll__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/scroll */ "./js/util/scroll.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupSuccessSubtleNotification 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 AUDIENCE_SEGMENTATION_SETUP_SUCCESS_NOTIFICATION = 'setup-success-notification-audiences';
function SetupSuccessSubtleNotification({
  id,
  Notification
}) {
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_8__.useBreakpoint)();
  const {
    dismissNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_NOTIFICATIONS);
  const isAudienceSegmentationWidgetHidden = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).isAudienceSegmentationWidgetHidden());
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (isAudienceSegmentationWidgetHidden) {
      dismissNotification(AUDIENCE_SEGMENTATION_SETUP_SUCCESS_NOTIFICATION);
    }
  }, [dismissNotification, isAudienceSegmentationWidgetHidden]);
  function scrollToWidgetArea(event) {
    event.preventDefault();
    dismissNotification(AUDIENCE_SEGMENTATION_SETUP_SUCCESS_NOTIFICATION);
    setTimeout(() => {
      const widgetClass = '.googlesitekit-widget-area--mainDashboardTrafficAudienceSegmentation';
      globalThis.scrollTo({
        top: (0,_js_util_scroll__WEBPACK_IMPORTED_MODULE_9__.getNavigationalScrollTop)(widgetClass, breakpoint),
        behavior: 'smooth'
      });
    }, 50);
  }
  if (isAudienceSegmentationWidgetHidden === undefined) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Notification, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_googlesitekit_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_6__["default"], {
      notificationID: id,
      type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.SUCCESS,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Success! Visitor groups added to your dashboard', 'google-site-kit'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Get to know how different types of visitors interact with your site, e.g. which pages they visit and for how long', 'google-site-kit'),
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Show me', 'google-site-kit'),
        onClick: scrollToWidgetArea
      },
      dismissButton: true
    })
  });
}
SetupSuccessSubtleNotification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/audience-segmentation/dashboard/index.js"
/*!************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/audience-segmentation/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 */   AudienceAreaFooter: () => (/* reexport safe */ _AudienceAreaFooter__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   AudienceErrorModal: () => (/* reexport safe */ _AudienceErrorModal__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   AudienceSegmentationBackNotice: () => (/* reexport safe */ _AudienceSegmentationBackNotice__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   AudienceSegmentationErrorWidget: () => (/* reexport safe */ _AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   AudienceSegmentationSetupErrorWidget: () => (/* reexport safe */ _AudienceSegmentationSetupErrorWidget__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   AudienceSelectionPanel: () => (/* reexport safe */ _AudienceSelectionPanel__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   AudienceTilesWidget: () => (/* reexport safe */ _AudienceTilesWidget__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   ChangeGroupsLink: () => (/* reexport safe */ _ChangeGroupsLink__WEBPACK_IMPORTED_MODULE_9__["default"]),
/* harmony export */   ConnectAnalyticsCTAWidget: () => (/* reexport safe */ _ConnectAnalyticsCTAWidget__WEBPACK_IMPORTED_MODULE_10__["default"]),
/* harmony export */   InfoNotice: () => (/* reexport safe */ _InfoNotice__WEBPACK_IMPORTED_MODULE_12__["default"]),
/* harmony export */   InfoNoticeWidget: () => (/* reexport safe */ _InfoNoticeWidget__WEBPACK_IMPORTED_MODULE_11__["default"]),
/* harmony export */   IntroductoryOverlayNotification: () => (/* reexport safe */ _IntroductoryOverlayNotification__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   NoAudienceBannerWidget: () => (/* reexport safe */ _NoAudienceBannerWidget__WEBPACK_IMPORTED_MODULE_13__["default"]),
/* harmony export */   PrimaryUserSetupWidget: () => (/* reexport safe */ _PrimaryUserSetupWidget__WEBPACK_IMPORTED_MODULE_15__["default"]),
/* harmony export */   SecondaryUserSetupWidget: () => (/* reexport safe */ _SecondaryUserSetupWidget__WEBPACK_IMPORTED_MODULE_14__["default"]),
/* harmony export */   SetupCTABanner: () => (/* reexport safe */ _SetupCTABanner__WEBPACK_IMPORTED_MODULE_5__["default"])
/* harmony export */ });
/* harmony import */ var _AudienceErrorModal__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AudienceErrorModal */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceErrorModal.js");
/* harmony import */ var _AudienceSegmentationBackNotice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./AudienceSegmentationBackNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationBackNotice.tsx");
/* harmony import */ var _AudienceSegmentationErrorWidget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./AudienceSegmentationErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationErrorWidget/index.js");
/* harmony import */ var _AudienceSegmentationSetupErrorWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./AudienceSegmentationSetupErrorWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationSetupErrorWidget.tsx");
/* harmony import */ var _IntroductoryOverlayNotification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./IntroductoryOverlayNotification */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/IntroductoryOverlayNotification.js");
/* harmony import */ var _SetupCTABanner__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupCTABanner */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/SetupCTABanner.js");
/* harmony import */ var _AudienceTilesWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./AudienceTilesWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/index.js");
/* harmony import */ var _AudienceSelectionPanel__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AudienceSelectionPanel */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/index.js");
/* harmony import */ var _AudienceAreaFooter__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./AudienceAreaFooter */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceAreaFooter.js");
/* harmony import */ var _ChangeGroupsLink__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ChangeGroupsLink */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/ChangeGroupsLink.js");
/* harmony import */ var _ConnectAnalyticsCTAWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectAnalyticsCTAWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/ConnectAnalyticsCTAWidget.js");
/* harmony import */ var _InfoNoticeWidget__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./InfoNoticeWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNoticeWidget/index.js");
/* harmony import */ var _InfoNotice__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./InfoNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/InfoNotice.js");
/* harmony import */ var _NoAudienceBannerWidget__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./NoAudienceBannerWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/NoAudienceBannerWidget/index.js");
/* harmony import */ var _SecondaryUserSetupWidget__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./SecondaryUserSetupWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/SecondaryUserSetupWidget/index.js");
/* harmony import */ var _PrimaryUserSetupWidget__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./PrimaryUserSetupWidget */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/PrimaryUserSetupWidget/index.js");
/**
 * Audience Segmentation dashboard 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.
 */


















/***/ },

/***/ "./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_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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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.ts");
/* harmony import */ var _CreateAccountField__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./CreateAccountField */ "./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __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, setValue] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_1__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.FORM_ACCOUNT_CREATE, 'accountName');
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_CreateAccountField__WEBPACK_IMPORTED_MODULE_3__["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_0__ = __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 _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/countries-timezones */ "./js/modules/analytics-4/utils/countries-timezones.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __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, setValue] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, 'countryCode');
  const [, setTimezone] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, 'timezone');
  const onEnhancedChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((index, item) => {
    const newCountryCode = item.dataset.value;
    if (newCountryCode !== value && _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_5__.countriesByCode[newCountryCode]) {
      setValue(newCountryCode);
      setTimezone(
      // eslint-disable-next-line sitekit/acronym-case
      _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_5__.countriesByCode[newCountryCode].defaultTimeZoneId);
    }
  }, [setValue, setTimezone, value]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Select, {
    className: "googlesitekit-analytics__select-country",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Country', 'google-site-kit'),
    value: value,
    onEnhancedChange: onEnhancedChange,
    enhanced: true,
    outlined: true,
    children: _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_5__.allCountries.map(({
      countryCode,
      displayName
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.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_0__ = __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_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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _CreateAccountField__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CreateAccountField */ "./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.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_4__.useFeature)('setupFlowRefresh');
  const [value, setValue] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.FORM_ACCOUNT_CREATE, 'propertyName');
  const isAnalyticsConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4));

  // 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_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_CreateAccountField__WEBPACK_IMPORTED_MODULE_9__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_6__.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_0__ = __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 _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_countries_timezones__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/countries-timezones */ "./js/modules/analytics-4/utils/countries-timezones.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __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_3__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, 'countryCode');
  const [value, setValue] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_ACCOUNT_CREATE, 'timezone');
  const onEnhancedChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)((index, item) => {
    setValue(item.dataset.value);
  }, [setValue]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Select, {
    className: "googlesitekit-analytics__select-timezone",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_5__.timeZonesByCountryCode[countryCode] || []).map(
    // eslint-disable-next-line sitekit/acronym-case
    ({
      timeZoneId,
      displayName
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.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_0__ = __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_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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _CreateAccountField__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CreateAccountField */ "./js/modules/analytics-4/components/common/AccountCreate/CreateAccountField.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_4__.useFeature)('setupFlowRefresh');
  const [value, setValue] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.FORM_ACCOUNT_CREATE, 'dataStreamName');
  const isAnalyticsConnected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4));

  // 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_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_CreateAccountField__WEBPACK_IMPORTED_MODULE_9__["default"], {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_6__.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 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* 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 _wordpress_url__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-args.js");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_7__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_8__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__);
/* harmony import */ var _js_components_conversion_tracking_SetupPluginConversionTrackingNotice__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/conversion-tracking/SetupPluginConversionTrackingNotice */ "./js/components/conversion-tracking/SetupPluginConversionTrackingNotice.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var _js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.tsx");
/* harmony import */ var _js_components_Typography_P__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.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_useQueryArg__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_material_components__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/js/material-components */ "./js/material-components/index.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_25__ = __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_26__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_account__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/account */ "./js/modules/analytics-4/utils/account.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _AccountCreateIntro__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./AccountCreateIntro */ "./js/modules/analytics-4/components/common/AccountCreate/AccountCreateIntro.tsx");
/* harmony import */ var _AccountField__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./AccountField */ "./js/modules/analytics-4/components/common/AccountCreate/AccountField.js");
/* harmony import */ var _Actions__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./Actions */ "./js/modules/analytics-4/components/common/AccountCreate/Actions.tsx");
/* harmony import */ var _CountrySelect__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./CountrySelect */ "./js/modules/analytics-4/components/common/AccountCreate/CountrySelect.js");
/* harmony import */ var _PropertyField__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./PropertyField */ "./js/modules/analytics-4/components/common/AccountCreate/PropertyField.js");
/* harmony import */ var _TimezoneSelect__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./TimezoneSelect */ "./js/modules/analytics-4/components/common/AccountCreate/TimezoneSelect.js");
/* harmony import */ var _WebDataStreamField__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./WebDataStreamField */ "./js/modules/analytics-4/components/common/AccountCreate/WebDataStreamField.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__ = __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 {
    accountCreationErrorCode,
    showProgress
  } = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_6__.getQueryArgs)(location.href);
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_19__.useFeature)('setupFlowRefresh');
  const setupFlowRefreshPhase4Enabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_19__.useFeature)('setupFlowRefreshPhase4');
  const [isNavigating, setIsNavigating] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4).getAccountSummaries());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const accountTicketTermsOfServiceURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4).getAccountTicketTermsOfServiceURL());
  const canSubmitAccountCreate = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4).canSubmitAccountCreate());
  const isDoingCreateAccount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4).isDoingCreateAccount());
  const hasEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.EDIT_SCOPE));
  const hasGTMScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.GTM_SCOPE));
  const hasAccountCreateForm = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_15__.CORE_FORMS).hasForm(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.FORM_ACCOUNT_CREATE));
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_20__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.FORM_ACCOUNT_CREATE, 'autoSubmit');
  const [, setAccountCreationErrorCode] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_21__["default"])('accountCreationErrorCode');
  const siteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_SITE).getReferenceSiteURL());
  const siteName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_SITE).getSiteName());
  const timezone = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_SITE).getTimezone());
  const pluginConversionsDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_SITE).getDocumentationLinkURL('plugin-conversion-tracking');
  });
  const dashboardURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_SITE).getAdminURL('googlesitekit-dashboard'));
  const sitePurposeSetupURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useSelect)(select => {
    const url = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_SITE).getAdminURL('googlesitekit-key-metrics-setup');
    return (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.addQueryArgs)(url, {
      showProgress
    });
  });
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_22__["default"])();
  const {
    setValues,
    createSnapshot
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_15__.CORE_FORMS);
  const {
    navigateTo
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useDispatch)(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_16__.CORE_LOCATION);
  const {
    createAccount
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4);
  const {
    setPermissionScopeError,
    saveInitialSetupSettings,
    setIsAnalyticsSetupComplete
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER);
  const {
    setConversionTrackingEnabled,
    saveConversionTrackingSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_9__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_SITE);
  const hasRequiredScope = hasEditScope;

  // Redirect if the accountTicketTermsOfServiceURL is set.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (accountTicketTermsOfServiceURL) {
      (async () => {
        await (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_7__.invalidateCache)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_25__.MODULE_SLUG_ANALYTICS_4);
        // Snapshot the `CORE_FORMS` store so the account creation
        // form values are restored if the user returns with an
        // error from the Terms of Service screen.
        await createSnapshot();
        navigateTo(accountTicketTermsOfServiceURL);
      })();
    }
  }, [accountTicketTermsOfServiceURL, navigateTo, createSnapshot]);

  // Set form defaults on initial render.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.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_26__.FORM_ACCOUNT_CREATE, (0,_js_modules_analytics_4_utils_account__WEBPACK_IMPORTED_MODULE_27__.getAccountDefaults)({
        siteName,
        siteURL,
        timezone
      }));
    }
  }, [hasAccountCreateForm, siteName, siteURL, timezone, setValues]);
  const isInitialSetupFlow = !!showProgress && setupFlowRefreshEnabled;
  const hasAccountCreationError = setupFlowRefreshEnabled && !!accountCreationErrorCode;
  const handleSubmit = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(async () => {
    const scopes = [];
    if (!hasEditScope) {
      scopes.push(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.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_26__.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.
      setAutoSubmit(true);
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_29__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Additional permissions are required to create a new Analytics account.', 'google-site-kit'),
        data: {
          status: 403,
          scopes,
          skipModal: true
        }
      });
      return;
    }
    setAutoSubmit(false);
    if (isInitialSetupFlow) {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_28__.trackEvent)(`${viewContext}_setup`, 'setup_flow_v3_create_analytics_account');
    } else {
      await (0,_js_util__WEBPACK_IMPORTED_MODULE_28__.trackEvent)(`${viewContext}_analytics`, 'create_account', 'proxy');
    }
    const {
      error
    } = await createAccount({
      showProgress: showProgress === 'true'
    });
    if (!error) {
      setConversionTrackingEnabled(true);
      await saveConversionTrackingSettings();
      setIsNavigating(true);
    }
  }, [hasEditScope, hasGTMScope, setAutoSubmit, 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_2__.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_9__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4);
  const handleBack = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    setAccountCreationErrorCode(undefined);
    rollbackSettings();
  }, [rollbackSettings, setAccountCreationErrorCode]);

  // Navigate the user directly to the next step without setting up Analytics.
  // `isAnalyticsSetupComplete` is persisted to `true` so the dashboard's
  // initial-setup-flow redirect (in `Screens.php`) doesn't bounce the user
  // back to the Analytics setup screen.
  const handleContinueWithoutAnalytics = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(async () => {
    const nextURL = setupFlowRefreshPhase4Enabled ? sitePurposeSetupURL : dashboardURL;
    setIsAnalyticsSetupComplete(true);
    setIsNavigating(true);
    await saveInitialSetupSettings();
    navigateTo(nextURL);
  }, [navigateTo, dashboardURL, sitePurposeSetupURL, saveInitialSetupSettings, setIsAnalyticsSetupComplete, setupFlowRefreshPhase4Enabled]);
  if (isDoingCreateAccount || isNavigating || !hasResolvedAccounts || hasRequiredScope === undefined) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_8__.ProgressBar, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsxs)("div", {
    className: className,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_13__["default"], {
      moduleSlug: "analytics-4",
      storeName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.MODULES_ANALYTICS_4
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_AccountCreateIntro__WEBPACK_IMPORTED_MODULE_30__["default"], {
      isInitialSetupFlow: isInitialSetupFlow,
      accountCreationErrorCode: accountCreationErrorCode,
      onRetry: handleSubmit
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--grid-layout",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_23__.Cell, {
        size: 6,
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--account",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_AccountField__WEBPACK_IMPORTED_MODULE_31__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_23__.Cell, {
        size: 6,
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--property",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_PropertyField__WEBPACK_IMPORTED_MODULE_34__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_23__.Cell, {
        size: 6,
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--webdatastream",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_WebDataStreamField__WEBPACK_IMPORTED_MODULE_36__["default"], {})
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--grid-layout",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_23__.Cell, {
        size: 6,
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--country",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_CountrySelect__WEBPACK_IMPORTED_MODULE_33__["default"], {})
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_material_components__WEBPACK_IMPORTED_MODULE_23__.Cell, {
        size: 6,
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--timezone",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_TimezoneSelect__WEBPACK_IMPORTED_MODULE_35__["default"], {})
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_24__.EnhancedMeasurementSwitch, {
        formName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_26__.FORM_ACCOUNT_CREATE,
        className: "googlesitekit-margin-bottom-0"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_components_conversion_tracking_SetupPluginConversionTrackingNotice__WEBPACK_IMPORTED_MODULE_10__["default"], {
        className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
          'googlesitekit-margin-top-0': !setupFlowRefreshEnabled
        }),
        message: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_37__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_11__["default"], {
            href: pluginConversionsDocumentationURL,
            external: true,
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Learn more', 'google-site-kit')
          }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)(_js_components_Null__WEBPACK_IMPORTED_MODULE_12__["default"], {})
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsxs)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_14__["default"], {
      className: "googlesitekit-analytics-setup__analytics-create-account-info",
      size: setupFlowRefreshEnabled ? 'small' : undefined,
      children: [hasRequiredScope && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_37__.jsx)("span", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_37__.jsx)("span", {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('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_37__.jsx)(_Actions__WEBPACK_IMPORTED_MODULE_32__["default"], {
      canSubmitAccountCreate: canSubmitAccountCreate,
      onCreateAccount: handleSubmit,
      accounts: accounts,
      onBack: handleBack,
      hasAccountCreationError: hasAccountCreationError,
      isInitialSetupFlow: isInitialSetupFlow,
      onContinueWithoutAnalytics: handleContinueWithoutAnalytics
    })]
  });
}
AccountCreate.propTypes = {
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_0__ = __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_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.tsx");
/* 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_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _CreatePropertyInfoNotice__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./CreatePropertyInfoNotice */ "./js/modules/analytics-4/components/common/CreatePropertyInfoNotice.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __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_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.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_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getAccountID());
  const isCreateAccount = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ACCOUNT_CREATE === accountID;
  const createAccountURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getServiceURL({
    path: '/provision/SignUp'
  }));
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const createAccountHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async event => {
    event.preventDefault();
    await (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(`${viewContext}_analytics`, 'create_account', 'custom-oauth');
    globalThis.open(createAccountURL, '_blank');
  }, [createAccountURL, viewContext]);
  const {
    resetAccountSummaries,
    resetAccountSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
  const refetchAccountsHandler = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    resetAccountSummaries();
    resetAccountSettings();
  }, [resetAccountSettings, resetAccountSummaries]);
  if (!hasResolvedAccounts) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {});
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_CreatePropertyInfoNotice__WEBPACK_IMPORTED_MODULE_9__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_4__["default"], {
      moduleSlug: "analytics-4",
      storeName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4
    }), !isCreateAccount && accounts && accounts.length === 0 && /*#__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_1__.__)('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_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_1__.__)('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_10__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_5__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Once completed, click the link below to re-fetch your accounts to continue.', 'google-site-kit')
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("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: createAccountHandler,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Create an account', 'google-site-kit')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        className: "googlesitekit-setup-module__sub-action",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.Button, {
          onClick: refetchAccountsHandler,
          tertiary: true,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.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.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getAccountID());
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.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_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const {
    selectAccount
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  const onAccountChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.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_6__.ACCOUNT_CREATE ? 'change_account_new' : 'change_account';
      (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.trackEvent)(`${viewContext}_analytics`, action);
      if (onChange) {
        onChange();
      }
    }
  }, [accountID, selectAccount, viewContext, onChange]);
  if (!hasResolvedAccounts) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.ProgressBar, {
      small: true
    });
  }
  if (hasModuleAccess === false) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Select, {
      className: "googlesitekit-analytics__select-account",
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Account', 'google-site-kit'),
      value: accountID,
      enhanced: true,
      outlined: true,
      disabled: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Option, {
        value: accountID,
        children: accountID
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Select, {
    className: "googlesitekit-analytics__select-account",
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('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_6__.ACCOUNT_CREATE,
      displayName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Set up a new account', 'google-site-kit')
    }).map(({
      _id,
      displayName
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Option, {
      value: _id,
      children: displayName
    }, index))
  });
}
AccountSelect.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_element__WEBPACK_IMPORTED_MODULE_0__ = __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_components_Link__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _js_components_Notice_index__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice/index */ "./js/components/Notice/index.tsx");
/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_2__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getDocumentationLinkURL('ga4');
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_Notice_index__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_4__.NOTICE_TYPES.INFO,
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_7__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["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_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_use__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _js_components_SupportLink__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/SupportLink */ "./js/components/SupportLink.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_tick_svg__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/svg/icons/tick.svg */ "./svg/icons/tick.svg");
/* harmony import */ var _MeasurementSettingRow__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./MeasurementSettingRow */ "./js/modules/analytics-4/components/common/MeasurementSettingRow.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __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_11__.ENHANCED_MEASUREMENT_FORM,
  isEnhancedMeasurementAlreadyEnabled = false,
  showTick = false,
  variant = 'switch'
}) {
  const [isEnhancedMeasurementEnabled, setIsEnhancedMeasurementEnabled] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(formName, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.ENHANCED_MEASUREMENT_ENABLED);
  const [, setShouldDismissActivationBanner] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.ENHANCED_MEASUREMENT_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.ENHANCED_MEASUREMENT_SHOULD_DISMISS_ACTIVATION_BANNER);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const [showProgress] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_9__["default"])('showProgress');
  const isInitialSetupFlow = !!showProgress;
  const handleClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__.useCallback)(() => {
    setIsEnhancedMeasurementEnabled(!isEnhancedMeasurementEnabled);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.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?.();
  }, [isEnhancedMeasurementEnabled, onClick, setIsEnhancedMeasurementEnabled, viewContext]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_2__["default"])(() => {
    // Ensure the Enhanced Measurement activation banner won't be shown if we've updated the setting
    // via the switch.
    setShouldDismissActivationBanner(true);
  });

  // Both variants show the same description. Define it once so the
  // translatable text is not duplicated and both Learn more links send
  // the same tracking event.
  const description = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('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_15__.jsx)(_js_components_SupportLink__WEBPACK_IMPORTED_MODULE_7__["default"], {
      path: "/analytics/answer/9216061",
      onClick: () => {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.trackEvent)(isInitialSetupFlow ? `${viewContext}_setup` : viewContext, 'click_learn_more_link', 'enhanced_measurement');
      },
      hideExternalIndicator: variant === 'row',
      external: true
    })
  });

  // The settings screen shows enhanced measurement as a row, to match the
  // advanced data breakdowns row. The setup screen keeps the switch.
  if (variant === 'row') {
    const isEnabled = isEnhancedMeasurementEnabled || isEnhancedMeasurementAlreadyEnabled;
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_MeasurementSettingRow__WEBPACK_IMPORTED_MODULE_14__["default"], {
      loading: loading,
      isEnabled: isEnabled,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Enhanced measurement', 'google-site-kit'),
      description: description,
      action: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__.Button, {
        onClick: handleClick,
        disabled: disabled,
        inverse: true,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Enable', 'google-site-kit')
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.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_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__.ProgressBar, {
      className: "googlesitekit-analytics-enable-enhanced-measurement__progress--settings-edit",
      small: true
    }), !loading && isEnhancedMeasurementAlreadyEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsxs)("div", {
      className: "googlesitekit-analytics-enable-enhanced-measurement__already-enabled-label",
      children: [showTick && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("div", {
        className: "googlesitekit-analytics-enable-enhanced-measurement__already-enabled-tick",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(_svg_icons_tick_svg__WEBPACK_IMPORTED_MODULE_13__["default"], {})
      }), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Enhanced measurement is enabled for this web data stream', 'google-site-kit')]
    }), !loading && !isEnhancedMeasurementAlreadyEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__.Switch, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_5__.__)('Enable enhanced measurement', 'google-site-kit'),
      checked: isEnhancedMeasurementEnabled,
      disabled: disabled,
      onClick: handleClick,
      hideLabel: false
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__.jsx)("p", {
      className: "googlesitekit-module-settings-group__helper-text",
      children: description
    })]
  });
}
EnhancedMeasurementSwitch.propTypes = {
  onClick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func),
  disabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  loading: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  isEnhancedMeasurementAlreadyEnabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  showTick: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  variant: prop_types__WEBPACK_IMPORTED_MODULE_1___default().oneOf(['switch', 'row'])
};

/***/ },

/***/ "./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_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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 _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_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __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 viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const learnMoreLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('what-is-ga4-property'));
  const [showProgress] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_6__["default"])('showProgress');
  const isInitialSetupFlow = !!showProgress;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_setup_StepHint__WEBPACK_IMPORTED_MODULE_4__["default"], {
    leadingText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('What is an Analytics property?', 'google-site-kit'),
    tooltipText: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_9__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
        href: learnMoreLink,
        onClick: () => {
          (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(isInitialSetupFlow ? `${viewContext}_setup` : viewContext, 'click_learn_more_link', 'analytics_property');
        },
        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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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 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_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* 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_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __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_5__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getAccountID());
  const properties = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => hasModuleAccess && !isDisabled ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertySummaries(accountID) || [] : null);
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyID());
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
    if (isDisabled) {
      return false;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isLoadingPropertySummaries() || select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isLoadingWebDataStreams({
      hasModuleAccess
    });
  });
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const {
    selectProperty
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
  const onPropertyChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)((index, {
    dataset
  }) => {
    const newPropertyID = dataset.value;
    if (propertyID === newPropertyID) {
      return;
    }
    selectProperty(newPropertyID);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}_analytics`, newPropertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.PROPERTY_CREATE ? 'change_property_new' : 'change_property', 'ga4');
    onChange();
  }, [onChange, propertyID, selectProperty, viewContext]);
  if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidAccountID)(accountID)) {
    return null;
  } else if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.ProgressBar, {
      mobileVerticalSpacing: 76,
      desktopVerticalSpacing: 84,
      small: true
    });
  }
  const isValidSelection = propertyID === undefined || propertyID === '' ? true : (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertySelection)(propertyID);
  if (hasModuleAccess === false) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Select, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-analytics-4__select-property', className),
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Property', 'google-site-kit'),
      value: propertyID,
      enhanced: true,
      outlined: true,
      disabled: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Option, {
        value: propertyID,
        children: propertyID
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.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_3__.__)('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_7__.PROPERTY_CREATE,
      displayName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Set up a new property', 'google-site-kit')
    }).map(({
      _id,
      displayName
    }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Option, {
      value: _id,
      children: _id === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.PROPERTY_CREATE ? displayName : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: 1: Property name. 2: Property ID. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._x)('%1$s (%2$s)', 'Analytics property name and ID', 'google-site-kit'), displayName, _id)
    }, _id))
  });
}
PropertySelect.propTypes = {
  isDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  onChange: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_0__ = __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_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 _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_1__.__)('All logged-in users', 'google-site-kit'),
  [TRACKING_CONTENT_CREATORS]: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Users that can write posts', 'google-site-kit')
};
function TrackingExclusionSwitches() {
  const trackingDisabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getTrackingDisabled());
  const {
    setTrackingDisabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  let message;
  if (trackingDisabled && trackingDisabled.includes(TRACKING_LOGGED_IN_USERS)) {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_1__.__)('Users that can write posts will be excluded from Analytics tracking', 'google-site-kit');
  } else {
    message = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('All logged-in users will be included in Analytics tracking', 'google-site-kit');
  }
  const updateTrackingDisabled = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_0__.useCallback)(event => {
    const {
      checked: exclude
    } = event.target;
    updateTrackingDisabled(TRACKING_CONTENT_CREATORS, exclude);
  }, [updateTrackingDisabled]);
  const onChangeTrackLoggedInUsers = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.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_7__.jsxs)("div", {
    className: "googlesitekit-settings-module__fields-group",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_1__.__)('Exclude Analytics', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-item",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsxs)("div", {
        className: "googlesitekit-settings-module__inline-items",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("div", {
          className: "googlesitekit-settings-module__inline-item",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_7__.jsx)("div", {
          className: "googlesitekit-settings-module__inline-item",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.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_7__.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_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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.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.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __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_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getUseSnippet());
  const {
    setUseSnippet
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    const newUseSnippet = !useSnippet;
    setUseSnippet(newUseSnippet);
    (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.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_8__.jsxs)("div", {
    className: "googlesitekit-analytics-usesnippet",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Switch, {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Place Google Analytics code', 'google-site-kit'),
      checked: useSnippet,
      onClick: onChange,
      hideLabel: false
    }), description]
  });
}
UseSnippetSwitch.propTypes = {
  description: (prop_types__WEBPACK_IMPORTED_MODULE_0___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_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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 _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_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __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 viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const learnMoreLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).getDocumentationLinkURL('what-is-ga4-data-stream'));
  const [showProgress] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_6__["default"])('showProgress');
  const isInitialSetupFlow = !!showProgress;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_components_setup_StepHint__WEBPACK_IMPORTED_MODULE_4__["default"], {
    leadingText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('What is a web data stream?', 'google-site-kit'),
    tooltipText: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('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_9__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["default"], {
        href: learnMoreLink,
        onClick: () => {
          (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.trackEvent)(isInitialSetupFlow ? `${viewContext}_setup` : viewContext, 'click_learn_more_link', 'analytics_data_stream');
        },
        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_1__ = __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 _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* 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 googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _js_components_AccessibleWarningIcon__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/AccessibleWarningIcon */ "./js/components/AccessibleWarningIcon.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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __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_6__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getPropertyID());
  const webDataStreamID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getWebDataStreamID());
  const [webDataStreamName, setWebDataStreamName] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_9__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.FORM_SETUP, 'webDataStreamName');
  const webDataStreamAlreadyExists = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_11__.isValidPropertyID)(propertyID) ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).doesWebDataStreamExist(propertyID, webDataStreamName) : false);
  const siteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getReferenceSiteURL());
  const onChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(({
    currentTarget
  }) => {
    setWebDataStreamName(currentTarget.value);
  }, [setWebDataStreamName]);

  // Set the default web data stream name.
  (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(() => {
    if (!webDataStreamName && (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_4__.isURL)(siteURL)) {
      const {
        hostname
      } = new URL(siteURL);
      setWebDataStreamName(hostname);
    }
  });

  // Return early if an existing web data stream is selected.
  if (webDataStreamID !== _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.WEBDATASTREAM_CREATE) {
    return null;
  }
  const error = webDataStreamAlreadyExists || !webDataStreamName || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_11__.isValidWebDataStreamName)(webDataStreamName);
  let helperText = false;
  if (webDataStreamAlreadyExists) {
    helperText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('A web data stream with this name already exists.', 'google-site-kit');
  } else if (!webDataStreamName) {
    helperText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('A web data stream name is required.', 'google-site-kit');
  } else if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_11__.isValidWebDataStreamName)(webDataStreamName)) {
    helperText = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('This is not a valid web data stream name.', 'google-site-kit');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("div", {
    className: "googlesitekit-analytics-webdatastreamname",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.TextField, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
        'mdc-text-field--error': error
      }),
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Web data stream name', 'google-site-kit'),
      helperText: helperText,
      trailingIcon: error && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
        className: "googlesitekit-text-field-icon--error",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_AccessibleWarningIcon__WEBPACK_IMPORTED_MODULE_7__["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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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 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_useViewContext__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* 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_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.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 WebDataStreamSelect(props) {
  const {
    hasModuleAccess,
    isDisabled,
    className,
    onChange
  } = props;
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getAccountID());
  const {
    propertyID,
    webDataStreamID,
    measurementID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getSettings() || {});
  const webDataStreams = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID) && hasModuleAccess ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getWebDataStreams(propertyID) : []);
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => {
    if (isDisabled) {
      return false;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isLoadingWebDataStreams({
      hasModuleAccess
    });
  });
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_6__["default"])();
  const {
    setWebDataStreamID,
    updateSettingsForMeasurementID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
  const onWebDataStreamChange = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.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_9__.trackEvent)(`${viewContext}_analytics`, newID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.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_8__.isValidAccountID)(accountID)) {
    return null;
  } else if (isLoading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.ProgressBar, {
      mobileVerticalSpacing: 76,
      desktopVerticalSpacing: 84,
      small: true
    });
  }
  const isValidSelection = webDataStreamID === undefined || webDataStreamID === '' ? true : (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamSelection)(webDataStreamID);
  if (hasModuleAccess === false) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Select, {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-analytics-4__select-webdatastream', className),
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Web data stream', 'google-site-kit'),
      value: measurementID,
      enhanced: true,
      outlined: true,
      disabled: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Option, {
        value: measurementID,
        children: measurementID
      })
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.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_3__.__)('Web data stream', 'google-site-kit'),
    value: webDataStreamID,
    onEnhancedChange: onWebDataStreamChange,
    disabled: isDisabled || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertySelection)(propertyID),
    enhanced: true,
    outlined: true,
    children: (webDataStreams || []).concat({
      _id: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.WEBDATASTREAM_CREATE,
      displayName: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Set up a new web data stream', 'google-site-kit')
    }).map(({
      _id,
      displayName,
      webStreamData = {}
    }, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Option, {
      value: _id,
      children: _id === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.WEBDATASTREAM_CREATE || !webStreamData?.measurementId // eslint-disable-line sitekit/acronym-case
      ? displayName : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: 1: Data stream name. 2: Measurement ID. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._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_1___default().bool),
  isDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  className: (prop_types__WEBPACK_IMPORTED_MODULE_1___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_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__);
/* 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_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 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_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getCurrentEntityURL());
  if (skipPrefix) {
    return url ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Your page hasn’t received any visitors yet', 'google-site-kit')
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Your site hasn’t received any visitors yet', 'google-site-kit')
    });
  }
  return url ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No data to display: your page hasn’t received any visitors yet', 'google-site-kit')
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)("span", {
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No data to display: your site hasn’t received any visitors yet', 'google-site-kit')
  });
}
ZeroDataMessage.propTypes = {
  skipPrefix: (prop_types__WEBPACK_IMPORTED_MODULE_0___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 */   MeasurementSettingRow: () => (/* reexport safe */ _MeasurementSettingRow__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   PropertyHint: () => (/* reexport safe */ _PropertyHint__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   PropertySelect: () => (/* reexport safe */ _PropertySelect__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   TrackingExclusionSwitches: () => (/* reexport safe */ _TrackingExclusionSwitches__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   UseSnippetSwitch: () => (/* reexport safe */ _UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_12__["default"]),
/* harmony export */   WebDataStreamHint: () => (/* reexport safe */ _WebDataStreamHint__WEBPACK_IMPORTED_MODULE_9__["default"]),
/* harmony export */   WebDataStreamNameInput: () => (/* reexport safe */ _WebDataStreamNameInput__WEBPACK_IMPORTED_MODULE_10__["default"]),
/* harmony export */   WebDataStreamSelect: () => (/* reexport safe */ _WebDataStreamSelect__WEBPACK_IMPORTED_MODULE_11__["default"]),
/* harmony export */   ZeroDataMessage: () => (/* reexport safe */ _ZeroDataMessage__WEBPACK_IMPORTED_MODULE_13__["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 _MeasurementSettingRow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MeasurementSettingRow */ "./js/modules/analytics-4/components/common/MeasurementSettingRow.tsx");
/* harmony import */ var _PropertyHint__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./PropertyHint */ "./js/modules/analytics-4/components/common/PropertyHint.js");
/* harmony import */ var _PropertySelect__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PropertySelect */ "./js/modules/analytics-4/components/common/PropertySelect.js");
/* harmony import */ var _TrackingExclusionSwitches__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./TrackingExclusionSwitches */ "./js/modules/analytics-4/components/common/TrackingExclusionSwitches.js");
/* harmony import */ var _WebDataStreamHint__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./WebDataStreamHint */ "./js/modules/analytics-4/components/common/WebDataStreamHint.js");
/* harmony import */ var _WebDataStreamNameInput__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./WebDataStreamNameInput */ "./js/modules/analytics-4/components/common/WebDataStreamNameInput.js");
/* harmony import */ var _WebDataStreamSelect__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./WebDataStreamSelect */ "./js/modules/analytics-4/components/common/WebDataStreamSelect.js");
/* harmony import */ var _UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./UseSnippetSwitch */ "./js/modules/analytics-4/components/common/UseSnippetSwitch.js");
/* harmony import */ var _ZeroDataMessage__WEBPACK_IMPORTED_MODULE_13__ = __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/dashboard/DashboardAllTrafficWidgetGA4/DataSourceLink.js"
/*!****************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/DataSourceLink.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 */ DataSourceLink)
/* 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_url__WEBPACK_IMPORTED_MODULE_1__ = __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_components_SourceLink__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* 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_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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * DashboardAllTrafficWidgetGA4 Data Source Link 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 DataSourceLink() {
  const viewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const serviceReportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (viewOnly) {
      return null;
    }
    const dimensionName = select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_UI).getValue(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.UI_DIMENSION_NAME) || 'sessionDefaultChannelGrouping';
    const entityURL = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getCurrentEntityURL();
    const {
      startDate,
      endDate,
      compareStartDate,
      compareEndDate
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getDateRangeDates({
      compare: true
    });
    const reportArgs = {
      dates: {
        startDate,
        endDate,
        compareStartDate,
        compareEndDate
      }
    };
    let reportType;
    switch (dimensionName) {
      case 'country':
        reportType = 'user-demographics-detail';
        reportArgs.details = {
          metric: 'activeUsers',
          dimension: 'country'
        };
        // eslint-disable-next-line sitekit/acronym-case
        reportArgs.otherArgs = {
          collectionId: 'user'
        };
        break;
      case 'deviceCategory':
        reportType = 'user-technology-detail';
        reportArgs.details = {
          metric: 'activeUsers',
          dimension: 'deviceCategory'
        };
        // eslint-disable-next-line sitekit/acronym-case
        reportArgs.otherArgs = {
          collectionId: 'user'
        };
        break;
      case 'sessionDefaultChannelGrouping':
      default:
        reportType = 'lifecycle-traffic-acquisition-v2';
        // eslint-disable-next-line sitekit/acronym-case
        reportArgs.otherArgs = {
          collectionId: 'life-cycle'
        };
        break;
    }
    if ((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.isURL)(entityURL)) {
      reportArgs.filters = {
        unifiedPagePathScreen: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.getURLPath)(entityURL)
      };
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceReportURL(reportType, reportArgs);
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_3__["default"], {
    className: "googlesitekit-data-block__source",
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Analytics', 'Service name', 'google-site-kit'),
    href: serviceReportURL,
    external: true
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/DimensionTabs.js"
/*!***************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/DimensionTabs.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 */ DimensionTabs)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * DimensionTabs 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 tabs = [{
  tabText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Channels', 'google-site-kit'),
  dimensionName: 'sessionDefaultChannelGrouping'
}, {
  tabText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Locations', 'google-site-kit'),
  dimensionName: 'country'
}, {
  tabText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Devices', 'google-site-kit'),
  dimensionName: 'deviceCategory'
}];
function DimensionTabs({
  dimensionName,
  gatheringData,
  loaded,
  isZeroData
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_UI);
  const activeTab = tabs.findIndex(tab => tab.dimensionName === dimensionName);
  const handleTabUpdate = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(index => {
    const {
      dimensionName: name
    } = tabs[index] || {};
    setValues({
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.UI_DIMENSION_NAME]: name,
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.UI_DIMENSION_VALUE]: '',
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.UI_DIMENSION_COLOR]: '',
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.UI_ACTIVE_ROW_INDEX]: null
    });
    (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.trackEvent)(`${viewContext}_all-traffic-widget`, 'tab_select', name);
  }, [setValues, viewContext]);
  if (!loaded) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "googlesitekit-widget--analyticsAllTraffic__tabs--loading",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
        width: "100px",
        height: "40px",
        shape: "square"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
        width: "100px",
        height: "40px",
        shape: "square"
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
        width: "100px",
        height: "40px",
        shape: "square"
      })]
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "googlesitekit-widget--analyticsAllTraffic__tabs hidden-on-mobile",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.TabBar, {
        activeIndex: activeTab,
        handleActiveIndexUpdate: handleTabUpdate,
        children: tabs.map(tab => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Tab, {
          className: "mdc-tab--min-width",
          focusOnActivate: false,
          disabled: gatheringData || isZeroData,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("span", {
            className: "mdc-tab__text-label",
            children: tab.tabText
          })
        }, tab.dimensionName))
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "googlesitekit-widget--analyticsAllTraffic__tabs--small",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Select, {
        onEnhancedChange: handleTabUpdate,
        value: `dimension-name-${activeTab}`,
        disabled: gatheringData || isZeroData,
        enhanced: true,
        outlined: true,
        children: tabs.map((tab, index) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Option, {
          value: `dimension-name-${index}`,
          children: tab.tabText
        }, tab.dimensionName))
      })
    })]
  });
}
DimensionTabs.propTypes = {
  dimensionName: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  isZeroData: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  loaded: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/TotalUserCount.js"
/*!****************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/TotalUserCount.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 */ TotalUserCount)
/* 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/icon/index.js");
/* harmony import */ var _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/icons */ "../node_modules/@wordpress/icons/build-module/library/chevron-right.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/ChangeArrow */ "./js/components/ChangeArrow.js");
/* harmony import */ var _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/GatheringDataNotice */ "./js/components/GatheringDataNotice.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_components_ReportError__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/ReportError */ "./js/components/ReportError.js");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TotalUserCount 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 TotalUserCount(props) {
  const {
    loaded,
    error,
    report,
    dimensionValue,
    gatheringData
  } = props;
  const dateRange = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).getDateRange());
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_UI);
  function showAllUsers() {
    setValues({
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_VALUE]: '',
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: ''
    });
  }
  if (!loaded) {
    return (
      /*#__PURE__*/
      // Height is based on real count desktop height (100px), minus 10px for the extra margin.
      // For extra large desktop viewports, it is increased via CSS to 106px, to match the respective
      // real count height for those devices (116px).
      // TODO: Modify `PreviewBlock` to allow for different sizes per breakpoint.
      (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_10__["default"], {
        className: "googlesitekit-widget--analyticsAllTraffic__totalcount--loading",
        width: "220px",
        height: "90px",
        shape: "square"
      })
    );
  }
  if (error) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_ReportError__WEBPACK_IMPORTED_MODULE_11__["default"], {
      moduleSlug: "analytics-4",
      error: error
    });
  }
  const {
    totals
  } = report || {};
  const [current, previous] = totals || [];
  const change = (0,_js_util__WEBPACK_IMPORTED_MODULE_16__.calculateChange)(previous?.metricValues?.[0]?.value, current?.metricValues?.[0]?.value);
  let currentDateRangeLabel = null;
  const currentDateRangeDays = (0,_js_util__WEBPACK_IMPORTED_MODULE_16__.getAvailableDateRanges)()[dateRange]?.days;
  if (currentDateRangeDays) {
    currentDateRangeLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.sprintf)(/* translators: %s: number of days */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('compared to the previous %s days', 'google-site-kit'), currentDateRangeDays);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("div", {
    className: "googlesitekit-widget--analyticsAllTraffic__totalcount googlesitekit-data-block",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_12__["default"], {
      as: "h3",
      className: "googlesitekit-subheading-1 googlesitekit-data-block__title",
      children: [!dimensionValue && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("span", {
        children: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('All Visitors', 'google-site-kit'), " "]
      }), dimensionValue && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
        children: [dimensionValue && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_9__["default"], {
          onClick: showAllUsers,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('All Visitors', 'google-site-kit')
        }), !dimensionValue && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("span", {
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('All Visitors', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_wordpress_icons__WEBPACK_IMPORTED_MODULE_4__["default"], {
          icon: _wordpress_icons__WEBPACK_IMPORTED_MODULE_5__["default"],
          size: "18",
          fill: "currentColor"
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("span", {
          children: dimensionValue
        })]
      })]
    }), gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_8__["default"], {
      style: _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_8__.NOTICE_STYLE.LARGE
    }), !gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
      children: [!!current?.metricValues?.[0]?.value && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("div", {
        className: "googlesitekit-data-block__datapoint",
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_16__.numFmt)(current?.metricValues?.[0]?.value)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("div", {
        className: "googlesitekit-data-block__change",
        children: [!!change && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("span", {
          className: "googlesitekit-data-block__arrow",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_7__["default"], {
            direction: 0 <= change ? 'up' : 'down',
            width: 9,
            height: 9
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("span", {
          className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-data-block__value', {
            'googlesitekit-data-block__value--up': 0 < change,
            'googlesitekit-data-block__value--down': 0 > change
          }),
          children: (0,_js_util__WEBPACK_IMPORTED_MODULE_16__.numFmt)(Math.abs(change), {
            style: 'percent',
            maximumFractionDigits: 1
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("span", {
          className: "googlesitekit-data-block__suffix",
          children: currentDateRangeLabel
        })]
      })]
    })]
  });
}
TotalUserCount.propTypes = {
  loaded: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  report: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  dimensionValue: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().string),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/UserCountGraph.js"
/*!****************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/UserCountGraph.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 */ UserCountGraph)
/* 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_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 _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_components_GoogleChart__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/GoogleChart */ "./js/components/GoogleChart/index.js");
/* harmony import */ var _js_components_ReportError__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/ReportError */ "./js/components/ReportError.js");
/* harmony import */ var _js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/parseDimensionStringToDate */ "./js/modules/analytics-4/utils/parseDimensionStringToDate.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/utils.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * UserCountGraph 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 UserCountGraph(props) {
  const {
    loaded,
    error,
    report,
    gatheringData
  } = props;
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_8__["default"])();
  const {
    startDate,
    endDate
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getDateRangeDates());
  const graphLineColor = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_UI).getValue(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.UI_DIMENSION_COLOR) || '#3c7251');
  const propertyCreateTime = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (isViewOnly) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getPropertyCreateTime();
  });
  if (error) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_ReportError__WEBPACK_IMPORTED_MODULE_5__["default"], {
      moduleSlug: "analytics-4",
      error: error
    });
  }
  let rows;
  if (Array.isArray(report?.rows)) {
    rows = report.rows;
  } else if (gatheringData) {
    rows = [];
  } else {
    // Get the first date after the start date so there's a tick at the start
    // of the date range.
    // See: https://github.com/google/site-kit-wp/pull/8053#pullrequestreview-1811682783
    const dateAfterStartDate = (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.stringToDate)(startDate);
    dateAfterStartDate.setDate(dateAfterStartDate.getDate() + 1);
    const dateAfterStartDateString = (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.getDateString)(dateAfterStartDate);

    // For the "zero data" case, we need to create a zero data row for the start
    // and end dates to ensure the chart renders the ticks at the correct
    // offsets.
    //
    // We also need to create an additional row for
    rows = [(0,_utils__WEBPACK_IMPORTED_MODULE_12__.createZeroDataRow)(startDate), (0,_utils__WEBPACK_IMPORTED_MODULE_12__.createZeroDataRow)(dateAfterStartDateString), (0,_utils__WEBPACK_IMPORTED_MODULE_12__.createZeroDataRow)(endDate)];
  }
  const chartData = [[{
    type: 'date',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Day', 'google-site-kit')
  }, {
    type: 'number',
    label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Users', 'google-site-kit')
  }], ...rows.map(({
    metricValues,
    dimensionValues
  }) => [(0,_js_modules_analytics_4_utils_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_10__["default"])(dimensionValues[0].value), metricValues[0].value])];
  const [, ...ticks] = chartData.slice(1).map(([date]) => date);
  const chartOptions = (0,lodash__WEBPACK_IMPORTED_MODULE_0__.cloneDeep)(UserCountGraph.chartOptions);
  chartOptions.series[0].color = graphLineColor;
  chartOptions.hAxis.ticks = ticks;

  // Set the `max` height of the chart to `undefined` so that the chart will
  // show all content, but only if the report is loaded/has data.
  if (!report?.totals?.[0]?.metricValues?.[0]?.value ||
  // The total returned by the API can be a string, so make sure we cast it
  // to a number.
  parseInt(report?.totals?.[0]?.metricValues?.[0]?.value, 10) === 0) {
    chartOptions.vAxis.viewWindow.max = 100;
  } else {
    chartOptions.vAxis.viewWindow.max = undefined;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
    className: "googlesitekit-widget--analyticsAllTraffic__user-count-chart",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_GoogleChart__WEBPACK_IMPORTED_MODULE_4__["default"], {
      chartType: "LineChart",
      data: chartData,
      dateMarkers: propertyCreateTime ? [{
        date: (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.getDateString)(
        // Valid use of `new Date()` with an argument.
        // eslint-disable-next-line sitekit/no-direct-date
        new Date(propertyCreateTime)),
        text: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Google Analytics property created', 'google-site-kit')
      }] : undefined,
      height: "368px",
      loadingHeight: "340px",
      loaded: loaded,
      options: chartOptions,
      gatheringData: gatheringData,
      width: "100%"
    })
  });
}
UserCountGraph.propTypes = {
  loaded: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool),
  error: prop_types__WEBPACK_IMPORTED_MODULE_1___default().shape({}),
  report: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().object),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().bool)
};
UserCountGraph.chartOptions = {
  animation: {
    startup: true
  },
  curveType: 'function',
  height: 340,
  width: '100%',
  colors: ['#3c7251'],
  chartArea: {
    left: 7,
    right: 40,
    height: 300,
    top: 21
  },
  legend: {
    position: 'none'
  },
  hAxis: {
    // This color is the result of placing `rgba(26, 115, 232, 0.08)` over the white (`#ffffff`) background.
    backgroundColor: '#eef4fd',
    format: 'MMM d',
    gridlines: {
      color: '#ffffff'
    },
    textPosition: 'out',
    textStyle: {
      color: '#616161',
      fontSize: 12
    }
  },
  vAxis: {
    gridlines: {
      color: '#ece9f1'
    },
    lineWidth: 3,
    minorGridlines: {
      color: '#ffffff'
    },
    minValue: 0,
    textStyle: {
      color: '#616161',
      fontSize: 12
    },
    textPosition: 'out',
    viewWindow: {
      min: 0
    }
  },
  series: {
    0: {
      lineWidth: 3,
      targetAxisIndex: 1
    }
  },
  focusTarget: 'category',
  crosshair: {
    color: '#3c7251',
    opacity: 0.1,
    orientation: 'vertical',
    trigger: 'both'
  }
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/UserDimensionsPieChart.js"
/*!************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/UserDimensionsPieChart.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 */ UserDimensionsPieChart)
/* 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_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_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/useKey.js");
/* 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_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);
/* 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_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/GatheringDataNotice */ "./js/components/GatheringDataNotice.js");
/* harmony import */ var _js_components_GoogleChart__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/GoogleChart */ "./js/components/GoogleChart/index.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.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_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_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_icons_pie_chart_zero_data_svg__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/svg/icons/pie-chart-zero-data.svg */ "./svg/icons/pie-chart-zero-data.svg");
/* harmony import */ var _hooks_usePieChartSlices__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./hooks/usePieChartSlices */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/hooks/usePieChartSlices.js");
/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./utils */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/utils.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * UserDimensionsPieChart 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 UserDimensionsPieChart(props) {
  const {
    dimensionName,
    dimensionValue,
    gatheringData,
    loaded,
    report
  } = props;
  const [selectable, setSelectable] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(false);
  const [isTooltipOpen, setIsTooltipOpen] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useState)(false);
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_14__["default"])();
  const otherSupportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/13331684'
  }));
  const notSetSupportURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_12__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/13504892'
  }));
  const dimensionColor = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_UI).getValue(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR));
  const activeRowIndex = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_UI).getValue(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX));
  const hasZeroData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).hasZeroData());
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_UI);
  const chartWrapperRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useRef)();
  const containerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useRef)();
  const handleTooltipClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)(event => {
    const {
      target
    } = event || {};
    if (!target?.classList?.contains('googlesitekit-cta-link__tooltip')) {
      return;
    }
    const label = target.dataset.rowLabel;
    if (label === '(other)' || label === '(not set)') {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.trackEvent)(`${viewContext}_all-traffic-widget`, 'help_click', label);
    }
  }, [viewContext]);
  const handleExitClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)(event => {
    if (isTooltipOpen && !event?.target?.closest('.googlesitekit-widget--analyticsAllTraffic__dimensions-chart')) {
      setIsTooltipOpen(false);
    }
  }, [isTooltipOpen]);
  const handleEscapeKey = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.useCallback)(() => {
    if (isTooltipOpen) {
      setIsTooltipOpen(false);
      setValues({
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_VALUE]: '',
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: '',
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: null
      });
    }
  }, [isTooltipOpen, setValues]);
  (0,react_use__WEBPACK_IMPORTED_MODULE_3__["default"])('click', handleTooltipClick, containerRef.current);
  (0,react_use__WEBPACK_IMPORTED_MODULE_3__["default"])('click', handleExitClick);
  (0,react_use__WEBPACK_IMPORTED_MODULE_4__["default"])('Escape', handleEscapeKey, {
    event: 'keyup'
  }, [handleEscapeKey]);
  const dataMap = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_16__.extractAnalyticsDataForPieChart)(report, {
    keyColumnIndex: 0,
    maxSlices: 5,
    withOthers: true,
    tooltipCallback: (row, previousDateRangeRow, rowData) => {
      const absValue = row?.metricValues?.[0]?.value || 0;
      const difference = previousDateRangeRow?.metricValues?.[0]?.value > 0 ? absValue * 100 / previousDateRangeRow.metricValues[0].value - 100 : 100;
      const formattedValue = (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.numberFormat)(absValue);
      let statInfo;
      if (previousDateRangeRow) {
        const svgArrow = (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.getChartDifferenceArrow)(difference);
        statInfo = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.sprintf)(/* translators: 1: numeric value of users, 2: up or down arrow , 3: different change in percentage, %%: percent symbol */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__._x)('Users: <strong>%1$s</strong> <em>%2$s %3$s%%</em>', 'Stat information shown in the user dimensions chart tooltip when comparison data is available', 'google-site-kit'), formattedValue, svgArrow, (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.numberFormat)(Math.abs(difference), {
          maximumFractionDigits: 2
        }));
      } else {
        statInfo = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.sprintf)(/* translators: 1: numeric value of users */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__._x)('Users: <strong>%1$s</strong>', 'Stat information shown in the user dimensions chart tooltip when no comparison data is available', 'google-site-kit'), formattedValue);
      }
      const rowLabel = rowData[0].toLowerCase();
      const dimensionClassName = `googlesitekit-visualization-tooltip-${rowLabel.replace(/\W+/, '_')}`;
      let tooltip = `<p>
					${ /* translators: %s: dimension label */(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.sprintf)((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('%s:', 'google-site-kit'), rowData[0].toUpperCase())}
					<b>${(0,_js_util__WEBPACK_IMPORTED_MODULE_17__.numberFormat)(rowData[1], {
        maximumFractionDigits: 1,
        style: 'percent'
      })}</b>
				</p>
				<p>
					${statInfo}
				</p>`;
      const othersLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Others', 'google-site-kit').toLowerCase();
      if (rowLabel === othersLabel) {
        switch (dimensionName) {
          case 'country':
            tooltip += `<p>${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('See the full list of locations in Analytics', 'google-site-kit')}</p>`;
            break;
          case 'deviceCategory':
            tooltip += `<p>${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('See the full list of devices in Analytics', 'google-site-kit')}</p>`;
            break;
          case 'sessionDefaultChannelGrouping':
          default:
            tooltip += `<p>${(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('See the full list of channels in Analytics', 'google-site-kit')}</p>`;
            break;
        }
      }
      if (otherSupportURL && rowLabel === '(other)') {
        tooltip += (0,_utils__WEBPACK_IMPORTED_MODULE_20__.getTooltipHelp)(otherSupportURL, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.sprintf)(/* translators: %s: pie slice label */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Learn more about what "%s" means', 'google-site-kit'), rowLabel), rowLabel);
      }
      if (notSetSupportURL && rowLabel === '(not set)') {
        tooltip += (0,_utils__WEBPACK_IMPORTED_MODULE_20__.getTooltipHelp)(notSetSupportURL, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.sprintf)(/* translators: %s: pie slice label */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Learn more about what "%s" means', 'google-site-kit'), rowLabel), rowLabel);
      }
      tooltip = `<div class="${classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-visualization-tooltip', dimensionClassName, {
        'googlesitekit-visualization-tooltip--up': difference > 0,
        'googlesitekit-visualization-tooltip--down': difference < 0
      })}">
					${tooltip}
				</div>`;
      return tooltip;
    }
  });
  const getPieChartSlices = (0,_hooks_usePieChartSlices__WEBPACK_IMPORTED_MODULE_19__["default"])();
  const options = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(UserDimensionsPieChart.chartOptions);
  const slices = getPieChartSlices(dataMap.slice(1).map(([rowDimensionValue]) => rowDimensionValue));
  options.slices = slices;
  function onLegendClick(index) {
    if (!chartWrapperRef.current) {
      return;
    }
    const newDimensionValue = chartWrapperRef.current.getDataTable().getValue(index, 0);
    const isOthers = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Others', 'google-site-kit') === newDimensionValue;

    // Do not do anything as "Others" should not be selectable.
    if (isOthers) {
      return;
    }
    const {
      row
    } = chartWrapperRef.current.getChart().getSelection()?.[0] || {};
    if (row === index) {
      setIsTooltipOpen(false);
      setValues({
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_VALUE]: '',
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: '',
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: null
      });
    } else if (newDimensionValue) {
      setIsTooltipOpen(true);
      setValues({
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: slices[row]?.color,
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_VALUE]: newDimensionValue,
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: index
      });
      (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.trackEvent)(`${viewContext}_all-traffic-widget`, 'slice_select', `${dimensionName}:${newDimensionValue}`);
    }
  }
  function onMouseOut() {
    setSelectable(false);
  }
  function onMouseOver(event, {
    chartWrapper
  }) {
    const {
      row
    } = event;
    if (row === undefined || row === null) {
      setSelectable(false);
    }
    const dataTable = chartWrapper.getDataTable();
    setSelectable(dataTable.getValue(row, 0) !== (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Others', 'google-site-kit'));
  }
  function onSelect({
    chartWrapper
  }) {
    const chart = chartWrapper.getChart();
    const {
      row
    } = chart.getSelection()?.[0] || {};
    if (row === null || row === undefined) {
      setIsTooltipOpen(false);
      setValues({
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_VALUE]: '',
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: '',
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: null
      });
    } else {
      const dataTable = chartWrapper.getDataTable();
      if (dataTable) {
        const newDimensionValue = dataTable.getValue(row, 0);
        const isOthers = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Others', 'google-site-kit') === newDimensionValue;
        if (isOthers) {
          // Maintain the existing selection when clicking on the "Others" slice.
          // We set a value here because otherwise Google Charts will show the
          // "Others" slice as selected.
          if (activeRowIndex === null || activeRowIndex === undefined) {
            chart.setSelection([]);
          } else {
            chart.setSelection([{
              row: activeRowIndex
            }]);
          }
        } else {
          setIsTooltipOpen(true);
          setValues({
            [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: slices[row]?.color,
            [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_VALUE]: newDimensionValue,
            [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: row
          });
          (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.trackEvent)(`${viewContext}_all-traffic-widget`, 'slice_select', `${dimensionName}:${newDimensionValue}`);
        }
      }
    }
  }
  function onReady({
    chartWrapper
  }) {
    const chart = chartWrapper.getChart();

    // If there is a dimension value set but the initialized chart does not have a
    // selection yet, find the matching row index and initially select it in the chart.
    if (dimensionValue && !chart.getSelection()?.length) {
      // Look in the real data map, which includes headings, therefore subtract 1.
      const selectedRow = dataMap.findIndex(row => row[0] === dimensionValue) - 1;
      if (selectedRow >= 0) {
        // If the new data includes the original dimension value, re-select it and adjust the color as needed.
        chart.setSelection([{
          row: selectedRow
        }]);
        if (activeRowIndex !== selectedRow || (slices[selectedRow]?.color || dimensionColor) !== dimensionColor) {
          setValues({
            [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: selectedRow,
            [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: slices[selectedRow]?.color || dimensionColor
          });
        }
      } else {
        // If the new data does not include the original dimension value, unset it to match the empty selection.
        setValues({
          [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_VALUE]: '',
          [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: '',
          [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: null
        });
      }
    }

    // If there is no dimension value set but the initialized chart does have a selection,
    // ensure it is no longer selected in the chart.
    if (!dimensionValue && chart.getSelection()?.length) {
      chart.setSelection([]);
      if (activeRowIndex !== null) {
        setValues({
          [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_ACTIVE_ROW_INDEX]: null
        });
      }
    }

    // If no dimensionValue is set, unset the color.
    if (!dimensionValue && dimensionColor !== '') {
      setValues({
        [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_15__.UI_DIMENSION_COLOR]: ''
      });
    }
  }
  let labels = {
    sessionDefaultChannelGrouping: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('<span>By</span> channels', 'google-site-kit'),
    country: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('<span>By</span> locations', 'google-site-kit'),
    deviceCategory: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('<span>By</span> devices', 'google-site-kit')
  };
  if (gatheringData) {
    labels = {
      sessionDefaultChannelGrouping: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('gathering data…', 'google-site-kit')
    };
    options.pieSliceText = 'none';
    options.tooltip.trigger = 'none';
    options.sliceVisibilityThreshold = 1;
  }
  const sanitizeArgs = {
    ALLOWED_TAGS: ['span'],
    ALLOWED_ATTR: []
  };
  const title = loaded ? (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.sanitizeHTML)(labels[dimensionName] || '', sanitizeArgs) : {
    __html: ''
  };
  const isSingleSliceReport = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_16__.isSingleSlice)(report);
  if (isSingleSliceReport) {
    // When there is only one row, the chart will add a label which we need to hide - see issue #2660
    options.pieSliceText = 'none';
  }
  if (isTooltipOpen) {
    options.tooltip.trigger = 'selection';
  } else {
    options.tooltip.trigger = 'focus';
  }
  const showZeroDataChart = hasZeroData || dataMap.length < 2;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("div", {
    className: "googlesitekit-widget--analyticsAllTraffic__dimensions-container",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)("div", {
      ref: containerRef,
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget--analyticsAllTraffic__dimensions-chart', {
        'googlesitekit-widget--analyticsAllTraffic__slice-selected': !!dimensionValue,
        'googlesitekit-widget--analyticsAllTraffic__selectable': selectable
      }),
      children: [showZeroDataChart && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)("div", {
        className: "googlesitekit-widget--analyticsAllTraffic__chart-zero-data",
        children: [gatheringData && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_8__["default"], {
          style: _js_components_GatheringDataNotice__WEBPACK_IMPORTED_MODULE_8__.NOTICE_STYLE.SMALL_OVERLAY
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_svg_icons_pie_chart_zero_data_svg__WEBPACK_IMPORTED_MODULE_18__["default"], {})]
      }), !showZeroDataChart &&
      /*#__PURE__*/
      /* eslint-disable-next-line jsx-a11y/mouse-events-have-key-events */
      (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_GoogleChart__WEBPACK_IMPORTED_MODULE_9__["default"], {
        chartType: "PieChart",
        data: dataMap || [],
        getChartWrapper: chartWrapper => {
          chartWrapperRef.current = chartWrapper;
        },
        gatheringData: gatheringData,
        height: "368px",
        loaded: loaded,
        loadingHeight: "300px",
        loadingWidth: "300px",
        onMouseOut: onMouseOut,
        onMouseOver: onMouseOver,
        onReady: onReady,
        onSelect: onSelect,
        options: options,
        width: "100%",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("div", {
          className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
            'googlesitekit-widget--analyticsAllTraffic__dimensions-chart-gathering-data': gatheringData,
            'googlesitekit-widget--analyticsAllTraffic__dimensions-chart-title': !gatheringData
          }),
          dangerouslySetInnerHTML: title
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)("div", {
        "aria-label": gatheringData ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('A pie chart for Analytics that is gathering data, so has no data to display.', 'google-site-kit') : undefined,
        className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget--analyticsAllTraffic__legend', {
          'googlesitekit-widget--analyticsAllTraffic__legend--single': isSingleSliceReport
        }),
        role: "region",
        children: [loaded && !showZeroDataChart && dataMap?.slice(1).map(([label], index) => {
          const isActive = label === dimensionValue;
          const sliceColor = slices[index]?.color;
          const isOthers = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Others', 'google-site-kit') === label;
          return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)(_js_components_Link__WEBPACK_IMPORTED_MODULE_10__["default"], {
            onClick: () => onLegendClick(index),
            className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-widget--analyticsAllTraffic__legend-slice', {
              'googlesitekit-widget--analyticsAllTraffic__legend-active': isActive,
              'googlesitekit-widget--analyticsAllTraffic__legend-others': isOthers
            }),
            disabled: gatheringData,
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("span", {
              className: "googlesitekit-widget--analyticsAllTraffic__dot",
              style: {
                backgroundColor: sliceColor
              }
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("span", {
              className: "googlesitekit-widget--analyticsAllTraffic__label",
              "data-label": label,
              children: label
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("span", {
              className: "googlesitekit-widget--analyticsAllTraffic__underlay",
              style: {
                backgroundColor: sliceColor
              }
            })]
          }, label);
        }), !loaded && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_5__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)("div", {
            className: "googlesitekit-widget--analyticsAllTraffic__legend-slice",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("span", {
              className: "googlesitekit-widget--analyticsAllTraffic__dot",
              style: {
                backgroundColor: '#ccc'
              }
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_11__["default"], {
              height: "18px",
              width: "68px",
              shape: "square"
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)("div", {
            className: "googlesitekit-widget--analyticsAllTraffic__legend-slice",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("span", {
              className: "googlesitekit-widget--analyticsAllTraffic__dot",
              style: {
                backgroundColor: '#ccc'
              }
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_11__["default"], {
              height: "18px",
              width: "52px",
              shape: "square"
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)("div", {
            className: "googlesitekit-widget--analyticsAllTraffic__legend-slice",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("span", {
              className: "googlesitekit-widget--analyticsAllTraffic__dot",
              style: {
                backgroundColor: '#ccc'
              }
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_11__["default"], {
              height: "18px",
              width: "40px",
              shape: "square"
            })]
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsxs)("div", {
            className: "googlesitekit-widget--analyticsAllTraffic__legend-slice",
            children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)("span", {
              className: "googlesitekit-widget--analyticsAllTraffic__dot",
              style: {
                backgroundColor: '#ccc'
              }
            }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_11__["default"], {
              height: "18px",
              width: "52px",
              shape: "square"
            })]
          })]
        })]
      })]
    })
  });
}
UserDimensionsPieChart.defaultProps = {
  dimensionName: 'sessionDefaultChannelGrouping'
};
UserDimensionsPieChart.chartOptions = {
  chartArea: {
    left: 'auto',
    height: 300,
    top: 'auto',
    width: '100%'
  },
  backgroundColor: 'transparent',
  fontSize: 12,
  height: 368,
  legend: {
    position: 'none'
  },
  pieHole: 0.6,
  pieSliceTextStyle: {
    color: '#131418',
    fontSize: 12
  },
  title: null,
  tooltip: {
    isHtml: true,
    // eslint-disable-line sitekit/acronym-case
    trigger: 'focus'
  },
  width: '100%'
};
UserDimensionsPieChart.propTypes = {
  dimensionName: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string).isRequired,
  dimensionValue: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().string),
  gatheringData: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool),
  report: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().object),
  loaded: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/hooks/usePieChartSlices.js"
/*!*************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/hooks/usePieChartSlices.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 */ usePieChartSlices)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/**
 * `usePieChartSlices()` custom hook for the `UserDimensionsPieChart` 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
 */

const PIE_CHART_COLORS = ['#fece72', '#a983e6', '#bed4ff', '#ee92da', '#ff9b7a'];

// This is the fallback color for dimension values that are not in the `PIE_CHART_COLORS` array.
// In practice, we should never reach this fallback color.
const FALLBACK_COLOR = '#ccc';

/**
 * Gets the pie chart slices for the given dimension values.
 *
 * This hook caches the colors for the dimension values and returns them when the
 * same dimension values are passed in again.
 *
 * @since 1.167.0
 *
 * @return {Function} A function that returns the pie chart slices for the given dimension values.
 */
function usePieChartSlices() {
  const dimensionValueColorsRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)({});
  function getDimensionValueColor(dimensionValue) {
    const colors = dimensionValueColorsRef.current;
    if (colors[dimensionValue]) {
      return colors[dimensionValue];
    }
    const usedColors = Object.values(colors);
    const availableColor = PIE_CHART_COLORS.find(color => !usedColors.includes(color)) || FALLBACK_COLOR;
    colors[dimensionValue] = availableColor;
    return availableColor;
  }
  function getPieChartSlices(dimensionValues) {
    if (dimensionValues.length === 0) {
      return {};
    }

    // Remove cached colors for dimension values that are not in the new dimension values array,
    // to avoid running out of colors.
    Object.keys(dimensionValueColorsRef.current).forEach(dimensionValue => {
      if (!dimensionValues.includes(dimensionValue)) {
        delete dimensionValueColorsRef.current[dimensionValue];
      }
    });

    // Get slices for new dimension values.
    return dimensionValues.reduce((slices, dimensionValue, index) => {
      slices[index] = {
        color: getDimensionValueColor(dimensionValue)
      };
      return slices;
    }, {});
  }
  return getPieChartSlices;
}

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/index.js"
/*!*******************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/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 _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_material_components_layout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/material-components/layout */ "./js/material-components/layout/index.ts");
/* 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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useAllTrafficWidgetReport__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useAllTrafficWidgetReport */ "./js/modules/analytics-4/hooks/useAllTrafficWidgetReport.js");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _DataSourceLink__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./DataSourceLink */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/DataSourceLink.js");
/* harmony import */ var _DimensionTabs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./DimensionTabs */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/DimensionTabs.js");
/* harmony import */ var _reportOptions__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./reportOptions */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/reportOptions.ts");
/* harmony import */ var _TotalUserCount__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./TotalUserCount */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/TotalUserCount.js");
/* harmony import */ var _UserCountGraph__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./UserCountGraph */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/UserCountGraph.js");
/* harmony import */ var _UserDimensionsPieChart__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./UserDimensionsPieChart */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/UserDimensionsPieChart.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * DashboardAllTrafficWidgetGA4 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 DashboardAllTrafficWidgetGA4(props) {
  const {
    Widget,
    WidgetReportError
  } = props;
  const viewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const [firstLoad, setFirstLoad] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)(true);
  const [currentRange, setCurrentRange] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useState)('');
  const canViewSharedAnalytics4 = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (!viewOnly) {
      return true;
    }
    return select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).canViewSharedModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4);
  });
  const isGatheringData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => canViewSharedAnalytics4 && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isGatheringData());
  const dateRange = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRange());
  const dimensionName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI).getValue(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.UI_DIMENSION_NAME) || 'sessionDefaultChannelGrouping');
  const dimensionValue = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI).getValue(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.UI_DIMENSION_VALUE));
  const {
    compareStartDate,
    compareEndDate
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_UI);
  const pieArgs = {
    compareStartDate,
    compareEndDate,
    dimensions: [dimensionName],
    orderby: [{
      metric: {
        metricName: 'totalUsers'
      },
      desc: true
    }],
    reportID: 'analytics-4_dashboard-all-traffic-widget-ga4_widget_pieArgs'
  };
  const dimensionFilters = dimensionName && dimensionValue ? {
    [dimensionName]: dimensionValue
  } : undefined;
  const graphArgs = (0,_reportOptions__WEBPACK_IMPORTED_MODULE_13__.getGraphReportOptions)({
    dimensionFilters
  });
  const totalsArgs = (0,_reportOptions__WEBPACK_IMPORTED_MODULE_13__.getTotalsReportOptions)({
    compareStartDate,
    compareEndDate,
    dimensionFilters
  });
  const {
    loaded: pieChartLoaded,
    error: pieChartError,
    report: pieChartReport
  } = (0,_js_modules_analytics_4_hooks_useAllTrafficWidgetReport__WEBPACK_IMPORTED_MODULE_8__["default"])(pieArgs);
  const {
    loaded: userCountGraphLoaded,
    error: userCountGraphError,
    report: userCountGraphReport
  } = (0,_js_modules_analytics_4_hooks_useAllTrafficWidgetReport__WEBPACK_IMPORTED_MODULE_8__["default"])(graphArgs);
  const {
    loaded: totalUsersLoaded,
    error: totalUsersError,
    report: totalUsersReport
  } = (0,_js_modules_analytics_4_hooks_useAllTrafficWidgetReport__WEBPACK_IMPORTED_MODULE_8__["default"])(totalsArgs);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (dateRange !== currentRange) {
      setFirstLoad(true);
      setCurrentRange(dateRange);
    } else if (pieChartLoaded && totalUsersLoaded && userCountGraphLoaded) {
      setFirstLoad(false);
    }
  }, [pieChartLoaded, totalUsersLoaded, userCountGraphLoaded, dateRange, currentRange]);

  // Set a flag in the core/ui store when all data is loaded.
  // Currently only used by the feature tour to delay showing
  // while the widget is in a loading state.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (firstLoad && pieChartLoaded && totalUsersLoaded && userCountGraphLoaded) {
      setValue(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.UI_ALL_TRAFFIC_LOADED, true);
    }
  }, [firstLoad, pieChartLoaded, totalUsersLoaded, userCountGraphLoaded, setValue]);

  // The User Dimensions Pie Chart uses the sample report to check
  // for zero data, so we need to retry the sample report to make
  // sure the pie chart reloads correctly.
  const sampleReportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getSampleReportArgs()]));
  const retryableErrors = [pieChartError, sampleReportError, totalUsersError, userCountGraphError].filter(Boolean);
  if (pieChartError || totalUsersError || userCountGraphError) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(Widget, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(WidgetReportError, {
        moduleSlug: "analytics-4",
        error: retryableErrors
      })
    });
  }
  const pieChartReportIsZero = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__.isZeroReport)(pieChartReport);
  const gatheringDataLoaded = isGatheringData !== undefined;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(Widget, {
    className: "googlesitekit-widget--footer-v2 googlesitekit-widget__analytics--all-traffic",
    Footer: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_DataSourceLink__WEBPACK_IMPORTED_MODULE_11__["default"], {}),
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_5__.Grid, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_5__.Row, {
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          className: "googlesitekit-widget--analyticsAllTraffic__totals",
          lgSize: 7,
          mdSize: 8,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_TotalUserCount__WEBPACK_IMPORTED_MODULE_14__["default"], {
            loaded: gatheringDataLoaded && totalUsersLoaded && !firstLoad,
            report: totalUsersReport,
            error: totalUsersError,
            dimensionValue: dimensionValue,
            gatheringData: isGatheringData
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_UserCountGraph__WEBPACK_IMPORTED_MODULE_15__["default"], {
            loaded: gatheringDataLoaded && userCountGraphLoaded && !firstLoad,
            error: userCountGraphError,
            report: userCountGraphReport,
            gatheringData: isGatheringData
          })]
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_5__.Cell, {
          className: "googlesitekit-widget--analyticsAllTraffic__dimensions",
          lgSize: 5,
          mdSize: 8,
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_DimensionTabs__WEBPACK_IMPORTED_MODULE_12__["default"], {
            loaded: gatheringDataLoaded && !firstLoad,
            dimensionName: dimensionName,
            gatheringData: isGatheringData,
            isZeroData: pieChartReportIsZero
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_UserDimensionsPieChart__WEBPACK_IMPORTED_MODULE_16__["default"], {
            dimensionName: dimensionName,
            dimensionValue: dimensionValue,
            gatheringData: isGatheringData,
            loaded: gatheringDataLoaded && pieChartLoaded && !firstLoad,
            report: pieChartReport
          })]
        })]
      })
    })
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_10__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4
})(DashboardAllTrafficWidgetGA4));

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/utils.js"
/*!*******************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/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 */   createZeroDataRow: () => (/* binding */ createZeroDataRow),
/* harmony export */   getTooltipHelp: () => (/* binding */ getTooltipHelp)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/serialize.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");
/**
 * DashboardAllTrafficWidgetGA4 utility functions.
 *
 * 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
 */



/**
 * Creates a GA4 report row for the given date, with a zero for the metric value.
 *
 * @since 1.96.0
 * @since 1.123.0 Migrated from analytics to analytics-4.
 *
 * @param {string} date Date in YYYY-MM-DD format.
 * @return {Object} Row object with the date in the GA4 report format as the dimension value, and a zero for the metric value.
 */

function createZeroDataRow(date) {
  // Note, this uses `replace()` rather than `replaceAll()` as our current version of Node does not support `replaceAll()`.
  // TODO: Replace with `replaceAll()` when we upgrade to Node 15+.
  return {
    dimensionValues: [{
      value: date.replace(new RegExp('-', 'g'), '')
    }],
    metricValues: [{
      value: 0
    }]
  };
}
/**
 * Gets HTML string for a tooltip help link.
 *
 * @since 1.116.0
 * @since 1.123.0 Migrated from analytics to analytics-4.
 *
 * @param {string} url      The URL to link to.
 * @param {string} label    The label for the link.
 * @param {string} rowLabel The label for the row.
 * @return {string} The HTML string for the tooltip help link.
 */
function getTooltipHelp(url, label, rowLabel) {
  return (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])(
  /*#__PURE__*/
  // We're not using the `P` component here because that uses `useBreakpoint`
  // under the hood. This causes issues when this function is used inside a
  // tooltip callback as that is not at the top-level of a component.
  (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
    as: "p",
    size: "medium",
    type: "body",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_3__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_1__["default"], {
      className: "googlesitekit-cta-link__tooltip",
      href: url,
      "data-row-label": rowLabel,
      external: true,
      children: label
    })
  }));
}

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardOverallPageMetricsWidgetGA4.js"
/*!*********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardOverallPageMetricsWidgetGA4.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 _wordpress_url__WEBPACK_IMPORTED_MODULE_1__ = __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_components_DataBlock__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/DataBlock */ "./js/components/DataBlock/index.js");
/* harmony import */ var _js_components_DataBlockGroup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/DataBlockGroup */ "./js/components/DataBlockGroup.js");
/* harmony import */ var _js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/PreviewBlock */ "./js/components/PreviewBlock.js");
/* harmony import */ var _js_components_SourceLink__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* harmony import */ var _js_components_Sparkline__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Sparkline */ "./js/components/Sparkline.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_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetHeaderTitle */ "./js/googlesitekit/widgets/components/WidgetHeaderTitle.tsx");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_material_components_layout__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/material-components/layout */ "./js/material-components/layout/index.ts");
/* 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 _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_overall_page_metrics__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/overall-page-metrics */ "./js/modules/analytics-4/utils/overall-page-metrics.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * DashboardOverallPageMetricsWidgetGA4 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 DashboardOverallPageMetricsWidgetGA4({
  Widget,
  WidgetReportError
}) {
  const isGatheringData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).isGatheringData());
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const url = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getCurrentEntityURL());
  const args = {
    ...dates,
    dimensions: ['date'],
    metrics: [{
      name: 'screenPageViews'
    }, {
      name: 'sessions'
    }, {
      name: 'engagementRate'
    }, {
      name: 'averageSessionDuration'
    }],
    orderby: [{
      dimension: {
        dimensionName: 'date'
      }
    }],
    url,
    reportID: 'analytics-4_dashboard-overall-page-metrics-widget-args'
  };
  const reportArgs = {
    dates,
    // eslint-disable-next-line sitekit/acronym-case
    otherArgs: {
      collectionId: 'life-cycle'
    }
  };
  if ((0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.isURL)(url)) {
    reportArgs.filters = {
      unifiedPagePathScreen: (0,_js_util__WEBPACK_IMPORTED_MODULE_16__.getURLPath)(url)
    };
  }
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [args]));
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [args]));
  const serviceURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', reportArgs);
  });
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getReport(args), [args]);
  const currentDayCount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).getDateRangeNumberOfDays());
  function Header() {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_10__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: number of days */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._n)('Overall page metrics over the last %s day', 'Overall page metrics over the last %s days', currentDayCount, 'google-site-kit'), currentDayCount)
    });
  }
  function Footer() {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_6__["default"], {
      className: "googlesitekit-data-block__source",
      name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Analytics', 'Service name', 'google-site-kit'),
      href: serviceURL,
      external: true
    });
  }
  if (isLoading || isGatheringData === undefined) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(Widget, {
      Footer: Footer,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_PreviewBlock__WEBPACK_IMPORTED_MODULE_5__["default"], {
        width: "100%",
        height: "222px"
      })
    });
  }
  if (error) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(Widget, {
      Footer: Footer,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(WidgetReportError, {
        moduleSlug: "analytics-4",
        error: error
      })
    });
  }
  const data = (0,_js_modules_analytics_4_utils_overall_page_metrics__WEBPACK_IMPORTED_MODULE_15__.calculateOverallPageMetricsData)(report, dates.startDate);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(Widget, {
    Header: Header,
    Footer: Footer,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_12__.Grid, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_DataBlockGroup__WEBPACK_IMPORTED_MODULE_4__["default"], {
        className: "mdc-layout-grid__inner",
        children: data.map(({
          metric,
          title,
          sparkLineData,
          datapointUnit,
          total,
          change
        }) => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_material_components_layout__WEBPACK_IMPORTED_MODULE_12__.Cell, {
          smSize: 2,
          lgSize: 3,
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_DataBlock__WEBPACK_IMPORTED_MODULE_3__["default"], {
            title: title,
            datapoint: total,
            datapointUnit: datapointUnit,
            change: change,
            changeDataUnit: "%",
            gatheringData: isGatheringData,
            sparkline: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_18__.jsx)(_js_components_Sparkline__WEBPACK_IMPORTED_MODULE_7__["default"], {
              data: sparkLineData,
              change: change,
              gatheringData: isGatheringData
            })
          })
        }, metric))
      })
    })
  });
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_17__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_13__.MODULE_SLUG_ANALYTICS_4
})(DashboardOverallPageMetricsWidgetGA4));

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/ProcessingBanner.js"
/*!*************************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/ProcessingBanner.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 */ ProcessingBanner)
/* 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__);
/* 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_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_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_SetupCTA__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/SetupCTA */ "./js/googlesitekit/notifications/components/layout/SetupCTA.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.ts");
/* harmony import */ var _svg_graphics_banner_enhanced_measurement_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/svg/graphics/banner-enhanced-measurement-setup-cta-mobile.svg?url */ "./svg/graphics/banner-enhanced-measurement-setup-cta-mobile.svg?url");
/* harmony import */ var _svg_graphics_banner_enhanced_measurement_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/svg/graphics/banner-enhanced-measurement-setup-cta.svg?url */ "./svg/graphics/banner-enhanced-measurement-setup-cta.svg?url");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EnhancedMeasurementActivationBanner > ProcessingBanner 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 ProcessingBanner({
  id,
  Notification,
  onDismiss
}) {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/9216061'
  }));
  const hasEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.EDIT_SCOPE));
  const description = hasEditScope ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Enable enhanced measurement in Analytics to automatically track metrics like file downloads, video plays, form interactions, etc. No extra code required.', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Enable enhanced measurement in Analytics to automatically track metrics like file downloads, video plays, form interactions, etc. No extra code required — you’ll be redirected to give permission for Site Kit to enable it on your behalf.', 'google-site-kit');
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(Notification, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_9__.jsx)(_js_googlesitekit_notifications_components_layout_SetupCTA__WEBPACK_IMPORTED_MODULE_5__["default"], {
      notificationID: id,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Understand how visitors interact with your content', 'google-site-kit'),
      description: description,
      learnMoreLink: {
        href: documentationURL
      },
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Enable now', 'google-site-kit'),
        disabled: true
      },
      dismissButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Maybe later', 'google-site-kit'),
        onClick: onDismiss
      },
      waitingProgress: {
        verticalSpacing: 0,
        // Remove vertical spacing to show the banner flush to the header.
        height: 7,
        indeterminate: true
      },
      helpText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('You can always add/edit this in the Site Kit Settings', 'google-site-kit'),
      svg: {
        desktop: _svg_graphics_banner_enhanced_measurement_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_8__["default"],
        mobile: _svg_graphics_banner_enhanced_measurement_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_7__["default"],
        verticalPosition: 'center'
      }
    })
  });
}
ProcessingBanner.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType),
  onDismiss: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/SetupBanner.js"
/*!********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/SetupBanner.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 */ SetupBanner)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _wordpress_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* 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_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_user_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_components_layout_SetupCTA__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/SetupCTA */ "./js/googlesitekit/notifications/components/layout/SetupCTA.js");
/* harmony import */ var _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.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.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _svg_graphics_banner_enhanced_measurement_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/svg/graphics/banner-enhanced-measurement-setup-cta-mobile.svg?url */ "./svg/graphics/banner-enhanced-measurement-setup-cta-mobile.svg?url");
/* harmony import */ var _svg_graphics_banner_enhanced_measurement_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/svg/graphics/banner-enhanced-measurement-setup-cta.svg?url */ "./svg/graphics/banner-enhanced-measurement-setup-cta.svg?url");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EnhancedMeasurementActivationBanner > SetupBanner 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 SetupBanner(props) {
  const {
    id,
    Notification,
    errorNotice,
    isSaving,
    onDismiss,
    onSubmit
  } = props;

  // The `enhanced_measurement` query value is arbitrary and serves two purposes:
  // 1. To ensure that `authentication_success` isn't appended when returning from OAuth.
  // 2. To guarantee it doesn't match any existing notifications in the `BannerNotifications` component, thus preventing any unintended displays.
  const redirectURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_3__.addQueryArgs)(globalThis.location.href, {
    notification: 'enhanced_measurement'
  });
  const hasEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.EDIT_SCOPE));
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/9216061'
  }));
  const isNavigatingToOAuthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    const OAuthURL = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).getConnectURL({
      additionalScopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.EDIT_SCOPE],
      redirectURL
    });
    if (!OAuthURL) {
      return false;
    }
    return select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_LOCATION).isNavigatingTo(OAuthURL);
  });
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_FORMS);
  const {
    setPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER);
  const {
    pinNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_NOTIFICATIONS);
  const handleSubmitChanges = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    const scopes = [];
    if (hasEditScope === false) {
      scopes.push(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.EDIT_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) {
      setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_SETUP, {
        autoSubmit: true
      });
      await pinNotification(id, _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_10__.NOTIFICATION_GROUPS.SETUP_CTAS);
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_14__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Additional permissions are required to enable enhanced measurement for the selected web data stream', 'google-site-kit'),
        data: {
          status: 403,
          scopes,
          skipModal: true,
          redirectURL
        }
      });
      return;
    }
    await onSubmit();
  }, [hasEditScope, id, onSubmit, pinNotification, redirectURL, setPermissionScopeError, setValues]);
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER);
  const handleView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    triggerSurvey('view_enhanced_measurement_cta', {
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_13__.DAY_IN_SECONDS
    });
  }, [triggerSurvey]);
  const description = hasEditScope ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enable enhanced measurement in Analytics to automatically track metrics like file downloads, video plays, form interactions, etc. No extra code required.', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enable enhanced measurement in Analytics to automatically track metrics like file downloads, video plays, form interactions, etc. No extra code required — you’ll be redirected to give permission for Site Kit to enable it on your behalf.', 'google-site-kit');
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(Notification, {
    onView: handleView,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_googlesitekit_notifications_components_layout_SetupCTA__WEBPACK_IMPORTED_MODULE_9__["default"], {
      notificationID: id,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Understand how visitors interact with your content', 'google-site-kit'),
      description: description,
      errorText: errorNotice?.message,
      learnMoreLink: {
        href: documentationURL
      },
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Enable now', 'google-site-kit'),
        onClick: handleSubmitChanges,
        disabled: isSaving || isNavigatingToOAuthURL,
        inProgress: isSaving || isNavigatingToOAuthURL
      },
      dismissButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Maybe later', 'google-site-kit'),
        onClick: onDismiss,
        disabled: isSaving || isNavigatingToOAuthURL
      },
      helpText: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You can always add/edit this in the Site Kit Settings', 'google-site-kit'),
      svg: {
        desktop: _svg_graphics_banner_enhanced_measurement_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_16__["default"],
        mobile: _svg_graphics_banner_enhanced_measurement_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_15__["default"],
        verticalPosition: 'center'
      }
    })
  });
}
SetupBanner.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType),
  errorNotice: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().object),
  isSaving: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  onSubmit: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func),
  onDismiss: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/SuccessBanner.js"
/*!**********************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/SuccessBanner.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 */ SuccessBanner)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/NoticeNotification */ "./js/googlesitekit/notifications/components/layout/NoticeNotification.tsx");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EnhancedMeasurementActivationBanner > SuccessBanner 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 SuccessBanner({
  id,
  Notification
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_10__["default"])();
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getGoogleSupportURL({
    path: '/analytics/answer/9216061'
  }));

  // All three variations (SetupBanner, InProgressBanner and SuccessBanner) are under a single parent
  // (EnhancedMeasurementActivationBanner). The <Notification> component wrapping all of them share
  // the same "notification ID". So this event is not auto-tracked by the new <Notification> component.
  // It considers the EnhancedMeasurementActivationBanner as already viewed when SetupBanner is
  // rendered and doesn't track the view again when the SuccessBanner variant is rendered.
  const handleView = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_11__.trackEvent)(`${viewContext}_enhanced-measurement-success`, 'view_notification');
  }, [viewContext]);
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_9__["default"])(id);
  const gaTrackingEventArgs = {
    category: `${viewContext}_enhanced-measurement-success`
  };
  function learnMoreTrackEvent() {
    trackEvents.clickLearnMore(gaTrackingEventArgs.label, gaTrackingEventArgs.value);
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(Notification, {
    onView: handleView,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_googlesitekit_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_8__["default"], {
      notificationID: id,
      type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.NOTICE_TYPES.SUCCESS,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('You successfully enabled enhanced measurement for your site', 'google-site-kit'),
      description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Your configured Analytics web data stream will now automatically measure interactions on your site in addition to standard page views measurement. <a>Learn more</a>', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
          href: documentationURL,
          onClick: learnMoreTrackEvent,
          external: true
        })
      }),
      gaTrackingEventArgs: gaTrackingEventArgs
    })
  });
}
SuccessBanner.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType)
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/index.js"
/*!**************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/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 */ EnhancedMeasurementActivationBanner)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_AdminScreenTooltip_useShowTooltip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/AdminScreenTooltip/useShowTooltip */ "./js/components/AdminScreenTooltip/useShowTooltip.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_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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__ = __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_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _ProcessingBanner__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ProcessingBanner */ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/ProcessingBanner.js");
/* harmony import */ var _SetupBanner__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./SetupBanner */ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/SetupBanner.js");
/* harmony import */ var _SuccessBanner__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./SuccessBanner */ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/SuccessBanner.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EnhancedMeasurementActivationBanner 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 EnhancedMeasurementActivationBanner({
  id,
  Notification
}) {
  const [step, setStep] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ACTIVATION_STEP_SETUP);
  const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [errorNotice, setErrorNotice] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(null);
  const hasEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.EDIT_SCOPE));
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.FORM_SETUP, 'autoSubmit');
  const [, setEnhancedMeasurementEnabled] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_8__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.ENHANCED_MEASUREMENT_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.ENHANCED_MEASUREMENT_ENABLED);
  const {
    submitChanges
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4);
  const {
    unpinNotification
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_NOTIFICATIONS);
  const tooltipSettings = {
    tooltipSlug: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ENHANCED_MEASUREMENT_ACTIVATION_BANNER_TOOLTIP_STATE_KEY,
    content: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('You can always enable Enhanced Measurement in Settings later', 'google-site-kit'),
    dismissLabel: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Got it', 'google-site-kit')
  };
  const showTooltip = (0,_js_components_AdminScreenTooltip_useShowTooltip__WEBPACK_IMPORTED_MODULE_4__.useShowTooltip)(tooltipSettings);
  const handleSubmit = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    setIsSaving(true);
    setEnhancedMeasurementEnabled(true);
    const {
      error
    } = await submitChanges();
    setIsSaving(false);
    if (error) {
      setErrorNotice(error);
      setStep(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ACTIVATION_STEP_SETUP);
      return;
    }
    await unpinNotification(id, _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_6__.NOTIFICATION_GROUPS.SETUP_CTAS);
    setStep(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ACTIVATION_STEP_SUCCESS);
  }, [id, setEnhancedMeasurementEnabled, submitChanges, unpinNotification]);

  // If the user lands back on this component with autoSubmit and the edit scope,
  // resubmit the form.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    async function handleAutoSubmit() {
      // Auto-submit should only auto-invoke once.
      setAutoSubmit(false);
      setStep(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ACTIVATION_STEP_IN_PROGRESS);
      await handleSubmit();
    }
    if (autoSubmit && hasEditScope) {
      handleAutoSubmit();
    }
  }, [hasEditScope, setAutoSubmit, handleSubmit, autoSubmit]);
  if (step === _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ACTIVATION_STEP_SETUP) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_SetupBanner__WEBPACK_IMPORTED_MODULE_12__["default"], {
      id: id,
      Notification: Notification,
      errorNotice: errorNotice,
      isSaving: isSaving,
      onDismiss: showTooltip,
      onSubmit: handleSubmit
    });
  }
  if (step === _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ACTIVATION_STEP_IN_PROGRESS) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_ProcessingBanner__WEBPACK_IMPORTED_MODULE_11__["default"], {
      id: id,
      Notification: Notification,
      onDismiss: showTooltip
    });
  }
  if (step === _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.ACTIVATION_STEP_SUCCESS) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_14__.jsx)(_SuccessBanner__WEBPACK_IMPORTED_MODULE_13__["default"], {
      id: id,
      Notification: Notification
    });
  }
  return null;
}
EnhancedMeasurementActivationBanner.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/index.js"
/*!**************************************************************!*\
  !*** ./js/modules/analytics-4/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 */   DashboardAllTrafficWidgetGA4: () => (/* reexport safe */ _DashboardAllTrafficWidgetGA4__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   DashboardOverallPageMetricsWidgetGA4: () => (/* reexport safe */ _DashboardOverallPageMetricsWidgetGA4__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   EnhancedMeasurementActivationBanner: () => (/* reexport safe */ _EnhancedMeasurementActivationBanner__WEBPACK_IMPORTED_MODULE_0__["default"])
/* harmony export */ });
/* harmony import */ var _EnhancedMeasurementActivationBanner__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EnhancedMeasurementActivationBanner */ "./js/modules/analytics-4/components/dashboard/EnhancedMeasurementActivationBanner/index.js");
/* harmony import */ var _DashboardAllTrafficWidgetGA4__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./DashboardAllTrafficWidgetGA4 */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/index.js");
/* harmony import */ var _DashboardOverallPageMetricsWidgetGA4__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./DashboardOverallPageMetricsWidgetGA4 */ "./js/modules/analytics-4/components/dashboard/DashboardOverallPageMetricsWidgetGA4.js");
/**
 * GA4 Dashboard 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/analytics-4/components/key-metrics/AnalyticsUpdateError.js"
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/key-metrics/AnalyticsUpdateError.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 */ AnalyticsUpdateError)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__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 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_components_KeyMetrics_MetricTileError__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileError */ "./js/components/KeyMetrics/MetricTileError.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __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 AnalyticsUpdateError(props) {
  const {
    onRetry,
    error,
    infoTooltip,
    headerText
  } = props;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_9__["default"])();
  const helpLink = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getErrorTroubleshootingLinkURL(error));
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEventOnce)(`${viewContext}_kmw`, 'analytics_update_error');
  }, [viewContext]);
  const retry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.trackEvent)(`${viewContext}_kmw`, 'analytics_update_error_retry');
    onRetry?.();
  }, [onRetry, viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics_MetricTileError__WEBPACK_IMPORTED_MODULE_6__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Analytics update failed', 'google-site-kit'),
    headerText: headerText,
    infoTooltip: infoTooltip,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsxs)("div", {
      className: "googlesitekit-report-error-actions",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_4__.Button, {
        onClick: retry,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Retry', 'google-site-kit')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Retry didn’t work? <a>Learn more</a>', 'google-site-kit'), {
          a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_7__["default"], {
            href: helpLink,
            external: true,
            hideExternalIndicator: true
          })
        })
      })]
    })
  });
}
AnalyticsUpdateError.propTypes = {
  error: prop_types__WEBPACK_IMPORTED_MODULE_0___default().shape({}).isRequired,
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  headerText: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  infoTooltip: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
};

/***/ },

/***/ "./js/modules/analytics-4/components/key-metrics/CustomDimensionsMissingError.js"
/*!***************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/key-metrics/CustomDimensionsMissingError.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 */ CustomDimensionsMissingError)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_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_KeyMetrics_MetricTileError__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileError */ "./js/components/KeyMetrics/MetricTileError.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.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 CustomDimensionsMissingError(props) {
  const {
    onRetry,
    infoTooltip,
    headerText
  } = props;
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_5__["default"])();
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEventOnce)(`${viewContext}_kmw`, 'custom_dimension_missing_error');
  }, [viewContext]);
  const retry = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.trackEvent)(`${viewContext}_kmw`, 'custom_dimension_missing_error_retry');
    onRetry?.();
  }, [onRetry, viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_KeyMetrics_MetricTileError__WEBPACK_IMPORTED_MODULE_4__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No data to show', '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)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.Button, {
        onClick: retry,
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Update', 'google-site-kit')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)("span", {
        className: "googlesitekit-error-retry-text",
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Update Analytics to track metric', 'google-site-kit')
      })]
    })
  });
}
CustomDimensionsMissingError.propTypes = {
  onRetry: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func).isRequired,
  headerText: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string),
  infoTooltip: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string)
};

/***/ },

/***/ "./js/modules/analytics-4/components/key-metrics/index.js"
/*!****************************************************************!*\
  !*** ./js/modules/analytics-4/components/key-metrics/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 */   AnalyticsUpdateError: () => (/* reexport safe */ _AnalyticsUpdateError__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   CustomDimensionsMissingError: () => (/* reexport safe */ _CustomDimensionsMissingError__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _AnalyticsUpdateError__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AnalyticsUpdateError */ "./js/modules/analytics-4/components/key-metrics/AnalyticsUpdateError.js");
/* harmony import */ var _CustomDimensionsMissingError__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./CustomDimensionsMissingError */ "./js/modules/analytics-4/components/key-metrics/CustomDimensionsMissingError.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/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/Footer.js"
/*!****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/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 _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_SourceLink__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/SourceLink */ "./js/components/SourceLink.tsx");
/* 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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Footer component of the ModulePopularPagesWidgetGA4 widget.
 *
 * 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 Footer() {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_4__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates());
  const sourceLinkURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (viewOnlyDashboard) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
      dates,
      // eslint-disable-next-line sitekit/acronym-case
      otherArgs: {
        collectionId: 'life-cycle'
      }
    });
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_SourceLink__WEBPACK_IMPORTED_MODULE_2__["default"], {
    href: sourceLinkURL,
    name: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)('Analytics', 'Service name', 'google-site-kit'),
    external: true
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/Header.js"
/*!****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/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": () => (/* binding */ Header)
/* 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 _js_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/widgets/components/WidgetHeaderTitle */ "./js/googlesitekit/widgets/components/WidgetHeaderTitle.tsx");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Header component of the ModulePopularPagesWidgetGA4 widget.
 *
 * 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 Header() {
  const currentDayCount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getDateRangeNumberOfDays());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_4__.jsx)(_js_googlesitekit_widgets_components_WidgetHeaderTitle__WEBPACK_IMPORTED_MODULE_3__["default"], {
    children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %s: number of days */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._n)('Top content over the last %s day', 'Top content over the last %s days', currentDayCount, 'google-site-kit'), currentDayCount)
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/index.js"
/*!***************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/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 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_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_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_DetailsPermaLinks__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/DetailsPermaLinks */ "./js/components/DetailsPermaLinks.js");
/* harmony import */ var _js_components_PreviewTable__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/PreviewTable */ "./js/components/PreviewTable.js");
/* harmony import */ var _js_components_ReportTable__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/ReportTable */ "./js/components/ReportTable.js");
/* harmony import */ var _js_components_TableOverflowContainer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/TableOverflowContainer */ "./js/components/TableOverflowContainer.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_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useBreakpoint */ "./js/hooks/useBreakpoint.ts");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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 _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _Footer__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./Footer */ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/Footer.js");
/* harmony import */ var _Header__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Header */ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/Header.js");
/* harmony import */ var _reportOptions__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./reportOptions */ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/reportOptions.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ModulePopularPagesWidgetGA4 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 ModulePopularPagesWidgetGA4(props) {
  const {
    Widget,
    WidgetReportError
  } = props;
  const breakpoint = (0,_js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_10__.useBreakpoint)();
  const isGatheringData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).isGatheringData());
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).getDateRangeDates());
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const args = {
    ...dates,
    ...(0,_reportOptions__WEBPACK_IMPORTED_MODULE_19__.getPopularPagesReportOptions)()
  };
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [args]));
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getReport(args), [args]);
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useInViewSelect)(select => !error ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getPageTitles(report, args) : undefined, [error, report, args]);
  const loaded = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    const reportLoaded = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [args]);
    return undefined !== error || reportLoaded && undefined !== titles;
  });
  const loading = !loaded || isGatheringData === undefined;
  if (loading) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
      Header: _Header__WEBPACK_IMPORTED_MODULE_18__["default"],
      Footer: _Footer__WEBPACK_IMPORTED_MODULE_17__["default"],
      noPadding: true,
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_PreviewTable__WEBPACK_IMPORTED_MODULE_6__["default"], {
        padding: true
      })
    });
  }
  if (error) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
      Header: _Header__WEBPACK_IMPORTED_MODULE_18__["default"],
      Footer: _Footer__WEBPACK_IMPORTED_MODULE_17__["default"],
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(WidgetReportError, {
        moduleSlug: "analytics-4",
        error: error
      })
    });
  }
  const columnClassName = 'googlesitekit-typography googlesitekit-typography--title googlesitekit-typography--small';
  const tableColumns = [{
    columnHeaderClassName: columnClassName,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Title', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Page Title', 'google-site-kit'),
    primary: true,
    Component({
      row
    }) {
      const [{
        value: title
      }, {
        value: url
      }] = row.dimensionValues;
      const serviceURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
        if (viewOnlyDashboard) {
          return null;
        }
        return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        });
      });
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_DetailsPermaLinks__WEBPACK_IMPORTED_MODULE_5__["default"], {
        title: title,
        path: url,
        serviceURL: serviceURL
      });
    }
  }, {
    columnHeaderClassName: columnClassName,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Pageviews', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Pageviews', 'google-site-kit'),
    field: 'metricValues.0.value',
    className: 'googlesitekit-table__head-item--pageviews',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.numFmt)(fieldValue, {
          style: 'decimal'
        })
      });
    }
  }, {
    columnHeaderClassName: columnClassName,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Sessions', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Sessions', 'google-site-kit'),
    field: 'metricValues.1.value',
    className: 'googlesitekit-table__head-item--sessions',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.numFmt)(fieldValue, {
          style: 'decimal'
        })
      });
    }
  }, {
    columnHeaderClassName: columnClassName,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Engagement Rate', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Engagement Rate', 'google-site-kit'),
    field: 'metricValues.2.value',
    className: 'googlesitekit-table__head-item--engagement-rate',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.numFmt)(fieldValue, '%')
      });
    }
  }, {
    columnHeaderClassName: columnClassName,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Session Duration', 'google-site-kit'),
    description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Session Duration', 'google-site-kit'),
    field: 'metricValues.3.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_15__.numFmt)(fieldValue, 's')
      });
    }
  }];
  const rows = report?.rows?.length ? (0,lodash__WEBPACK_IMPORTED_MODULE_1__.cloneDeep)(report.rows) : [];
  const ZeroState = _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_12__.ZeroDataMessage;

  // Combine the titles from the pageTitles with the rows from the metrics report.
  rows.forEach(row => {
    const url = row.dimensionValues[0].value;
    row.dimensionValues.unshift({
      value: titles[url]
    }); // We always have an entry for titles[url].
  });
  const tabbedLayout = breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_10__.BREAKPOINT_SMALL || breakpoint === _js_hooks_useBreakpoint__WEBPACK_IMPORTED_MODULE_10__.BREAKPOINT_TABLET;
  const reportTable = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_ReportTable__WEBPACK_IMPORTED_MODULE_7__["default"], {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()({
      'googlesitekit-analytics-popular-pages-widget__report-table--tabbed-layout': tabbedLayout
    }),
    rows: rows,
    columns: tableColumns,
    zeroState: ZeroState,
    gatheringData: isGatheringData,
    tabbedLayout: tabbedLayout
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(Widget, {
    Header: _Header__WEBPACK_IMPORTED_MODULE_18__["default"],
    Footer: _Footer__WEBPACK_IMPORTED_MODULE_17__["default"],
    noPadding: true,
    children: tabbedLayout ? reportTable : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_TableOverflowContainer__WEBPACK_IMPORTED_MODULE_8__["default"], {
      children: reportTable
    })
  });
}
ModulePopularPagesWidgetGA4.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().elementType).isRequired,
  WidgetReportError: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().elementType).isRequired,
  WidgetReportZero: (prop_types__WEBPACK_IMPORTED_MODULE_2___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_16__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_13__.MODULE_SLUG_ANALYTICS_4
})(ModulePopularPagesWidgetGA4));

/***/ },

/***/ "./js/modules/analytics-4/components/module/index.js"
/*!***********************************************************!*\
  !*** ./js/modules/analytics-4/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 */   ModulePopularPagesWidgetGA4: () => (/* reexport safe */ _ModulePopularPagesWidgetGA4__WEBPACK_IMPORTED_MODULE_0__["default"])
/* harmony export */ });
/* harmony import */ var _ModulePopularPagesWidgetGA4__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ModulePopularPagesWidgetGA4 */ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/index.js");
/**
 * Analytics module page 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.
 */



/***/ },

/***/ "./js/modules/analytics-4/components/notifications/EnhancedConversionsNotification.js"
/*!********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/notifications/EnhancedConversionsNotification.js ***!
  \********************************************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   ECEE_ANALYTICS_SURVEY_TRIGGER_ID: () => (/* binding */ ECEE_ANALYTICS_SURVEY_TRIGGER_ID),
/* harmony export */   ENHANCED_CONVERSIONS_NOTIFICATION_ANALYTICS: () => (/* binding */ ENHANCED_CONVERSIONS_NOTIFICATION_ANALYTICS),
/* harmony export */   "default": () => (/* binding */ EnhancedConversionsNotification)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_components_common_LearnMoreLink__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/common/LearnMoreLink */ "./js/googlesitekit/notifications/components/common/LearnMoreLink.js");
/* harmony import */ var _js_googlesitekit_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/NoticeNotification */ "./js/googlesitekit/notifications/components/layout/NoticeNotification.tsx");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_escape_uri__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util/escape-uri */ "./js/util/escape-uri.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics EnhancedConversionsNotification 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
 */










const ENHANCED_CONVERSIONS_NOTIFICATION_ANALYTICS = 'ecee-notification-analytics';
const ECEE_ANALYTICS_SURVEY_TRIGGER_ID = 'view_ecee_analytics_banner';
function EnhancedConversionsNotification({
  id,
  Notification
}) {
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getDocumentationLinkURL('enhanced-conversions-analytics'));
  const ctaURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    const {
      getAccountID,
      getPropertyID,
      getServiceURL
    } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4);
    const accountID = getAccountID();
    const propertyID = getPropertyID();
    return getServiceURL({
      path: (0,_js_util_escape_uri__WEBPACK_IMPORTED_MODULE_12__.escapeURI)`/a${accountID}p${propertyID}/admin/datapolicies/datacollection`
    });
  });
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    triggerSurvey(ECEE_ANALYTICS_SURVEY_TRIGGER_ID, {
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_11__.DAY_IN_SECONDS
    });
  }, [triggerSurvey]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(Notification, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_googlesitekit_notifications_components_layout_NoticeNotification__WEBPACK_IMPORTED_MODULE_9__["default"], {
      notificationID: id,
      type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.INFO_ALT,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Boost your Analytics data with more metrics about your visitors', 'google-site-kit'),
      description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Site Kit now supports user-provided data collection, a feature which helps you get a more complete and reliable count of your sales and leads from your website, even when people switch devices. To activate, turn on the setting for collecting user data in your Analytics account. If you’ve already enabled this, no further action is required. <a />', 'google-site-kit'), {
        a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_googlesitekit_notifications_components_common_LearnMoreLink__WEBPACK_IMPORTED_MODULE_8__["default"], {
          id: id,
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Learn more', 'google-site-kit'),
          url: documentationURL
        })
      }),
      dismissButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('No thanks', 'google-site-kit')
      },
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Go to Analytics', 'google-site-kit'),
        href: ctaURL,
        dismissOnClick: true,
        external: true,
        hideExternalIndicator: true
      }
    })
  });
}
EnhancedConversionsNotification.propTypes = {
  id: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired,
  Notification: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/notifications/GoogleTagIDMismatchNotification.js"
/*!********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/notifications/GoogleTagIDMismatchNotification.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 */ GoogleTagIDMismatchNotification)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/BannerNotification */ "./js/googlesitekit/notifications/components/layout/BannerNotification.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_google_tag__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/google-tag */ "./js/modules/analytics-4/utils/google-tag.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GoogleTagIDMismatchNotification 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 GoogleTagIDMismatchNotification({
  id,
  Notification
}) {
  const currentAnalyticsConfig = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getSettings());
  const googleTagContainerDestinations = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => currentAnalyticsConfig?.googleTagAccountID && currentAnalyticsConfig?.googleTagContainerID && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getGoogleTagContainerDestinations(currentAnalyticsConfig.googleTagAccountID, currentAnalyticsConfig.googleTagContainerID));
  const currentAnalyticsProperty = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => currentAnalyticsConfig?.propertyID && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getProperty(currentAnalyticsConfig.propertyID));
  const newAnalyticsConfig = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!Array.isArray(googleTagContainerDestinations)) {
      return null;
    }
    const destinationIDs = googleTagContainerDestinations.map(
    // eslint-disable-next-line sitekit/acronym-case
    destination => destination.destinationId);
    const validGA4MeasurementIDs = destinationIDs.filter(_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_9__.isValidMeasurementID);
    if (validGA4MeasurementIDs.length === 0) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getAnalyticsConfigByMeasurementIDs(validGA4MeasurementIDs);
  });
  const newAnalyticsProperty = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => newAnalyticsConfig && newAnalyticsConfig.propertyID && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getProperty(newAnalyticsConfig?.propertyID));
  const newGoogleTagID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const tagIDs = currentAnalyticsConfig?.measurementID && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getGoogleTagContainer(currentAnalyticsConfig?.measurementID)?.tagIds; // eslint-disable-line sitekit/acronym-case

    if (Array.isArray(tagIDs)) {
      return (0,_js_modules_analytics_4_utils_google_tag__WEBPACK_IMPORTED_MODULE_8__.getBestTagID)(tagIDs, currentAnalyticsConfig.measurementID);
    }
    return null;
  });
  const isDoingSubmitChanges = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).isDoingSubmitChanges(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4));
  const {
    setPropertyID,
    setWebDataStreamID,
    setMeasurementID,
    updateSettingsForMeasurementID,
    submitChanges,
    setHasMismatchedGoogleTagID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
  const updateToNewAnalyticsConfig = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    setPropertyID(newAnalyticsConfig?.propertyID);
    setWebDataStreamID(newAnalyticsConfig?.webDataStreamID);
    setMeasurementID(newAnalyticsConfig?.measurementID);
    await submitChanges();
    setHasMismatchedGoogleTagID(false);
  }, [setPropertyID, setWebDataStreamID, setMeasurementID, newAnalyticsConfig?.propertyID, newAnalyticsConfig?.webDataStreamID, newAnalyticsConfig?.measurementID, submitChanges, setHasMismatchedGoogleTagID]);
  const updateGoogleTagConfig = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(async () => {
    await updateSettingsForMeasurementID(currentAnalyticsConfig?.measurementID);
    await submitChanges();
    setHasMismatchedGoogleTagID(false);
  }, [updateSettingsForMeasurementID, currentAnalyticsConfig?.measurementID, submitChanges, setHasMismatchedGoogleTagID]);
  if (googleTagContainerDestinations === undefined || newAnalyticsProperty === undefined || newGoogleTagID === undefined || currentAnalyticsProperty === undefined) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_2__.ProgressBar, {
      className: "googlesitekit-banner__progress-bar",
      height: 4 // The progress bar height is set to 7px via CSS. This value removes margins within the ProgressBar component.
      ,
      indeterminate: true
    });
  }

  // If the current and new properties are the same, don't show the notification.
  // This can happen momentarily when the banner is actioned and the new property
  // has been saved, but the notification hasn't been dismissed / removed from the
  // queue yet. There is also a rare issue reported where hasMismatchedGoogleTagID
  // is set to true, but the new property is the same as the current one. This will
  // result in a perpetual loading banner on the screen if we returned the loading
  // bar. So it is safer to return null, as eventually, the syncGoogleTag action
  // will be called within an hour and reset this correctly.
  if (currentAnalyticsProperty?._id && newAnalyticsProperty?._id && currentAnalyticsProperty._id === newAnalyticsProperty._id) {
    return null;
  }
  if (newAnalyticsProperty) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Notification, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_5__["default"], {
        notificationID: id,
        type: _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_5__.TYPES.WARNING,
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Update Site Kit's Analytics configuration to continue seeing Analytics data on the dashboard", 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Current GA4 property name. 2: Current GA4 property ID. 3: Newly linked GA4 property name. 4: Newly linked GA4 property ID. */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The Google Tag on your site is no longer associated with your current Google Analytics property "%1$s (%2$s)". It is now recording metrics to another Google Analytics property "%3$s (%4$s)". If you want to continue seeing Analytics data in the Site Kit dashboard, we suggest you update Site Kit’s Google Analytics configuration to show data for the property used in your Google Tag.', 'google-site-kit'), currentAnalyticsProperty.displayName, currentAnalyticsProperty._id, newAnalyticsProperty.displayName, newAnalyticsProperty._id),
        ctaButton: {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Use new property', 'google-site-kit'),
          onClick: updateToNewAnalyticsConfig,
          inProgress: isDoingSubmitChanges,
          dismissOnClick: true,
          dismissOptions: {
            expiresInSeconds: 1 // Expire the dismissal almost instantly so that the notification can be shown again if there is another mismatch in the future.
          }
        },
        dismissButton: {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Keep existing property', 'google-site-kit'),
          onClick: updateGoogleTagConfig,
          dismissOptions: {
            expiresInSeconds: 1 // Expire the dismissal almost instantly so that the notification can be shown again if there is another mismatch in the future.
          }
        }
      })
    });
  }
  if (newGoogleTagID) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(Notification, {
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_5__["default"], {
        notificationID: id,
        type: _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_5__.TYPES.WARNING,
        title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Your Google tag configuration has changed', 'google-site-kit'),
        description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Currently set Google Tag ID. 2: Newly linked Google Tag ID. 3: Current GA4 property name. 4: Current GA4 property ID. */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The Google tag for your Google Analytics configuration has changed from %1$s to %2$s. To keep using your current Google Analytics property "%3$s (%4$s)", you need to configure Site Kit to place the new Google tag %2$s instead.', 'google-site-kit'), currentAnalyticsConfig.googleTagID, newGoogleTagID, currentAnalyticsProperty.displayName, currentAnalyticsProperty._id),
        ctaButton: {
          label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Newly linked Google Tag ID. */
          (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Update Google tag to %s', 'google-site-kit'), newGoogleTagID),
          onClick: updateGoogleTagConfig,
          dismissOnClick: true,
          dismissOptions: {
            expiresInSeconds: 1 // Expire the dismissal almost instantly so that the notification can be shown again if there is another mismatch in the future.
          }
        }
      })
    });
  }
}

/***/ },

/***/ "./js/modules/analytics-4/components/notifications/WebDataStreamNotAvailableNotification.js"
/*!**************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/notifications/WebDataStreamNotAvailableNotification.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 */ WebDataStreamNotAvailableNotification)
/* 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_location_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/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_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/layout/BannerNotification */ "./js/googlesitekit/notifications/components/layout/BannerNotification.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * WebDataStreamNotAvailableNotification 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 WebDataStreamNotAvailableNotification({
  id,
  Notification
}) {
  const measurementID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getMeasurementID());
  const analyticsSettingsEditURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_SITE).getModuleSettingsEditURL(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4));
  const {
    setIsWebDataStreamUnavailable
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  function resetWebDataStreamAvailability() {
    // Reset the web data stream availability by setting its value to FALSE.
    // This means that the corresponding transient will be deleted on backend.
    setIsWebDataStreamUnavailable(false);
  }
  const isNavigatingToSettingsEditURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_LOCATION).isNavigatingTo(analyticsSettingsEditURL));
  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_BannerNotification__WEBPACK_IMPORTED_MODULE_4__["default"], {
      notificationID: id,
      type: _js_googlesitekit_notifications_components_layout_BannerNotification__WEBPACK_IMPORTED_MODULE_4__.TYPES.WARNING,
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your Analytics configuration has changed', 'google-site-kit'),
      description: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.sprintf)(/* translators: %1$s: Google Analytics Measurement ID. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('The previously selected web data stream with measurement ID %1$s is no longer available. Please select a new web data stream to continue collecting data with Google Analytics.', 'google-site-kit'), measurementID),
      ctaButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Update Analytics settings', 'google-site-kit'),
        href: analyticsSettingsEditURL,
        disabled: isNavigatingToSettingsEditURL,
        onClick: resetWebDataStreamAvailability
      },
      dismissButton: {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Maybe later', 'google-site-kit'),
        onClick: resetWebDataStreamAvailability,
        dismissOptions: {
          expiresInSeconds: _js_util__WEBPACK_IMPORTED_MODULE_7__.MINUTE_IN_SECONDS * 55
        }
      }
    })
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/notifications/index.js"
/*!******************************************************************!*\
  !*** ./js/modules/analytics-4/components/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 */   EnhancedConversionsNotification: () => (/* reexport safe */ _EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   GoogleTagIDMismatchNotification: () => (/* reexport safe */ _GoogleTagIDMismatchNotification__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   WebDataStreamNotAvailableNotification: () => (/* reexport safe */ _WebDataStreamNotAvailableNotification__WEBPACK_IMPORTED_MODULE_2__["default"])
/* harmony export */ });
/* harmony import */ var _EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./EnhancedConversionsNotification */ "./js/modules/analytics-4/components/notifications/EnhancedConversionsNotification.js");
/* harmony import */ var _GoogleTagIDMismatchNotification__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./GoogleTagIDMismatchNotification */ "./js/modules/analytics-4/components/notifications/GoogleTagIDMismatchNotification.js");
/* harmony import */ var _WebDataStreamNotAvailableNotification__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./WebDataStreamNotAvailableNotification */ "./js/modules/analytics-4/components/notifications/WebDataStreamNotAvailableNotification.js");
/**
 * Analytics Notification components.
 *
 * 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.
 */





/***/ },

/***/ "./js/modules/analytics-4/components/settings/AnalyticsSettingsNotice.js"
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/AnalyticsSettingsNotice.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 */ AnalyticsSettingsNotice)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.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_components_Notice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics 4 Settings 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.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */



/**
 * Internal dependencies
 */






function AnalyticsSettingsNotice({
  hasModuleAccess
}) {
  const module = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES).getModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4));
  const formattedOwnerName = module?.owner?.login ? `<strong>${module.owner.login}</strong>` : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Another admin', 'google-site-kit');
  if (!hasModuleAccess) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_4__["default"], {
      type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_5__.NOTICE_TYPES.WARNING,
      className: "googlesitekit-analytics-settings-notice",
      description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: module owner's name */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s configured Analytics and you don’t have access to its configured property. Contact them to share access or change the configured property.', 'google-site-kit'), formattedOwnerName), {
        strong: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_8__.jsx)("strong", {})
      })
    });
  }
  return null;
}
AnalyticsSettingsNotice.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/settings/EnhancedConversionsSettingsNotice.js"
/*!*****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/EnhancedConversionsSettingsNotice.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 */ EnhancedConversionsSettingsNotice)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_Notice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Notice */ "./js/components/Notice/index.tsx");
/* harmony import */ var _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* 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_googlesitekit_notifications_components_common_LearnMoreLink__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/notifications/components/common/LearnMoreLink */ "./js/googlesitekit/notifications/components/common/LearnMoreLink.js");
/* harmony import */ var _js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/notifications/hooks/useNotificationEvents */ "./js/googlesitekit/notifications/hooks/useNotificationEvents.js");
/* harmony import */ var _js_hooks_useInView__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useInView */ "./js/hooks/useInView.js");
/* harmony import */ var _js_modules_analytics_4_components_notifications_EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/notifications/EnhancedConversionsNotification */ "./js/modules/analytics-4/components/notifications/EnhancedConversionsNotification.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_escape_uri__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/util/escape-uri */ "./js/util/escape-uri.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics EnhancedConversionsSettingsNotice 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 EnhancedConversionsSettingsNotice({
  type = _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.NOTICE_TYPES.INFO
}) {
  const id = _js_modules_analytics_4_components_notifications_EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_12__.ENHANCED_CONVERSIONS_NOTIFICATION_ANALYTICS;
  const inView = (0,_js_hooks_useInView__WEBPACK_IMPORTED_MODULE_11__.useInView)();
  const trackEvents = (0,_js_googlesitekit_notifications_hooks_useNotificationEvents__WEBPACK_IMPORTED_MODULE_10__["default"])(id);
  const [isViewedOnce, setIsViewedOnce] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getDocumentationLinkURL('enhanced-conversions-analytics'));
  const ctaURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    const {
      getAccountID,
      getPropertyID,
      getServiceURL
    } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4);
    const accountID = getAccountID();
    const propertyID = getPropertyID();
    return getServiceURL({
      path: (0,_js_util_escape_uri__WEBPACK_IMPORTED_MODULE_15__.escapeURI)`/a${accountID}p${propertyID}/admin/datapolicies/datacollection`
    });
  });
  const isDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).isItemDismissed(id));
  const {
    dismissItem,
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER);
  const handleCTAClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    // Dismiss the notice when the CTA is clicked.
    await dismissItem(id);
    trackEvents.confirm();
  }, [dismissItem, id, trackEvents]);
  const handleDismiss = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    await dismissItem(id);
    trackEvents.dismiss();
  }, [dismissItem, id, trackEvents]);

  // Track view event and fire survey trigger when notice comes into view.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!isViewedOnce && inView) {
      trackEvents.view();
      triggerSurvey(_js_modules_analytics_4_components_notifications_EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_12__.ECEE_ANALYTICS_SURVEY_TRIGGER_ID, {
        ttl: _js_util__WEBPACK_IMPORTED_MODULE_14__.DAY_IN_SECONDS
      });
      setIsViewedOnce(true);
    }
  }, [inView, trackEvents, isViewedOnce, triggerSurvey]);
  if (isDismissed) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Notice__WEBPACK_IMPORTED_MODULE_5__["default"], {
    type: type,
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Boost your Analytics data with more metrics about your visitors', 'google-site-kit'),
    description: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Site Kit now supports user-provided data collection, a feature which helps you get a more complete and reliable count of your sales and leads from your website, even when people switch devices. To activate, turn on the setting for collecting user data in your Analytics account. If you’ve already enabled this, no further action is required. <a />', 'google-site-kit'), {
      a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_googlesitekit_notifications_components_common_LearnMoreLink__WEBPACK_IMPORTED_MODULE_9__["default"], {
        id: id,
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Learn more', 'google-site-kit'),
        url: documentationURL
      })
    }),
    dismissButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('No thanks', 'google-site-kit'),
      onClick: handleDismiss
    },
    ctaButton: {
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Go to Analytics', 'google-site-kit'),
      href: ctaURL,
      onClick: handleCTAClick,
      external: true,
      hideExternalIndicator: true
    }
  });
}
EnhancedConversionsSettingsNotice.propTypes = {
  type: prop_types__WEBPACK_IMPORTED_MODULE_0___default().oneOf(Object.values(_js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_6__.NOTICE_TYPES))
};

/***/ },

/***/ "./js/modules/analytics-4/components/settings/OptionalSettingsView.js"
/*!****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/OptionalSettingsView.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 */ OptionalSettingsView)
/* 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_Typography__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.js");
/* harmony import */ var _js_modules_analytics_4_components_common_TrackingExclusionSwitches__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common/TrackingExclusionSwitches */ "./js/modules/analytics-4/components/common/TrackingExclusionSwitches.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.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Optional Settings View 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 OptionalSettingsView() {
  const trackingDisabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getTrackingDisabled() || []);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)("div", {
    className: "googlesitekit-settings-module__meta-items",
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-item",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_2__["default"], {
        as: "h5",
        size: "medium",
        type: "label",
        className: "googlesitekit-settings-module__meta-item-type",
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Excluded from Analytics', 'google-site-kit')
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_5__.jsxs)("p", {
        className: "googlesitekit-settings-module__meta-item-data",
        children: [!!trackingDisabled.length && trackingDisabled.map(exclusion => _js_modules_analytics_4_components_common_TrackingExclusionSwitches__WEBPACK_IMPORTED_MODULE_3__.trackingExclusionLabels[exclusion]).join((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__._x)(', ', 'list separator', 'google-site-kit')), !trackingDisabled.length && (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Analytics is currently enabled for all visitors', 'google-site-kit')]
      })]
    })
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/settings/PropertyOrWebDataStreamNotAvailableError.js"
/*!************************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/PropertyOrWebDataStreamNotAvailableError.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 */ PropertyOrWebDataStreamNotAvailableError)
/* 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__);
/* 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_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/ErrorNotice */ "./js/components/ErrorNotice.tsx");
/* 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.ts");
/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PropertyOrWebDataStreamNotAvailableError 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 PropertyOrWebDataStreamNotAvailableError(props) {
  const {
    hasModuleAccess,
    isDisabled
  } = props;
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getAccountID());
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getPropertyID());
  const measurementID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getMeasurementID());
  const properties = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => hasModuleAccess && !isDisabled ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getPropertySummaries(accountID) : []);
  const finishedSelectingAccount = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).hasFinishedSelectingAccount());
  const webDataStreams = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.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 getWebDataStreamsError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getErrorForSelector('getWebDataStreams', [propertyID]));
  const getPropertiesError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getErrorForSelector('getAccountSummaries', []));
  if (!hasModuleAccess || isDisabled || properties === undefined || webDataStreams === undefined || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidPropertyID)(propertyID) || finishedSelectingAccount === false) {
    return null;
  }
  const propertyAvailable = properties.some(({
    _id
  }) => _id === propertyID);
  if (propertyAvailable && measurementID && !getWebDataStreamsError && !webDataStreams.some(({
    webStreamData
  }) =>
  // eslint-disable-next-line sitekit/acronym-case
  webStreamData.measurementId === measurementID)) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__["default"], {
      message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Google Analytics Measurement ID. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The previously selected web data stream with measurement ID %1$s is no longer available. Please select a new web data stream to continue collecting data with Google Analytics.', 'google-site-kit'), measurementID),
      skipRetryMessage: true
    });
  }
  if (!propertyAvailable && !getPropertiesError) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_ErrorNotice__WEBPACK_IMPORTED_MODULE_3__["default"], {
      message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: 1: Google Analytics Property ID. */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('The previously selected property with ID %1$s is no longer available. Please select a new property to continue collecting data with Google Analytics.', 'google-site-kit'), propertyID),
      skipRetryMessage: true
    });
  }
  return null;
}
PropertyOrWebDataStreamNotAvailableError.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool),
  isDisabled: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/settings/SettingsControls.js"
/*!************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/SettingsControls.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 */ SettingsControls)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.tsx");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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.ts");
/* harmony import */ var _AnalyticsSettingsNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./AnalyticsSettingsNotice */ "./js/modules/analytics-4/components/settings/AnalyticsSettingsNotice.js");
/* harmony import */ var _PropertyOrWebDataStreamNotAvailableError__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PropertyOrWebDataStreamNotAvailableError */ "./js/modules/analytics-4/components/settings/PropertyOrWebDataStreamNotAvailableError.js");
/* harmony import */ var _SettingsUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./SettingsUseSnippetSwitch */ "./js/modules/analytics-4/components/settings/SettingsUseSnippetSwitch.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics 4 Settings controls.
 *
 * 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 SettingsControls(props) {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__.useFeature)('setupFlowRefresh');
  const {
    hasModuleAccess
  } = props;
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.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_6__.MODULES_ANALYTICS_4).getWebDataStreamID());
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
    className: "googlesitekit-settings-module__fields-group",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_3__["default"], {
      moduleSlug: "analytics-4",
      storeName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_PropertyOrWebDataStreamNotAvailableError__WEBPACK_IMPORTED_MODULE_8__["default"], {
      hasModuleAccess: hasModuleAccess,
      isDisabled: !propertyID
    }), setupFlowRefreshEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--grid-layout",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--account",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.AccountSelect, {
          hasModuleAccess: hasModuleAccess
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--property",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.PropertySelect, {
          hasModuleAccess: hasModuleAccess,
          isDisabled: !propertyID
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--webdatastream",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.WebDataStreamSelect, {
          hasModuleAccess: hasModuleAccess,
          isDisabled: !propertyID
        })
      }), webDataStreamID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.WEBDATASTREAM_CREATE && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--webdatastream-name",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.WebDataStreamNameInput, {})
      })]
    }), !setupFlowRefreshEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
        className: "googlesitekit-setup-module__inputs",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.AccountSelect, {
          hasModuleAccess: hasModuleAccess
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.PropertySelect, {
          hasModuleAccess: hasModuleAccess,
          isDisabled: !propertyID
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.WebDataStreamSelect, {
          hasModuleAccess: hasModuleAccess,
          isDisabled: !propertyID
        })]
      }), webDataStreamID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.WEBDATASTREAM_CREATE && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        className: "googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--multiline",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.WebDataStreamNameInput, {})
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_AnalyticsSettingsNotice__WEBPACK_IMPORTED_MODULE_7__["default"], {
      hasModuleAccess: hasModuleAccess,
      className: "googlesitekit-margin-top-0"
    }), propertyID && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "googlesitekit-settings-module__meta-item",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_SettingsUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_9__["default"], {})
    })]
  });
}
SettingsControls.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/settings/SettingsEdit.js"
/*!********************************************************************!*\
  !*** ./js/modules/analytics-4/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 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_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.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 googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* 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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__ = __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_10__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useExistingTagEffect__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useExistingTagEffect */ "./js/modules/analytics-4/hooks/useExistingTagEffect.js");
/* harmony import */ var _SettingsForm__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./SettingsForm */ "./js/modules/analytics-4/components/settings/SettingsForm.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics 4 Settings Edit 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 SettingsEdit() {
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_7__.useFeature)('setupFlowRefresh');
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getAccountSummaries()) || [];
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getAccountID());
  const isDoingSubmitChanges = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).isDoingSubmitChanges());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const usingProxy = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_SITE).isUsingProxy());
  const hasModuleAccess = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => {
    const {
      hasModuleOwnershipOrAccess,
      getErrorForAction
    } = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_MODULES);
    const hasAccess = hasModuleOwnershipOrAccess(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4);
    if (hasAccess) {
      return true;
    }
    const checkAccessError = getErrorForAction('checkModuleAccess', [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4]);

    // Return early if request is not completed yet.
    if (undefined === hasAccess && !checkAccessError) {
      return undefined;
    }

    // Return false if GA4 is connected and access is concretely missing.
    if (false === hasAccess) {
      return false;
    }
    if ('module_not_connected' === checkAccessError?.code) {
      return true;
    }

    // For any other error or case, the user does not have access to GA4.
    return false;
  });
  const settingsLoaded = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4).getSettings() !== undefined);
  (0,_js_modules_analytics_4_hooks_useExistingTagEffect__WEBPACK_IMPORTED_MODULE_11__["default"])();
  const {
    setAccountID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.MODULES_ANALYTICS_4);
  const accountCreationErrorCode = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.getQueryArg)(location.href, 'accountCreationErrorCode');
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (setupFlowRefreshEnabled && settingsLoaded && accountCreationErrorCode && accountID !== _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.ACCOUNT_CREATE) {
      setAccountID(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.ACCOUNT_CREATE);
    }
  }, [setupFlowRefreshEnabled, accountCreationErrorCode, setAccountID, accountID, settingsLoaded]);
  const isCreateAccount = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.ACCOUNT_CREATE === accountID;
  let viewComponent;
  // Here we also check for `hasResolvedAccounts` to prevent showing a different case below
  // when the component initially loads and has yet to start fetching accounts.
  if (isDoingSubmitChanges || !hasResolvedAccounts || hasModuleAccess === undefined) {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_3__.ProgressBar, {});
  } else if (!accounts.length || isCreateAccount) {
    viewComponent = usingProxy ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_8__.AccountCreate, {}) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_8__.AccountCreateLegacy, {});
  } else {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_SettingsForm__WEBPACK_IMPORTED_MODULE_12__["default"], {
      hasModuleAccess: hasModuleAccess
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("div", {
    className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-setup-module googlesitekit-setup-module--analytics', {
      'googlesitekit-feature--setupFlowRefresh': setupFlowRefreshEnabled
    }),
    children: viewComponent
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/settings/SettingsEnhancedMeasurementSwitch.js"
/*!*****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/SettingsEnhancedMeasurementSwitch.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 */ SettingsEnhancedMeasurementSwitch)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_components_common_EnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common/EnhancedMeasurementSwitch */ "./js/modules/analytics-4/components/common/EnhancedMeasurementSwitch.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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SettingsEnhancedMeasurementSwitch 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 SettingsEnhancedMeasurementSwitch({
  hasModuleAccess
}) {
  const [isEnhancedMeasurementEnabled, setIsEnhancedMeasurementEnabled] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_3__["default"])(_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_ENABLED);
  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 isLoadingPropertySummaries = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).isLoadingPropertySummaries();
  });
  const isLoadingWebDataStreams = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).isLoadingWebDataStreams({
      hasModuleAccess
    });
  });
  const isEnhancedMeasurementStreamEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (isLoadingPropertySummaries || isLoadingWebDataStreams || propertyID === undefined || webDataStreamID === undefined) {
      return undefined;
    }
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidPropertyID)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidWebDataStreamID)(webDataStreamID)) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).isEnhancedMeasurementStreamEnabled(propertyID, webDataStreamID);
  }, [isLoadingPropertySummaries, isLoadingWebDataStreams, propertyID, webDataStreamID]);
  const isEnhancedMeasurementAlreadyEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (isLoadingPropertySummaries || isLoadingWebDataStreams || propertyID === undefined || webDataStreamID === undefined) {
      return undefined;
    }
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidPropertyID)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidWebDataStreamID)(webDataStreamID)) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).isEnhancedMeasurementStreamAlreadyEnabled(propertyID, webDataStreamID);
  }, [isLoadingPropertySummaries, isLoadingWebDataStreams, propertyID, webDataStreamID]);
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (propertyID === undefined || webDataStreamID === undefined || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidPropertySelection)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidWebDataStreamSelection)(webDataStreamID) || isLoadingPropertySummaries || isLoadingWebDataStreams) {
      return true;
    }
    if (propertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.PROPERTY_CREATE || webDataStreamID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.WEBDATASTREAM_CREATE) {
      return false;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).hasFinishedResolution('getEnhancedMeasurementSettings', [propertyID, webDataStreamID]) || !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).hasFinishedResolution('isEnhancedMeasurementStreamAlreadyEnabled', [propertyID, webDataStreamID]);
  }, [isLoadingPropertySummaries, isLoadingWebDataStreams, propertyID, webDataStreamID, isEnhancedMeasurementStreamEnabled, isEnhancedMeasurementAlreadyEnabled]);
  const {
    setEnhancedMeasurementStreamEnabled
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4);
  const initialValues = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)({
    isEnhancedMeasurementEnabled,
    propertyID,
    webDataStreamID
  });
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (initialValues.current.isEnhancedMeasurementEnabled !== undefined &&
    // initialValues.current.isEnhancedMeasurementEnabled !== null &&
    initialValues.current.webDataStreamID === webDataStreamID && initialValues.current.propertyID === propertyID) {
      return;
    }
    if (isEnhancedMeasurementStreamEnabled === undefined ||
    // isEnhancedMeasurementStreamEnabled === null ||
    !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidPropertySelection)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidWebDataStreamSelection)(webDataStreamID)) {
      return;
    }

    // Here we update the form value in order to toggle the switch in `EnhancedMeasurementSwitch`,
    if (propertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.PROPERTY_CREATE || webDataStreamID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.WEBDATASTREAM_CREATE) {
      setIsEnhancedMeasurementEnabled(true);
    } else {
      setIsEnhancedMeasurementEnabled(isEnhancedMeasurementStreamEnabled);
    }
  }, [isEnhancedMeasurementStreamEnabled, propertyID, setIsEnhancedMeasurementEnabled, webDataStreamID]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_modules_analytics_4_components_common_EnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_4__["default"], {
    variant: "row",
    disabled: !hasModuleAccess,
    loading: isLoading,
    isEnhancedMeasurementAlreadyEnabled: isEnhancedMeasurementAlreadyEnabled,
    onClick: () => {
      if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidPropertyID)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.isValidWebDataStreamID)(webDataStreamID)) {
        return;
      }

      // Here we update the enhanced measurement `streamEnabled` setting to ensure `validateCanSubmitChanges()` can detect
      // that the setting has changed via its call to `haveEnhancedMeasurementSettingsChanged()`.
      setEnhancedMeasurementStreamEnabled({
        propertyID,
        webDataStreamID,
        enabled: !isEnhancedMeasurementStreamEnabled
      });
    },
    showTick: true
  });
}
SettingsEnhancedMeasurementSwitch.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/settings/SettingsForm.js"
/*!********************************************************************!*\
  !*** ./js/modules/analytics-4/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 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* harmony import */ var _js_components_conversion_tracking_ConversionTrackingToggle__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/conversion-tracking/ConversionTrackingToggle */ "./js/components/conversion-tracking/ConversionTrackingToggle.js");
/* harmony import */ var _js_components_google_tag_gateway_GoogleTagGatewayToggle__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/google-tag-gateway/GoogleTagGatewayToggle */ "./js/components/google-tag-gateway/GoogleTagGatewayToggle.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_Notice_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Notice/constants */ "./js/components/Notice/constants.ts");
/* harmony import */ var _js_components_settings_EntityOwnershipChangeNotice__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/settings/EntityOwnershipChangeNotice */ "./js/components/settings/EntityOwnershipChangeNotice.js");
/* harmony import */ var _js_components_settings_SettingsGroup__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/settings/SettingsGroup */ "./js/components/settings/SettingsGroup.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/constants.js");
/* harmony import */ var _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_15__ = __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_16__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _EnhancedConversionsSettingsNotice__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./EnhancedConversionsSettingsNotice */ "./js/modules/analytics-4/components/settings/EnhancedConversionsSettingsNotice.js");
/* harmony import */ var _SettingsAdvancedDataBreakdowns__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./SettingsAdvancedDataBreakdowns */ "./js/modules/analytics-4/components/settings/SettingsAdvancedDataBreakdowns.tsx");
/* harmony import */ var _SettingsControls__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./SettingsControls */ "./js/modules/analytics-4/components/settings/SettingsControls.js");
/* harmony import */ var _SettingsEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./SettingsEnhancedMeasurementSwitch */ "./js/modules/analytics-4/components/settings/SettingsEnhancedMeasurementSwitch.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics 4 Settings form.
 *
 * 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 SettingsForm({
  hasModuleAccess
}) {
  const gtgEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_12__.useFeature)('googleTagGateway');
  const gtagUserDataEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_12__.useFeature)('gtagUserData');
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_12__.useFeature)('setupFlowRefresh');
  const siteGoalsEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_12__.useFeature)('siteGoals');
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_13__["default"])();
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_16__.MODULES_ANALYTICS_4).getAccountID());
  const conversionTrackingDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_SITE).getDocumentationLinkURL('plugin-conversion-tracking'));
  const onClickLearnMoreLink = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (setupFlowRefreshEnabled) {
      (0,_js_util__WEBPACK_IMPORTED_MODULE_18__.trackEvent)(viewContext, 'click_learn_more_link', 'plugin_conversion_tracking');
    }
  }, [setupFlowRefreshEnabled, viewContext]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_SettingsControls__WEBPACK_IMPORTED_MODULE_21__["default"], {
      hasModuleAccess: hasModuleAccess
    }), (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_17__.isValidAccountID)(accountID) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_14__.TrackingExclusionSwitches, {}), hasModuleAccess && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_settings_EntityOwnershipChangeNotice__WEBPACK_IMPORTED_MODULE_9__["default"], {
      slug: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_15__.MODULE_SLUG_ANALYTICS_4]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsxs)(_js_components_settings_SettingsGroup__WEBPACK_IMPORTED_MODULE_10__["default"], {
      className: "googlesitekit-module-settings-group--improve-measurement",
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Improve your measurement', 'google-site-kit'),
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_conversion_tracking_ConversionTrackingToggle__WEBPACK_IMPORTED_MODULE_5__["default"], {
        children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Conversion tracking allows you to measure additional events on your site from other plugins that Site Kit integrates with to optimize your campaign performance. <a>Learn more</a>', 'google-site-kit'), {
          a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_7__["default"], {
            href: conversionTrackingDocumentationURL,
            "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Learn more about conversion tracking', 'google-site-kit'),
            onClick: onClickLearnMoreLink,
            external: true,
            hideExternalIndicator: true
          })
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_SettingsEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_22__["default"], {
        hasModuleAccess: hasModuleAccess
      }), siteGoalsEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_SettingsAdvancedDataBreakdowns__WEBPACK_IMPORTED_MODULE_20__["default"], {
        hasModuleAccess: hasModuleAccess
      }), gtgEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_js_components_google_tag_gateway_GoogleTagGatewayToggle__WEBPACK_IMPORTED_MODULE_6__["default"], {}), gtagUserDataEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_23__.jsx)(_EnhancedConversionsSettingsNotice__WEBPACK_IMPORTED_MODULE_19__["default"], {
        type: _js_components_Notice_constants__WEBPACK_IMPORTED_MODULE_8__.NOTICE_TYPES.INFO_ALT
      })]
    })]
  });
}
SettingsForm.propTypes = {
  hasModuleAccess: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().bool)
};

/***/ },

/***/ "./js/modules/analytics-4/components/settings/SettingsUseSnippetSwitch.js"
/*!********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/settings/SettingsUseSnippetSwitch.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 */ SettingsUseSnippetSwitch)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_Typography_P__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_modules_analytics_4_components_common_UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common/UseSnippetSwitch */ "./js/modules/analytics-4/components/common/UseSnippetSwitch.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.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GA4 Settings Use Snippet 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 SettingsUseSnippetSwitch() {
  const useSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getUseSnippet());
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getExistingTag());
  const measurementID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getMeasurementID());
  let description;
  if (existingTag) {
    description = existingTag === measurementID ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: existing tag ID */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('A tag %s for the selected property already exists on the site', 'google-site-kit'), existingTag)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Consider removing the existing tag to avoid loading both tags on your site', 'google-site-kit')
      })]
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: existing tag ID */
        (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('An existing tag %s was found on the page', 'google-site-kit'), existingTag)
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('If you prefer to collect data using that existing tag, please select the corresponding account and property above', 'google-site-kit')
      })]
    });
  } else {
    description = useSnippet ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit will add the code automatically', 'google-site-kit')
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit will not add the code to your site', 'google-site-kit')
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_modules_analytics_4_components_common_UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__["default"], {
    description: description
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/settings/SettingsView.js"
/*!********************************************************************!*\
  !*** ./js/modules/analytics-4/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_0__ = __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_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/DisplaySetting */ "./js/components/DisplaySetting.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_settings_SettingsStatuses__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/settings/SettingsStatuses */ "./js/components/settings/SettingsStatuses.js");
/* harmony import */ var _js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.tsx");
/* 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_VisuallyHidden__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/VisuallyHidden */ "./js/components/VisuallyHidden.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 _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util_escape_uri__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util/escape-uri */ "./js/util/escape-uri.ts");
/* harmony import */ var _EnhancedConversionsSettingsNotice__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./EnhancedConversionsSettingsNotice */ "./js/modules/analytics-4/components/settings/EnhancedConversionsSettingsNotice.js");
/* harmony import */ var _OptionalSettingsView__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./OptionalSettingsView */ "./js/modules/analytics-4/components/settings/OptionalSettingsView.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics Settings View 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 SettingsView() {
  const gtgEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_10__.useFeature)('googleTagGateway');
  const gtagUserDataEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_10__.useFeature)('gtagUserData');
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getAccountID());
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getPropertyID());
  const measurementID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getMeasurementID());
  const googleTagID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getGoogleTagID());
  const useSnippet = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getUseSnippet());
  const editAccountSettingsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getServiceURL({
    path: (0,_js_util_escape_uri__WEBPACK_IMPORTED_MODULE_13__.escapeURI)`/a${accountID}p${propertyID}/admin/account/settings`
  }));
  const editDataStreamSettingsURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getServiceEntityAccessURL());
  const webDataStreamID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getWebDataStreamID());
  const isEnhancedMeasurementStreamEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (propertyID === undefined || webDataStreamID === undefined) {
      return undefined;
    }
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertyID)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidWebDataStreamID)(webDataStreamID)) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isEnhancedMeasurementStreamEnabled(propertyID, webDataStreamID);
  }, [propertyID, webDataStreamID]);
  const isConversionTrackingEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).isConversionTrackingEnabled());
  const isGTGEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => {
    if (!gtgEnabled) {
      return false;
    }
    const {
      isGoogleTagGatewayEnabled,
      isGTGHealthy,
      isScriptAccessEnabled
    } = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE);
    return isGoogleTagGatewayEnabled() && isGTGHealthy() && isScriptAccessEnabled();
  });
  if (!propertyID || propertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.PROPERTY_CREATE) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
    className: "googlesitekit-setup-module googlesitekit-setup-module--analytics",
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_6__["default"], {
      moduleSlug: "analytics-4",
      storeName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Account', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_3__["default"], {
            value: accountID
          })
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", {
        className: "googlesitekit-settings-module__meta-item googlesitekit-settings-module__meta-item--data-only",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data googlesitekit-settings-module__meta-item-data--tiny",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
            href: editAccountSettingsURL,
            external: true,
            children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Edit <VisuallyHidden>account </VisuallyHidden>in Analytics', 'google-site-kit'), {
              VisuallyHidden: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_8__["default"], {})
            })
          })
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Property', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_3__["default"], {
            value: propertyID
          })
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('<VisuallyHidden>Google Analytics</VisuallyHidden> Measurement ID', 'google-site-kit'), {
            VisuallyHidden: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_8__["default"], {})
          })
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_3__["default"], {
            value: measurementID
          })
        })]
      }), googleTagID && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Google Tag ID', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_3__["default"], {
            value: googleTagID
          })
        })]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", {
        className: "googlesitekit-settings-module__meta-item googlesitekit-settings-module__meta-item--data-only",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("p", {
          className: "googlesitekit-settings-module__meta-item-data googlesitekit-settings-module__meta-item-data--tiny",
          children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_4__["default"], {
            href: editDataStreamSettingsURL,
            external: true,
            children: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Edit <VisuallyHidden>web data stream </VisuallyHidden>in Analytics', 'google-site-kit'), {
              VisuallyHidden: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_VisuallyHidden__WEBPACK_IMPORTED_MODULE_8__["default"], {})
            })
          })
        })
      })]
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("div", {
      className: "googlesitekit-settings-module__meta-items",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("div", {
        className: "googlesitekit-settings-module__meta-item",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_7__["default"], {
          as: "h5",
          size: "medium",
          type: "label",
          className: "googlesitekit-settings-module__meta-item-type",
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Code Snippet', 'google-site-kit')
        }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsxs)("p", {
          className: "googlesitekit-settings-module__meta-item-data",
          children: [useSnippet && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span", {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Snippet is inserted', 'google-site-kit')
          }), useSnippet === false && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)("span", {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Snippet is not inserted', 'google-site-kit')
          }), useSnippet === undefined && _js_components_DisplaySetting__WEBPACK_IMPORTED_MODULE_3__.BLANK_SPACE]
        })]
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_OptionalSettingsView__WEBPACK_IMPORTED_MODULE_15__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_js_components_settings_SettingsStatuses__WEBPACK_IMPORTED_MODULE_5__["default"], {
      statuses: [{
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Enhanced Measurement', 'google-site-kit'),
        status: isEnhancedMeasurementStreamEnabled
      }, {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Plugin conversion tracking', 'google-site-kit'),
        status: isConversionTrackingEnabled
      }, ...(gtgEnabled ? [{
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Google tag gateway for advertisers', 'google-site-kit'),
        status: isGTGEnabled
      }] : [])]
    }), gtagUserDataEnabled && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_16__.jsx)(_EnhancedConversionsSettingsNotice__WEBPACK_IMPORTED_MODULE_14__["default"], {})]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/settings/index.js"
/*!*************************************************************!*\
  !*** ./js/modules/analytics-4/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 */   AnalyticsSettingsNotice: () => (/* reexport safe */ _AnalyticsSettingsNotice__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   EnhancedConversionsSettingsNotice: () => (/* reexport safe */ _EnhancedConversionsSettingsNotice__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   OptionalSettingsView: () => (/* reexport safe */ _OptionalSettingsView__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   PropertyOrWebDataStreamNotAvailableError: () => (/* reexport safe */ _PropertyOrWebDataStreamNotAvailableError__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   SettingsAdvancedDataBreakdowns: () => (/* reexport safe */ _SettingsAdvancedDataBreakdowns__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   SettingsControls: () => (/* reexport safe */ _SettingsControls__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   SettingsEdit: () => (/* reexport safe */ _SettingsEdit__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   SettingsEnhancedMeasurementSwitch: () => (/* reexport safe */ _SettingsEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   SettingsForm: () => (/* reexport safe */ _SettingsForm__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   SettingsUseSnippetSwitch: () => (/* reexport safe */ _SettingsUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_9__["default"]),
/* harmony export */   SettingsView: () => (/* reexport safe */ _SettingsView__WEBPACK_IMPORTED_MODULE_10__["default"])
/* harmony export */ });
/* harmony import */ var _AnalyticsSettingsNotice__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AnalyticsSettingsNotice */ "./js/modules/analytics-4/components/settings/AnalyticsSettingsNotice.js");
/* harmony import */ var _EnhancedConversionsSettingsNotice__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./EnhancedConversionsSettingsNotice */ "./js/modules/analytics-4/components/settings/EnhancedConversionsSettingsNotice.js");
/* harmony import */ var _OptionalSettingsView__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./OptionalSettingsView */ "./js/modules/analytics-4/components/settings/OptionalSettingsView.js");
/* harmony import */ var _PropertyOrWebDataStreamNotAvailableError__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./PropertyOrWebDataStreamNotAvailableError */ "./js/modules/analytics-4/components/settings/PropertyOrWebDataStreamNotAvailableError.js");
/* harmony import */ var _SettingsAdvancedDataBreakdowns__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SettingsAdvancedDataBreakdowns */ "./js/modules/analytics-4/components/settings/SettingsAdvancedDataBreakdowns.tsx");
/* harmony import */ var _SettingsControls__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SettingsControls */ "./js/modules/analytics-4/components/settings/SettingsControls.js");
/* harmony import */ var _SettingsEdit__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./SettingsEdit */ "./js/modules/analytics-4/components/settings/SettingsEdit.js");
/* harmony import */ var _SettingsEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./SettingsEnhancedMeasurementSwitch */ "./js/modules/analytics-4/components/settings/SettingsEnhancedMeasurementSwitch.js");
/* harmony import */ var _SettingsForm__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SettingsForm */ "./js/modules/analytics-4/components/settings/SettingsForm.js");
/* harmony import */ var _SettingsUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./SettingsUseSnippetSwitch */ "./js/modules/analytics-4/components/settings/SettingsUseSnippetSwitch.js");
/* harmony import */ var _SettingsView__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./SettingsView */ "./js/modules/analytics-4/components/settings/SettingsView.js");
/**
 * GA4 settings 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/analytics-4/components/setup/SetupEnhancedMeasurementSwitch.js"
/*!***********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/setup/SetupEnhancedMeasurementSwitch.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 */ SetupEnhancedMeasurementSwitch)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_components_common_EnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common/EnhancedMeasurementSwitch */ "./js/modules/analytics-4/components/common/EnhancedMeasurementSwitch.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.ts");
/* 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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupEnhancedMeasurementSwitch 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 SetupEnhancedMeasurementSwitch() {
  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 propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getPropertyID());
  const webDataStreamID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getWebDataStreamID());
  const isLoadingPropertySummaries = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).isLoadingPropertySummaries());
  const isLoadingWebDataStreams = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).isLoadingWebDataStreams({
    hasModuleAccess: true
  }));
  const isEnhancedMeasurementAlreadyEnabled = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (isLoadingPropertySummaries || isLoadingWebDataStreams) {
      return undefined;
    }
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidPropertyID)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidWebDataStreamID)(webDataStreamID)) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).isEnhancedMeasurementStreamAlreadyEnabled(propertyID, webDataStreamID);
  });
  const isLoading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidPropertySelection)(propertyID) || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidWebDataStreamSelection)(webDataStreamID) || isLoadingPropertySummaries || isLoadingWebDataStreams) {
      return true;
    }
    if (propertyID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.PROPERTY_CREATE || webDataStreamID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.WEBDATASTREAM_CREATE) {
      return false;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).hasFinishedResolution('isEnhancedMeasurementStreamAlreadyEnabled', [propertyID, webDataStreamID]);
  }, [isEnhancedMeasurementAlreadyEnabled, isLoadingPropertySummaries, isLoadingWebDataStreams, propertyID, webDataStreamID]);
  const [isAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_2__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.FORM_SETUP, 'autoSubmit');
  const [isEnhancedMeasurementEnabled, setIsEnhancedMeasurementEnabled] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_2__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.ENHANCED_MEASUREMENT_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.ENHANCED_MEASUREMENT_ENABLED);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (!isAutoSubmit && isEnhancedMeasurementEnabled === undefined) {
      setIsEnhancedMeasurementEnabled(true);
    }
  }, [isAutoSubmit, isEnhancedMeasurementEnabled, setIsEnhancedMeasurementEnabled]);
  if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_5__.isValidAccountID)(accountID)) {
    return null;
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_modules_analytics_4_components_common_EnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_3__["default"], {
    loading: isLoading,
    isEnhancedMeasurementAlreadyEnabled: isEnhancedMeasurementAlreadyEnabled
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/setup/SetupForm.js"
/*!**************************************************************!*\
  !*** ./js/modules/analytics-4/components/setup/SetupForm.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 */ SetupForm)
/* 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__);
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/create-interpolate-element.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__);
/* 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_conversion_tracking_SetupPluginConversionTrackingNotice__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/conversion-tracking/SetupPluginConversionTrackingNotice */ "./js/components/conversion-tracking/SetupPluginConversionTrackingNotice.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.js");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.js");
/* harmony import */ var _js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/StoreErrorNotices */ "./js/components/StoreErrorNotices.tsx");
/* harmony import */ var _js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/googlesitekit/datastore/location/constants */ "./js/googlesitekit/datastore/location/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/googlesitekit/datastore/site/constants */ "./js/googlesitekit/datastore/site/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_hooks_useFeature__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _SetupFormFields__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./SetupFormFields */ "./js/modules/analytics-4/components/setup/SetupFormFields.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics Setup form.
 *
 * 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 SetupForm({
  finishSetup
}) {
  const hasEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_14__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.EDIT_SCOPE));
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_16__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.FORM_SETUP, 'autoSubmit');
  const canSubmitChanges = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).canSubmitChanges());
  const isSaving = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).isDoingSubmitChanges() || select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_12__.CORE_LOCATION).isNavigating());
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_17__["default"])();
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_15__.useFeature)('setupFlowRefresh');
  const showProgress = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_5__.getQueryArg)(location.href, 'showProgress');
  const keyMetricsSetupURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => {
    if (!setupFlowRefreshEnabled) {
      return undefined;
    }
    const url = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_SITE).getAdminURL('googlesitekit-key-metrics-setup');
    return showProgress ? (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_4__.addQueryArgs)(url, {
      showProgress: 'true'
    }) : url;
  });
  const pluginConversionsDocumentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => {
    return select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_SITE).getDocumentationLinkURL('plugin-conversion-tracking');
  });
  const {
    submitChanges
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4);
  const {
    setConversionTrackingEnabled,
    saveConversionTrackingSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_13__.CORE_SITE);
  const [isEnhancedMeasurementEnabled] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_16__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.ENHANCED_MEASUREMENT_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.ENHANCED_MEASUREMENT_ENABLED);
  const isInitialSetupFlow = !!showProgress;
  const submitForm = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async event => {
    event.preventDefault();
    // Disable autoSubmit unconditionally to prevent
    // automatic invocation more than once.
    setAutoSubmit(false);
    const {
      error
    } = await submitChanges();
    if ((0,_js_util_errors__WEBPACK_IMPORTED_MODULE_20__.isPermissionScopeError)(error)) {
      setAutoSubmit(true);
    }
    if (!error) {
      setConversionTrackingEnabled(true);
      await saveConversionTrackingSettings();
      if (isEnhancedMeasurementEnabled === true) {
        await (0,_js_util__WEBPACK_IMPORTED_MODULE_19__.trackEvent)(`${viewContext}_analytics`, 'ga4_setup_enhanced_measurement_enabled');
      }
      finishSetup(keyMetricsSetupURL);
    }
  }, [finishSetup, keyMetricsSetupURL, isEnhancedMeasurementEnabled, setConversionTrackingEnabled, saveConversionTrackingSettings, setAutoSubmit, submitChanges, viewContext]);

  // If the user lands back on this component with autoSubmit and the edit scope,
  // resubmit the form.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (autoSubmit && hasEditScope) {
      submitForm({
        preventDefault: () => {}
      });
    }
  }, [hasEditScope, autoSubmit, submitForm]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsxs)("form", {
    className: "googlesitekit-analytics-setup__form",
    onSubmit: submitForm,
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_StoreErrorNotices__WEBPACK_IMPORTED_MODULE_11__["default"], {
      moduleSlug: "analytics-4",
      storeName: _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_SetupFormFields__WEBPACK_IMPORTED_MODULE_21__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_conversion_tracking_SetupPluginConversionTrackingNotice__WEBPACK_IMPORTED_MODULE_8__["default"], {
      message: (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('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_22__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_9__["default"], {
          href: pluginConversionsDocumentationURL,
          onClick: () => {
            (0,_js_util__WEBPACK_IMPORTED_MODULE_19__.trackEvent)(isInitialSetupFlow ? `${viewContext}_setup` : viewContext, 'click_learn_more_link', 'plugin_conversion_tracking');
          },
          external: true,
          children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Learn more', 'google-site-kit')
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(_js_components_Null__WEBPACK_IMPORTED_MODULE_10__["default"], {})
      })
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)("div", {
      className: "googlesitekit-setup-module__action",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_22__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_6__.SpinnerButton, {
        disabled: !canSubmitChanges || isSaving,
        isSaving: isSaving,
        children: setupFlowRefreshEnabled ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Set up', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Complete setup', 'google-site-kit')
      })
    })]
  });
}
SetupForm.propTypes = {
  finishSetup: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().func)
};
SetupForm.defaultProps = {
  finishSetup: () => {}
};

/***/ },

/***/ "./js/modules/analytics-4/components/setup/SetupFormFields.js"
/*!********************************************************************!*\
  !*** ./js/modules/analytics-4/components/setup/SetupFormFields.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 */ SetupFormFields)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _SetupEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./SetupEnhancedMeasurementSwitch */ "./js/modules/analytics-4/components/setup/SetupEnhancedMeasurementSwitch.js");
/* harmony import */ var _SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./SetupUseSnippetSwitch */ "./js/modules/analytics-4/components/setup/SetupUseSnippetSwitch.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * SetupFormFields 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 SetupFormFields() {
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getAccountSummaries()) || [];
  const hasExistingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasExistingTag());
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getExistingTag());
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getAccountID());
  const measurementID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getMeasurementID());
  const webDataStreamID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getWebDataStreamID());
  const {
    setValues
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_FORMS);
  const {
    setUseSnippet
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_4__.useFeature)('setupFlowRefresh');
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (hasExistingTag) {
      setUseSnippet(existingTag !== measurementID);
    }
  }, [setUseSnippet, hasExistingTag, existingTag, measurementID]);
  const resetEnhancedMeasurementSetting = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
    setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENHANCED_MEASUREMENT_FORM, {
      [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENHANCED_MEASUREMENT_ENABLED]: true
    });
  }, [setValues]);
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [!!accounts.length && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("p", {
      className: "googlesitekit-setup-module__select_account",
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Please select the account information below. You can change this later in your settings.', 'google-site-kit')
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
      className: "googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--grid-layout",
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--account",
        children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.AccountSelect, {
          onChange: resetEnhancedMeasurementSetting
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--property",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.PropertySelect, {
          onChange: resetEnhancedMeasurementSetting,
          hasModuleAccess: true
        }), setupFlowRefreshEnabled && (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_7__.isValidAccountID)(accountID) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.PropertyHint, {})]
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsxs)("div", {
        className: "googlesitekit-setup-module__input-wrapper googlesitekit-setup-module__input-wrapper--webdatastream",
        children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.WebDataStreamSelect, {
          onChange: resetEnhancedMeasurementSetting,
          hasModuleAccess: true
        }), setupFlowRefreshEnabled && (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_7__.isValidAccountID)(accountID) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.WebDataStreamHint, {})]
      })]
    }), webDataStreamID === _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.WEBDATASTREAM_CREATE && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("div", {
      className: "googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--grid-layout googlesitekit-setup-module__inputs--multiline",
      children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.WebDataStreamNameInput, {})
    }), hasExistingTag && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_9__["default"], {}), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_SetupEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_8__["default"], {})]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/setup/SetupMain.js"
/*!**************************************************************!*\
  !*** ./js/modules/analytics-4/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 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_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 _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/get-query-arg.js");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! googlesitekit-components */ "googlesitekit-components");
/* harmony import */ var googlesitekit_components__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__);
/* harmony import */ var _js_components_ToastNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/ToastNotice */ "./js/components/ToastNotice.tsx");
/* harmony import */ var _js_components_Typography__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Typography */ "./js/components/Typography/index.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 _js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/hooks/useFeature */ "./js/hooks/useFeature.js");
/* harmony import */ var _js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/hooks/useQueryArg */ "./js/hooks/useQueryArg.js");
/* harmony import */ var _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useExistingTagEffect__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useExistingTagEffect */ "./js/modules/analytics-4/hooks/useExistingTagEffect.js");
/* harmony import */ var _svg_graphics_analytics_svg__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/svg/graphics/analytics.svg */ "./svg/graphics/analytics.svg");
/* harmony import */ var _SetupForm__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./SetupForm */ "./js/modules/analytics-4/components/setup/SetupForm.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * Analytics Main setup 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 SetupMain({
  finishSetup
}) {
  const accounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).getAccountSummaries());
  const accountID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).getAccountID());
  const hasResolvedAccounts = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'));
  const usingProxy = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).isUsingProxy());
  const {
    setAccountID
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4);
  const {
    findMatchedAccount,
    matchAndSelectProperty
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_6__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4);
  const [isMatchedAccount, setIsMatchedAccount] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(false);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useEffect)(() => {
    if (!accounts) {
      return;
    }
    async function fetchMatchedAccount() {
      setIsMatchedAccount(true);
      const matchedAccount = await findMatchedAccount();
      setIsMatchedAccount(false);
      if (matchedAccount) {
        setAccountID(matchedAccount._id);
        matchAndSelectProperty(matchedAccount._id);
      }
    }
    if (!accountID) {
      fetchMatchedAccount();
    }
  }, [findMatchedAccount, accounts, setAccountID, accountID, matchAndSelectProperty]);

  // Set the accountID and containerID if there is an existing tag.
  (0,_js_modules_analytics_4_hooks_useExistingTagEffect__WEBPACK_IMPORTED_MODULE_14__["default"])();
  const [showProgress] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_11__["default"])('showProgress');
  const accountCreationErrorCode = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_4__.getQueryArg)(location.href, 'accountCreationErrorCode');
  const setupFlowRefreshEnabled = (0,_js_hooks_useFeature__WEBPACK_IMPORTED_MODULE_10__.useFeature)('setupFlowRefresh');

  // Show the Create Account screen when an account creation error is present,
  // even if the user has existing accounts, so the error can be surfaced inline
  // and the user can retry or continue without Analytics.
  const isCreateAccount = _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.ACCOUNT_CREATE === accountID || Array.isArray(accounts) && !accounts.length || setupFlowRefreshEnabled && !!accountCreationErrorCode;
  const isInitialSetupFlow = !!showProgress && setupFlowRefreshEnabled;
  const [searchConsoleSetupSuccess, setSearchConsoleSetupSuccess] = (0,_js_hooks_useQueryArg__WEBPACK_IMPORTED_MODULE_11__["default"])('searchConsoleSetupSuccess');
  const showSearchConsoleSetupSuccessToast = !!searchConsoleSetupSuccess && setupFlowRefreshEnabled;
  let viewComponent;
  // Here we also check for `hasResolvedAccounts` to prevent showing a different case below
  // when the component initially loads and has yet to start fetching accounts.
  if (!hasResolvedAccounts || isMatchedAccount) {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(googlesitekit_components__WEBPACK_IMPORTED_MODULE_5__.ProgressBar, {});
  } else if (isCreateAccount) {
    viewComponent = usingProxy ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_12__.AccountCreate, {
      className: "googlesitekit-analytics-setup__form"
    }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_12__.AccountCreateLegacy, {});
  } else {
    viewComponent = /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_SetupForm__WEBPACK_IMPORTED_MODULE_16__["default"], {
      finishSetup: finishSetup
    });
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)("div", {
      className: classnames__WEBPACK_IMPORTED_MODULE_0___default()('googlesitekit-setup-module googlesitekit-setup-module--analytics', {
        'googlesitekit-feature--setupFlowRefresh': setupFlowRefreshEnabled
      }),
      children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("div", {
        className: "googlesitekit-setup-module__step",
        children: isInitialSetupFlow ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_8__["default"], {
          as: "h1",
          className: "googlesitekit-setup__title",
          size: "medium",
          type: "headline",
          children: isCreateAccount ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Create your Analytics account', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Set up Analytics', 'google-site-kit')
        }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.Fragment, {
          children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("div", {
            className: "googlesitekit-setup-module__logo",
            children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_svg_graphics_analytics_svg__WEBPACK_IMPORTED_MODULE_15__["default"], {
              width: "40",
              height: "40"
            })
          }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_Typography__WEBPACK_IMPORTED_MODULE_8__["default"], {
            as: "h3",
            className: "googlesitekit-setup-module__title",
            size: "small",
            type: "headline",
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__._x)('Analytics', 'Service name', 'google-site-kit')
          })]
        })
      }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)("div", {
        className: "googlesitekit-setup-module__step",
        children: viewComponent
      })]
    }), showSearchConsoleSetupSuccessToast && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_17__.jsx)(_js_components_ToastNotice__WEBPACK_IMPORTED_MODULE_7__["default"], {
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_3__.__)('Search Console was successfully set up', 'google-site-kit'),
      onDismiss: () => setSearchConsoleSetupSuccess(undefined)
    })]
  });
}
SetupMain.propTypes = {
  finishSetup: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().func)
};
SetupMain.defaultProps = {
  finishSetup: () => {}
};

/***/ },

/***/ "./js/modules/analytics-4/components/setup/SetupUseSnippetSwitch.js"
/*!**************************************************************************!*\
  !*** ./js/modules/analytics-4/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_0__ = __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_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_Typography_P__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Typography/P */ "./js/components/Typography/P.js");
/* harmony import */ var _js_modules_analytics_4_components_common_UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common/UseSnippetSwitch */ "./js/modules/analytics-4/components/common/UseSnippetSwitch.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.ts");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * GA4 Setup Use Snippet 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 existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getExistingTag());
  const measurementID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getMeasurementID());
  const description = existingTag === measurementID ? /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: existing tag ID */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('A tag %s for the selected property already exists on the site', 'google-site-kit'), existingTag)
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Consider removing the existing tag to avoid loading both tags on your site', 'google-site-kit')
    })]
  }) : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsxs)(_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
    children: [/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: existing tag ID */
      (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('An existing tag %s was found on the page', 'google-site-kit'), existingTag)
    }), /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_components_Typography_P__WEBPACK_IMPORTED_MODULE_3__["default"], {
      children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('If you prefer to collect data using that existing Analytics tag, please select the corresponding account and property above', 'google-site-kit')
    })]
  });
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_6__.jsx)(_js_modules_analytics_4_components_common_UseSnippetSwitch__WEBPACK_IMPORTED_MODULE_4__["default"], {
    description: description
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/setup/index.js"
/*!**********************************************************!*\
  !*** ./js/modules/analytics-4/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 */   SetupEnhancedMeasurementSwitch: () => (/* reexport safe */ _SetupEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   SetupForm: () => (/* reexport safe */ _SetupForm__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   SetupFormFields: () => (/* reexport safe */ _SetupFormFields__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   SetupLayout: () => (/* reexport safe */ _SetupLayout__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   SetupMain: () => (/* reexport safe */ _SetupMain__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   SetupUseSnippetSwitch: () => (/* reexport safe */ _SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_1__["default"])
/* harmony export */ });
/* harmony import */ var _SetupEnhancedMeasurementSwitch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./SetupEnhancedMeasurementSwitch */ "./js/modules/analytics-4/components/setup/SetupEnhancedMeasurementSwitch.js");
/* harmony import */ var _SetupUseSnippetSwitch__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./SetupUseSnippetSwitch */ "./js/modules/analytics-4/components/setup/SetupUseSnippetSwitch.js");
/* harmony import */ var _SetupFormFields__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./SetupFormFields */ "./js/modules/analytics-4/components/setup/SetupFormFields.js");
/* harmony import */ var _SetupForm__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./SetupForm */ "./js/modules/analytics-4/components/setup/SetupForm.js");
/* harmony import */ var _SetupLayout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./SetupLayout */ "./js/modules/analytics-4/components/setup/SetupLayout/index.tsx");
/* harmony import */ var _SetupMain__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./SetupMain */ "./js/modules/analytics-4/components/setup/SetupMain.js");
/**
 * GA4 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/analytics-4/components/util/whenHasChangedConversionEvents.js"
/*!**********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/util/whenHasChangedConversionEvents.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 */ whenHasChangedConversionEvents)
/* 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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* 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.
 */

/**
 * Internal dependencies
 */



/**
 * Higher-Order Component to render wrapped components when changed conversion events are detected.
 *
 * @since 1.150.0
 *
 * @return {Function} Enhancing function.
 */

function whenHasChangedConversionEvents() {
  return WrappedComponent => {
    function WhenHasChangedConversionEvents(props) {
      const hasChangedConversionEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
        const {
          hasNewConversionReportingEvents,
          hasLostConversionReportingEvents
        } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_1__.MODULES_ANALYTICS_4);
        return hasNewConversionReportingEvents() || hasLostConversionReportingEvents();
      }, []);
      if (hasChangedConversionEvents) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(WrappedComponent, {
          ...props
        });
      }
      const {
        WidgetNull = null
      } = props;
      return WidgetNull && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(WidgetNull, {});
    }
    WhenHasChangedConversionEvents.displayName = `WhenHasChangedConversionEvents(${WrappedComponent.displayName || WrappedComponent.name || 'Component'})`;
    return WhenHasChangedConversionEvents;
  };
}

/***/ },

/***/ "./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_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__);
/* 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_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics/ConnectModuleCTATile */ "./js/components/KeyMetrics/ConnectModuleCTATile.js");
/* harmony import */ var _js_components_Null__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/Null */ "./js/components/Null.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_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/widgets/hooks/useWidgetStateEffect */ "./js/googlesitekit/widgets/hooks/useWidgetStateEffect.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 react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__ = __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_6__.MODULE_SLUG_ANALYTICS_4
};
function ConnectGA4CTATileWidget({
  Widget,
  widgetSlug
}) {
  const ga4DependantKeyMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const keyMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getKeyMetrics();
    if (!keyMetrics) {
      return [];
    }
    return keyMetrics.filter(keyMetric => _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.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_3__["default"] : _js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_2__["default"];
  (0,_js_googlesitekit_widgets_hooks_useWidgetStateEffect__WEBPACK_IMPORTED_MODULE_5__["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_7__.jsx)(Widget, {
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_7__.jsx)(_js_components_KeyMetrics_ConnectModuleCTATile__WEBPACK_IMPORTED_MODULE_2__["default"], {
      ...metadata
    })
  });
}
ConnectGA4CTATileWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  widgetSlug: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().string).isRequired
};

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/ConnectGA4CTAWidget.js"
/*!**************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/ConnectGA4CTAWidget.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 */ ConnectGA4CTAWidget)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useIntersection.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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_components_Banner__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/Banner */ "./js/components/Banner/index.tsx");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_user_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useActivateModuleCallback */ "./js/hooks/useActivateModuleCallback.js");
/* harmony import */ var _js_hooks_useCompleteModuleActivationCallback__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/hooks/useCompleteModuleActivationCallback */ "./js/hooks/useCompleteModuleActivationCallback.js");
/* harmony import */ var _js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/hooks/useDebounce */ "./js/hooks/useDebounce.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__ = __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_17__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _svg_graphics_banner_conversions_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/svg/graphics/banner-conversions-setup-cta-mobile.svg?url */ "./svg/graphics/banner-conversions-setup-cta-mobile.svg?url");
/* harmony import */ var _svg_graphics_banner_conversions_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/svg/graphics/banner-conversions-setup-cta.svg?url */ "./svg/graphics/banner-conversions-setup-cta.svg?url");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ConnectGA4CTA 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 ConnectGA4CTAWidget({
  Widget,
  WidgetNull
}) {
  const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_15__["default"])();
  const trackingRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)();
  const ga4DependantKeyMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const keyMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).getKeyMetrics();
    const widgets = select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_WIDGETS).getWidgets(_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_11__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY);
    if (!keyMetrics || !widgets) {
      return [];
    }
    return widgets.filter(({
      slug,
      modules
    }) => keyMetrics.includes(slug) && modules.includes(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4));
  });
  const isAnalyticsActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_MODULES).isModuleActive(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4));
  const isNavigatingToReauthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const adminReauthURL = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_17__.MODULES_ANALYTICS_4).getAdminReauthURL();
    if (!adminReauthURL) {
      return false;
    }
    return select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_LOCATION).isNavigatingTo(adminReauthURL);
  });
  const isActivatingAnalytics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_MODULES).isFetchingSetModuleActivation(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4, true));
  const connectGA4URL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).getModuleSettingsEditURL(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4));
  const isNavigatingToGA4URL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_LOCATION).isNavigatingTo(connectGA4URL));
  const {
    dismissItem
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER);
  const activateAnalytics = (0,_js_hooks_useActivateModuleCallback__WEBPACK_IMPORTED_MODULE_12__["default"])(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4);
  const completeAnalyticsActivation = (0,_js_hooks_useCompleteModuleActivationCallback__WEBPACK_IMPORTED_MODULE_13__["default"])(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4);
  const handleCTAClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (isAnalyticsActive) {
      return completeAnalyticsActivation();
    }
    activateAnalytics();
    return null;
  }, [activateAnalytics, completeAnalyticsActivation, isAnalyticsActive]);
  const intersectionEntry = (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])(trackingRef, {
    threshold: 0.25
  });
  const [hasBeenInView, setHasBeenInView] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const inView = !!intersectionEntry?.intersectionRatio;
  const {
    triggerSurvey
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (!inView || hasBeenInView) {
      return;
    }
    triggerSurvey('view_kmw_setup_cta', {
      ttl: _js_util__WEBPACK_IMPORTED_MODULE_18__.WEEK_IN_SECONDS
    });
    setHasBeenInView(true);
  }, [inView, hasBeenInView, triggerSurvey]);
  const [inProgress, setInProgress] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);

  /*
   * Using debounce here because the spinner has to render across two separate calls.
   * Rather than risk it flickering on and off in between the activation call completing and
   * the navigate call starting, we will just set a debounce to keep the spinner for 3 seconds.
   */
  const debouncedSetInProgress = (0,_js_hooks_useDebounce__WEBPACK_IMPORTED_MODULE_14__.useDebounce)(setInProgress, 3000);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (isActivatingAnalytics || isNavigatingToReauthURL || isNavigatingToGA4URL) {
      setInProgress(true);
    } else {
      debouncedSetInProgress(false);
    }
  }, [isActivatingAnalytics, isNavigatingToReauthURL, debouncedSetInProgress, isNavigatingToGA4URL]);
  const isDismissed = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).isItemDismissed(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.KM_CONNECT_GA4_CTA_WIDGET_DISMISSED_ITEM_KEY));
  if (isDismissed !== false || ga4DependantKeyMetrics.length < 4) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(WidgetNull, {});
  }
  const description = isViewOnly ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Metrics cannot be displayed without Analytics. To fix the issue, contact your administrator.', 'google-site-kit') : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Metrics cannot be displayed without Analytics', 'google-site-kit');
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(Widget, {
    noPadding: true,
    children: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_Banner__WEBPACK_IMPORTED_MODULE_4__["default"], {
      ref: trackingRef,
      className: "googlesitekit-banner--setup-cta googlesitekit-km-connect-ga4-cta",
      title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Analytics is disconnected', 'google-site-kit'),
      description: description,
      ctaButton: isViewOnly ? undefined : {
        label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Connect Analytics', 'google-site-kit'),
        onClick: handleCTAClick,
        disabled: inProgress,
        inProgress
      },
      svg: {
        desktop: _svg_graphics_banner_conversions_setup_cta_svg_url__WEBPACK_IMPORTED_MODULE_20__["default"],
        mobile: _svg_graphics_banner_conversions_setup_cta_mobile_svg_url__WEBPACK_IMPORTED_MODULE_19__["default"],
        verticalPosition: 'top'
      },
      footer: isViewOnly ? undefined : /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_21__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_5__["default"], {
        onClick: () => dismissItem(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.KM_CONNECT_GA4_CTA_WIDGET_DISMISSED_ITEM_KEY),
        children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Maybe later', 'google-site-kit')
      })
    })
  });
}

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/ConversionReportingNotificationCTAWidget.js"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/ConversionReportingNotificationCTAWidget.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_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__);
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useIntersection.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.js");
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/hooks/use-previous/index.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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_6__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__);
/* 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_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_components_KeyMetrics_ConversionReportingDashboardSubtleNotification__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/components/KeyMetrics/ConversionReportingDashboardSubtleNotification */ "./js/components/KeyMetrics/ConversionReportingDashboardSubtleNotification.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useDisplayNewEventsCalloutAfterInitialDetection__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutAfterInitialDetection */ "./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutAfterInitialDetection.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useDisplayNewEventsCalloutForTailoredMetrics__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForTailoredMetrics */ "./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForTailoredMetrics.js");
/* harmony import */ var _js_components_KeyMetrics_hooks_useDisplayNewEventsCalloutForUserPickedMetrics__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForUserPickedMetrics */ "./js/components/KeyMetrics/hooks/useDisplayNewEventsCalloutForUserPickedMetrics.js");
/* harmony import */ var _js_components_KeyMetrics_LostEventsSubtleNotification__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/components/KeyMetrics/LostEventsSubtleNotification */ "./js/components/KeyMetrics/LostEventsSubtleNotification.js");
/* harmony import */ var _js_components_KeyMetrics_utils__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/components/KeyMetrics/utils */ "./js/components/KeyMetrics/utils.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/googlesitekit/datastore/ui/constants */ "./js/googlesitekit/datastore/ui/constants.js");
/* harmony import */ var _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/hooks/useViewContext */ "./js/hooks/useViewContext.js");
/* harmony import */ var _js_modules_analytics_4_components_util_whenHasChangedConversionEvents__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/modules/analytics-4/components/util/whenHasChangedConversionEvents */ "./js/modules/analytics-4/components/util/whenHasChangedConversionEvents.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_21__ = __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_22__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ConversionReportingNotificationCTAWidget 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 ConversionReportingNotificationCTAWidget({
  Widget,
  WidgetNull
}) {
  const viewContext = (0,_js_hooks_useViewContext__WEBPACK_IMPORTED_MODULE_19__["default"])();
  const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
  const [isViewed, setIsViewed] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useState)(false);
  const trackDismissalRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)(true);
  const conversionReportingNotificationRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useRef)();
  const intersectionEntry = (0,react_use__WEBPACK_IMPORTED_MODULE_1__["default"])(conversionReportingNotificationRef, {
    threshold: 0.25
  });
  const inView = !!intersectionEntry?.intersectionRatio;
  const haveLostConversionEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).haveLostEventsForCurrentMetrics());
  const newConversionEventsLastUpdateAt = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getNewConversionEventsLastUpdateAt());
  const lostConversionEventsLastUpdateAt = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getLostConversionEventsLastUpdateAt());
  const haveNewConversionEventsAfterDismiss = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER).haveNewConversionEventsAfterDismiss(newConversionEventsLastUpdateAt));
  const haveLostConversionEventsAfterDismiss = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER).haveLostConversionEventsAfterDismiss(lostConversionEventsLastUpdateAt));

  // Initial callout is surfaced to the users with tailored metrics, if detectedEvents setting
  // has a conversion event associated with the ACR key metrics matching the current site purpose answer.
  // If new ACR key metrics that can be added are found using haveConversionReportingEventsForTailoredMetrics,
  // and have not been already included, which is determined by includeConversionEvents user input setting, callout banner should be displayed.
  const shouldShowInitialCalloutForTailoredMetrics = (0,_js_components_KeyMetrics_hooks_useDisplayNewEventsCalloutForTailoredMetrics__WEBPACK_IMPORTED_MODULE_11__["default"])({
    haveNewConversionEventsAfterDismiss
  });

  // If users have set up key metrics manually and ACR events are detected,
  // we display the same callout banner, with a different call to action
  // "Select metrics" which opens the metric selection panel.
  const shouldShowCalloutForUserPickedMetrics = (0,_js_components_KeyMetrics_hooks_useDisplayNewEventsCalloutForUserPickedMetrics__WEBPACK_IMPORTED_MODULE_12__["default"])({
    haveNewConversionEventsAfterDismiss
  });

  // If new events have been detected after initial set of events, we display
  // the same callout banner, with a different call to action "View metrics"
  // which opens the metric selection panel.
  const shouldShowCalloutForNewEvents = (0,_js_components_KeyMetrics_hooks_useDisplayNewEventsCalloutAfterInitialDetection__WEBPACK_IMPORTED_MODULE_10__["default"])({
    haveNewConversionEventsAfterDismiss
  });
  const shouldShowCalloutForLostEvents = haveLostConversionEvents && haveLostConversionEventsAfterDismiss;
  const userPickedMetrics = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER).getUserPickedMetrics());

  // Build a common object to use as the first argument in conversionReportingDetectedEventsTracking().
  const conversionReportingDetectedEventsTrackingArgs = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useMemo)(() => {
    return {
      shouldShowInitialCalloutForTailoredMetrics,
      shouldShowCalloutForUserPickedMetrics,
      shouldShowCalloutForNewEvents,
      userPickedMetrics
    };
  }, [shouldShowInitialCalloutForTailoredMetrics, shouldShowCalloutForUserPickedMetrics, shouldShowCalloutForNewEvents, userPickedMetrics]);
  const isSavingConversionReportingSettings = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER).isSavingConversionReportingSettings());
  const isSavingKeyMetricsSettings = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER).isSavingKeyMetricsSettings());
  const {
    saveConversionReportingSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER);
  const dismissCallout = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(async eventType => {
    // Dismissed callout settings times should rely on real times, not the reference date,
    // so the timestamps are consistent even when changing the reference dates when developing/testing.
    const timestamp = Math.round(Date.now() / 1000); // eslint-disable-line sitekit/no-direct-date
    const conversionReportingSettings = {
      newEventsCalloutDismissedAt: timestamp
    };
    if (eventType === 'lostEvents') {
      conversionReportingSettings.lostEventsCalloutDismissedAt = timestamp;

      // Handle internal tracking for lost events banner dismissal.
      if (trackDismissalRef.current) {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(`${viewContext}_kmw-lost-conversion-events-detected-notification`, 'dismiss_notification', 'conversion_reporting');
      }
    } else if (trackDismissalRef.current) {
      // Handle internal tracking.
      (0,_js_components_KeyMetrics_utils__WEBPACK_IMPORTED_MODULE_14__.conversionReportingDetectedEventsTracking)(conversionReportingDetectedEventsTrackingArgs, viewContext, 'dismiss_notification');
    }
    await saveConversionReportingSettings(conversionReportingSettings);
  }, [viewContext, conversionReportingDetectedEventsTrackingArgs, saveConversionReportingSettings]);
  const userInputPurposeConversionEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_22__.MODULES_ANALYTICS_4).getUserInputPurposeConversionEvents());
  const {
    setUserInputSetting,
    saveUserInputSettings
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_18__.CORE_USER);
  const handleAddMetricsClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)(() => {
    if (shouldShowInitialCalloutForTailoredMetrics) {
      setIsSaving(true);
      setUserInputSetting('includeConversionEvents', userInputPurposeConversionEvents);
      saveUserInputSettings();
      setIsSaving(false);
    }

    // Handle internal tracking.
    (0,_js_components_KeyMetrics_utils__WEBPACK_IMPORTED_MODULE_14__.conversionReportingDetectedEventsTracking)(conversionReportingDetectedEventsTrackingArgs, viewContext, 'confirm_add_new_conversion_metrics');
    trackDismissalRef.current = false;
    dismissCallout();
  }, [setUserInputSetting, saveUserInputSettings, dismissCallout, userInputPurposeConversionEvents, shouldShowInitialCalloutForTailoredMetrics, viewContext, conversionReportingDetectedEventsTrackingArgs]);
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_UI);
  const handleSelectMetricsClick = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useCallback)((clickContext = '') => {
    trackDismissalRef.current = false;
    setValue(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_8__.KEY_METRICS_SELECTION_PANEL_OPENED_KEY, true);

    // Handle internal tracking of lost events variant.
    if ('lostEvents' === clickContext) {
      if (shouldShowCalloutForLostEvents) {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(`${viewContext}_kmw-lost-conversion-events-detected-notification`, 'confirm_get_select_metrics', 'conversion_reporting');
      }
      return;
    }
    if (!shouldShowCalloutForNewEvents) {
      // Handle internal tracking for initial events detection - manually selected KMW.
      (0,_js_components_KeyMetrics_utils__WEBPACK_IMPORTED_MODULE_14__.conversionReportingDetectedEventsTracking)(conversionReportingDetectedEventsTrackingArgs, viewContext, 'confirm_select_new_conversion_metrics');
    }
    if (shouldShowCalloutForNewEvents) {
      // Handle internal tracking for new events detection - after initial events were detected.
      (0,_js_components_KeyMetrics_utils__WEBPACK_IMPORTED_MODULE_14__.conversionReportingDetectedEventsTracking)(conversionReportingDetectedEventsTrackingArgs, viewContext, 'confirm_view_new_conversion_metrics');
    }
  }, [viewContext, conversionReportingDetectedEventsTrackingArgs, setValue, shouldShowCalloutForLostEvents, shouldShowCalloutForNewEvents]);
  const isSelectionPanelOpen = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_17__.CORE_UI).getValue(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_8__.KEY_METRICS_SELECTION_PANEL_OPENED_KEY));
  const prevIsSelectionPanelOpen = (0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_3__["default"])(isSelectionPanelOpen);

  // Handle dismiss of new events callout on opening of the selection panel.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    if (!prevIsSelectionPanelOpen && isSelectionPanelOpen && (
    // Dismiss the new events callout if shouldShowCalloutForNewEvents is true
    // and settings are not being saved. This prevents duplicate requests, as after
    // the first call, the settings enter the saving state. Once saving is complete,
    // shouldShowCalloutForNewEvents will no longer be true.
    !isSavingConversionReportingSettings && (shouldShowCalloutForNewEvents || shouldShowCalloutForUserPickedMetrics) ||
    // shouldShowInitialCalloutForTailoredMetrics is more specific because the "Add metrics"
    // CTA does not open the panel; it directly adds metrics. We want to dismiss this callout
    // only when the user opens the selection panel and saves their metrics selection. This marks
    // the transition to manual selection, after which this callout should no longer be shown.
    shouldShowInitialCalloutForTailoredMetrics && isSavingKeyMetricsSettings)) {
      dismissCallout();
    }
  }, [isSelectionPanelOpen, prevIsSelectionPanelOpen, shouldShowCalloutForNewEvents, shouldShowCalloutForUserPickedMetrics, shouldShowInitialCalloutForTailoredMetrics, isSavingConversionReportingSettings, isSavingKeyMetricsSettings, dismissCallout]);

  // Handle dismiss of lost events callout on opening of the selection panel.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    if (!prevIsSelectionPanelOpen && isSelectionPanelOpen && shouldShowCalloutForLostEvents && !isSavingConversionReportingSettings) {
      dismissCallout('lostEvents');
    }
  }, [isSelectionPanelOpen, prevIsSelectionPanelOpen, isSavingConversionReportingSettings, shouldShowCalloutForLostEvents, dismissCallout]);

  // Track when the notification is viewed.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_4__.useEffect)(() => {
    if (!isViewed && inView) {
      // Handle internal tracking.
      (0,_js_components_KeyMetrics_utils__WEBPACK_IMPORTED_MODULE_14__.conversionReportingDetectedEventsTracking)(conversionReportingDetectedEventsTrackingArgs, viewContext, 'view_notification');

      // Handle internal tracking for lost events banner.
      if (shouldShowCalloutForLostEvents) {
        (0,_js_util__WEBPACK_IMPORTED_MODULE_23__.trackEvent)(`${viewContext}_kmw-lost-conversion-events-detected-notification`, 'view_notification', 'conversion_reporting');
      }
      setIsViewed(true);
    }
  }, [isViewed, inView, viewContext, conversionReportingDetectedEventsTrackingArgs, shouldShowCalloutForLostEvents]);
  const documentationURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_7__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_16__.CORE_SITE).getDocumentationLinkURL('key-metrics'));
  if (!shouldShowInitialCalloutForTailoredMetrics && !shouldShowCalloutForLostEvents && !shouldShowCalloutForUserPickedMetrics && !shouldShowCalloutForNewEvents) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_25__.jsx)(WidgetNull, {});
  }
  let description = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_5__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('We’ve extended your metrics selection with metrics that aren’t available by default in Analytics. Add them to your dashboard to get a better understanding of how users interact with your site. <a>Learn more</a>', 'google-site-kit'), {
    a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_25__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_15__["default"], {
      href: documentationURL,
      "aria-label": (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Learn more about advanced conversion reporting', 'google-site-kit'),
      external: true
    })
  });
  let ctaLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Select metrics', 'google-site-kit');
  let dismissCTALabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Maybe later', 'google-site-kit');
  if (shouldShowInitialCalloutForTailoredMetrics) {
    ctaLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Add metrics', 'google-site-kit');
  }
  if (shouldShowCalloutForNewEvents) {
    description = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('We’ve extended your metrics selection based on your website events', 'google-site-kit');
    ctaLabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('View metrics', 'google-site-kit');
    dismissCTALabel = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_6__.__)('Got it', 'google-site-kit');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_25__.jsxs)(Widget, {
    ref: conversionReportingNotificationRef,
    noPadding: true,
    fullWidth: true,
    children: [shouldShowCalloutForLostEvents && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_25__.jsx)(_js_components_KeyMetrics_LostEventsSubtleNotification__WEBPACK_IMPORTED_MODULE_13__["default"], {
      onSelectMetricsCallback: () => {
        handleSelectMetricsClick('lostEvents');
      },
      onDismissCallback: () => dismissCallout('lostEvents')
    }), (shouldShowInitialCalloutForTailoredMetrics || shouldShowCalloutForUserPickedMetrics || shouldShowCalloutForNewEvents) && /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_25__.jsx)(_js_components_KeyMetrics_ConversionReportingDashboardSubtleNotification__WEBPACK_IMPORTED_MODULE_9__["default"], {
      description: description,
      ctaLabel: ctaLabel,
      dismissCTALabel: dismissCTALabel,
      handleCTAClick: shouldShowInitialCalloutForTailoredMetrics ? handleAddMetricsClick : handleSelectMetricsClick,
      isSaving: isSaving,
      onDismiss: dismissCallout
    })]
  });
}
ConversionReportingNotificationCTAWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType)
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_2__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_24__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_21__.MODULE_SLUG_ANALYTICS_4
}), (0,_js_modules_analytics_4_components_util_whenHasChangedConversionEvents__WEBPACK_IMPORTED_MODULE_20__["default"])())(ConversionReportingNotificationCTAWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/EngagedTrafficSourceWidget.js"
/*!*********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/EngagedTrafficSourceWidget.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 */   getEngagedTrafficSourceReportOptions: () => (/* binding */ getEngagedTrafficSourceReportOptions),
/* harmony export */   getEngagedTrafficSourceSubtext: () => (/* binding */ getEngagedTrafficSourceSubtext)
/* 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_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 _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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * EngagedTrafficSourceWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Engaged Traffic Source metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getEngagedTrafficSourceReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['sessionDefaultChannelGroup'],
    metrics: [{
      name: 'engagedSessions'
    }],
    orderBy: 'engagedSessions',
    limit: 1,
    reportID: 'analytics-4_engaged-traffic-source-widget_widget_reportOptions'
  };
}

/**
 * Builds the sub-text for the Engaged Traffic Source metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile show the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} rate                 The engaged sessions rate for the top source.
 * @param {number} totalEngagedSessions The total number of engaged sessions.
 * @return {string} The metric tile sub-text.
 */
function getEngagedTrafficSourceSubtext(rate, totalEngagedSessions) {
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: 1. Percentage of total engaged sessions. 2: Total number of engaged sessions. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%1$s of %2$s engaged sessions', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, format), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalEngagedSessions, {
    style: 'decimal'
  }));
}
function EngagedTrafficSourceWidget(props) {
  const {
    Widget
  } = props;
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const reportOptions = getEngagedTrafficSourceReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  const {
    rows = [],
    totals = []
  } = report || {};
  function makeFilter(dateRange, dimensionIndex) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, `dimensionValues.${dimensionIndex}.value`) === dateRange;
  }
  const topTrafficSource = rows.filter(makeFilter('date_range_0', 1))[0]?.dimensionValues?.[0].value || '-';
  const currentEngagedSessions = parseFloat(rows.filter(makeFilter('date_range_0', 1))[0]?.metricValues?.[0]?.value) || 0;
  const currentTotalEngagedSessions = parseFloat(totals.filter(makeFilter('date_range_0', 1))[0]?.metricValues?.[0]?.value) || 0;
  const currentEngagedSessionsRate = currentEngagedSessions / currentTotalEngagedSessions || 0;
  const previousEngagedSessions = parseFloat(rows.filter(makeFilter('date_range_1', 1))[0]?.metricValues?.[0]?.value) || 0;
  const previousTotalEngagedSessions = parseFloat(totals.filter(makeFilter('date_range_1', 1))[0]?.metricValues?.[0]?.value) || 0;
  const previousEngagedSessionsRate = previousEngagedSessions / previousTotalEngagedSessions || 0;
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileText, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE,
    metricValue: topTrafficSource,
    metricValueFormat: format,
    subText: getEngagedTrafficSourceSubtext(currentEngagedSessionsRate, currentTotalEngagedSessions),
    previousValue: previousEngagedSessionsRate,
    currentValue: currentEngagedSessionsRate,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
EngagedTrafficSourceWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(EngagedTrafficSourceWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/LeastEngagingPagesWidget.js"
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/LeastEngagingPagesWidget.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 */   getLeastEngagingPagesReportOptions: () => (/* binding */ getLeastEngagingPagesReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * LeastEngagingPagesWidget 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
 */













/**
 * Builds the GA4 `getReport` options for the Least engaging pages widget.
 *
 * Returns both reports the widget needs: the `pageViews` report that ranks every
 * page by views so the caller can derive the median views, and the `report` that
 * lists the least engaging pages by bounce rate, filtered to pages with at least
 * the median views. The `report` filter depends on that median, so callers pass
 * it once known.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates             The date range for the reports.
 * @param {number} [medianPageViews] The median page views the `report` filters against. Defaults to `0`.
 * @return {Object} The `pageViews` and `report` report options.
 */

function getLeastEngagingPagesReportOptions(dates, medianPageViews = 0) {
  const pageViews = {
    ...dates,
    dimensions: ['pagePath'],
    metrics: [{
      name: 'screenPageViews'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    reportID: 'analytics-4_least-engaging-pages-widget_widget_pageViewsReportOptions'
  };
  const report = {
    ...dates,
    dimensions: ['pagePath'],
    metrics: ['bounceRate', 'screenPageViews'],
    orderby: [{
      metric: {
        metricName: 'bounceRate'
      },
      desc: true
    }, {
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    metricFilters: {
      screenPageViews: {
        operation: 'GREATER_THAN_OR_EQUAL',
        value: {
          int64Value: medianPageViews
        }
      }
    },
    limit: 3,
    reportID: 'analytics-4_least-engaging-pages-widget_widget_reportOptions'
  };
  return {
    pageViews,
    report
  };
}
function LeastEngagingPagesWidget(props) {
  const {
    Widget
  } = props;
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
  const {
    pageViews: pageViewsReportOptions
  } = getLeastEngagingPagesReportOptions(dates);
  const pageViewsReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(pageViewsReportOptions), [pageViewsReportOptions]);
  const medianIndex = parseInt(pageViewsReport?.rowCount / 2, 10);
  const medianPageViews = parseInt(pageViewsReport?.rows?.[medianIndex]?.metricValues?.[0]?.value, 10) || 0;
  const {
    report: reportOptions
  } = getLeastEngagingPagesReportOptions(dates, medianPageViews);
  const loadedPageViewsReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [pageViewsReportOptions]));
  const pageViewsReportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [pageViewsReportOptions]));
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => {
    if (!loadedPageViewsReport) {
      return undefined;
    }
    if (pageViewsReportError) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(reportOptions);
  }, [loadedPageViewsReport, pageViewsReportError, reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const reportError = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]);
    if (pageViewsReportError && reportError) {
      return [pageViewsReportError, reportError];
    }
    return pageViewsReportError || reportError || undefined;
  });
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => !error ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [error, report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || titles === undefined || !loadedPageViewsReport);
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__.decodeAmpersand)(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_1__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
          content: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["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_13__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(fieldValue, format)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_LEAST_ENGAGING_PAGES,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_6__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
LeastEngagingPagesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__["default"]
})(LeastEngagingPagesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/MostEngagingPagesWidget.js"
/*!******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/MostEngagingPagesWidget.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 */   getMostEngagingPagesReportOptions: () => (/* binding */ getMostEngagingPagesReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * MostEngagingPagesWidget 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
 */













/**
 * Builds the `getReport` options for the Most engaging pages widget, so the
 * dashboard tile and the PDF export request the same data.
 *
 * The engaging pages report filters to pages at or above the average page
 * views, a value derived from the page views report at runtime, so it is
 * passed in rather than recomputed here.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates              The date range for the reports.
 * @param {number} [averagePageViews] The average page views threshold the engaging pages report filters on. Defaults to `0`.
 * @return {Object} The `pageViews` and `engagingPages` `getReport` options.
 */

function getMostEngagingPagesReportOptions(dates, averagePageViews = 0) {
  return {
    pageViews: {
      ...dates,
      dimensions: ['pagePath'],
      metrics: [{
        name: 'screenPageViews'
      }],
      limit: 1,
      reportID: 'analytics-4_most-engaging-pages-widget_widget_pageViewsReportOptions'
    },
    engagingPages: {
      ...dates,
      dimensions: ['pagePath'],
      metrics: ['engagementRate', 'screenPageViews'],
      orderby: [{
        metric: {
          metricName: 'engagementRate'
        },
        desc: true
      }, {
        metric: {
          metricName: 'screenPageViews'
        },
        desc: true
      }],
      metricFilters: {
        screenPageViews: {
          filterType: 'numericFilter',
          operation: 'GREATER_THAN_OR_EQUAL',
          value: {
            int64Value: averagePageViews
          }
        }
      },
      limit: 3,
      reportID: 'analytics-4_most-engaging-pages-widget_widget_reportOptions'
    }
  };
}
function MostEngagingPagesWidget(props) {
  const {
    Widget
  } = props;
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
  const {
    pageViews: pageViewsReportOptions
  } = getMostEngagingPagesReportOptions(dates);
  const pageViewsReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(pageViewsReportOptions), [pageViewsReportOptions]);
  const averagePageViews = Math.round(pageViewsReport?.totals?.[0]?.metricValues?.[0]?.value / pageViewsReport?.rowCount) || 0;
  const {
    engagingPages: reportOptions
  } = getMostEngagingPagesReportOptions(dates, averagePageViews);
  const pageViewsReportErrors = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [pageViewsReportOptions]));
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    const reportOptionsErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]);
    if (pageViewsReportErrors && reportOptionsErrors) {
      return [pageViewsReportErrors, reportOptionsErrors];
    }
    return pageViewsReportErrors || reportOptionsErrors || undefined;
  });
  const hasFinishedResolvingPageViewReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [pageViewsReportOptions]));
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => {
    if (!hasFinishedResolvingPageViewReport) {
      return undefined;
    }
    if (pageViewsReportErrors) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(reportOptions);
  }, [hasFinishedResolvingPageViewReport, pageViewsReportErrors, reportOptions]);
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => !error ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [error, report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || !hasFinishedResolvingPageViewReport || titles === undefined);
  const {
    rows = []
  } = report || {};
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__.decodeAmpersand)(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_1__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
          content: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["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_13__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(fieldValue, format)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_MOST_ENGAGING_PAGES,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_6__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
MostEngagingPagesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__["default"]
})(MostEngagingPagesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/NewVisitorsWidget.js"
/*!************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/NewVisitorsWidget.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 */   getNewVisitorsReportOptions: () => (/* binding */ getNewVisitorsReportOptions),
/* harmony export */   getNewVisitorsSubtext: () => (/* binding */ getNewVisitorsSubtext)
/* 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_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 _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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/i18n */ "./js/util/i18n.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * NewVisitorsWidget 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
 */









/**
 * Builds the Analytics 4 report options for the New Visitors metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getNewVisitorsReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['newVsReturning'],
    metrics: [{
      name: 'activeUsers'
    }],
    reportID: 'analytics-4_new-visitors-widget_widget_reportOptions'
  };
}

/**
 * Builds the sub-text for the New Visitors metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile display the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} total The total number of visitors.
 * @return {string} The formatted sub-text.
 */
function getNewVisitorsSubtext(total) {
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Number of total visitors visiting the site, such as "1,234". */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('of %s total visitors', 'google-site-kit'), (0,_js_util_i18n__WEBPACK_IMPORTED_MODULE_8__.numFmt)(total, {
    style: 'decimal'
  }));
}
function NewVisitorsWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const reportOptions = getNewVisitorsReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  const {
    rows = [],
    totals = []
  } = report || {};
  function makeFind(dateRange) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, 'dimensionValues.0.value') === 'new' && (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, 'dimensionValues.1.value') === dateRange;
  }
  const newVisitors = rows.find(makeFind('date_range_0'))?.metricValues?.[0]?.value || 0;
  const total = Number(totals[0]?.metricValues?.[0]?.value) || 0;
  const prevTotal = Number(totals[1]?.metricValues?.[0]?.value) || 0;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileNumeric, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_NEW_VISITORS,
    metricValue: newVisitors,
    subText: getNewVisitorsSubtext(total),
    previousValue: prevTotal,
    currentValue: total,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
NewVisitorsWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(NewVisitorsWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/PagesPerVisitWidget.js"
/*!**************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/PagesPerVisitWidget.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 */   getPagesPerVisitReportOptions: () => (/* binding */ getPagesPerVisitReportOptions),
/* harmony export */   getPagesPerVisitSubtext: () => (/* binding */ getPagesPerVisitSubtext)
/* 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_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 _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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/i18n */ "./js/util/i18n.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PagesPerVisitWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Pages Per Visit metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getPagesPerVisitReportOptions(dates) {
  return {
    ...dates,
    metrics: [{
      name: 'screenPageViewsPerSession'
    }, {
      name: 'screenPageViews'
    }],
    reportID: 'analytics-4_pages-per-visit-widget_widget_reportOptions'
  };
}

/**
 * Builds the sub-text for the Pages Per Visit metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile display the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} pageViews The total number of page views.
 * @return {string} The formatted sub-text.
 */
function getPagesPerVisitSubtext(pageViews) {
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Number of total page views, such as "1,234". */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s page views', 'google-site-kit'), (0,_js_util_i18n__WEBPACK_IMPORTED_MODULE_8__.numFmt)(pageViews, {
    style: 'decimal'
  }));
}
function PagesPerVisitWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const reportOptions = getPagesPerVisitReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  const {
    rows = []
  } = report || {};
  function makeFind(dateRange) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, 'dimensionValues.0.value') === dateRange;
  }
  const currentPagesPerVisit = Number(rows.find(makeFind('date_range_0'))?.metricValues?.[0]?.value) || 0;
  const previousPagesPerVisit = Number(rows.find(makeFind('date_range_1'))?.metricValues?.[0]?.value) || 0;
  const currentTotalPageViews = Number(rows.find(makeFind('date_range_0'))?.metricValues?.[1]?.value) || 0;
  const format = {
    style: 'decimal',
    maximumFractionDigits: 2
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileNumeric, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_PAGES_PER_VISIT,
    metricValue: currentPagesPerVisit,
    metricValueFormat: format,
    subText: getPagesPerVisitSubtext(currentTotalPageViews),
    previousValue: previousPagesPerVisit,
    currentValue: currentPagesPerVisit,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
PagesPerVisitWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(PagesPerVisitWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/PopularAuthorsWidget.js"
/*!***************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/PopularAuthorsWidget.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 */   getPopularAuthorsReportOptions: () => (/* binding */ getPopularAuthorsReportOptions)
/* 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__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/withCustomDimensions */ "./js/modules/analytics-4/utils/withCustomDimensions.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PopularAuthorsWidget 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
 */











/**
 * Builds the Analytics 4 report options for the Popular Authors metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getPopularAuthorsReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['customEvent:googlesitekit_post_author'],
    dimensionFilters: {
      // Make sure that we select only rows without (not set) records.
      'customEvent:googlesitekit_post_author': {
        filterType: 'emptyFilter',
        notExpression: true
      }
    },
    metrics: [{
      name: 'screenPageViews'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_popular-authors-widget_widget_reportOptions'
  };
}

/**
 * Gets the report options for the Popular Authors widget.
 *
 * @since 1.113.0
 *
 * @param {Function} select Data store 'select' function.
 * @return {Object} The report options.
 */
function getPopularAuthorsWidgetReportOptions(select) {
  return getPopularAuthorsReportOptions(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
}
function PopularAuthorsWidget(props) {
  const {
    Widget
  } = props;
  const reportOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(getPopularAuthorsWidgetReportOptions);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__.MetricTileTablePlainText, {
        content: fieldValue
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_9__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_POPULAR_AUTHORS,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
PopularAuthorsWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_10__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_11__["default"]
}), (0,_js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_8__["default"])({
  reportOptions: getPopularAuthorsWidgetReportOptions
}))(PopularAuthorsWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/PopularContentWidget.js"
/*!***************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/PopularContentWidget.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 */   getPopularContentReportOptions: () => (/* binding */ getPopularContentReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PopularContentWidget 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
 */













/**
 * Builds the Analytics 4 report options for the Most popular content metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range for the report.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getPopularContentReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['pagePath'],
    metrics: [{
      name: 'screenPageViews'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_popular-content-widget_widget_reportOptions'
  };
}
function PopularContentWidget(props) {
  const {
    Widget
  } = props;
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
  const reportOptions = getPopularContentReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => !error ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [error, report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || titles === undefined);
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__.decodeAmpersand)(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_1__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
          content: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["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_13__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_POPULAR_CONTENT,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_6__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
PopularContentWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__["default"]
})(PopularContentWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/PopularProductsWidget.js"
/*!****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/PopularProductsWidget.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 */   getPopularProductsReportOptions: () => (/* binding */ getPopularProductsReportOptions)
/* 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__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* 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_4__ = __webpack_require__(/*! @wordpress/i18n */ "@wordpress/i18n");
/* harmony import */ var _wordpress_i18n__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__);
/* 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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.js");
/* harmony import */ var _js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/components/KeyMetrics/constants */ "./js/components/KeyMetrics/constants.js");
/* harmony import */ var _js_components_Link__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/components/Link */ "./js/components/Link.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 _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_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_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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 _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/withCustomDimensions */ "./js/modules/analytics-4/utils/withCustomDimensions.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * PopularProductsWidget 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
 */
















/**
 * Builds the Analytics 4 report options for the Popular Products metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates           The date range.
 * @param {string} productPostType The detected product post type to filter on.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getPopularProductsReportOptions(dates, productPostType) {
  return {
    ...dates,
    dimensions: ['pagePath'],
    dimensionFilters: {
      'customEvent:googlesitekit_post_type': {
        filterType: 'stringFilter',
        matchType: 'EXACT',
        value: productPostType
      }
    },
    metrics: [{
      name: 'screenPageViews'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_popular-products-widget_widget_reportOptions'
  };
}

/**
 * Gets the report options for the Popular Products widget.
 *
 * @since 1.127.0
 *
 * @param {Function} select Data store 'select' function.
 * @return {Object} The report options.
 */
function getPopularProductsWidgetReportOptions(select) {
  return getPopularProductsReportOptions(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).getDateRangeDates(), select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getProductPostType());
}
function PopularProductsWidget(props) {
  const {
    Widget,
    WidgetNull
  } = props;
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_12__["default"])();
  const productPostType = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_SITE).getProductPostType());
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).getDateRangeDates());
  const {
    setValue
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useDispatch)(_js_googlesitekit_datastore_ui_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_UI);
  const [showTooltip, setShowTooltip] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useState)(true);
  const openMetricsSelectionPanel = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_2__.useCallback)(() => {
    // Hide the tooltip so it doesn't remain visible, above the panel we're
    // opening.
    setShowTooltip(false);

    // Open the panel.
    setValue(_js_components_KeyMetrics_constants__WEBPACK_IMPORTED_MODULE_7__.KEY_METRICS_SELECTION_PANEL_OPENED_KEY, true);

    // Wait for the panel to be open before we re-enable the tooltip.
    // This prevents it from appearing above the slide-out panel, see:
    // https://github.com/google/site-kit-wp/issues/7060#issuecomment-1664827831
    setTimeout(() => {
      setShowTooltip(true);
    }, 0);
  }, [setValue]);
  const reportOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(getPopularProductsWidgetReportOptions);
  const isPopularProductsWidgetActive = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.KM_ANALYTICS_POPULAR_PRODUCTS));
  const showWidget = isPopularProductsWidgetActive || productPostType;
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useInViewSelect)(select => showWidget ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [showWidget, reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useInViewSelect)(select => !error && report ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [error, report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_5__.useSelect)(select => showWidget ? !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || titles === undefined : undefined);
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_15__.decodeAmpersand)(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_5__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_14__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_6__.MetricTileTablePlainText, {
          content: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_8__["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_20__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_17__.numFmt)(fieldValue)
      });
    }
  }];
  if (!showWidget) {
    return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(WidgetNull, {});
  }
  const infoTooltip = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_3__["default"])((0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Products on your site which visitors viewed the most. Site Kit detected these are your product pages. If this is inaccurate, you can <a>replace</a> this with another metric', 'google-site-kit'), {
    a: /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_8__["default"], {
      onClick: openMetricsSelectionPanel
    })
  });
  let zeroStateMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('Analytics doesn’t have data for your site’s products yet', 'google-site-kit');
  if (!productPostType && isPopularProductsWidgetActive) {
    zeroStateMessage = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_4__.__)('No product posts currently detected on your site. This metric applies only to sites with product posts.', 'google-site-kit');
  }
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_6__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_11__.KM_ANALYTICS_POPULAR_PRODUCTS,
    loading: loading,
    rows: rows,
    columns: columns
    // Instead of sourcing the infoTooltip from KEY_METRICS_WIDGETS,
    // this widget provides it directly to the MetricTileTable component.
    // This is to accommodate a link behavior within the tooltip when the Metrics Selection Panel is open.
    ,
    infoTooltip: showTooltip ? infoTooltip : null,
    ZeroState: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_20__.jsx)("span", {
      children: zeroStateMessage
    }),
    error: error,
    moduleSlug: "analytics-4"
  });
}
PopularProductsWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired,
  WidgetNull: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_18__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_13__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_19__["default"]
}), (0,_js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_16__["default"])({
  reportOptions: getPopularProductsWidgetReportOptions
}))(PopularProductsWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/ReturningVisitorsWidget.js"
/*!******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/ReturningVisitorsWidget.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 */   getReturningVisitorsReportOptions: () => (/* binding */ getReturningVisitorsReportOptions),
/* harmony export */   getReturningVisitorsSubtext: () => (/* binding */ getReturningVisitorsSubtext)
/* 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_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 _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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * ReturningVisitorsWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Returning Visitors metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getReturningVisitorsReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['newVsReturning'],
    metrics: [{
      name: 'activeUsers'
    }],
    reportID: 'analytics-4_returning-visitors-widget_widget_reportOptions'
  };
}

/**
 * Builds the sub-text for the Returning Visitors metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile display the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} total The total number of visitors.
 * @return {string} The formatted sub-text.
 */
function getReturningVisitorsSubtext(total) {
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Number of total visitors visiting the site, such as "1,234". */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('of %s total visitors', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(total, {
    style: 'decimal'
  }));
}
function ReturningVisitorsWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const reportOptions = getReturningVisitorsReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  const {
    rows = [],
    totals = []
  } = report || {};
  function makeFind(dateRange) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, 'dimensionValues.0.value') === 'returning' && (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, 'dimensionValues.1.value') === dateRange;
  }
  const returning = rows.find(makeFind('date_range_0'))?.metricValues?.[0]?.value || 0;
  const total = totals[0]?.metricValues?.[0]?.value || 0;
  const prevReturning = rows.find(makeFind('date_range_1'))?.metricValues?.[0]?.value || 0;
  const prevTotal = totals[1]?.metricValues?.[0]?.value || 0;
  const currentPercentage = total > 0 ? returning / total : 0;
  const prevPercentage = prevTotal > 0 ? prevReturning / prevTotal : 0;
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileNumeric, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_RETURNING_VISITORS,
    metricValue: currentPercentage,
    metricValueFormat: format,
    subText: getReturningVisitorsSubtext(total),
    previousValue: prevPercentage,
    currentValue: currentPercentage,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
ReturningVisitorsWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(ReturningVisitorsWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopCategoriesWidget.js"
/*!**************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopCategoriesWidget.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 */   getTopCategoriesReportOptions: () => (/* binding */ getTopCategoriesReportOptions)
/* 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__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/withCustomDimensions */ "./js/modules/analytics-4/utils/withCustomDimensions.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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopCategoriesWidget 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
 */












/**
 * Builds the Analytics 4 report options for the Top Categories metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getTopCategoriesReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['customEvent:googlesitekit_post_categories'],
    dimensionFilters: {
      // Make sure that we select only rows without (not set) records.
      'customEvent:googlesitekit_post_categories': {
        filterType: 'emptyFilter',
        notExpression: true
      }
    },
    metrics: [{
      name: 'screenPageViews'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_top-categories-widget_widget_reportOptions'
  };
}

/**
 * Gets the report options for the Top Categories widget.
 *
 * @since 1.113.0
 *
 * @param {Function} select Data store 'select' function.
 * @return {Object} The report options.
 */
function getReportOptions(select) {
  return getTopCategoriesReportOptions(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
}
function TopCategoriesWidget({
  Widget
}) {
  const topCategoriesReportOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(getReportOptions);
  const topCategoriesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(topCategoriesReportOptions), [topCategoriesReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [topCategoriesReportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [topCategoriesReportOptions]));
  const {
    rows = []
  } = topCategoriesReport || {};
  const columns = [{
    field: 'dimensionValues',
    Component({
      fieldValue
    }) {
      const [categories] = fieldValue;
      const categoriesList = typeof categories?.value === 'string' ? (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_8__.splitCategories)(categories.value) : [];
      const categoriesString = (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.listFormat)(
      // All values _must_ be a string or format will throw an error.
      categoriesList.map(String), {
        style: 'narrow'
      });
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__.MetricTileTablePlainText, {
        content: categoriesString
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_CATEGORIES,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_5__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopCategoriesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__["default"]
}), (0,_js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_9__["default"])({
  reportOptions: getReportOptions
}))(TopCategoriesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopCitiesDrivingAddToCartWidget.js"
/*!**************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopCitiesDrivingAddToCartWidget.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 */   getTopCitiesDrivingAddToCartReportOptions: () => (/* binding */ getTopCitiesDrivingAddToCartReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.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_components_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* 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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopCitiesDrivingAddToCartWidget 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
 */










/**
 * Builds the Analytics 4 report options for the Top Cities Driving Add to Cart metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range.
 * @return {Object} The `getReport` options for the top cities report.
 */

function getTopCitiesDrivingAddToCartReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['city'],
    dimensionFilters: {
      city: {
        filterType: 'emptyFilter',
        notExpression: true
      }
    },
    metrics: [{
      name: 'addToCarts'
    }],
    orderby: [{
      metric: {
        metricName: 'addToCarts'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_top-cities-driving-add-to-cart-widget_widget_topCitiesReportOptions'
  };
}
function TopCitiesDrivingAddToCartWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates());
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getDetectedEvents());
  const hasRequiredEvent = detectedEvents?.includes('add_to_cart');
  const topCitiesReportOptions = getTopCitiesDrivingAddToCartReportOptions(dates);
  const topCitiesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => hasRequiredEvent ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getReport(topCitiesReportOptions) : undefined, [topCitiesReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [topCitiesReportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => hasRequiredEvent ? !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [topCitiesReportOptions]) : undefined);
  const {
    rows = []
  } = topCitiesReport || {};
  const columns = [{
    field: 'dimensionValues',
    Component({
      fieldValue
    }) {
      const [title] = fieldValue;
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
        content: title.value
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_4__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopCitiesDrivingAddToCartWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* 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_5__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__["default"]
})(TopCitiesDrivingAddToCartWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopCitiesDrivingLeadsWidget.js"
/*!**********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopCitiesDrivingLeadsWidget.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 */   getTopCitiesDrivingLeadsEventNames: () => (/* binding */ getTopCitiesDrivingLeadsEventNames),
/* harmony export */   getTopCitiesDrivingLeadsReportOptions: () => (/* binding */ getTopCitiesDrivingLeadsReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.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_components_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* 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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopCitiesDrivingLeadsWidget 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
 */










/**
 * Builds the Analytics 4 report options for the Top Cities Driving Leads metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object}   dates      The date range for the report.
 * @param {string[]} eventNames The lead event names to filter by.
 * @return {Object} The `getReport` options for the top cities report.
 */
/**
 * Resolves the lead conversion event names to filter the report by, from the
 * property's detected events.
 *
 * Mirrors the dashboard widget: it keeps the detected lead events, and drops
 * `CONTACT` when `SUBMIT_LEAD_FORM` is also present to avoid double-counting.
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request filter by the same events.
 *
 * @since n.e.x.t
 *
 * @param {string[]} [detectedEvents] The property's detected conversion events.
 * @return {string[]} The lead event names to filter by.
 */

function getTopCitiesDrivingLeadsEventNames(detectedEvents) {
  const eventNames = [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD].filter(item => detectedEvents?.includes(item));
  if (eventNames.includes(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM) && eventNames.includes(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENUM_CONVERSION_EVENTS.CONTACT)) {
    eventNames.splice(eventNames.indexOf(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.ENUM_CONVERSION_EVENTS.CONTACT), 1);
  }
  return eventNames;
}
function getTopCitiesDrivingLeadsReportOptions(dates, eventNames) {
  return {
    ...dates,
    dimensions: ['city', 'eventName'],
    dimensionFilters: {
      eventName: {
        filterType: 'inListFilter',
        value: eventNames
      },
      city: {
        filterType: 'emptyFilter',
        notExpression: true
      }
    },
    metrics: [{
      name: 'eventCount'
    }],
    orderby: [{
      metric: {
        metricName: 'eventCount'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_top-cities-driving-leads-widget_widget_topCitiesReportOptions'
  };
}
function TopCitiesDrivingLeadsWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates());
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getDetectedEvents());
  const eventNames = getTopCitiesDrivingLeadsEventNames(detectedEvents);
  const topCitiesReportOptions = getTopCitiesDrivingLeadsReportOptions(dates, eventNames);
  const topCitiesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => eventNames?.length ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getReport(topCitiesReportOptions) : undefined, [eventNames, topCitiesReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [topCitiesReportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => eventNames?.length ? !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [topCitiesReportOptions]) : undefined);
  const {
    rows = []
  } = topCitiesReport || {};
  const columns = [{
    field: 'dimensionValues',
    Component({
      fieldValue
    }) {
      const [title] = fieldValue;
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
        content: title.value
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_4__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopCitiesDrivingLeadsWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* 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_5__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__["default"]
})(TopCitiesDrivingLeadsWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopCitiesDrivingPurchasesWidget.js"
/*!**************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopCitiesDrivingPurchasesWidget.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 */   getTopCitiesDrivingPurchasesReportOptions: () => (/* binding */ getTopCitiesDrivingPurchasesReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.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_components_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* 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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopCitiesDrivingPurchasesWidget 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
 */










/**
 * Builds the Analytics 4 report options for the Top Cities Driving Purchases metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getTopCitiesDrivingPurchasesReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['city'],
    dimensionFilters: {
      city: {
        filterType: 'emptyFilter',
        notExpression: true
      }
    },
    metrics: [{
      name: 'ecommercePurchases'
    }],
    metricFilters: {
      ecommercePurchases: {
        operation: 'GREATER_THAN',
        value: {
          int64Value: 0
        }
      }
    },
    orderby: [{
      metric: {
        metricName: 'ecommercePurchases'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_top-cities-driving-purchases-widget_widget_topCitiesReportOptions'
  };
}
function TopCitiesDrivingPurchasesWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates());
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getDetectedEvents());
  const hasDetectedEvent = detectedEvents?.includes('purchase');
  const topCitiesReportOptions = getTopCitiesDrivingPurchasesReportOptions(dates);
  const topCitiesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => hasDetectedEvent ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getReport(topCitiesReportOptions) : undefined, [hasDetectedEvent, topCitiesReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [topCitiesReportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => hasDetectedEvent ? !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [topCitiesReportOptions]) : undefined);
  const {
    rows = []
  } = topCitiesReport || {};
  const columns = [{
    field: 'dimensionValues',
    Component({
      fieldValue
    }) {
      const [title] = fieldValue;
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
        content: title.value
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_10__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_4__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopCitiesDrivingPurchasesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* 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_5__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_9__["default"]
})(TopCitiesDrivingPurchasesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopCitiesWidget.js"
/*!**********************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopCitiesWidget.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 */   getTopCitiesReportOptions: () => (/* binding */ getTopCitiesReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.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_components_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/report-rows-with-set-values */ "./js/modules/analytics-4/utils/report-rows-with-set-values.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopCitiesWidget 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
 */











/**
 * Builds the Analytics 4 report options for the Top Cities metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getTopCitiesReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['city'],
    metrics: [{
      name: 'totalUsers'
    }],
    orderby: [{
      metric: {
        metricName: 'totalUsers'
      },
      desc: true
    }],
    limit: 4,
    reportID: 'analytics-4_top-cities-widget_widget_topCitiesReportOptions'
  };
}
function TopCitiesWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates());
  const topCitiesReportOptions = getTopCitiesReportOptions(dates);
  const topCitiesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getReport(topCitiesReportOptions), [topCitiesReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [topCitiesReportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [topCitiesReportOptions]));
  const {
    rows = [],
    totals = []
  } = topCitiesReport || {};
  const totalUsers = totals[0]?.metricValues?.[0]?.value;
  const columns = [{
    field: 'dimensionValues',
    Component({
      fieldValue
    }) {
      const [title] = fieldValue;
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
        content: title.value
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(fieldValue / totalUsers, {
          style: 'percent',
          maximumFractionDigits: 1
        })
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES,
    loading: loading,
    rows: (0,_js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_7__.reportRowsWithSetValues)(rows),
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_4__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopCitiesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopCitiesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopConvertingTrafficSourceWidget.js"
/*!***************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopConvertingTrafficSourceWidget.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 */   getTopConvertingTrafficSourceReportOptions: () => (/* binding */ getTopConvertingTrafficSourceReportOptions),
/* harmony export */   getTopConvertingTrafficSourceSubtext: () => (/* binding */ getTopConvertingTrafficSourceSubtext)
/* 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__);
/* 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_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileText */ "./js/components/KeyMetrics/MetricTileText.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_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useInViewSelect */ "./js/hooks/useInViewSelect.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopConvertingTrafficSourceWidget 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
 */










/**
 * Builds the Analytics 4 report options for the Top Converting Traffic Source
 * metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getTopConvertingTrafficSourceReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['sessionDefaultChannelGroup'],
    metrics: [{
      name: 'sessionKeyEventRate'
    }],
    limit: 1,
    orderBy: 'sessionKeyEventRate',
    reportID: 'analytics-4_top-converting-traffic-source-widget_widget_reportOptions'
  };
}

/**
 * Builds the sub-text for the Top Converting Traffic Source metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile show the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} rate The share of visits that led to key events.
 * @return {string} The metric tile sub-text.
 */
function getTopConvertingTrafficSourceSubtext(rate) {
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Percentage of visits that led to key events. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s of visits led to key events', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, format));
}
function TopConvertingTrafficSourceWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const reportOptions = getTopConvertingTrafficSourceReportOptions(dates);
  const report = (0,_js_hooks_useInViewSelect__WEBPACK_IMPORTED_MODULE_5__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  function getRowForDateRange(dateRange) {
    if (!report?.rows) {
      return null;
    }

    // Filter the report to get only rows that match the given date range.
    const rows = report.rows.filter(({
      dimensionValues: [, dateValue]
    }) => dateValue.value === dateRange);

    // As the report is limited to 1 row per date range, return the first row.
    return rows[0];
  }
  const currentRow = getRowForDateRange('date_range_0');
  const previousRow = getRowForDateRange('date_range_1');
  const topChannelGroup = currentRow?.dimensionValues?.[0].value || '-';
  const topKeyEventRate = parseFloat(currentRow?.metricValues?.[0].value || '0');
  const previousTopKeyEventRate = parseFloat(previousRow?.metricValues?.[0].value || '0');
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_3__["default"], {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE,
    metricValue: topChannelGroup,
    metricValueFormat: format,
    subText: getTopConvertingTrafficSourceSubtext(topKeyEventRate),
    previousValue: previousTopKeyEventRate,
    currentValue: topKeyEventRate,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopConvertingTrafficSourceWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopConvertingTrafficSourceWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopCountriesWidget.js"
/*!*************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopCountriesWidget.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 */   getTopCountriesReportOptions: () => (/* binding */ getTopCountriesReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.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_components_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/modules/analytics-4/components/common */ "./js/modules/analytics-4/components/common/index.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/report-rows-with-set-values */ "./js/modules/analytics-4/utils/report-rows-with-set-values.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopCountriesWidget 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
 */











/**
 * Builds the Analytics 4 report options for the Top Countries metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getTopCountriesReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['country'],
    metrics: [{
      name: 'totalUsers'
    }],
    orderby: [{
      metric: {
        metricName: 'totalUsers'
      },
      desc: true
    }],
    limit: 4,
    reportID: 'analytics-4_top-countries-widget_widget_topCountriesReportOptions'
  };
}
function TopCountriesWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getDateRangeDates());
  const topCountriesReportOptions = getTopCountriesReportOptions(dates);
  const topCountriesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getReport(topCountriesReportOptions), [topCountriesReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [topCountriesReportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [topCountriesReportOptions]));
  const {
    rows = [],
    totals = []
  } = topCountriesReport || {};
  const totalUsers = totals[0]?.metricValues?.[0]?.value;
  const columns = [{
    field: 'dimensionValues',
    Component({
      fieldValue
    }) {
      const [title] = fieldValue;
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
        content: title.value
      });
    }
  }, {
    field: 'metricValues.0.value',
    Component({
      fieldValue
    }) {
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(fieldValue / totalUsers, {
          style: 'percent',
          maximumFractionDigits: 1
        })
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_COUNTRIES,
    loading: loading,
    rows: (0,_js_modules_analytics_4_utils_report_rows_with_set_values__WEBPACK_IMPORTED_MODULE_7__.reportRowsWithSetValues)(rows),
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_4__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopCountriesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopCountriesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopDeviceDrivingPurchasesWidget.js"
/*!**************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopDeviceDrivingPurchasesWidget.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 */   getTopDeviceDrivingPurchasesReportOptions: () => (/* binding */ getTopDeviceDrivingPurchasesReportOptions),
/* harmony export */   getTopDeviceDrivingPurchasesSubtext: () => (/* binding */ getTopDeviceDrivingPurchasesSubtext)
/* 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_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 _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_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileText */ "./js/components/KeyMetrics/MetricTileText.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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopDeviceDrivingPurchases 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
 */









/**
 * Builds the Analytics 4 report options for the Top Device Driving Purchases
 * metric.
 *
 * Returns both the total-purchases report and the per-device report the tile
 * combines. Both this widget and the metric's PDF tile import this, so the
 * dashboard tile and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The `totalPurchases` and `device` `getReport` options.
 */

function getTopDeviceDrivingPurchasesReportOptions(dates) {
  return {
    totalPurchases: {
      ...dates,
      metrics: [{
        name: 'ecommercePurchases'
      }],
      reportID: 'analytics-4_top-device-driving-purchases-widget_widget_totalPurchasesReportOptions'
    },
    device: {
      ...dates,
      dimensions: ['deviceCategory'],
      metrics: [{
        name: 'ecommercePurchases'
      }],
      limit: 1,
      orderBy: 'ecommercePurchases',
      reportID: 'analytics-4_top-device-driving-purchases-widget_widget_deviceReportOptions'
    }
  };
}

/**
 * Builds the sub-text for the Top Device Driving Purchases metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile show the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} rate The relative share of total purchases for the top device.
 * @return {string} The metric tile sub-text.
 */
function getTopDeviceDrivingPurchasesSubtext(rate) {
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Percentage of purchases for the current top device compared to the number of purchases for all devices. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s of total purchases', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, format));
}
function TopDeviceDrivingPurchases({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getDetectedEvents());
  const hasDetectedEvent = detectedEvents?.includes('purchase');
  const {
    totalPurchases: totalPurchasesReportOptions,
    device: deviceReportOptions
  } = getTopDeviceDrivingPurchasesReportOptions(dates);
  const totalPurchasesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => hasDetectedEvent ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(totalPurchasesReportOptions) : undefined, [hasDetectedEvent, totalPurchasesReportOptions]);

  // ecommercePurchases metric will always be assigned a value, unlike most
  // other metrics, where rows would be empty if there is no data, ecommercePurchases
  // will assign value `0` for each date range if there is no event data. So we need
  // to verify that value is non-zero for one of the rows, to allow report request for
  // traffic source. Otherwise zero data will be incorrectly displayed, showing zero for
  // purchases and comparison, but still include the traffic source.
  const hasPurchases = totalPurchasesReport?.rows ? totalPurchasesReport?.rows?.[0]?.metricValues?.[0]?.value > 0 || totalPurchasesReport?.rows?.[1]?.metricValues?.[0]?.value > 0 : false;
  const deviceReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => hasDetectedEvent && hasPurchases ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(deviceReportOptions) : undefined, [hasPurchases, hasDetectedEvent, deviceReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const deviceReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [deviceReportOptions]);
    const totalPurchasesReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [totalPurchasesReportOptions]);
    if (deviceReportErrors && totalPurchasesReportErrors) {
      return [deviceReportErrors, totalPurchasesReportErrors];
    }
    return deviceReportErrors || totalPurchasesReportErrors || undefined;
  });
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => hasDetectedEvent && hasPurchases ? !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [totalPurchasesReportOptions]) || !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [deviceReportOptions]) : undefined);
  function makeFilter(dateRange, dimensionIndex) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, `dimensionValues.${dimensionIndex}.value`) === dateRange;
  }

  // Prevents running a filter on `report.rows` which could be undefined.
  const {
    rows: totalPurchasesReportRows = []
  } = totalPurchasesReport || {};
  const {
    rows: deviceReportRows = []
  } = deviceReport || {};
  const topDevice = deviceReportRows.filter(makeFilter('date_range_0', 1))[0]?.dimensionValues?.[0].value || '-';
  const currentTotalPurchases = parseInt(totalPurchasesReportRows.filter(makeFilter('date_range_0', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const currentTopDevicePurchases = parseInt(deviceReportRows.filter(makeFilter('date_range_0', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativeCurrentTopDevicePurchases = currentTotalPurchases ? currentTopDevicePurchases / currentTotalPurchases : 0;
  const previousTotalPurchases = parseInt(totalPurchasesReportRows.filter(makeFilter('date_range_1', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const previousTopDevicePurchases = parseInt(deviceReportRows.filter(makeFilter('date_range_1', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativePreviousTopDevicePurchases = previousTotalPurchases ? previousTopDevicePurchases / previousTotalPurchases : 0;
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__["default"], {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES,
    metricValue: topDevice,
    metricValueFormat: format,
    subText: getTopDeviceDrivingPurchasesSubtext(relativeCurrentTopDevicePurchases),
    previousValue: relativePreviousTopDevicePurchases,
    currentValue: relativeCurrentTopDevicePurchases,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopDeviceDrivingPurchases.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopDeviceDrivingPurchases));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopPagesDrivingLeadsWidget.js"
/*!*********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopPagesDrivingLeadsWidget.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 */   getTopPagesDrivingLeadsEventNames: () => (/* binding */ getTopPagesDrivingLeadsEventNames),
/* harmony export */   getTopPagesDrivingLeadsReportOptions: () => (/* binding */ getTopPagesDrivingLeadsReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopPagesDrivingLeadsWidget 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
 */













/**
 * Resolves the lead conversion event names to filter the report by, from the
 * property's detected events.
 *
 * Mirrors the dashboard widget: it keeps the detected lead events, and drops
 * `CONTACT` when `SUBMIT_LEAD_FORM` is also present to avoid double-counting.
 *
 * @since n.e.x.t
 *
 * @param {string[]} [detectedEvents] The property's detected conversion events.
 * @return {string[]} The lead event names to filter by.
 */

function getTopPagesDrivingLeadsEventNames(detectedEvents) {
  const eventNames = [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD].filter(item => detectedEvents?.includes(item));
  if (eventNames.includes(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM) && eventNames.includes(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.CONTACT)) {
    eventNames.splice(eventNames.indexOf(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.CONTACT), 1);
  }
  return eventNames;
}

/**
 * Builds the Analytics 4 report options for the Top Pages Driving Leads metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object}   dates      The date range.
 * @param {string[]} eventNames The lead event names to filter by.
 * @return {Object} The `getReport` options.
 */
function getTopPagesDrivingLeadsReportOptions(dates, eventNames) {
  return {
    ...dates,
    dimensions: ['pagePath', 'eventName'],
    dimensionFilters: {
      eventName: {
        filterType: 'inListFilter',
        value: eventNames
      }
    },
    metrics: [{
      name: 'eventCount'
    }],
    orderby: [{
      metric: {
        metricName: 'eventCount'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_top-pages-driving-leads-widget_widget_reportOptions'
  };
}
function TopPagesDrivingLeadsWidget(props) {
  const {
    Widget
  } = props;
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents());
  const eventNames = getTopPagesDrivingLeadsEventNames(detectedEvents);
  const reportOptions = getTopPagesDrivingLeadsReportOptions(dates, eventNames);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => eventNames?.length ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(reportOptions) : undefined, [eventNames, reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => {
    if (!eventNames?.length || error) {
      return undefined;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions);
  }, [eventNames, error, report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => {
    if (!eventNames?.length) {
      return undefined;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || titles === undefined;
  });
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__.decodeAmpersand)(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_1__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
          content: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["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_13__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_6__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopPagesDrivingLeadsWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__["default"]
})(TopPagesDrivingLeadsWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopRecentTrendingPagesWidget.js"
/*!***********************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopRecentTrendingPagesWidget.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 */   getDateRange: () => (/* binding */ getDateRange),
/* harmony export */   getReportOptions: () => (/* binding */ getTopRecentTrendingPagesReportOptions),
/* harmony export */   getTopRecentTrendingPagesReportOptions: () => (/* binding */ getTopRecentTrendingPagesReportOptions)
/* 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__);
/* harmony import */ var _wordpress_compose__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/compose */ "../node_modules/@wordpress/compose/build-module/higher-order/compose.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_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_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_useViewOnly__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__ = __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_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/withCustomDimensions */ "./js/modules/analytics-4/utils/withCustomDimensions.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopRecentTrendingPagesWidget 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
 */













/**
 * Returns the date range (eg. the `startDate` and `endDate`) for this widget's
 * reporting options.
 *
 * @since 1.113.0
 * @since 1.132.0 Update the function to receive the reference date instead of the select function.
 *
 * @param {string} referenceDate The reference date.
 * @return {Object} An object containing the `startDate` and `endDate` for a
 * report.
 */

function getDateRange(referenceDate) {
  const yesterday = (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.getPreviousDate)(referenceDate, 1);
  const threeDaysAgo = (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.getPreviousDate)(referenceDate, 3);
  return {
    startDate: threeDaysAgo,
    endDate: yesterday
  };
}

/**
 * Generates the report options required for fetching data in
 * `topRecentTrendingPagesWidget`.
 *
 * The function utilizes the dates from the last three days to
 * prepare the filter and structure required for the report.
 *
 * This is defined as a function outside the component so that the
 * component, the higher-order-component (`withCustomDimensions`), and
 * the metric's PDF tile all request the same data.
 *
 * @since 1.113.0
 * @since 1.132.0 Update the function to receive the reference date instead of the select function.
 * @since n.e.x.t Renamed to `getTopRecentTrendingPagesReportOptions`.
 *
 * @param {string} referenceDate The reference date.
 * @return {Object} The report options containing dimensions, filters,
 * metrics, and other parameters.
 */
function getTopRecentTrendingPagesReportOptions(referenceDate) {
  const yesterday = (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.getPreviousDate)(referenceDate, 1);
  const twoDaysAgo = (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.getPreviousDate)(referenceDate, 2);
  const threeDaysAgo = (0,_js_util__WEBPACK_IMPORTED_MODULE_12__.getPreviousDate)(referenceDate, 3);
  const dates = getDateRange(referenceDate);
  const reportOptions = {
    ...dates,
    dimensions: ['pagePath'],
    dimensionFilters: {
      'customEvent:googlesitekit_post_date': {
        filterType: 'inListFilter',
        value: [yesterday.replace(/-/g, ''), twoDaysAgo.replace(/-/g, ''), threeDaysAgo.replace(/-/g, '')]
      }
    },
    metrics: [{
      name: 'screenPageViews'
    }],
    orderby: [{
      metric: {
        metricName: 'screenPageViews'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_top-recent-trending-pages-widget_widget_reportOptions'
  };
  return reportOptions;
}

// Backwards-compatible alias for existing importers (tests and stories).

function CustomZeroDataMessage() {
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('No data to display: either no pages were published in the last three days, or they haven’t received any visitors yet', 'google-site-kit');
}
function TopRecentTrendingPagesWidget({
  Widget
}) {
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const [dates, reportOptions] = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const referenceDate = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate();
    return [getDateRange(referenceDate), getTopRecentTrendingPagesReportOptions(referenceDate)];
  });
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => !error && report ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [error, report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || titles === undefined);
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_10__.decodeAmpersand)(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_3__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.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_12__.numFmt)(fieldValue)
      });
    }
  }];
  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_6__.KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: CustomZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopRecentTrendingPagesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_wordpress_compose__WEBPACK_IMPORTED_MODULE_1__["default"])((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_13__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_14__["default"]
}), (0,_js_modules_analytics_4_utils_withCustomDimensions__WEBPACK_IMPORTED_MODULE_11__["default"])({
  reportOptions(select) {
    return getTopRecentTrendingPagesReportOptions(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getReferenceDate());
  }
}))(TopRecentTrendingPagesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopReturningVisitorPages.js"
/*!*******************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopReturningVisitorPages.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 */   getTopReturningVisitorPagesReportOptions: () => (/* binding */ getTopReturningVisitorPagesReportOptions)
/* 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__);
/* 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_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_user_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.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 _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopReturningVisitorPages 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
 */













/**
 * Builds the Analytics 4 report options for the Top pages by returning visitors metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getTopReturningVisitorPagesReportOptions(dates) {
  return {
    ...dates,
    dimensions: ['pagePath'],
    dimensionFilters: {
      newVsReturning: 'returning'
    },
    metrics: [{
      name: 'activeUsers'
    }],
    orderby: [{
      metric: {
        metricName: 'activeUsers'
      },
      desc: true
    }],
    limit: 3,
    keepEmptyRows: false,
    reportID: 'analytics-4_top-returning-visitor-pages-widget_widget_reportOptions'
  };
}
function TopReturningVisitorPages(props) {
  const {
    Widget
  } = props;
  const viewOnlyDashboard = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_5__["default"])();
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates());
  const reportOptions = getTopReturningVisitorPagesReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const titles = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useInViewSelect)(select => !error ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPageTitles(report, reportOptions) : undefined, [error, report, reportOptions]);
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]) || titles === undefined);
  const {
    rows = []
  } = report || {};
  const columns = [{
    field: 'dimensionValues.0.value',
    Component({
      fieldValue
    }) {
      const url = fieldValue;
      const title = (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_9__.decodeAmpersand)(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_1__.useSelect)(select => {
        return !viewOnlyDashboard ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceReportURL('all-pages-and-screens', {
          filters: {
            unifiedPagePathScreen: url
          },
          dates
        }) : null;
      });
      if (viewOnlyDashboard) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTablePlainText, {
          content: title
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_Link__WEBPACK_IMPORTED_MODULE_3__["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_13__.jsx)("strong", {
        children: (0,_js_util__WEBPACK_IMPORTED_MODULE_10__.numFmt)(fieldValue)
      });
    }
  }];
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_13__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_2__.MetricTileTable, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES,
    loading: loading,
    rows: rows,
    columns: columns,
    ZeroState: _js_modules_analytics_4_components_common__WEBPACK_IMPORTED_MODULE_6__.ZeroDataMessage,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopReturningVisitorPages.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_0___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_11__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_12__["default"]
})(TopReturningVisitorPages));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingAddToCartWidget.js"
/*!*********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingAddToCartWidget.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 */   getTopTrafficSourceDrivingAddToCartReportOptions: () => (/* binding */ getTopTrafficSourceDrivingAddToCartReportOptions),
/* harmony export */   getTopTrafficSourceDrivingAddToCartSubtext: () => (/* binding */ getTopTrafficSourceDrivingAddToCartSubtext)
/* 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_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 _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_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileText */ "./js/components/KeyMetrics/MetricTileText.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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopTrafficSourceDrivingAddToCartWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Top Traffic Source Driving Add
 * to Cart metric.
 *
 * Returns both the total add-to-cart report and the per-channel report the tile
 * combines. Both this widget and the metric's PDF tile import this, so the
 * dashboard tile and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The `totalAddToCart` and `trafficSource` `getReport` options.
 */

function getTopTrafficSourceDrivingAddToCartReportOptions(dates) {
  return {
    totalAddToCart: {
      ...dates,
      metrics: [{
        name: 'addToCarts'
      }],
      reportID: 'analytics-4_top-traffic-source-driving-add-to-cart-widget_widget_totalAddToCartReportOptions'
    },
    trafficSource: {
      ...dates,
      dimensions: ['sessionDefaultChannelGroup'],
      metrics: [{
        name: 'addToCarts'
      }],
      limit: 1,
      orderBy: 'addToCarts',
      reportID: 'analytics-4_top-traffic-source-driving-add-to-cart-widget_widget_trafficSourceReportOptions'
    }
  };
}

/**
 * Builds the sub-text for the Top Traffic Source Driving Add to Cart metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile show the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} rate The relative share of total add to carts for the top source.
 * @return {string} The metric tile sub-text.
 */
function getTopTrafficSourceDrivingAddToCartSubtext(rate) {
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Percentage of add to carts for the current top traffic source compared to the number of total add to carts for all traffic sources. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s of total add to carts', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, format));
}
function TopTrafficSourceDrivingAddToCartWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getDetectedEvents());
  const hasDetectedEvent = detectedEvents?.includes(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ENUM_CONVERSION_EVENTS.ADD_TO_CART);
  const {
    totalAddToCart: totalAddToCartReportOptions,
    trafficSource: trafficSourceReportOptions
  } = getTopTrafficSourceDrivingAddToCartReportOptions(dates);
  const totalAddToCartReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => hasDetectedEvent ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(totalAddToCartReportOptions) : undefined, [hasDetectedEvent, totalAddToCartReportOptions]);
  const trafficSourceReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => hasDetectedEvent ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(trafficSourceReportOptions) : undefined, [hasDetectedEvent, trafficSourceReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const trafficSourceReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [trafficSourceReportOptions]);
    const totalAddToCartReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [totalAddToCartReportOptions]);
    if (trafficSourceReportErrors && totalAddToCartReportErrors) {
      return [trafficSourceReportErrors, totalAddToCartReportErrors];
    }
    return trafficSourceReportErrors || totalAddToCartReportErrors || undefined;
  });
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => hasDetectedEvent ? !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [totalAddToCartReportOptions]) || !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [trafficSourceReportOptions]) : undefined);
  function makeFilter(dateRange, dimensionIndex) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, `dimensionValues.${dimensionIndex}.value`) === dateRange;
  }

  // Prevents running a filter on `report.rows` which could be undefined.
  const {
    rows: totalAddToCartReportRows = []
  } = totalAddToCartReport || {};
  const {
    rows: trafficSourceReportRows = []
  } = trafficSourceReport || {};
  const topTrafficSource = trafficSourceReportRows.filter(makeFilter('date_range_0', 1))[0]?.dimensionValues?.[0].value || '-';
  const currentTotalAddToCart = parseInt(totalAddToCartReportRows.filter(makeFilter('date_range_0', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const currentTopTrafficSourceAddToCart = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_0', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativeCurrentTopTrafficSourceAddToCart = currentTotalAddToCart ? currentTopTrafficSourceAddToCart / currentTotalAddToCart : 0;
  const previousTotalAddToCart = parseInt(totalAddToCartReportRows.filter(makeFilter('date_range_1', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const previousTopTrafficSourceAddToCart = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_1', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativePreviousTopTrafficSourceAddToCart = previousTotalAddToCart ? previousTopTrafficSourceAddToCart / previousTotalAddToCart : 0;
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__["default"], {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART,
    metricValue: topTrafficSource,
    metricValueFormat: format,
    subText: getTopTrafficSourceDrivingAddToCartSubtext(relativeCurrentTopTrafficSourceAddToCart),
    previousValue: relativePreviousTopTrafficSourceAddToCart,
    currentValue: relativeCurrentTopTrafficSourceAddToCart,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopTrafficSourceDrivingAddToCartWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopTrafficSourceDrivingAddToCartWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingLeadsWidget.js"
/*!*****************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingLeadsWidget.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 */   getTopTrafficSourceDrivingLeadsEventNames: () => (/* binding */ getTopTrafficSourceDrivingLeadsEventNames),
/* harmony export */   getTopTrafficSourceDrivingLeadsReportOptions: () => (/* binding */ getTopTrafficSourceDrivingLeadsReportOptions),
/* harmony export */   getTopTrafficSourceDrivingLeadsSubtext: () => (/* binding */ getTopTrafficSourceDrivingLeadsSubtext)
/* 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_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 _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_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileText */ "./js/components/KeyMetrics/MetricTileText.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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopTrafficSourceDrivingLeadsWidget 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 getDateRangeIndex(reportRows, dateRangeSlug) {
  for (let rowIndex = 0; rowIndex < reportRows.length; rowIndex++) {
    const dimensionValues = reportRows?.[rowIndex]?.dimensionValues;
    const dimensionIndex = dimensionValues.findIndex(dimensionValue => dimensionValue.value === dateRangeSlug);
    if (dimensionIndex !== -1) {
      return dimensionIndex;
    }
  }
  return 0;
}

/**
 * Resolves the lead conversion event names to filter the reports by, from the
 * property's detected events.
 *
 * Mirrors the dashboard widget: it keeps the detected lead events, and drops
 * `CONTACT` when `SUBMIT_LEAD_FORM` is also present to avoid double-counting.
 *
 * @since n.e.x.t
 *
 * @param {string[]} [detectedEvents] The property's detected conversion events.
 * @return {string[]} The lead event names to filter by.
 */
function getTopTrafficSourceDrivingLeadsEventNames(detectedEvents) {
  const eventNames = [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ENUM_CONVERSION_EVENTS.CONTACT, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ENUM_CONVERSION_EVENTS.GENERATE_LEAD].filter(item => detectedEvents?.includes(item));
  if (eventNames.includes(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ENUM_CONVERSION_EVENTS.SUBMIT_LEAD_FORM) && eventNames.includes(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ENUM_CONVERSION_EVENTS.CONTACT)) {
    eventNames.splice(eventNames.indexOf(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.ENUM_CONVERSION_EVENTS.CONTACT), 1);
  }
  return eventNames;
}

/**
 * Builds the Analytics 4 report options for the Top Traffic Source Driving Leads
 * metric.
 *
 * Returns both the total-leads report and the per-channel report the tile
 * combines, each filtered to the given lead event names. Both this widget and
 * the metric's PDF tile import this, so the dashboard tile and the report
 * request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object}   dates      The date range, including the compare dates.
 * @param {string[]} eventNames The lead event names to filter by.
 * @return {Object} The `totalLeads` and `trafficSource` `getReport` options.
 */
function getTopTrafficSourceDrivingLeadsReportOptions(dates, eventNames) {
  return {
    totalLeads: {
      ...dates,
      metrics: [{
        name: 'eventCount'
      }],
      dimensions: ['eventName'],
      dimensionFilters: {
        eventName: {
          filterType: 'inListFilter',
          value: eventNames
        }
      },
      reportID: 'analytics-4_top-traffic-source-driving-leads-widget_widget_totalLeadsReportOptions'
    },
    trafficSource: {
      ...dates,
      dimensions: ['sessionDefaultChannelGroup', 'eventName'],
      dimensionFilters: {
        eventName: {
          filterType: 'inListFilter',
          value: eventNames
        }
      },
      metrics: [{
        name: 'eventCount'
      }],
      limit: 1,
      orderBy: 'eventCount',
      reportID: 'analytics-4_top-traffic-source-driving-leads-widget_widget_trafficSourceReportOptions'
    }
  };
}

/**
 * Builds the sub-text for the Top Traffic Source Driving Leads metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile show the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} rate The relative share of total leads for the top source.
 * @return {string} The metric tile sub-text.
 */
function getTopTrafficSourceDrivingLeadsSubtext(rate) {
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Percentage of leads for the current top traffic source compared to the number of total leads for all traffic sources. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s of total leads', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, format));
}
function TopTrafficSourceDrivingLeadsWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getDetectedEvents());
  const eventNames = getTopTrafficSourceDrivingLeadsEventNames(detectedEvents);
  const {
    totalLeads: totalLeadsReportOptions,
    trafficSource: trafficSourceReportOptions
  } = getTopTrafficSourceDrivingLeadsReportOptions(dates, eventNames);
  const totalLeadsReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => eventNames.length ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(totalLeadsReportOptions) : undefined, [eventNames, totalLeadsReportOptions]);
  const trafficSourceReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => eventNames.length ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(trafficSourceReportOptions) : undefined, [eventNames, trafficSourceReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const trafficSourceReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [trafficSourceReportOptions]);
    const totalLeadsReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [totalLeadsReportOptions]);
    if (trafficSourceReportErrors && totalLeadsReportErrors) {
      return [trafficSourceReportErrors, totalLeadsReportErrors];
    }
    return trafficSourceReportErrors || totalLeadsReportErrors || undefined;
  });
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!eventNames.length) {
      return undefined;
    }
    return !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [totalLeadsReportOptions]) || !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [trafficSourceReportOptions]);
  });
  function makeFilter(dateRange, dimensionIndex) {
    return row => {
      return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, `dimensionValues.${dimensionIndex}.value`) === dateRange;
    };
  }

  // Prevents running a filter on `report.rows` which could be undefined.
  const {
    rows: totalLeadsReportRows = []
  } = totalLeadsReport || {};
  const {
    rows: trafficSourceReportRows = []
  } = trafficSourceReport || {};
  const topTrafficSourceDateRangeIndex = getDateRangeIndex(trafficSourceReportRows, 'date_range_0');
  const topTrafficSource = trafficSourceReportRows.filter(makeFilter('date_range_0', topTrafficSourceDateRangeIndex))[0]?.dimensionValues?.[0].value || '-';
  const currentTotalLeadsDateRangeIndex = getDateRangeIndex(totalLeadsReportRows, 'date_range_0');
  const currentTotalLeads = parseInt(totalLeadsReportRows.filter(makeFilter('date_range_0', currentTotalLeadsDateRangeIndex))[0]?.metricValues?.[0]?.value, 10) || 0;
  const currentTopTrafficSourceLeadsDateRangeIndex = getDateRangeIndex(trafficSourceReportRows, 'date_range_0');
  const currentTopTrafficSourceLeads = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_0', currentTopTrafficSourceLeadsDateRangeIndex))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativeCurrentTopTrafficSourceUsers = currentTotalLeads ? currentTopTrafficSourceLeads / currentTotalLeads : 0;
  const previousTotalLeadsDateRangeIndex = getDateRangeIndex(totalLeadsReportRows, 'date_range_1');
  const previousTotalLeads = parseInt(totalLeadsReportRows.filter(makeFilter('date_range_1', previousTotalLeadsDateRangeIndex))[0]?.metricValues?.[0]?.value, 10) || 0;
  const previousTopTrafficSourceUsersDateRangeIndex = getDateRangeIndex(trafficSourceReportRows, 'date_range_1');
  const previousTopTrafficSourceUsers = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_1', previousTopTrafficSourceUsersDateRangeIndex))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativePreviousTopTrafficSourceUsers = previousTotalLeads ? previousTopTrafficSourceUsers / previousTotalLeads : 0;
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__["default"], {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS,
    metricValue: topTrafficSource,
    metricValueFormat: format,
    subText: getTopTrafficSourceDrivingLeadsSubtext(relativeCurrentTopTrafficSourceUsers),
    previousValue: relativePreviousTopTrafficSourceUsers,
    currentValue: relativeCurrentTopTrafficSourceUsers,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopTrafficSourceDrivingLeadsWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopTrafficSourceDrivingLeadsWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingPurchasesWidget.js"
/*!*********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingPurchasesWidget.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 */   getTopTrafficSourceDrivingPurchasesReportOptions: () => (/* binding */ getTopTrafficSourceDrivingPurchasesReportOptions),
/* harmony export */   getTopTrafficSourceDrivingPurchasesSubtext: () => (/* binding */ getTopTrafficSourceDrivingPurchasesSubtext)
/* 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_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 _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_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileText */ "./js/components/KeyMetrics/MetricTileText.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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopTrafficSourceDrivingPurchasesWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Top Traffic Source Driving
 * Purchases metric.
 *
 * Returns both the total-purchases report and the per-channel report the tile
 * combines. Both this widget and the metric's PDF tile import this, so the
 * dashboard tile and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The `totalPurchases` and `trafficSource` `getReport` options.
 */

function getTopTrafficSourceDrivingPurchasesReportOptions(dates) {
  return {
    totalPurchases: {
      ...dates,
      metrics: [{
        name: 'ecommercePurchases'
      }],
      reportID: 'analytics-4_top-traffic-source-driving-purchases-widget_widget_totalPurchasesReportOptions'
    },
    trafficSource: {
      ...dates,
      dimensions: ['sessionDefaultChannelGroup'],
      metrics: [{
        name: 'ecommercePurchases'
      }],
      limit: 1,
      orderBy: 'ecommercePurchases',
      reportID: 'analytics-4_top-traffic-source-driving-purchases-widget_widget_trafficSourceReportOptions'
    }
  };
}

/**
 * Builds the sub-text for the Top Traffic Source Driving Purchases metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile show the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} rate The relative share of total purchases for the top source.
 * @return {string} The metric tile sub-text.
 */
function getTopTrafficSourceDrivingPurchasesSubtext(rate) {
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Percentage of purchases for the current top traffic source compared to the number of total purchases for all traffic sources. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s of total purchases', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, format));
}
function TopTrafficSourceDrivingPurchasesWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const detectedEvents = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getDetectedEvents());
  const hasDetectedEvent = detectedEvents?.includes('purchase');
  const {
    totalPurchases: totalPurchasesReportOptions,
    trafficSource: trafficSourceReportOptions
  } = getTopTrafficSourceDrivingPurchasesReportOptions(dates);
  const totalPurchasesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => hasDetectedEvent ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(totalPurchasesReportOptions) : undefined, [hasDetectedEvent, totalPurchasesReportOptions]);
  // ecommercePurchases metric will always be assigned a value, unlike most
  // other metrics, where rows would be empty if there is no data, ecommercePurchases
  // will assign value `0` for each date range if there is no event data. So we need
  // to verify that value is non-zero for one of the rows, to allow report request for
  // traffic source. Otherwise zero data will be incorrectly displayed, showing zero for
  // purchases and comparison, but still include the traffic source.
  const hasPurchases = totalPurchasesReport?.rows ? totalPurchasesReport?.rows?.[0]?.metricValues?.[0]?.value > 0 || totalPurchasesReport?.rows?.[1]?.metricValues?.[0]?.value > 0 : false;
  const trafficSourceReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => hasDetectedEvent && hasPurchases ? select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(trafficSourceReportOptions) : undefined, [hasDetectedEvent, hasPurchases, trafficSourceReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const trafficSourceReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [trafficSourceReportOptions]);
    const totalPurchasesReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [totalPurchasesReportOptions]);
    if (trafficSourceReportErrors && totalPurchasesReportErrors) {
      return [trafficSourceReportErrors, totalPurchasesReportErrors];
    }
    return trafficSourceReportErrors || totalPurchasesReportErrors || undefined;
  });
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => hasDetectedEvent ? !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [totalPurchasesReportOptions]) || !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [trafficSourceReportOptions]) && hasPurchases : undefined);
  function makeFilter(dateRange, dimensionIndex) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, `dimensionValues.${dimensionIndex}.value`) === dateRange;
  }

  // Prevents running a filter on `report.rows` which could be undefined.
  const {
    rows: totalPurchasesReportRows = []
  } = totalPurchasesReport || {};
  const {
    rows: trafficSourceReportRows = []
  } = trafficSourceReport || {};
  const topTrafficSource = trafficSourceReportRows.filter(makeFilter('date_range_0', 1))[0]?.dimensionValues?.[0].value || '-';
  const currentTotalPurchases = parseInt(totalPurchasesReportRows.filter(makeFilter('date_range_0', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const currentTopTrafficSourcePurchases = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_0', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativeCurrentTopTrafficSourcePurchases = currentTotalPurchases ? currentTopTrafficSourcePurchases / currentTotalPurchases : 0;
  const previousTotalPurchases = parseInt(totalPurchasesReportRows.filter(makeFilter('date_range_1', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const previousTopTrafficSourcePurchases = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_1', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativePreviousTopTrafficSourcePurchases = previousTotalPurchases ? previousTopTrafficSourcePurchases / previousTotalPurchases : 0;
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__["default"], {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES,
    metricValue: topTrafficSource,
    metricValueFormat: format,
    subText: getTopTrafficSourceDrivingPurchasesSubtext(relativeCurrentTopTrafficSourcePurchases),
    previousValue: relativePreviousTopTrafficSourcePurchases,
    currentValue: relativeCurrentTopTrafficSourcePurchases,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopTrafficSourceDrivingPurchasesWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopTrafficSourceDrivingPurchasesWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/TopTrafficSourceWidget.js"
/*!*****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/TopTrafficSourceWidget.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 */   getTopTrafficSourceReportOptions: () => (/* binding */ getTopTrafficSourceReportOptions),
/* harmony export */   getTopTrafficSourceSubtext: () => (/* binding */ getTopTrafficSourceSubtext)
/* 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_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 _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_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/MetricTileText */ "./js/components/KeyMetrics/MetricTileText.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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * TopTrafficSourceWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Top Traffic Source metric.
 *
 * Returns both the total-users report and the per-channel report the tile
 * combines. Both this widget and the metric's PDF tile import this, so the
 * dashboard tile and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The `totalUsers` and `trafficSource` `getReport` options.
 */

function getTopTrafficSourceReportOptions(dates) {
  return {
    totalUsers: {
      ...dates,
      metrics: [{
        name: 'totalUsers'
      }],
      reportID: 'analytics-4_top-traffic-source-widget_widget_totalUsersReportOptions'
    },
    trafficSource: {
      ...dates,
      dimensions: ['sessionDefaultChannelGroup'],
      metrics: [{
        name: 'totalUsers'
      }],
      limit: 1,
      orderBy: 'totalUsers',
      reportID: 'analytics-4_top-traffic-source-widget_widget_trafficSourceReportOptions'
    }
  };
}

/**
 * Builds the sub-text for the Top Traffic Source metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile show the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} rate The relative share of total traffic for the top source.
 * @return {string} The metric tile sub-text.
 */
function getTopTrafficSourceSubtext(rate) {
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Percentage of users for the current top traffic source compared to the number of total users for all traffic sources. */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s of total traffic', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(rate, format));
}
function TopTrafficSourceWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const {
    totalUsers: totalUsersReportOptions,
    trafficSource: trafficSourceReportOptions
  } = getTopTrafficSourceReportOptions(dates);
  const totalUsersReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(totalUsersReportOptions), [totalUsersReportOptions]);
  const trafficSourceReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(trafficSourceReportOptions), [trafficSourceReportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const trafficSourceReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [trafficSourceReportOptions]);
    const totalUsersReportErrors = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [totalUsersReportOptions]);
    if (trafficSourceReportErrors && totalUsersReportErrors) {
      return [trafficSourceReportErrors, totalUsersReportErrors];
    }
    return trafficSourceReportErrors || totalUsersReportErrors || undefined;
  });
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [totalUsersReportOptions]) || !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [trafficSourceReportOptions]));
  function makeFilter(dateRange, dimensionIndex) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, `dimensionValues.${dimensionIndex}.value`) === dateRange;
  }

  // Prevents running a filter on `report.rows` which could be undefined.
  const {
    rows: totalUsersReportRows = []
  } = totalUsersReport || {};
  const {
    rows: trafficSourceReportRows = []
  } = trafficSourceReport || {};
  const topTrafficSource = trafficSourceReportRows.filter(makeFilter('date_range_0', 1))[0]?.dimensionValues?.[0].value || '-';
  const currentTotalUsers = parseInt(totalUsersReportRows.filter(makeFilter('date_range_0', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const currentTopTrafficSourceUsers = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_0', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativeCurrentTopTrafficSourceUsers = currentTotalUsers ? currentTopTrafficSourceUsers / currentTotalUsers : 0;
  const previousTotalUsers = parseInt(totalUsersReportRows.filter(makeFilter('date_range_1', 0))[0]?.metricValues?.[0]?.value, 10) || 0;
  const previousTopTrafficSourceUsers = parseInt(trafficSourceReportRows.filter(makeFilter('date_range_1', 1))[0]?.metricValues?.[0]?.value, 10) || 0;
  const relativePreviousTopTrafficSourceUsers = previousTotalUsers ? previousTopTrafficSourceUsers / previousTotalUsers : 0;
  const format = {
    style: 'percent',
    signDisplay: 'never',
    maximumFractionDigits: 1
  };
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics_MetricTileText__WEBPACK_IMPORTED_MODULE_4__["default"], {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE,
    metricValue: topTrafficSource,
    metricValueFormat: format,
    subText: getTopTrafficSourceSubtext(relativeCurrentTopTrafficSourceUsers),
    previousValue: relativePreviousTopTrafficSourceUsers,
    currentValue: relativeCurrentTopTrafficSourceUsers,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
TopTrafficSourceWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(TopTrafficSourceWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/VisitLengthWidget.js"
/*!************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/VisitLengthWidget.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 */   getVisitLengthReportOptions: () => (/* binding */ getVisitLengthReportOptions),
/* harmony export */   getVisitLengthSubtext: () => (/* binding */ getVisitLengthSubtext)
/* 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_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 _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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_i18n__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/i18n */ "./js/util/i18n.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * VisitLengthWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Visit Length metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getVisitLengthReportOptions(dates) {
  return {
    ...dates,
    metrics: [{
      name: 'averageSessionDuration'
    }, {
      name: 'sessions'
    }],
    reportID: 'analytics-4_visit-length-widget_widget_reportOptions'
  };
}

/**
 * Builds the sub-text for the Visit Length metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile display the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} totalSessions The total number of visits.
 * @return {string} The formatted sub-text.
 */
function getVisitLengthSubtext(totalSessions) {
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Number of total visits to the site, such as "1,234". */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s total visits', 'google-site-kit'), (0,_js_util_i18n__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalSessions, {
    style: 'decimal'
  }));
}
function VisitLengthWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const reportOptions = getVisitLengthReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  const {
    rows = []
  } = report || {};
  function makeFind(dateRange) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, 'dimensionValues.0.value') === dateRange;
  }
  const currentVisitLength = Number(rows.find(makeFind('date_range_0'))?.metricValues?.[0]?.value) || 0;
  const previousVisitLength = Number(rows.find(makeFind('date_range_1'))?.metricValues?.[0]?.value) || 0;
  const currentTotalSessions = Number(rows.find(makeFind('date_range_0'))?.metricValues?.[1]?.value) || 0;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileNumeric, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_VISIT_LENGTH,
    metricValue: currentVisitLength,
    metricValueFormat: "s",
    subText: getVisitLengthSubtext(currentTotalSessions),
    previousValue: previousVisitLength,
    currentValue: currentVisitLength,
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
VisitLengthWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(VisitLengthWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/VisitsPerVisitorWidget.js"
/*!*****************************************************************************!*\
  !*** ./js/modules/analytics-4/components/widgets/VisitsPerVisitorWidget.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 */   getVisitsPerVisitorReportOptions: () => (/* binding */ getVisitsPerVisitorReportOptions),
/* harmony export */   getVisitsPerVisitorSubtext: () => (/* binding */ getVisitsPerVisitorSubtext)
/* 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_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 _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_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/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_constants__WEBPACK_IMPORTED_MODULE_6__ = __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_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_when_active__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/util/when-active */ "./js/util/when-active.js");
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * VisitsPerVisitorWidget 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
 */









/**
 * Builds the Analytics 4 report options for the Visits Per Visitor metric.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the report request the same data.
 *
 * @since n.e.x.t
 *
 * @param {Object} dates The date range, including the compare dates.
 * @return {Object} The Analytics 4 `getReport` options.
 */

function getVisitsPerVisitorReportOptions(dates) {
  return {
    ...dates,
    metrics: [{
      name: 'sessionsPerUser'
    }, {
      name: 'sessions'
    }],
    reportID: 'analytics-4_visits-per-visitor-widget_widget_reportOptions'
  };
}

/**
 * Builds the sub-text for the Visits Per Visitor metric tile.
 *
 * Both this widget and the metric's PDF tile import this, so the dashboard tile
 * and the PDF tile display the same sub-text.
 *
 * @since n.e.x.t
 *
 * @param {number} totalSessions The total number of visits.
 * @return {string} The formatted sub-text.
 */
function getVisitsPerVisitorSubtext(totalSessions) {
  return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.sprintf)(/* translators: %s: Number of total visits to the site, such as "1,234". */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('%s total visits', 'google-site-kit'), (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.numFmt)(totalSessions, {
    style: 'decimal'
  }));
}
function VisitsPerVisitorWidget({
  Widget
}) {
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const reportOptions = getVisitsPerVisitorReportOptions(dates);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportOptions), [reportOptions]);
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]));
  const loading = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]));
  const {
    rows = []
  } = report || {};
  function makeFind(dateRange) {
    return row => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.get)(row, 'dimensionValues.0.value') === dateRange;
  }
  const currentVisitsPerVisitor = rows.find(makeFind('date_range_0'))?.metricValues?.[0]?.value || 0;
  const previousVisitsPerVisitor = rows.find(makeFind('date_range_1'))?.metricValues?.[0]?.value || 0;
  const currentTotalSessions = Number(rows.find(makeFind('date_range_0'))?.metricValues?.[1]?.value) || 0;
  return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_11__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_4__.MetricTileNumeric, {
    Widget: Widget,
    widgetSlug: _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.KM_ANALYTICS_VISITS_PER_VISITOR,
    metricValue: currentVisitsPerVisitor,
    subText: getVisitsPerVisitorSubtext(currentTotalSessions),
    previousValue: Number(previousVisitsPerVisitor),
    currentValue: Number(currentVisitsPerVisitor),
    loading: loading,
    error: error,
    moduleSlug: "analytics-4"
  });
}
VisitsPerVisitorWidget.propTypes = {
  Widget: (prop_types__WEBPACK_IMPORTED_MODULE_1___default().elementType).isRequired
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((0,_js_util_when_active__WEBPACK_IMPORTED_MODULE_9__["default"])({
  moduleName: _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4,
  FallbackComponent: _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_10__["default"]
})(VisitsPerVisitorWidget));

/***/ },

/***/ "./js/modules/analytics-4/components/widgets/index.js"
/*!************************************************************!*\
  !*** ./js/modules/analytics-4/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 */   ConnectGA4CTATileWidget: () => (/* reexport safe */ _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_0__["default"]),
/* harmony export */   ConnectGA4CTAWidget: () => (/* reexport safe */ _ConnectGA4CTAWidget__WEBPACK_IMPORTED_MODULE_1__["default"]),
/* harmony export */   ConversionReportingNotificationCTAWidget: () => (/* reexport safe */ _ConversionReportingNotificationCTAWidget__WEBPACK_IMPORTED_MODULE_2__["default"]),
/* harmony export */   EngagedTrafficSourceWidget: () => (/* reexport safe */ _EngagedTrafficSourceWidget__WEBPACK_IMPORTED_MODULE_3__["default"]),
/* harmony export */   LeastEngagingPagesWidget: () => (/* reexport safe */ _LeastEngagingPagesWidget__WEBPACK_IMPORTED_MODULE_4__["default"]),
/* harmony export */   MostEngagingPagesWidget: () => (/* reexport safe */ _MostEngagingPagesWidget__WEBPACK_IMPORTED_MODULE_5__["default"]),
/* harmony export */   NewVisitorsWidget: () => (/* reexport safe */ _NewVisitorsWidget__WEBPACK_IMPORTED_MODULE_6__["default"]),
/* harmony export */   PagesPerVisitWidget: () => (/* reexport safe */ _PagesPerVisitWidget__WEBPACK_IMPORTED_MODULE_21__["default"]),
/* harmony export */   PopularAuthorsWidget: () => (/* reexport safe */ _PopularAuthorsWidget__WEBPACK_IMPORTED_MODULE_28__["default"]),
/* harmony export */   PopularContentWidget: () => (/* reexport safe */ _PopularContentWidget__WEBPACK_IMPORTED_MODULE_7__["default"]),
/* harmony export */   PopularProductsWidget: () => (/* reexport safe */ _PopularProductsWidget__WEBPACK_IMPORTED_MODULE_8__["default"]),
/* harmony export */   ReturningVisitorsWidget: () => (/* reexport safe */ _ReturningVisitorsWidget__WEBPACK_IMPORTED_MODULE_9__["default"]),
/* harmony export */   TopCategoriesWidget: () => (/* reexport safe */ _TopCategoriesWidget__WEBPACK_IMPORTED_MODULE_26__["default"]),
/* harmony export */   TopCitiesDrivingAddToCartWidget: () => (/* reexport safe */ _TopCitiesDrivingAddToCartWidget__WEBPACK_IMPORTED_MODULE_12__["default"]),
/* harmony export */   TopCitiesDrivingLeadsWidget: () => (/* reexport safe */ _TopCitiesDrivingLeadsWidget__WEBPACK_IMPORTED_MODULE_11__["default"]),
/* harmony export */   TopCitiesDrivingPurchasesWidget: () => (/* reexport safe */ _TopCitiesDrivingPurchasesWidget__WEBPACK_IMPORTED_MODULE_13__["default"]),
/* harmony export */   TopCitiesWidget: () => (/* reexport safe */ _TopCitiesWidget__WEBPACK_IMPORTED_MODULE_10__["default"]),
/* harmony export */   TopConvertingTrafficSourceWidget: () => (/* reexport safe */ _TopConvertingTrafficSourceWidget__WEBPACK_IMPORTED_MODULE_19__["default"]),
/* harmony export */   TopCountriesWidget: () => (/* reexport safe */ _TopCountriesWidget__WEBPACK_IMPORTED_MODULE_15__["default"]),
/* harmony export */   TopDeviceDrivingPurchasesWidget: () => (/* reexport safe */ _TopDeviceDrivingPurchasesWidget__WEBPACK_IMPORTED_MODULE_14__["default"]),
/* harmony export */   TopPagesDrivingLeadsWidget: () => (/* reexport safe */ _TopPagesDrivingLeadsWidget__WEBPACK_IMPORTED_MODULE_27__["default"]),
/* harmony export */   TopRecentTrendingPagesWidget: () => (/* reexport safe */ _TopRecentTrendingPagesWidget__WEBPACK_IMPORTED_MODULE_25__["default"]),
/* harmony export */   TopReturningVisitorPages: () => (/* reexport safe */ _TopReturningVisitorPages__WEBPACK_IMPORTED_MODULE_23__["default"]),
/* harmony export */   TopTrafficSourceDrivingAddToCartWidget: () => (/* reexport safe */ _TopTrafficSourceDrivingAddToCartWidget__WEBPACK_IMPORTED_MODULE_17__["default"]),
/* harmony export */   TopTrafficSourceDrivingLeadsWidget: () => (/* reexport safe */ _TopTrafficSourceDrivingLeadsWidget__WEBPACK_IMPORTED_MODULE_18__["default"]),
/* harmony export */   TopTrafficSourceDrivingPurchasesWidget: () => (/* reexport safe */ _TopTrafficSourceDrivingPurchasesWidget__WEBPACK_IMPORTED_MODULE_20__["default"]),
/* harmony export */   TopTrafficSourceWidget: () => (/* reexport safe */ _TopTrafficSourceWidget__WEBPACK_IMPORTED_MODULE_16__["default"]),
/* harmony export */   VisitLengthWidget: () => (/* reexport safe */ _VisitLengthWidget__WEBPACK_IMPORTED_MODULE_22__["default"]),
/* harmony export */   VisitsPerVisitorWidget: () => (/* reexport safe */ _VisitsPerVisitorWidget__WEBPACK_IMPORTED_MODULE_24__["default"])
/* harmony export */ });
/* harmony import */ var _ConnectGA4CTATileWidget__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConnectGA4CTATileWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTATileWidget.js");
/* harmony import */ var _ConnectGA4CTAWidget__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ConnectGA4CTAWidget */ "./js/modules/analytics-4/components/widgets/ConnectGA4CTAWidget.js");
/* harmony import */ var _ConversionReportingNotificationCTAWidget__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ConversionReportingNotificationCTAWidget */ "./js/modules/analytics-4/components/widgets/ConversionReportingNotificationCTAWidget.js");
/* harmony import */ var _EngagedTrafficSourceWidget__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./EngagedTrafficSourceWidget */ "./js/modules/analytics-4/components/widgets/EngagedTrafficSourceWidget.js");
/* harmony import */ var _LeastEngagingPagesWidget__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./LeastEngagingPagesWidget */ "./js/modules/analytics-4/components/widgets/LeastEngagingPagesWidget.js");
/* harmony import */ var _MostEngagingPagesWidget__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./MostEngagingPagesWidget */ "./js/modules/analytics-4/components/widgets/MostEngagingPagesWidget.js");
/* harmony import */ var _NewVisitorsWidget__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./NewVisitorsWidget */ "./js/modules/analytics-4/components/widgets/NewVisitorsWidget.js");
/* harmony import */ var _PopularContentWidget__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./PopularContentWidget */ "./js/modules/analytics-4/components/widgets/PopularContentWidget.js");
/* harmony import */ var _PopularProductsWidget__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./PopularProductsWidget */ "./js/modules/analytics-4/components/widgets/PopularProductsWidget.js");
/* harmony import */ var _ReturningVisitorsWidget__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ReturningVisitorsWidget */ "./js/modules/analytics-4/components/widgets/ReturningVisitorsWidget.js");
/* harmony import */ var _TopCitiesWidget__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./TopCitiesWidget */ "./js/modules/analytics-4/components/widgets/TopCitiesWidget.js");
/* harmony import */ var _TopCitiesDrivingLeadsWidget__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./TopCitiesDrivingLeadsWidget */ "./js/modules/analytics-4/components/widgets/TopCitiesDrivingLeadsWidget.js");
/* harmony import */ var _TopCitiesDrivingAddToCartWidget__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./TopCitiesDrivingAddToCartWidget */ "./js/modules/analytics-4/components/widgets/TopCitiesDrivingAddToCartWidget.js");
/* harmony import */ var _TopCitiesDrivingPurchasesWidget__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./TopCitiesDrivingPurchasesWidget */ "./js/modules/analytics-4/components/widgets/TopCitiesDrivingPurchasesWidget.js");
/* harmony import */ var _TopDeviceDrivingPurchasesWidget__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./TopDeviceDrivingPurchasesWidget */ "./js/modules/analytics-4/components/widgets/TopDeviceDrivingPurchasesWidget.js");
/* harmony import */ var _TopCountriesWidget__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./TopCountriesWidget */ "./js/modules/analytics-4/components/widgets/TopCountriesWidget.js");
/* harmony import */ var _TopTrafficSourceWidget__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./TopTrafficSourceWidget */ "./js/modules/analytics-4/components/widgets/TopTrafficSourceWidget.js");
/* harmony import */ var _TopTrafficSourceDrivingAddToCartWidget__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./TopTrafficSourceDrivingAddToCartWidget */ "./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingAddToCartWidget.js");
/* harmony import */ var _TopTrafficSourceDrivingLeadsWidget__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./TopTrafficSourceDrivingLeadsWidget */ "./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingLeadsWidget.js");
/* harmony import */ var _TopConvertingTrafficSourceWidget__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./TopConvertingTrafficSourceWidget */ "./js/modules/analytics-4/components/widgets/TopConvertingTrafficSourceWidget.js");
/* harmony import */ var _TopTrafficSourceDrivingPurchasesWidget__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./TopTrafficSourceDrivingPurchasesWidget */ "./js/modules/analytics-4/components/widgets/TopTrafficSourceDrivingPurchasesWidget.js");
/* harmony import */ var _PagesPerVisitWidget__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./PagesPerVisitWidget */ "./js/modules/analytics-4/components/widgets/PagesPerVisitWidget.js");
/* harmony import */ var _VisitLengthWidget__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./VisitLengthWidget */ "./js/modules/analytics-4/components/widgets/VisitLengthWidget.js");
/* harmony import */ var _TopReturningVisitorPages__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./TopReturningVisitorPages */ "./js/modules/analytics-4/components/widgets/TopReturningVisitorPages.js");
/* harmony import */ var _VisitsPerVisitorWidget__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./VisitsPerVisitorWidget */ "./js/modules/analytics-4/components/widgets/VisitsPerVisitorWidget.js");
/* harmony import */ var _TopRecentTrendingPagesWidget__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./TopRecentTrendingPagesWidget */ "./js/modules/analytics-4/components/widgets/TopRecentTrendingPagesWidget.js");
/* harmony import */ var _TopCategoriesWidget__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./TopCategoriesWidget */ "./js/modules/analytics-4/components/widgets/TopCategoriesWidget.js");
/* harmony import */ var _TopPagesDrivingLeadsWidget__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./TopPagesDrivingLeadsWidget */ "./js/modules/analytics-4/components/widgets/TopPagesDrivingLeadsWidget.js");
/* harmony import */ var _PopularAuthorsWidget__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./PopularAuthorsWidget */ "./js/modules/analytics-4/components/widgets/PopularAuthorsWidget.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/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 */   ANALYTICS_SETUP_ERROR: () => (/* binding */ ANALYTICS_SETUP_ERROR),
/* 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';
const ANALYTICS_SETUP_ERROR = 'analytics-4-setup-error';

/**
 * 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/data-requirements/index.js"
/*!***********************************************************!*\
  !*** ./js/modules/analytics-4/data-requirements/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 */   requireAudienceSegmentationSetupCompleted: () => (/* binding */ requireAudienceSegmentationSetupCompleted),
/* harmony export */   requireAudienceSegmentationSetupCompletedByUser: () => (/* binding */ requireAudienceSegmentationSetupCompletedByUser),
/* harmony export */   requireDataIsAvailableOnLoad: () => (/* binding */ requireDataIsAvailableOnLoad),
/* harmony export */   requireEnhancedMeasurementEnabled: () => (/* binding */ requireEnhancedMeasurementEnabled),
/* harmony export */   requireMismatchedGoogleTag: () => (/* binding */ requireMismatchedGoogleTag),
/* harmony export */   requireWebDataStreamUnavailable: () => (/* binding */ requireWebDataStreamUnavailable)
/* 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.ts");
/**
 * 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 a function that checks if data is available on load.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): boolean} Whether data is available on load or not.
 */
function requireDataIsAvailableOnLoad() {
  return ({
    select
  }) => true === select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).isDataAvailableOnLoad();
}

/**
 * Returns a function that checks if audience segmentation setup is completed.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} Whether setup is completed or not.
 */
function requireAudienceSegmentationSetupCompleted() {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getAudienceSettings();
    return !!select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getAudienceSegmentationSetupCompletedBy();
  };
}

/**
 * Returns a function that checks if audience segmentation setup was completed by the current user.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} Whether setup was completed by the current user or not.
 */
function requireAudienceSegmentationSetupCompletedByUser() {
  return async ({
    select,
    resolveSelect
  }) => {
    await Promise.all([
    // The getAudienceSegmentationSetupCompletedBy() selector relies
    // on the resolution of the getAudienceSettings() resolver.
    resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getAudienceSettings(),
    // The getID() selector relies on the resolution
    // of the getUser() resolver.
    resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getUser()]);
    const userID = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getID();
    const setupCompletedBy = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getAudienceSegmentationSetupCompletedBy();
    return setupCompletedBy === userID;
  };
}

/**
 * Returns a function that checks if the connected web datastream is not available.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} `true` if the connected web datastream is not available, otherwise `false`.
 */
function requireWebDataStreamUnavailable() {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getModuleData();
    return true === select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).isWebDataStreamUnavailable();
  };
}

/**
 * Returns a function that checks if the connected Google tag ID is mismatched.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} Whether the connected Google tag is mismatched or not.
 */
function requireMismatchedGoogleTag() {
  return async ({
    select,
    resolveSelect
  }) => {
    await resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getModuleData();
    return true === select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).hasMismatchedGoogleTagID();
  };
}

/**
 * Returns a function that checks if enhanced measurement is enabled for the connected web datastream.
 *
 * @since 1.166.0
 *
 * @return {function(WPDataRegistry): Promise<boolean>} Whether enhanced measurement is enabled or not.
 */
function requireEnhancedMeasurementEnabled() {
  return async ({
    select,
    resolveSelect
  }) => {
    const {
      isEnhancedMeasurementStreamEnabled,
      getSettings
    } = resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4);
    const {
      getPropertyID,
      getWebDataStreamID
    } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4);
    await getSettings();
    return true === (await isEnhancedMeasurementStreamEnabled(getPropertyID(), getWebDataStreamID()));
  };
}

/***/ },

/***/ "./js/modules/analytics-4/datastore/accounts.js"
/*!******************************************************!*\
  !*** ./js/modules/analytics-4/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 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 _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.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");
/* harmony import */ var _js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils_account__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/account */ "./js/modules/analytics-4/utils/account.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util_case_insensitive_sort__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/case-insensitive-sort */ "./js/util/case-insensitive-sort.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` 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.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */











const {
  setErrorForAction,
  clearActionError,
  clearSelectorErrors,
  clearActionErrors
} = _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__.actions;
const fetchGetAccountSummariesStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'getAccountSummaries',
  controlCallback({
    pageToken
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ANALYTICS_4, 'account-summaries', {
      pageToken
    }, {
      useCache: false
    });
  },
  argsToParams: pageToken => {
    return {
      pageToken
    };
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, response) => {
    state.accountSummaries = [...(state.accountSummaries || []), ...(0,_js_modules_analytics_4_utils_account__WEBPACK_IMPORTED_MODULE_9__.populateAccountSummaries)(response.accountSummaries || [])];
  })
});
const fetchCreateAccountStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'createAccount',
  controlCallback: ({
    data
  }) => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ANALYTICS_4, 'create-account-ticket', data);
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)(
  // eslint-disable-next-line sitekit/acronym-case
  (state, {
    accountTicketId: accountTicketID
  }) => {
    state.accountTicketID = accountTicketID;
  }),
  argsToParams: data => {
    return {
      data
    };
  },
  validateParams: ({
    data
  } = {}) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(data), 'data must be an object.');
  },
  isAction: true
});

// Actions.
const START_SELECTING_ACCOUNT = 'START_SELECTING_ACCOUNT';
const FINISH_SELECTING_ACCOUNT = 'FINISH_SELECTING_ACCOUNT';
const RESET_ACCOUNT_SUMMARIES = 'RESET_ACCOUNT_SUMMARIES';
const RESET_ACCOUNT_SETTINGS = 'RESET_ACCOUNT_SETTINGS';
const SORT_ACCOUNT_SUMMARIES = 'SORT_ACCOUNT_SUMMARIES';
const baseInitialState = {
  accountSummaries: undefined,
  accountTicketID: undefined,
  finishedSelectingAccount: undefined
};
const baseActions = {
  /**
   * Resets the account summaries.
   *
   * @since 1.118.0
   *
   * @return {Object} Redux-style action.
   */
  *resetAccountSummaries() {
    const {
      dispatch
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    yield {
      payload: {},
      type: RESET_ACCOUNT_SUMMARIES
    };
    return dispatch(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).invalidateResolutionForStoreSelector('getAccountSummaries');
  },
  /**
   * Resets the account settings.
   *
   * @since 1.138.0
   *
   * @return {Object} Redux-style action.
   */
  resetAccountSettings() {
    return {
      payload: {},
      type: RESET_ACCOUNT_SETTINGS
    };
  },
  /**
   * Creates a new Analytics (GA4) account.
   *
   * @since 1.98.0
   * @since 1.165.0 Add `showProgress` option.
   *
   * @param {Object}  [options={}]                 Optional options object.
   * @param {boolean} [options.showProgress=false] Whether to show the progress indicator.
   * @return {Object} Object with `response` and `error`.
   */
  *createAccount({
    showProgress = false
  } = {}) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const {
      getValue
    } = registry.select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_FORMS);
    const data = {
      displayName: getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'accountName'),
      propertyName: getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'propertyName'),
      dataStreamName: getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'dataStreamName'),
      timezone: getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'timezone'),
      regionCode: getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'countryCode'),
      enhancedMeasurementStreamEnabled: getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, _constants__WEBPACK_IMPORTED_MODULE_12__.ENHANCED_MEASUREMENT_ENABLED),
      showProgress
    };
    yield clearActionError('createAccount', []);
    const {
      response,
      error
    } = yield fetchCreateAccountStore.actions.fetchCreateAccount(data);
    if (error) {
      yield setErrorForAction(error, 'createAccount', []);
    }
    return {
      response,
      error
    };
  },
  /**
   * Sets the given account in the store.
   *
   * @since 1.119.0
   *
   * @param {string} accountID Analytics account ID.
   * @return {Object} A generator function.
   */
  selectAccount: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__.createValidatedAction)(accountID => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_10__.isValidAccountSelection)(accountID), 'A valid accountID is required to select.');
  }, function* (accountID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const finishSelectingAccountAction = {
      type: FINISH_SELECTING_ACCOUNT,
      payload: {}
    };
    yield {
      type: START_SELECTING_ACCOUNT,
      payload: {}
    };
    yield clearSelectorErrors();
    yield clearActionErrors();
    registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).setSettings({
      accountID,
      propertyID: '',
      webDataStreamID: ''
    });
    if (_constants__WEBPACK_IMPORTED_MODULE_12__.ACCOUNT_CREATE === accountID) {
      yield finishSelectingAccountAction;
      return;
    }
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).matchAndSelectProperty(accountID, _constants__WEBPACK_IMPORTED_MODULE_12__.PROPERTY_CREATE));
    yield finishSelectingAccountAction;
  }),
  /**
   * Finds a matching account summary.
   *
   * @since 1.118.0
   *
   * @return {Object|null} Matching account summary on success, otherwise NULL.
   */
  *findMatchedAccount() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const matchedProperty = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).findMatchedProperty());
    if (!matchedProperty) {
      return null;
    }
    const accountSummaries = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getAccountSummaries());
    const matchedAccount = accountSummaries.find(account => account.propertySummaries.some(({
      _id
    }) => _id === matchedProperty._id));
    return matchedAccount || null;
  },
  /**
   * Sorts account summaries.
   *
   * @since 1.147.0
   *
   * @return {Object} Redux-style action.
   */
  sortAccountSummaries() {
    return {
      type: SORT_ACCOUNT_SUMMARIES
    };
  }
};
const baseControls = {};

/**
 * Creates immer reducer.
 */
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, {
  type
}) => {
  switch (type) {
    case START_SELECTING_ACCOUNT:
      state.finishedSelectingAccount = false;
      break;
    case FINISH_SELECTING_ACCOUNT:
      state.finishedSelectingAccount = true;
      break;
    case RESET_ACCOUNT_SUMMARIES:
      state.accountSummaries = undefined;
      break;
    case RESET_ACCOUNT_SETTINGS:
      state.settings.accountID = undefined;
      state.settings.propertyID = undefined;
      state.settings.measurementID = undefined;
      state.settings.webDataStreamID = undefined;
      break;
    case SORT_ACCOUNT_SUMMARIES:
      if (!state.accountSummaries?.length) {
        return;
      }
      state.accountSummaries = (0,_js_util_case_insensitive_sort__WEBPACK_IMPORTED_MODULE_11__.caseInsensitiveListSort)(state.accountSummaries, 'displayName');
  }
});
const baseResolvers = {
  *getAccountSummaries() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    let nextPageToken = '';
    const summaries = registry.select(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getAccountSummaries();

    // Fetch initial account summaries if they are undefined.
    if (summaries === undefined) {
      do {
        const {
          error,
          response
        } = yield fetchGetAccountSummariesStore.actions.fetchGetAccountSummaries(nextPageToken);
        nextPageToken = response?.nextPageToken || '';
        if (error) {
          break;
        }
      } while (nextPageToken);
    }
    yield baseActions.sortAccountSummaries();
  }
};
const baseSelectors = {
  /**
   * Gets account summaries.
   *
   * @since 1.32.0
   *
   * @param {Object} state Data store's state.
   * @return {Array.<Object>} Account summaries array.
   */
  getAccountSummaries(state) {
    return state.accountSummaries;
  },
  /**
   * Indicates whether account creation is currently in progress.
   *
   * @since 1.98.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean} True if an account is being created, false otherwise.
   */
  isDoingCreateAccount(state) {
    // Since isFetchingCreateAccount (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.isFetchingCreateAccount).some(Boolean);
  },
  /**
   * Get the terms of service URL.
   *
   * @since 1.98.0
   *
   * @param {Object} state Data store's state.
   * @return {(string|undefined)} The terms of service URL.
   */
  getAccountTicketTermsOfServiceURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => state => {
    const {
      accountTicketID
    } = state;
    if (accountTicketID === undefined) {
      return undefined;
    }
    const termsOfServiceURL = select(_constants__WEBPACK_IMPORTED_MODULE_12__.MODULES_ANALYTICS_4).getServiceURL({
      path: `/termsofservice/${accountTicketID}`,
      query: {
        provisioningSignup: 'false'
      }
    });
    if (!termsOfServiceURL) {
      return undefined;
    }
    return termsOfServiceURL;
  }),
  /**
   * Whether or not the account create form is valid to submit.
   *
   * @since 1.98.0
   * @private
   *
   * @return {boolean} True if valid, otherwise false.
   */
  canSubmitAccountCreate: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
    const {
      getValue
    } = select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_FORMS);
    if (!getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'accountName')) {
      return false;
    }
    if (!getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'propertyName')) {
      return false;
    }
    if (!getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'dataStreamName')) {
      return false;
    }
    if (!getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'timezone')) {
      return false;
    }
    if (!getValue(_constants__WEBPACK_IMPORTED_MODULE_12__.FORM_ACCOUNT_CREATE, 'countryCode')) {
      return false;
    }
    return true;
  }),
  /**
   * Determines whether the account selection process has finished or not.
   *
   * @since 1.119.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean|undefined} Initially undefined, TRUE if the account selection process has finished, otherwise FALSE.
   */
  hasFinishedSelectingAccount(state) {
    return state.finishedSelectingAccount;
  }
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.combineStores)(fetchGetAccountSummariesStore, fetchCreateAccountStore, {
  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/analytics-4/datastore/audience-settings.js"
/*!***************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/audience-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 */   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 _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/data/create-error-store */ "./js/googlesitekit/data/create-error-store.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");
/* harmony import */ var _js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.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_negate__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/negate */ "./js/util/negate.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: audience settings.
 *
 * 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 {
  setErrorForAction,
  clearActionError
} = _js_googlesitekit_data_create_error_store__WEBPACK_IMPORTED_MODULE_4__.actions;

/**
 * Validates audience settings.
 *
 * @since 1.148.0
 *
 * @param {Object} audienceSettings Audience settings to validate.
 * @return {void}
 */
function validateAudienceSettings(audienceSettings) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(audienceSettings), 'audienceSettings should be an object.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(audienceSettings.availableAudiences), 'availableAudiences should be an array.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(typeof audienceSettings.audienceSegmentationSetupCompletedBy === 'number', 'audienceSegmentationSetupCompletedBy should be an integer.');
}
const fetchStoreReducerCallback = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, settings) => {
  state.audienceSettings = settings;
});
const fetchGetAudienceSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'getAudienceSettings',
  controlCallback() {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'audience-settings', {}, {
      useCache: false
    });
  },
  reducerCallback: fetchStoreReducerCallback
});
const fetchSaveAudienceSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'saveAudienceSettings',
  controlCallback: settings => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'save-audience-settings', {
    settings
  }),
  reducerCallback: fetchStoreReducerCallback,
  argsToParams: settings => settings,
  validateParams: validateAudienceSettings,
  isAction: true
});
const fetchSyncAvailableAudiencesStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'syncAvailableAudiences',
  controlCallback: () => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'sync-audiences'),
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, audiences) => {
    if (!state.audienceSettings) {
      state.audienceSettings = {};
    }
    state.audienceSettings.availableAudiences = audiences;
  }),
  isAction: true
});

// Actions
const SET_AVAILABLE_AUDIENCES = 'SET_AVAILABLE_AUDIENCES';
const SET_AUDIENCE_SEGMENTATION_SETUP_COMPLETED_BY = 'SET_AUDIENCE_SEGMENTATION_SETUP_COMPLETED_BY';
const baseInitialState = {
  audienceSettings: undefined
};
const baseActions = {
  /**
   * Sets the available audiences.
   *
   * @since 1.148.0
   *
   * @param {Array} availableAudiences Available audience resource names.
   * @return {Object} Redux-style action.
   */
  setAvailableAudiences(availableAudiences) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(availableAudiences), 'Available audiences should be an array.');
    return {
      type: SET_AVAILABLE_AUDIENCES,
      payload: {
        availableAudiences
      }
    };
  },
  /**
   * Sets the user who set up Audience Segmentation.
   *
   * @since 1.148.0
   *
   * @param {number} audienceSegmentationSetupCompletedBy ID for the user who set up Audience Segmentation.
   * @return {Object} Redux-style action.
   */
  setAudienceSegmentationSetupCompletedBy(audienceSegmentationSetupCompletedBy) {
    // Should be an integer.
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(typeof audienceSegmentationSetupCompletedBy === 'number', 'audienceSegmentationSetupCompletedBy by should be an integer.');
    return {
      type: SET_AUDIENCE_SEGMENTATION_SETUP_COMPLETED_BY,
      payload: {
        audienceSegmentationSetupCompletedBy
      }
    };
  },
  /**
   * Saves the audience settings.
   *
   * @since 1.148.0
   *
   * @param {Object} settings Audience settings to save.
   * @return {Object} Object with `response` and `error`.
   */
  saveAudienceSettings: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__.createValidatedAction)(settings => {
    validateAudienceSettings(settings);
  }, function* (settings) {
    yield clearActionError('saveAudienceSettings', []);
    const {
      response,
      error
    } = yield fetchSaveAudienceSettingsStore.actions.fetchSaveAudienceSettings(settings);
    if (error) {
      yield setErrorForAction(error, 'saveAudienceSettings', []);
    }
    return {
      response,
      error
    };
  })
};
const baseResolvers = {
  *getAudienceSettings() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const {
      select
    } = registry;
    const audienceSettings = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudienceSettings();
    if (audienceSettings === undefined) {
      yield fetchGetAudienceSettingsStore.actions.fetchGetAudienceSettings();
    }
  },
  *getOrSyncAvailableAudiences() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const audiences = registry.select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAvailableAudiences();
    if (audiences === null) {
      registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).syncAvailableAudiences();
    }
  }
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, {
  type,
  payload
}) => {
  switch (type) {
    case SET_AVAILABLE_AUDIENCES:
      const {
        availableAudiences
      } = payload;
      state.audienceSettings = {
        ...state.audienceSettings,
        availableAudiences
      };
      break;
    case SET_AUDIENCE_SEGMENTATION_SETUP_COMPLETED_BY:
      const {
        audienceSegmentationSetupCompletedBy
      } = payload;
      state.audienceSettings = {
        ...state.audienceSettings,
        audienceSegmentationSetupCompletedBy
      };
      break;
    default:
      break;
  }
});
const baseSelectors = {
  /**
   * Gets the available audiences.
   *
   * @since 1.148.0
   *
   * @param {Object} state Data store's state.
   * @return {(Array|null|undefined)} Available audiences, `null` if not set, or `undefined` if not loaded.
   */
  getAvailableAudiences: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
    const audienceSettings = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudienceSettings() || {};
    return audienceSettings.availableAudiences;
  }),
  /**
   * Gets the available audiences.
   *
   * @since 1.152.0
   *
   * @param {Object} state Data store's state.
   * @return {(Array|null|undefined)} Available audiences, `null` if not set, or `undefined` if not loaded.
   */
  getOrSyncAvailableAudiences: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
    return select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAvailableAudiences();
  }),
  /**
   * Gets the audience settings.
   *
   * @since 1.151.0
   *
   * @param {Object} state Data store's state.
   * @return {Object|undefined} Audience settings, or `undefined` if not loaded.
   */
  getAudienceSettings(state) {
    return state.audienceSettings;
  },
  /**
   * Gets the last time the available audiences were synced.
   *
   * @since 1.151.0
   *
   * @param {Object} state Data store's state.
   * @return {(number|undefined)} Last time the available audiences were synced, or `undefined` if not loaded.
   */
  getAvailableAudiencesLastSyncedAt: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
    const audienceSettings = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudienceSettings() || {};
    return audienceSettings.availableAudiencesLastSyncedAt;
  }),
  /**
   * Gets the user who set up Audience Segmentation.
   *
   * @since 1.151.0
   *
   * @param {Object} state Data store's state.
   * @return {(number|null|undefined)} ID for the user who set up Audience Segmentation, `null` if not set, or `undefined` if not loaded.
   */
  getAudienceSegmentationSetupCompletedBy: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
    const audienceSettings = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudienceSettings() || {};
    return audienceSettings.audienceSegmentationSetupCompletedBy;
  }),
  /**
   * Checks if audience segmentation has been set up.
   *
   * @since 1.180.0
   *
   * @param {Object} state Data store's state.
   * @return {(boolean|undefined)} `true` if audience segmentation has been setup, otherwise `false`.
   */
  isAudienceSegmentationSetupCompleted: state => (0,_js_util_negate__WEBPACK_IMPORTED_MODULE_8__.negateDefined)((0,_js_util_negate__WEBPACK_IMPORTED_MODULE_8__.negateDefined)(baseSelectors.getAudienceSegmentationSetupCompletedBy(state)))
};
const store = (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__.combineStores)(fetchGetAudienceSettingsStore, fetchSaveAudienceSettingsStore, fetchSyncAvailableAudiencesStore, {
  initialState: baseInitialState,
  actions: baseActions,
  resolvers: baseResolvers,
  selectors: baseSelectors,
  reducer: baseReducer
});
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/analytics-4/datastore/audiences.js"
/*!*******************************************************!*\
  !*** ./js/modules/analytics-4/datastore/audiences.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 */   baseInitialState: () => (/* binding */ baseInitialState),
/* 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 _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.js");
/* harmony import */ var _js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.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_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_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: audiences.
 *
 * 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
 */










const MAX_INITIAL_AUDIENCES = 2;
const START_AUDIENCES_SETUP = 'START_AUDIENCES_SETUP';
const FINISH_AUDIENCES_SETUP = 'FINISH_AUDIENCES_SETUP';
const START_MAYBE_SYNC_AUDIENCES = 'START_MAYBE_SYNC_AUDIENCES';
const FINISH_MAYBE_SYNC_AUDIENCES = 'FINISH_MAYBE_SYNC_AUDIENCES';
/**
 * Retrieves user counts for the provided audiences, filters to those with data over the given date range,
 * sorts them by total users, and returns the audienceResourceNames in that order.
 *
 * @since 1.128.0
 *
 * @param {Object} registry  Registry object.
 * @param {Array}  audiences Array of available audiences.
 * @param {string} startDate Start date for the report.
 * @param {string} endDate   End date for the report.
 * @return {Object} Object with audienceResourceNames array and error if any.
 */
async function getNonZeroDataAudiencesSortedByTotalUsers(registry, audiences, startDate, endDate) {
  const {
    select,
    resolveSelect
  } = registry;
  const reportOptions = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudiencesUserCountReportOptions(audiences, {
    startDate,
    endDate
  });
  const report = await resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getReport(reportOptions);
  const error = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]);
  if (error) {
    return {
      error
    };
  }
  const sortedRows = [...(report.rows || [])].sort((rowA, rowB) => (rowB.metricValues?.[0]?.value || 0) - (
  // `value` is `totalUsers`.
  rowA.metricValues?.[0]?.value || 0));

  // Rows without data shouldn't actually be returned in the report, but to be safe, filter them out if present.
  const rowsWithData = sortedRows.filter(({
    metricValues
  }) => metricValues?.[0]?.value > 0);
  return {
    audienceResourceNames: rowsWithData.map(({
      dimensionValues
    }) => dimensionValues?.[0]?.value // `value` is `audienceResourceName`.
    )
  };
}
const fetchCreateAudienceStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_2__.createFetchStore)({
  baseName: 'createAudience',
  controlCallback: ({
    audience
  }) => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_0__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4, 'create-audience', {
    audience
  }),
  argsToParams: audience => ({
    audience
  }),
  validateParams: ({
    audience
  }) => {
    (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.validateAudience)(audience);
  },
  isAction: true
});

/**
 * Retrieves the initial set of selected audiences from the existing audiences.
 *
 * @since 1.148.0
 *
 * @param {Object} registry Registry object.
 * @return {Object} Object with `configuredAudiences` or `error`.
 */
async function getConfiguredAudiencesFromExistingAudiences(registry) {
  const {
    resolveSelect,
    select
  } = registry;
  const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
  const {
    error,
    configuredAudiences
  } = await getInitialConfiguredAudiences(registry, availableAudiences);
  if (error) {
    return {
      error
    };
  }
  if (configuredAudiences.length === 1) {
    // Add 'Purchasers' audience if it has data.
    const purchasersAudience = availableAudiences.find(({
      audienceSlug
    }) => audienceSlug === 'purchasers');
    if (purchasersAudience) {
      const purchasersResourceDataAvailabilityDate = await resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(purchasersAudience.name, _constants__WEBPACK_IMPORTED_MODULE_9__.RESOURCE_TYPE_AUDIENCE);
      if (purchasersResourceDataAvailabilityDate) {
        configuredAudiences.push(purchasersAudience.name);
      }
    }
  }
  return {
    configuredAudiences
  };
}

/**
 * Retrives the initial set of audiences for selection.
 *
 * @since 1.136.0
 * @since 1.148.0 Extracted to a helper function. Renamed from `retrieveInitialAudienceSelection` to `getInitialConfiguredAudiences`.
 *
 * @param {Object} registry           Registry object.
 * @param {Array}  availableAudiences List of available audiences.
 * @return {Object} Object with properties `configuredAudiences` or `error`.
 */
async function getInitialConfiguredAudiences(registry, availableAudiences) {
  const {
    select
  } = registry;
  const configuredAudiences = [];
  const userAudiences = availableAudiences.filter(({
    audienceType
  }) => audienceType === 'USER_AUDIENCE');
  if (userAudiences.length > 0) {
    // If there are user audiences, filter and sort them by total users over the last 90 days,
    // and add the top two (MAX_INITIAL_AUDIENCES) which have users to the configured audiences.

    const endDate = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getReferenceDate();
    const startDate = (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.getPreviousDate)(endDate, 90);
    const {
      audienceResourceNames,
      error
    } = await getNonZeroDataAudiencesSortedByTotalUsers(registry, userAudiences, startDate, endDate);
    if (error) {
      return {
        error
      };
    }
    configuredAudiences.push(...audienceResourceNames.slice(0, MAX_INITIAL_AUDIENCES));
  }
  if (configuredAudiences.length < MAX_INITIAL_AUDIENCES) {
    // If there are less than two (MAX_INITIAL_AUDIENCES) configured user audiences, add the Site Kit-created audiences
    // if they exist, up to the limit of two.

    const siteKitAudiences = availableAudiences.filter(({
      audienceType
    }) => audienceType === 'SITE_KIT_AUDIENCE');

    // Audience slugs to sort by:
    const sortedSlugs = ['new-visitors', 'returning-visitors'];
    const sortedSiteKitAudiences = siteKitAudiences.sort((audienceA, audienceB) => {
      const indexA = sortedSlugs.indexOf(audienceA.audienceSlug);
      const indexB = sortedSlugs.indexOf(audienceB.audienceSlug);
      return indexA - indexB;
    });
    const audienceResourceNames = sortedSiteKitAudiences.slice(0, MAX_INITIAL_AUDIENCES - configuredAudiences.length).map(({
      name
    }) => name);
    configuredAudiences.push(...audienceResourceNames);
  }
  return {
    configuredAudiences
  };
}
const baseInitialState = {
  isSettingUpAudiences: false,
  audienceSync: {
    inProgress: false,
    hasSynced: false
  }
};
const baseActions = {
  /**
   * Creates new property audience.
   *
   * @since 1.120.0
   *
   * @param {Object} audience                             The property audience parameters.
   * @param {string} [audience.displayName]               Required. The display name of the Audience.
   * @param {string} [audience.description]               Required. The description of the Audience.
   * @param {number} [audience.membershipDurationDays]    Required. The duration a user should stay in an Audience. Cannot be more than 540 days.
   * @param {Array}  [audience.filterClauses]             Required. Filter clauses array of <AudienceFilterClause> objects that define the Audience.
   * @param {Object} [audience.eventTrigger]              Optional. Specifies an event to log when a user joins the Audience.
   * @param {string} [audience.eventTrigger.eventName]    Required if `eventTrigger` is provided. The event name that will be logged.
   * @param {string} [audience.eventTrigger.logCondition] Required if `eventTrigger` is provided. When to log the event. Acceptable values:
   *                                                      - 'LOG_CONDITION_UNSPECIFIED': Log condition is not specified.
   *                                                      - 'AUDIENCE_JOINED': The event should be logged only when a user is joined.
   *                                                      - 'AUDIENCE_MEMBERSHIP_RENEWED': The event should be logged whenever the Audience condition is met, even if the user is already a member of the Audience.
   * @param {string} [audience.exclusionDurationMode]     Optional. Specifies how long an exclusion lasts for users that meet the exclusion filter. Acceptable values:
   *                                                      - 'AUDIENCE_EXCLUSION_DURATION_MODE_UNSPECIFIED': Not specified.
   *                                                      - 'EXCLUDE_TEMPORARILY': Exclude users from the Audience during periods when they meet the filter clause.
   *                                                      - 'EXCLUDE_PERMANENTLY': Exclude users from the Audience if they've ever met the filter clause.
   * @return {Object} Object with `response` and `error`.
   */
  createAudience: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_3__.createValidatedAction)(_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_6__.validateAudience, function* (audience) {
    const {
      response,
      error
    } = yield fetchCreateAudienceStore.actions.fetchCreateAudience(audience);
    return {
      response,
      error
    };
  }),
  /**
   * Syncs available audiences from the Analytics service.
   *
   * @since 1.126.0
   *
   * @return {Object} Object with `response` and `error`.
   */
  *syncAvailableAudiences() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const {
      select,
      dispatch,
      resolveSelect
    } = registry;
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getAuthentication());
    const isAuthenticated = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isAuthenticated();
    if (!isAuthenticated) {
      const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
      return {
        response: availableAudiences ?? []
      };
    }
    const {
      response: availableAudiences,
      error
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).fetchSyncAvailableAudiences());
    if (error) {
      return {
        response: availableAudiences,
        error
      };
    }

    // Remove any configuredAudiences that are no longer available in availableAudiences.
    const configuredAudiences = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getConfiguredAudiences();
    const newConfiguredAudiences = configuredAudiences?.filter(configuredAudience => availableAudiences?.some(({
      name
    }) => name === configuredAudience));
    if (configuredAudiences && newConfiguredAudiences && newConfiguredAudiences !== configuredAudiences) {
      dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).setConfiguredAudiences(newConfiguredAudiences || []);
    }
    return {
      response: availableAudiences,
      error
    };
  },
  /**
   * Syncs available audiences older than 1 hour.
   *
   * @since 1.132.0
   *
   * @return {void}
   */
  *maybeSyncAvailableAudiences() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const {
      select,
      dispatch,
      resolveSelect
    } = registry;
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getAuthentication());
    const isAuthenticated = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isAuthenticated();
    if (!isAuthenticated) {
      // Unblock the flag so component relying on the value are not incorrectly blocked.
      yield {
        type: FINISH_MAYBE_SYNC_AUDIENCES
      };
      return;
    }
    const isSyncingAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isSyncingAudiences();
    if (isSyncingAudiences) {
      return;
    }
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudienceSettings());
    yield {
      type: START_MAYBE_SYNC_AUDIENCES
    };
    const availableAudiencesLastSyncedAt = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAvailableAudiencesLastSyncedAt();

    // Update the audience cache if the availableAudiencesLastSyncedAt setting is older than 1 hour.
    if (!availableAudiencesLastSyncedAt || availableAudiencesLastSyncedAt * 1000 <
    // eslint-disable-next-line sitekit/no-direct-date
    Date.now() - 1 * 60 * 60 * 1000) {
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).syncAvailableAudiences());
    }
    yield {
      type: FINISH_MAYBE_SYNC_AUDIENCES
    };
  },
  /**
   * Populates the configured audiences with the top two user audiences and/or the Site Kit-created audiences,
   * depending on their availability and suitability (data over the last 90 days is required for user audiences).
   *
   * If no suitable audiences are available, creates the "new-visitors" and "returning-visitors" audiences.
   * If the `googlesitekit_post_type` custom dimension doesn't exist, creates it.
   *
   * @since 1.128.0
   * @since 1.131.0 Added `failedSiteKitAudienceSlugs` parameter to retry failed Site Kit audience creation.
   * @since 1.184.0 Added `isAudienceCreationError` to the return value.
   *
   * @param {Array} failedSiteKitAudienceSlugs List of failed Site Kit audience slugs to retry.
   * @return {Object} Object with `failedSiteKitAudienceSlugs`, `createdSiteKitAudienceSlugs`, `isAudienceCreationError` and `error`.
   */
  *enableAudienceGroup(failedSiteKitAudienceSlugs) {
    yield {
      type: START_AUDIENCES_SETUP
    };
    const response = yield baseActions.enableAudienceGroupMain(failedSiteKitAudienceSlugs);
    yield {
      type: FINISH_AUDIENCES_SETUP
    };
    return response;
  },
  /**
   * Checks if the user needs to grant the Analytics 4 edit scope to create audiences or custom dimensions.
   *
   * @since 1.148.0
   *
   * @return {Object} Object with `needsScope` or `error`.
   */
  *determineNeedForAnalytics4EditScope() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const {
      resolveSelect,
      select
    } = registry;
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAvailableCustomDimensions());
    if (!select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasCustomDimensions('googlesitekit_post_type')) {
      return {
        needsScope: true
      };
    }
    const {
      error,
      configuredAudiences
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(getConfiguredAudiencesFromExistingAudiences(registry));
    if (error) {
      return {
        error
      };
    }
    return {
      needsScope: configuredAudiences.length === 0
    };
  },
  /**
   * This contains the main logic for the `*enableAudienceGroup()` action above.
   *
   * @since 1.136.0
   * @since 1.184.0 Added `isAudienceCreationError` to the return value.
   *
   * @param {Array} failedSiteKitAudienceSlugs List of failed Site Kit audience slugs to retry.
   * @return {Object} Object with `failedSiteKitAudienceSlugs`, `createdSiteKitAudienceSlugs`, `isAudienceCreationError` and `error`.
   */
  *enableAudienceGroupMain(failedSiteKitAudienceSlugs) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const {
      dispatch,
      select,
      resolveSelect
    } = registry;
    const configuredAudiences = [];
    if (!failedSiteKitAudienceSlugs?.length) {
      const {
        error,
        configuredAudiences: audiences
      } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(getConfiguredAudiencesFromExistingAudiences(registry));
      if (error) {
        return {
          error
        };
      }
      configuredAudiences.push(...audiences);
    }
    if (configuredAudiences.length === 0) {
      const requiredAudienceSlugs = ['new-visitors', 'returning-visitors'];
      const audiencesToCreate = failedSiteKitAudienceSlugs?.length ? failedSiteKitAudienceSlugs : requiredAudienceSlugs;

      // If there are no configured audiences by this point, create the "new-visitors" and "returning-visitors" audiences,
      // and add them to the configured audiences.
      const audienceCreationResults = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(Promise.all(audiencesToCreate.map(audienceSlug => {
        return dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).createAudience(_constants__WEBPACK_IMPORTED_MODULE_9__.SITE_KIT_AUDIENCE_DEFINITIONS[audienceSlug]);
      })));
      const failedAudiencesToRetry = [];
      let insufficientPermissionsError = null;
      audienceCreationResults.forEach((result, index) => {
        const audienceSlug = audiencesToCreate[index];
        if (result.error) {
          if ((0,_js_util_errors__WEBPACK_IMPORTED_MODULE_8__.isInsufficientPermissionsError)(result.error)) {
            insufficientPermissionsError = result.error;
          } else {
            failedAudiencesToRetry.push(audienceSlug);
          }
        } else {
          configuredAudiences.push(result.response.name);
        }
      });
      if (insufficientPermissionsError) {
        return {
          error: insufficientPermissionsError,
          isAudienceCreationError: true
        };
      }
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getUserAudienceSettings());
      if (failedAudiencesToRetry.length > 0) {
        return {
          failedSiteKitAudienceSlugs: failedAudiencesToRetry
        };
      }
      const existingConfiguredAudiences = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getConfiguredAudiences() || [];
      configuredAudiences.push(...existingConfiguredAudiences);

      // Resync available audiences to ensure the newly created audiences are available.
      const {
        error,
        response: newAvailableAudiences
      } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).syncAvailableAudiences());
      if (error) {
        return {
          error
        };
      }

      // Find the audience in the newly available audiences that matches the required slug.
      // If a matching audience is found and it's not already in the configured audiences, add it.
      // This is to ensure if one audience was created successfully but the other failed,
      // the successful one is still added on the retry.
      requiredAudienceSlugs.forEach(slug => {
        const matchingAudience = newAvailableAudiences.find(item => item.audienceSlug === slug);
        if (matchingAudience && !configuredAudiences.includes(matchingAudience.name)) {
          configuredAudiences.push(matchingAudience.name);
        }
      });
    }

    // Create custom dimension if it doesn't exist.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAvailableCustomDimensions());
    if (!select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasCustomDimensions('googlesitekit_post_type')) {
      const propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getPropertyID();
      const {
        error
      } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).fetchCreateCustomDimension(propertyID, _constants__WEBPACK_IMPORTED_MODULE_9__.CUSTOM_DIMENSION_DEFINITIONS.googlesitekit_post_type));
      if (error) {
        return {
          error,
          isAudienceCreationError: true
        };
      }

      // If the custom dimension was created successfully, mark it as gathering
      // data immediately so that it doesn't cause unnecessary report requests.
      dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).receiveIsCustomDimensionGatheringData({
        customDimension: 'googlesitekit_post_type',
        gatheringData: true
      });

      // Resync available custom dimensions to ensure the newly created custom dimension is available.
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).fetchSyncAvailableCustomDimensions());
    }
    dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).setConfiguredAudiences(configuredAudiences);
    const {
      error
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).saveUserAudienceSettings());
    if (error) {
      return {
        error
      };
    }

    // Expire new badges for initially configured audiences.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).setExpirableItemTimers(configuredAudiences.map(slug => ({
      slug: `${_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX}${slug}`,
      expiresInSeconds: 1
    }))));
    const userID = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getID();
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).setAudienceSegmentationSetupCompletedBy(userID);
    const audienceSettings = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAudienceSettings();
    const {
      saveSettingsError
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).saveAudienceSettings(audienceSettings));
    if (saveSettingsError) {
      return {
        error: saveSettingsError
      };
    }
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).triggerSurvey('audience_segmentation_setup_completed'));
    return {};
  },
  /**
   * Populates the configured audiences for the secondary user.
   *
   * @since 1.136.0
   *
   * @return {Object} Object with `error`.
   */
  *enableSecondaryUserAudienceGroup() {
    yield {
      type: START_AUDIENCES_SETUP
    };
    const response = yield baseActions.enableSecondaryUserAudienceGroupMain();
    yield {
      type: FINISH_AUDIENCES_SETUP
    };
    return response;
  },
  /**
   * This contains the main logic for the `*enableSecondaryUserAudienceGroup()` action above.
   *
   * @since 1.136.0
   *
   * @return {Object} Object with `error`.
   */
  *enableSecondaryUserAudienceGroupMain() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const {
      dispatch,
      resolveSelect
    } = registry;
    const {
      response: availableAudiences,
      error: syncError
    } = yield baseActions.syncAvailableAudiences();
    if (syncError) {
      return {
        error: syncError
      };
    }
    const {
      error: retrieveInitialAudienceSelectionError,
      configuredAudiences
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(getInitialConfiguredAudiences(registry, availableAudiences));
    if (retrieveInitialAudienceSelectionError) {
      return {
        error: retrieveInitialAudienceSelectionError
      };
    }
    if (configuredAudiences.length < MAX_INITIAL_AUDIENCES) {
      // Add 'Purchasers' audience if it has data.
      const purchasersAudience = availableAudiences.find(({
        audienceSlug
      }) => audienceSlug === 'purchasers');
      if (purchasersAudience) {
        const purchasersResourceDataAvailabilityDate = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(purchasersAudience.name, _constants__WEBPACK_IMPORTED_MODULE_9__.RESOURCE_TYPE_AUDIENCE));
        if (purchasersResourceDataAvailabilityDate) {
          configuredAudiences.push(purchasersAudience.name);
        }
      }
    }
    dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).setConfiguredAudiences(configuredAudiences);
    const {
      error
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).saveUserAudienceSettings());
    if (error) {
      return {
        error
      };
    }
    if (configuredAudiences.length > 0) {
      // Expire new badges for initially configured audiences.
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).setExpirableItemTimers(configuredAudiences.map(slug => ({
        slug: `${_constants__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_ITEM_NEW_BADGE_SLUG_PREFIX}${slug}`,
        expiresInSeconds: 1
      }))));
    }
    return {};
  }
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createReducer)((state, {
  type
}) => {
  switch (type) {
    case START_AUDIENCES_SETUP:
      state.isSettingUpAudiences = true;
      break;
    case START_MAYBE_SYNC_AUDIENCES:
      state.audienceSync = {
        inProgress: true,
        hasSynced: false
      };
      break;
    case FINISH_MAYBE_SYNC_AUDIENCES:
      state.audienceSync = {
        inProgress: false,
        hasSynced: true
      };
      break;
    case FINISH_AUDIENCES_SETUP:
      state.isSettingUpAudiences = false;
      break;
    default:
      break;
  }
});
const baseResolvers = {};
const baseSelectors = {
  /**
   * Checks if the audience group setup is in progress.
   *
   * @since 1.136.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean} True if the audience group setup is in progress, otherwise false.
   */
  isSettingUpAudiences: state => state.isSettingUpAudiences,
  /**
   * Checks if the given audience is a default audience.
   *
   * @since 1.127.0
   *
   * @param {string} audienceResourceName The audience resource name.
   * @param {Object} state                Data store's state.
   * @return {(boolean|undefined)} `true` if the audience is a default audience, `false` if not, `undefined` if not loaded.
   */
  isDefaultAudience: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => (state, audienceResourceName) => {
    const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    if (availableAudiences === undefined) {
      return undefined;
    }
    const audience = availableAudiences.find(({
      name
    }) => name === audienceResourceName);
    return audience?.audienceType === 'DEFAULT_AUDIENCE';
  }),
  /**
   * Checks if the given audience is a Site Kit-created audience.
   *
   * @since 1.127.0
   *
   * @param {string} audienceResourceName The audience resource name.
   * @param {Object} state                Data store's state.
   * @return {(boolean|undefined)} `true` if the audience is a Site Kit-created audience, `false` if not, `undefined` if not loaded.
   */
  isSiteKitAudience: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => (state, audienceResourceName) => {
    const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    if (availableAudiences === undefined) {
      return undefined;
    }
    const audience = availableAudiences.find(({
      name
    }) => name === audienceResourceName);
    return audience?.audienceType === 'SITE_KIT_AUDIENCE';
  }),
  /**
   * Checks if the given audience is a user-defined audience.
   *
   * @since 1.127.0
   *
   * @param {string} audienceResourceName The audience resource name.
   * @param {Object} state                Data store's state.
   * @return {(boolean|undefined)} `true` if the audience is a user-defined audience, `false` if not, `undefined` if not loaded.
   */
  isUserAudience: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => (state, audienceResourceName) => {
    const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    if (availableAudiences === undefined) {
      return undefined;
    }
    const audience = availableAudiences.find(({
      name
    }) => name === audienceResourceName);
    return audience?.audienceType === 'USER_AUDIENCE';
  }),
  /**
   * Checks if the audience is syncing.
   *
   * @since 1.158.0
   *
   * @param {Object} state Data store's state.
   * @return {(boolean)} `true` if the audience is syncing, `false` if not.
   */
  isSyncingAudiences: state => state.audienceSync.inProgress,
  /**
   * Checks if the audience sync has completed.
   *
   * @since 1.158.0
   *
   * @param {Object} state Data store's state.
   * @return {(boolean)} `true` if the audience sync has completed, `false` if not.
   */
  hasSyncedAudiences: state => state.audienceSync.hasSynced,
  /**
   * Checks whether the provided audiences are available.
   *
   * @since 1.127.0
   *
   * @param {Object}               state                 Data store's state.
   * @param {string|Array<string>} audienceResourceNames The audience resource names to check.
   * @return {boolean} True if all provided audiences are available, otherwise false. Undefined if available audiences are not loaded yet.
   */
  hasAudiences: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => (state, audienceResourceNames) => {
    const audiencesToCheck = Array.isArray(audienceResourceNames) ? audienceResourceNames : [audienceResourceNames];
    const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    if (availableAudiences === undefined) {
      return undefined;
    }
    if (availableAudiences === null) {
      return false;
    }
    return audiencesToCheck.every(audienceResourceName => availableAudiences.some(({
      name
    }) => name === audienceResourceName));
  }),
  /**
   * Gets the available configurable audiences.
   *
   * This selector filters out the "Purchasers" audience if it has no data.
   *
   * @since 1.129.0
   *
   * @return {(Array|undefined)} Array of configurable audiences. Undefined if available audiences are not loaded yet.
   */
  getConfigurableAudiences: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
    const {
      getOrSyncAvailableAudiences,
      getResourceDataAvailabilityDate
    } = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4);
    const availableAudiences = getOrSyncAvailableAudiences();
    if (availableAudiences === undefined) {
      return undefined;
    }
    if (!Array.isArray(availableAudiences)) {
      return [];
    }
    return availableAudiences
    // Filter out "Purchasers" audience if it has no data.
    .filter(({
      audienceSlug,
      name
    }) => {
      if ('purchasers' !== audienceSlug) {
        return true;
      }
      return !!getResourceDataAvailabilityDate(name, 'audience');
    });
  }),
  /**
   * Gets the options for the audiences user count report.
   *
   * @since 1.131.0
   *
   * @param {Object} state             Data store's state.
   * @param {Array}  audiences         Array of available audiences.
   * @param {Object} options           Optional. Options to pass to the selector.
   * @param {string} options.startDate Start date for the report.
   * @param {string} options.endDate   End date for the report.
   * @return {Object} Returns the report options for the audiences user count report.
   */
  getAudiencesUserCountReportOptions: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => (state, audiences, {
    startDate,
    endDate
  } = {}) => {
    const dateRangeDates = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates();
    return {
      startDate: startDate || dateRangeDates.startDate,
      endDate: endDate || dateRangeDates.endDate,
      metrics: [{
        name: 'totalUsers'
      }],
      dimensions: [{
        name: 'audienceResourceName'
      }],
      dimensionFilters: {
        audienceResourceName: (audiences || []).map(({
          name
        }) => name)
      },
      reportID: 'audience-segmentation_get-audiences-user-count-report-options_store:selector'
    };
  }),
  /**
   * Gets the error for the audiences user count report.
   *
   * @since 1.131.0
   *
   * @return {(Object|undefined)} Error object if exists, otherwise undefined.
   */
  getAudienceUserCountReportErrors: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
    const {
      getConfigurableAudiences,
      getAudiencesUserCountReportOptions,
      getSiteKitAudiencesUserCountReportOptions,
      getErrorForSelector,
      getConfigurableSiteKitAndOtherAudiences,
      hasAudiencePartialData
    } = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4);
    const configurableAudiences = getConfigurableAudiences();
    if (configurableAudiences === undefined) {
      return undefined;
    }

    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
    const [siteKitAudiences, otherAudiences] = getConfigurableSiteKitAndOtherAudiences();
    const isSiteKitAudiencePartialData = hasAudiencePartialData(siteKitAudiences);
    if (undefined === isSiteKitAudiencePartialData) {
      return undefined;
    }
    const siteKitUserCountReportError = isSiteKitAudiencePartialData ? getErrorForSelector('getReport', [getSiteKitAudiencesUserCountReportOptions()]) : undefined;
    const otherUserCountReportError = isSiteKitAudiencePartialData === false || otherAudiences?.length > 0 ? getErrorForSelector('getReport', [getAudiencesUserCountReportOptions(isSiteKitAudiencePartialData ? otherAudiences : configurableAudiences)]) : undefined;
    return [siteKitUserCountReportError, otherUserCountReportError];
  }),
  /**
   * Gets the report options for the Site Kit audiences user count report.
   *
   * @since 1.134.0
   *
   * @return {Object} Returns the report options for the Site Kit audiences user count report.
   */
  getSiteKitAudiencesUserCountReportOptions: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
    const dateRangeDates = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates();
    return {
      startDate: dateRangeDates.startDate,
      endDate: dateRangeDates.endDate,
      metrics: [{
        name: 'totalUsers'
      }],
      dimensions: [{
        name: 'newVsReturning'
      }]
    };
  }),
  /**
   * Checks if any of the provided audiences are in the partial data state.
   *
   * @since 1.134.0
   *
   * @param {Array} audiences Array of audiences to check.
   * @return {boolean|undefined} True if any of the provided audiences is in partial data state, otherwise false. Undefined if available audiences or any partial data state is not loaded yet.
   */
  hasAudiencePartialData: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => (state, audiences) => {
    if (undefined === audiences) {
      return undefined;
    }
    for (const audience of audiences || []) {
      const isPartialData = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isAudiencePartialData(audience.name);
      if (isPartialData === undefined) {
        return undefined;
      }
      if (isPartialData) {
        return true;
      }
    }
    return false;
  }),
  /**
   * Checks if the provided audience is a Site Kit audience in the partial data state and returns the audience object if so.
   *
   * @since 1.136.0
   *
   * @param {string} audienceResourceName The audience resource name.
   * @return {(Object|null|undefined)} The audience object if the audience is a Site Kit audience in the partial data state, otherwise null. Undefined if available audiences or the partial data state is not loaded yet.
   */
  getPartialDataSiteKitAudience: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => (state, audienceResourceName) => {
    const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    if (availableAudiences === undefined) {
      return undefined;
    }
    const audience = availableAudiences.find(({
      name
    }) => name === audienceResourceName);
    if (audience?.audienceType !== 'SITE_KIT_AUDIENCE') {
      return null;
    }
    const isPartialData = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isAudiencePartialData(audienceResourceName);
    if (isPartialData === undefined) {
      return undefined;
    }
    return isPartialData ? audience : null;
  }),
  /**
   * Gets the configurable Site Kit and other (non Site Kit) audiences.
   *
   * @since 1.134.0
   *
   * @return {Array} Array of Site Kit and other audiences.
   */
  getConfigurableSiteKitAndOtherAudiences: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
    const audiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getConfigurableAudiences();
    if (undefined === audiences) {
      return undefined;
    }
    if (!audiences?.length) {
      return [];
    }
    const [siteKitAudiences, otherAudiences] = audiences.reduce(([siteKit, other], audience) => {
      if (audience.audienceType === 'SITE_KIT_AUDIENCE') {
        siteKit.push(audience);
      } else {
        other.push(audience);
      }
      return [siteKit, other];
    }, [[], []] // Initial values.
    );
    return [siteKitAudiences, otherAudiences];
  }),
  /**
   * Gets the configurable Site Kit and other (non Site Kit) audiences.
   *
   * @since 1.136.0
   *
   * @return {Array} Array of Site Kit and other audiences.
   */
  getConfiguredSiteKitAndOtherAudiences: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
    const configuredAudiences = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getConfiguredAudiences();
    const availableAudiences = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences();
    if (undefined === configuredAudiences || undefined === availableAudiences) {
      return undefined;
    }
    if (!configuredAudiences?.length) {
      return [];
    }
    const [siteKitAudiences, otherAudiences] = configuredAudiences.reduce(([siteKit, other], configuredAudience) => {
      const audience = availableAudiences.find(({
        name
      }) => name === configuredAudience);
      if (audience?.audienceType === 'SITE_KIT_AUDIENCE') {
        siteKit.push(audience);
      } else {
        other.push(audience);
      }
      return [siteKit, other];
    }, [[], []] // Initial values.
    );
    return [siteKitAudiences, otherAudiences];
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.combineStores)(fetchCreateAudienceStore, {
  initialState: baseInitialState,
  actions: baseActions,
  controls: {},
  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/analytics-4/datastore/base.js"
/*!**************************************************!*\
  !*** ./js/modules/analytics-4/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 _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./settings */ "./js/modules/analytics-4/datastore/settings.js");
/**
 * `modules/analytics-4` 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_analytics_4_constants__WEBPACK_IMPORTED_MODULE_1__.MODULE_SLUG_ANALYTICS_4, {
  ownedSettingsSlugs: ['accountID', 'propertyID', 'webDataStreamID', 'measurementID', 'googleTagID', 'googleTagAccountID', 'googleTagContainerID'],
  storeName: _constants__WEBPACK_IMPORTED_MODULE_3__.MODULES_ANALYTICS_4,
  settingSlugs: ['accountID', 'adSenseLinked', 'adSenseLinkedLastSyncedAt', 'propertyID', 'webDataStreamID', 'measurementID', 'useSnippet', 'ownerID', 'googleTagID', 'googleTagAccountID', 'googleTagContainerID', 'googleTagContainerDestinationIDs', 'googleTagLastSyncedAtMs', 'availableCustomDimensions', 'propertyCreateTime', 'trackingDisabled', 'adsLinked', 'adsLinkedLastSyncedAt', 'detectedEvents', 'newConversionEventsLastUpdateAt', 'lostConversionEventsLastUpdateAt'],
  submitChanges: _settings__WEBPACK_IMPORTED_MODULE_4__.submitChanges,
  rollbackChanges: _settings__WEBPACK_IMPORTED_MODULE_4__.rollbackChanges,
  validateCanSubmitChanges: _settings__WEBPACK_IMPORTED_MODULE_4__.validateCanSubmitChanges,
  validateHaveSettingsChanged: _settings__WEBPACK_IMPORTED_MODULE_4__.validateHaveSettingsChanged
});
const originalSetPropertyCreateTime = baseModuleStore.actions.setPropertyCreateTime;
baseModuleStore.actions.setPropertyCreateTime = value => {
  return originalSetPropertyCreateTime((0,_js_util__WEBPACK_IMPORTED_MODULE_2__.convertDateStringToUNIXTimestamp)(value));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (baseModuleStore);

/***/ },

/***/ "./js/modules/analytics-4/datastore/containers.js"
/*!********************************************************!*\
  !*** ./js/modules/analytics-4/datastore/containers.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 _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.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 _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: containers.
 *
 * 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 fetchGetGoogleTagContainerStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__.createFetchStore)({
  baseName: 'getGoogleTagContainer',
  controlCallback({
    measurementID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ANALYTICS_4, 'container-lookup', {
      destinationID: measurementID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, container, {
    measurementID
  }) => {
    state.containers[measurementID] = container;
  }),
  argsToParams(measurementID) {
    return {
      measurementID
    };
  },
  validateParams({
    measurementID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(measurementID, 'measurementID is required.');
  }
});
const fetchGetGoogleTagContainerDestinationsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__.createFetchStore)({
  baseName: 'getGoogleTagContainerDestinations',
  controlCallback({
    gtmAccountID,
    gtmContainerID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ANALYTICS_4, 'container-destinations', {
      accountID: gtmAccountID,
      containerID: gtmContainerID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, containerDestinations, {
    gtmAccountID,
    gtmContainerID
  }) => {
    state.containerDestinations[gtmAccountID] = state.containerDestinations[gtmAccountID] || {};
    state.containerDestinations[gtmAccountID][gtmContainerID] = state.containerDestinations[gtmAccountID][gtmContainerID] || [];
    state.containerDestinations[gtmAccountID][gtmContainerID].push(...containerDestinations);
  }),
  argsToParams(gtmAccountID, gtmContainerID) {
    return {
      gtmAccountID,
      gtmContainerID
    };
  },
  validateParams({
    gtmAccountID,
    gtmContainerID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(gtmAccountID, 'gtmAccountID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(gtmContainerID, 'gtmContainerID is required.');
  }
});
const baseInitialState = {
  containers: {},
  containerDestinations: {}
};
const baseActions = {};
const baseControls = {};
function baseReducer(state, {
  type
}) {
  switch (type) {
    default:
      {
        return state;
      }
  }
}
const baseResolvers = {
  *getGoogleTagContainer(measurementID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const container = registry.select(_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getGoogleTagContainer(measurementID);
    if (container === undefined) {
      yield fetchGetGoogleTagContainerStore.actions.fetchGetGoogleTagContainer(measurementID);
    }
  },
  *getGoogleTagContainerDestinations(gtmAccountID, gtmContainerID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    const containerDestinations = registry.select(_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getGoogleTagContainerDestinations(gtmAccountID, gtmContainerID);
    if (containerDestinations === undefined) {
      yield fetchGetGoogleTagContainerDestinationsStore.actions.fetchGetGoogleTagContainerDestinations(gtmAccountID, gtmContainerID);
    }
  }
};
const baseSelectors = {
  /**
   * Gets the Google Tag container for the given measurementID.
   *
   * @since 1.92.0
   *
   * @param {Object} state         Data store's state.
   * @param {string} measurementID Measurement ID.
   * @return {Object|undefined} Google Tag container object, or undefined if not loaded.
   */
  getGoogleTagContainer(state, measurementID) {
    return state.containers[measurementID];
  },
  /**
   * Gets the Google Tag container destinations for the given accountID and containerID.
   *
   * @since 1.92.0
   *
   * @param {Object} state          Data store's state.
   * @param {string} gtmAccountID   Google Tag Manager account ID.
   * @param {string} gtmContainerID Google Tag Manager container ID.
   * @return {(Array.<Object>|undefined)} Google Tag container destinations list, or undefined if not loaded.
   */
  getGoogleTagContainerDestinations(state, gtmAccountID, gtmContainerID) {
    return state.containerDestinations[gtmAccountID]?.[gtmContainerID];
  }
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchGetGoogleTagContainerStore, fetchGetGoogleTagContainerDestinationsStore, {
  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/analytics-4/datastore/conversion-reporting.js"
/*!******************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/conversion-reporting.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 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__);
/* 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_user_input_util_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/user-input/util/constants */ "./js/components/user-input/util/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_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_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: conversion reporting.
 *
 * 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 selectors = {
  /**
   * Checks whether the provided conversion reporting events are available.
   *
   * @since 1.135.0
   *
   * @param {Object}               state  Data store's state.
   * @param {string|Array<string>} events Conversion reporting events to check.
   * @return {(boolean|undefined)} True if all provided custom dimensions are available, otherwise false. Undefined if detected events are not loaded yet.
   */
  hasConversionReportingEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, events) => {
    // Ensure events is always an array, even if a string is passed.
    const eventsToCheck = Array.isArray(events) ? events : [events];
    const detectedEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents();
    if (detectedEvents === undefined) {
      return undefined;
    }
    if (!detectedEvents?.length) {
      return false;
    }
    return eventsToCheck.some(event => detectedEvents.includes(event));
  }),
  /**
   * Checks if any ecommerce conversion reporting events have been detected.
   *
   * @since 1.178.0
   *
   * @return {(boolean|undefined)} True if any ecommerce conversion reporting events are detected, otherwise false. Undefined if detected events are not loaded yet.
   */
  hasEcommerceConversionReportingEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    return select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasConversionReportingEvents(_constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_ECOMMERCE_EVENTS);
  }),
  /**
   * Checks if any lead conversion reporting events have been detected.
   *
   * @since 1.178.0
   *
   * @return {(boolean|undefined)} True if any lead conversion reporting events are detected, otherwise false. Undefined if detected events are not loaded yet.
   */
  hasLeadConversionReportingEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    return select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasConversionReportingEvents(_constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_LEAD_EVENTS);
  }),
  /**
   * Checks whether only ecommerce conversion reporting events have been detected.
   *
   * @since 1.181.0
   *
   * @return {(boolean|undefined)} True when ecommerce events are detected and no lead events are detected, otherwise false. Undefined if detected events are not loaded yet.
   */
  hasEcommerceConversionReportingEventsOnly: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const hasEcommerceEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasEcommerceConversionReportingEvents();
    const hasLeadEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasLeadConversionReportingEvents();
    if (hasEcommerceEvents === undefined || hasLeadEvents === undefined) {
      return undefined;
    }
    return hasEcommerceEvents && !hasLeadEvents;
  }),
  /**
   * Gets all conversion reporting inline data from this data store.
   *
   * Not intended to be used publicly; this is largely here so other selectors can
   * request data using the selector/resolver pattern.
   *
   * @since 1.140.0
   * @private
   *
   * @return {(Object|undefined)} Conversion reporting inline data.
   */
  getConversionReportingEventsChange: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const {
      getNewEvents,
      getLostEvents,
      getNewBadgeEvents
    } = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4);
    const newEvents = getNewEvents();
    const lostEvents = getLostEvents();
    const newBadgeEvents = getNewBadgeEvents();
    if (newEvents === undefined || lostEvents === undefined || newBadgeEvents === undefined) {
      return undefined;
    }
    return {
      newEvents,
      lostEvents,
      newBadgeEvents
    };
  }),
  /**
   * Checks if newEvents are present.
   *
   * @since 1.140.0
   *
   * @return {boolean|undefined} TRUE if `newEvents` are present, FALSE otherwise.
   */
  hasNewConversionReportingEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const newEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getNewEvents();
    if (newEvents === undefined) {
      return undefined;
    }
    return newEvents.length > 0;
  }),
  /**
   * Checks if lostEvents are present.
   *
   * @since 1.140.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean|undefined} TRUE if `lostEvents` are present, FALSE otherwise.
   */
  hasLostConversionReportingEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const lostEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getLostEvents();
    if (lostEvents === undefined) {
      return undefined;
    }
    return lostEvents.length > 0;
  }),
  /**
   * Checks if there are key metrics widgets connected with the detected events for the supplied purpose answer.
   *
   * @since 1.141.0
   *
   * @param {Object}  options              Options object.
   * @param {boolean} options.useNewEvents Flag inclusion of detected new events, otherwise initial detected events will be used.
   * @return {boolean|undefined} TRUE if current site purpose will have any ACR key metrics widgets assigned to it, FALSE otherwise, and undefined if metrics are not loaded.
   */
  haveConversionEventsForTailoredMetrics: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, {
    useNewEvents
  } = {}) => {
    const conversionReportingEventsChange = useNewEvents ? select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getConversionReportingEventsChange()?.newEvents : select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents();
    const currentTailoredMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getAnswerBasedMetrics();
    const tailoredMetricsWithNewEvents = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getAnswerBasedMetrics(null, conversionReportingEventsChange);
    return tailoredMetricsWithNewEvents?.some((metric, index) => metric !== currentTailoredMetrics?.[index]);
  }),
  /**
   * Checks if there are key metrics widgets that rely on the conversion events that have been lost.
   *
   * @since 1.142.0
   *
   * @return {boolean|undefined} TRUE if current metrics are depending on the conversion events that have been lost, FALSE otherwise, and undefined if event change data is not resolved.
   */
  haveLostEventsForCurrentMetrics: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const conversionEventWidgets = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getKeyMetricsConversionEventWidgets();
    const currentMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getKeyMetrics();
    const conversionReportingLostEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getConversionReportingEventsChange()?.lostEvents;
    return conversionReportingLostEvents?.some(event => conversionEventWidgets[event]?.some(widget => currentMetrics?.includes(widget)));
  }),
  /**
   * Returns the conversion events associated with the current site purpose.
   *
   * @since 1.142.0
   *
   * @return {Array|undefined} List of detected conversion events connected to the current site purpose, or undefined if data is not resolved.
   */
  getUserInputPurposeConversionEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const userInputSettings = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getUserInputSettings();
    const purpose = userInputSettings?.purpose?.values?.[0];
    const purposeEvents = _js_components_user_input_util_constants__WEBPACK_IMPORTED_MODULE_3__.USER_INPUT_PURPOSE_TO_CONVERSION_EVENTS_MAPPING[purpose];
    const detectedEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents();
    return purposeEvents?.reduce((acc, event) => {
      if (detectedEvents?.includes(event)) {
        return [...acc, event];
      }
      return acc;
    }, []);
  }),
  /**
   * Returns the conversion events if detected events are suitable for tailored metrics.
   *
   * @since 1.146.0
   *
   * @return {Array} List of detected conversion events or empty array.
   */
  shouldIncludeConversionTailoredMetrics: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const isGA4Connected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4);
    if (!isGA4Connected) {
      return [];
    }
    const {
      haveConversionEventsForTailoredMetrics,
      getDetectedEvents
    } = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4);
    if (haveConversionEventsForTailoredMetrics()) {
      return getDetectedEvents() || [];
    }
    return [];
  }),
  /**
   * Gets conversion events related metrics.
   *
   * @since 1.142.0
   * @private
   *
   * @return {Object} Metrics list object.
   */
  getKeyMetricsConversionEventWidgets() {
    const leadRelatedMetrics = [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS, _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS, _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS];
    return {
      purchase: [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES, _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES, _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES],
      add_to_cart: [_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART, _js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART],
      contact: leadRelatedMetrics,
      submit_lead_form: leadRelatedMetrics,
      generate_lead: leadRelatedMetrics
    };
  },
  /**
   * Checks if there are conversion events for the user picked metrics.
   *
   * @since 1.142.0
   *
   * @param {Object}  options              Options object.
   * @param {boolean} options.useNewEvents Flag inclusion of detected new events, otherwise initial detected events will be used.
   * @return {boolean|undefined} `true` if there are any ACR key metrics based on the users existing selected metrics, `false` otherwise. Will return `undefined` if the data is not loaded yet.
   */
  haveConversionEventsForUserPickedMetrics: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, {
    useNewEvents
  } = {}) => {
    const conversionEventWidgets = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getKeyMetricsConversionEventWidgets();
    const userPickedKeyMetrics = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getUserPickedMetrics();
    const conversionReportingEventsChange = useNewEvents ? select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getConversionReportingEventsChange()?.newEvents : select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents();
    return conversionReportingEventsChange?.some(event => conversionEventWidgets[event]?.some(widget => {
      return !userPickedKeyMetrics?.includes(widget);
    }));
  }),
  /**
   * Returns the primary ecommerce event based on detected events and fallback priority.
   *
   * @since 1.179.0
   *
   * @return {('purchase'|'add_to_cart'|undefined)} The primary ecommerce event name, or undefined if none detected or events not yet loaded.
   */
  getPrimaryEcommerceEvent: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const detectedEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents();
    if (detectedEvents === undefined) {
      return undefined;
    }

    // Check for the primary ecommerce events in order of priority.
    if (detectedEvents.includes(_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.PURCHASE)) {
      return _constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.PURCHASE;
    }

    // Check for the secondary ecommerce events.
    if (detectedEvents.includes(_constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.ADD_TO_CART)) {
      return _constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.ADD_TO_CART;
    }
    return undefined;
  }),
  /**
   * Returns detected ecommerce events excluding the given primaryEvent, in hierarchy order.
   *
   * @since 1.180.0
   *
   * @param {Object} state        Data store's state.
   * @param {string} primaryEvent The primary ecommerce event to exclude.
   * @return {(Array|undefined)} Array of secondary ecommerce event names, or undefined if events not yet loaded.
   */
  getSecondaryEcommerceEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, primaryEvent) => {
    const detectedEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents();
    if (detectedEvents === undefined) {
      return undefined;
    }
    const primaryIndex = _constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_ECOMMERCE_EVENTS.indexOf(primaryEvent);

    // Secondary events are those below the primary in hierarchy order.
    return _constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_ECOMMERCE_EVENTS.slice(primaryIndex + 1).filter(event => detectedEvents.includes(event));
  }),
  /**
   * Returns detected events intersected with CONVERSION_REPORTING_LEAD_EVENTS.
   *
   * @since 1.179.0
   *
   * @return {(Array|undefined)} Array of detected lead event names, or undefined if events not yet loaded.
   */
  getDetectedLeadEvents: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const detectedEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedEvents();
    if (detectedEvents === undefined) {
      return undefined;
    }
    return _constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_LEAD_EVENTS.filter(event => detectedEvents.includes(event));
  }),
  /**
   * Returns the Key action label for the Site Goals side panel Primary Action row.
   *
   * For ecommerce, returns the label of the primary event (`purchase` or `add_to_cart`).
   * For lead, returns `Form completion` when any lead event is detected.
   *
   * @since 1.182.0
   *
   * @param {Object}               state    Data store's state.
   * @param {('ecommerce'|'lead')} goalType Goal type.
   * @return {(string|undefined)} Label, or `undefined` for unresolved events or unknown goal types.
   */
  getPrimaryActionPanelLabel: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, goalType) => {
    if (goalType === 'ecommerce') {
      const primaryEvent = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPrimaryEcommerceEvent();
      if (primaryEvent === undefined) {
        return undefined;
      }
      if (primaryEvent === _constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.PURCHASE) {
        return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Purchase', 'google-site-kit');
      }
      if (primaryEvent === _constants__WEBPACK_IMPORTED_MODULE_8__.ENUM_CONVERSION_EVENTS.ADD_TO_CART) {
        return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Products added to cart', 'google-site-kit');
      }
      return undefined;
    }
    if (goalType === 'lead') {
      const detectedLeadEvents = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedLeadEvents();
      if (detectedLeadEvents === undefined) {
        return undefined;
      }
      if (detectedLeadEvents.length > 0) {
        return (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Form completion', 'google-site-kit');
      }
      return undefined;
    }
    return undefined;
  }),
  /**
   * Returns the event slug backing the Site Goals side panel Primary Action row.
   *
   * For ecommerce, returns the primary event (`purchase` or `add_to_cart`).
   * For lead, returns the first detected lead event.
   *
   * @since 1.183.0
   *
   * @param {Object}               state    Data store's state.
   * @param {('ecommerce'|'lead')} goalType Goal type.
   * @return {(string|undefined)} Event slug, or `undefined` if not yet resolved.
   */
  getPrimaryActionEventSlug: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, goalType) => {
    if (goalType === 'ecommerce') {
      return select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPrimaryEcommerceEvent();
    }
    return select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDetectedLeadEvents()?.[0];
  }),
  /**
   * Checks if there are new conversion events after initial events were detected. Regardless of how KM were setup.
   *
   * @since 1.142.0
   *
   * @return {boolean} `true` if there are metrics related to the new conversion events that differ from already detected/selected ones, `false` otherwise.
   */
  haveConversionEventsWithDifferentMetrics: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const isGA4Connected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4);
    if (!isGA4Connected) {
      return false;
    }
    const {
      getDetectedEvents,
      getConversionReportingEventsChange,
      haveConversionEventsForUserPickedMetrics,
      haveConversionEventsForTailoredMetrics,
      getKeyMetricsConversionEventWidgets
    } = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4);
    const detectedEvents = getDetectedEvents();
    const conversionReportingEventsChange = getConversionReportingEventsChange();
    if (!detectedEvents?.length || !conversionReportingEventsChange?.newEvents?.length ||
    // If events in detectedEvents do not differ from the new ones it means
    // it is the initial detection, since after initial detection newEvents will
    // only contain the difference in events.
    (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isEqual)((0,_js_util__WEBPACK_IMPORTED_MODULE_7__.safelySort)(conversionReportingEventsChange?.newEvents), (0,_js_util__WEBPACK_IMPORTED_MODULE_7__.safelySort)(detectedEvents))) {
      return false;
    }
    const detectedLeadEvents = detectedEvents.filter(event => _constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_LEAD_EVENTS.includes(event));
    const newLeadEvents = conversionReportingEventsChange.newEvents.filter(event => _constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_LEAD_EVENTS.includes(event));
    const newNonLeadEvents = conversionReportingEventsChange.newEvents.filter(event => !_constants__WEBPACK_IMPORTED_MODULE_8__.CONVERSION_REPORTING_LEAD_EVENTS.includes(event));

    // If new events include only additional lead events return early.
    if (detectedLeadEvents.length > 1 && newLeadEvents.length > 0 && !newNonLeadEvents.length) {
      return false;
    }
    const {
      getUserPickedMetrics,
      getKeyMetrics
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER);
    const userPickedMetrics = getUserPickedMetrics();
    const haveNewConversionEventsForUserPickedMetrics = haveConversionEventsForUserPickedMetrics({
      useNewEvents: true
    });
    if (userPickedMetrics?.length && !haveNewConversionEventsForUserPickedMetrics) {
      return false;
    }
    const keyMetricsConversionEventWidgets = getKeyMetricsConversionEventWidgets();
    const newConversionEventKeyMetrics = [];

    // Pick all conversion event widgets associated with new events.
    for (const event in keyMetricsConversionEventWidgets) {
      if (conversionReportingEventsChange.newEvents.includes(event)) {
        newConversionEventKeyMetrics.push(...keyMetricsConversionEventWidgets[event]);
      }
    }
    const currentKeyMetrics = getKeyMetrics();
    const haveAllConversionEventMetrics = newConversionEventKeyMetrics.every(keyMetric => currentKeyMetrics?.includes(keyMetric));

    // If the current site purpose has all conversion event metrics,
    // or there are some metrics that can be added via "Add
    // metrics CTA", don't show the "View metrics" variation.
    if (!userPickedMetrics?.length && (haveConversionEventsForTailoredMetrics({
      useNewEvents: true
    }) || haveAllConversionEventMetrics)) {
      return false;
    }
    return true;
  })
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  selectors
});

/***/ },

/***/ "./js/modules/analytics-4/datastore/custom-dimensions-gathering-data.js"
/*!******************************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/custom-dimensions-gathering-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 */   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 _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.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_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_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: custom dimensions gathering data store.
 *
 * 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 RECEIVE_CUSTOM_DIMENSION_GATHERING_DATA = 'RECEIVE_CUSTOM_DIMENSION_GATHERING_DATA';
const fetchSaveCustomDimensionDataAvailableStateStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__.createFetchStore)({
  baseName: 'saveCustomDimensionDataAvailableState',
  controlCallback: ({
    customDimension
  }) => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4, 'custom-dimension-data-available', {
    customDimension
  }),
  argsToParams: customDimension => ({
    customDimension
  }),
  validateParams: ({
    customDimension
  }) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof customDimension && customDimension.length > 0, 'customDimension must be a non-empty string.');
  }
});

/*
 * The initial state shape is as follows:
 *
 * {
 *   customDimensionsGatheringData: {
 *     googlesitekit_post_date: undefined,
 *     googlesitekit_post_author: undefined,
 *     // etc.
 *   },
 * }
 */
const baseInitialState = {
  customDimensionsGatheringData: Object.keys(_constants__WEBPACK_IMPORTED_MODULE_7__.CUSTOM_DIMENSION_DEFINITIONS).reduce((initialStateSlice, customDimension) => ({
    ...initialStateSlice,
    [customDimension]: undefined
  }), {})
};
const baseActions = {
  /**
   * Receives gathering data state for a custom dimension.
   *
   * @since 1.113.0
   * @private
   *
   * @param {Object}  options                 Options object.
   * @param {string}  options.customDimension Custom dimension slug.
   * @param {boolean} options.gatheringData   Gathering data.
   * @return {Object} Redux-style action.
   */
  receiveIsCustomDimensionGatheringData({
    customDimension,
    gatheringData
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof customDimension && customDimension.length > 0, 'customDimension must be a non-empty string.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()('boolean' === typeof gatheringData, 'gatheringData must be a boolean.');
    return {
      payload: {
        customDimension,
        gatheringData
      },
      type: RECEIVE_CUSTOM_DIMENSION_GATHERING_DATA
    };
  },
  /**
   * Checks whether data is available for the custom dimension.
   *
   * If data is available, saves the data available state to the server.
   *
   * @since 1.113.0
   *
   * @param {string} customDimension Custom dimension slug.
   */
  *checkCustomDimensionDataAvailability(customDimension) {
    const {
      select,
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getSettings());
    if (!select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasCustomDimensions(customDimension)) {
      yield baseActions.receiveIsCustomDimensionGatheringData({
        customDimension,
        gatheringData: true
      });
      return;
    }
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getAuthentication());
    if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isAuthenticated()) {
      yield baseActions.receiveIsCustomDimensionGatheringData({
        customDimension,
        gatheringData: true
      });
      return;
    }
    const reportArgs = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getDataAvailabilityReportOptions(customDimension));
    if (!reportArgs) {
      yield baseActions.receiveIsCustomDimensionGatheringData({
        customDimension,
        gatheringData: true
      });
      return;
    }
    const report = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportArgs));
    const hasReportError = !!select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportArgs]);
    const isGatheringData = hasReportError || !report?.rows?.length;
    yield baseActions.receiveIsCustomDimensionGatheringData({
      customDimension,
      gatheringData: isGatheringData
    });
    if (!isGatheringData) {
      yield fetchSaveCustomDimensionDataAvailableStateStore.actions.fetchSaveCustomDimensionDataAvailableState(customDimension);
    }
  }
};
const baseControls = {};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createReducer)((state, {
  type,
  payload
}) => {
  switch (type) {
    case RECEIVE_CUSTOM_DIMENSION_GATHERING_DATA:
      {
        const {
          customDimension,
          gatheringData
        } = payload;
        state.customDimensionsGatheringData[customDimension] = gatheringData;
        break;
      }
    default:
      {
        break;
      }
  }
});
const baseResolvers = {
  *isCustomDimensionGatheringData(customDimension) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();

    // If the gatheringData flag is already set, return early.
    if (registry.select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isCustomDimensionGatheringData(customDimension) !== undefined) {
      return;
    }

    // Module data needs to be resolved to determine the custom dimensions data availability state.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getModuleData());
    const dataAvailableOnLoad = registry.select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getCustomDimensionsDataAvailable()?.[customDimension];

    // If dataAvailableOnLoad is true, set gatheringData to false and do nothing else.
    if (dataAvailableOnLoad) {
      yield baseActions.receiveIsCustomDimensionGatheringData({
        customDimension,
        gatheringData: false
      });
      return;
    }
    yield baseActions.checkCustomDimensionDataAvailability(customDimension);
  },
  *getDataAvailabilityReportOptions() {
    const {
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyCreateTime());
  }
};
const baseSelectors = {
  /**
   * Determines whether the custom dimension is still gathering data or not.
   *
   * @since 1.113.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} customDimension Custom dimension slug.
   * @return {boolean|undefined} Returns TRUE if gathering data, otherwise FALSE. If the request is still being resolved, returns undefined.
   */
  isCustomDimensionGatheringData(state, customDimension) {
    return state.customDimensionsGatheringData[customDimension];
  },
  /**
   * Determines whether any of the provided custom dimensions are still gathering data.
   *
   * @since 1.113.0
   *
   * @param {Object}        state            Data store's state.
   * @param {Array<string>} customDimensions Array of custom dimension slugs.
   * @return {boolean|undefined} Returns TRUE if any of the provided custom dimensions are gathering data, otherwise FALSE.
   * 														 If any of the corresponding state is still being resolved, returns undefined.
   */
  areCustomDimensionsGatheringData: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, customDimensions) => {
    const {
      isCustomDimensionGatheringData
    } = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);

    // Return undefined if any of the custom dimensions' gathering data state is undefined,
    // or true if any of the custom dimensions' gathering data state is true.
    for (const gatheringDataState of [undefined, true]) {
      if (customDimensions.some(dimension => isCustomDimensionGatheringData(dimension) === gatheringDataState)) {
        return gatheringDataState;
      }
    }

    // Otherwise, all custom dimensions' gathering data state is false.
    return false;
  }),
  /**
   * Gets the options for the data availability report.
   *
   * @since 1.114.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} customDimension Custom dimension slug.
   * @return {Object|undefined} Returns the report options if the property is loaded, otherwise undefined.
   */
  getDataAvailabilityReportOptions: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, customDimension) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(customDimension, 'customDimension is required.');
    const propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyID();
    if (!propertyID) {
      return undefined;
    }
    const propertyCreateTime = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyCreateTime();
    if (!propertyCreateTime) {
      return undefined;
    }
    const endDate = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getReferenceDate();
    return {
      // Valid use of `new Date()` with an argument.
      // eslint-disable-next-line sitekit/no-direct-date
      startDate: (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.getDateString)(new Date(propertyCreateTime)),
      endDate,
      dimensions: [`customEvent:${customDimension}`],
      dimensionFilters: {
        [`customEvent:${customDimension}`]: {
          filterType: 'emptyFilter',
          notExpression: true
        }
      },
      metrics: [{
        name: 'eventCount'
      }],
      limit: 1,
      reportID: 'analytics-4_get-data-availability-report-options_store:selector'
    };
  }),
  /**
   * Gets the errors for the data availability report.
   *
   * @since 1.114.0
   *
   * @param {Object} state            Data store's state.
   * @param {Array}  customDimensions Array of custom dimension slugs.
   * @return {Object} Returns an object of errors keyed by custom dimension slug.
   */
  getDataAvailabilityReportErrors: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, customDimensions) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(customDimensions, 'customDimensions is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(customDimensions), 'customDimensions must be an array.');
    const {
      getDataAvailabilityReportOptions,
      getErrorForSelector
    } = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
    return customDimensions.reduce((errors, customDimension) => {
      const reportArgs = getDataAvailabilityReportOptions(customDimension);
      if (!reportArgs) {
        return errors;
      }
      const error = getErrorForSelector('getReport', [reportArgs]);
      if (error) {
        return {
          ...errors,
          [customDimension]: error
        };
      }
      return errors;
    }, {});
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchSaveCustomDimensionDataAvailableStateStore, {
  actions: baseActions,
  controls: baseControls,
  initialState: baseInitialState,
  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/analytics-4/datastore/custom-dimensions.js"
/*!***************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/custom-dimensions.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 */   baseControls: () => (/* binding */ baseControls),
/* harmony export */   baseReducer: () => (/* binding */ baseReducer),
/* 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 _js_components_KeyMetrics_key_metrics_widgets__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/key-metrics-widgets */ "./js/components/KeyMetrics/key-metrics-widgets.js");
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/features */ "./js/features/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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: custom-dimensions store.
 *
 * 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 customDimensionFields = ['parameterName', 'displayName', 'description', 'scope', 'disallowAdsPersonalization'];
const fetchCreateCustomDimensionStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'createCustomDimension',
  controlCallback: ({
    propertyID,
    customDimension
  }) => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4, 'create-custom-dimension', {
    propertyID,
    customDimension
  }),
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, createdCustomDimension, {
    propertyID
  }) => {
    const parameterName = createdCustomDimension?.parameterName;
    const propertyCustomDimensions = state.propertyCustomDimensions?.[propertyID];

    // Append the new dimension only when the property's list is already
    // loaded. Otherwise the `getCustomDimensions` resolver loads it in full.
    if (!parameterName || !propertyCustomDimensions || propertyCustomDimensions.includes(parameterName)) {
      return;
    }
    propertyCustomDimensions.push(parameterName);
  }),
  argsToParams: (propertyID, customDimension) => ({
    propertyID,
    customDimension
  }),
  validateParams: ({
    propertyID,
    customDimension
  }) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_10__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(customDimension), 'Custom dimension must be a plain object.');
    Object.keys(customDimension).forEach(key => {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(customDimensionFields.includes(key), `Custom dimension must contain only valid keys. Invalid key: "${key}"`);
    });
  },
  isAction: true
});
const fetchSyncAvailableCustomDimensionsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'syncAvailableCustomDimensions',
  controlCallback: () => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4, 'sync-custom-dimensions'),
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, dimensions) => {
    state.settings = state.settings || {};
    state.settings.availableCustomDimensions = dimensions;

    // The `sync-custom-dimensions` request saves `availableCustomDimensions`
    // on the server, so set it on `savedSettings` too. The form compares
    // `settings` and `savedSettings` to know if there are unsaved changes.
    // Without this, it would see the synced value as unsaved, and Cancel
    // would drop it until the next page load.
    state.savedSettings = state.savedSettings || {};
    state.savedSettings.availableCustomDimensions = dimensions;
  }),
  isAction: true
});
const fetchGetCustomDimensionsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'getCustomDimensions',
  controlCallback: ({
    propertyID
  }) => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4, 'custom-dimensions', {
    propertyID
  }, {
    useCache: false
  }),
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, dimensions, {
    propertyID
  }) => {
    state.propertyCustomDimensions = state.propertyCustomDimensions || {};
    state.propertyCustomDimensions[propertyID] = dimensions;
  }),
  argsToParams: propertyID => ({
    propertyID
  }),
  validateParams: ({
    propertyID
  } = {}) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_10__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
  }
});
const baseInitialState = {
  customDimensionsBeingCreated: [],
  propertyCustomDimensions: {},
  syncTimeoutID: undefined
};

// Actions
const SET_CUSTOM_DIMENSIONS_BEING_CREATED = 'SET_CUSTOM_DIMENSIONS_BEING_CREATED';
const SCHEDULE_SYNC_AVAILABLE_CUSTOM_DIMENSIONS = 'SCHEDULE_SYNC_AVAILABLE_CUSTOM_DIMENSIONS';
const SET_SYNC_TIMEOUT_ID = 'SET_SYNC_TIMEOUT_ID';
const baseActions = {
  /**
   * Creates custom dimensions and syncs them in the settings.
   *
   * @since 1.113.0
   * @since 1.181.0 Added the Site Goals custom dimensions when the `siteGoals` feature flag is on and advanced data breakdowns is enabled.
   * @since 1.182.0 Created the missing custom dimensions on the selected property, and added the Site Goals dimensions only when advanced data breakdowns is enabled for that property.
   *
   * @param {Array<string>} customDimensions Optional additional custom dimensions to create.
   * @return {Object} Object whose `error` property holds the available-dimensions sync error when the required dimensions already existed and that sync failed; otherwise an empty object.
   */
  *createCustomDimensions(customDimensions = []) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();

    // Wait for the necessary settings to be loaded before checking.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(Promise.all([registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getSettings(), registry.resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getKeyMetricsSettings(), registry.resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getUserInputSettings()]));
    const propertyID = registry.select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getPropertyID();

    // Custom dimensions are created on the selected property, so there's
    // nothing to create until a valid property is selected.
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_10__.isValidPropertyID)(propertyID)) {
      return {};
    }
    const selectedMetricTiles = registry.select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getKeyMetrics();

    // Extract required custom dimensions from selected metric tiles.
    const keyMetricsRequiredCustomDimensions = selectedMetricTiles.flatMap(tileName => {
      const tile = _js_components_KeyMetrics_key_metrics_widgets__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_WIDGETS[tileName];
      return tile?.requiredCustomDimensions || [];
    });
    const requiredCustomDimensions = [...keyMetricsRequiredCustomDimensions, ...(Array.isArray(customDimensions) ? customDimensions : [])];

    // Deduplicate if any custom dimensions are repeated among tiles.
    const uniqueRequiredCustomDimensions = [...new Set(requiredCustomDimensions)];

    // Add the Site Goals custom dimensions when the Site Goals feature is on
    // and advanced data breakdowns is enabled for the selected property. The
    // breakdowns setting is read only inside this check, so flows with the
    // feature off, like key metrics setup, never request it.
    if ((0,_js_features__WEBPACK_IMPORTED_MODULE_5__.isFeatureEnabled)('siteGoals')) {
      const isAdvancedDataBreakdownsEnabled = registry.select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isAdvancedDataBreakdownsEnabled(propertyID);
      if (isAdvancedDataBreakdownsEnabled) {
        _constants__WEBPACK_IMPORTED_MODULE_11__.SITE_GOALS_CUSTOM_DIMENSIONS.forEach(dimension => {
          if (!uniqueRequiredCustomDimensions.includes(dimension)) {
            uniqueRequiredCustomDimensions.push(dimension);
          }
        });
      }
    }

    // If no custom dimensions are required, there's nothing to create.
    if (!uniqueRequiredCustomDimensions.length) {
      return {};
    }

    /**
     * The selected property's custom dimensions, read from the property
     * itself, not from the saved `availableCustomDimensions`, which only
     * holds the dimensions of the property saved in settings.
     */
    // A finished resolver won't refetch, so a retry would reuse the stale
    // error (e.g. missing GA4 permission). Invalidate first to force a
    // fresh fetch that clears it.
    const hasLoadError = registry.select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getCustomDimensionsError(propertyID);
    if (hasLoadError) {
      registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).invalidateResolution('getCustomDimensions', [propertyID]);
    }
    const propertyCustomDimensions = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getCustomDimensions(propertyID));

    // Stop when the property's dimensions didn't load. Without the list, we
    // can't tell which are missing, so creating them could add ones that
    // already exist.
    if (!Array.isArray(propertyCustomDimensions)) {
      return {};
    }

    // Find out the missing custom dimensions.
    const missingCustomDimensions = uniqueRequiredCustomDimensions.filter(dimension => !propertyCustomDimensions.includes(dimension));

    // No missing dimensions: the required ones already exist. Sync the saved
    // `availableCustomDimensions` (which drives the success notice, not the
    // property read) and return any sync error — a failed sync leaves the
    // setting stale, so the notice can't render.
    if (!missingCustomDimensions.length) {
      const {
        error
      } = yield fetchSyncAvailableCustomDimensionsStore.actions.fetchSyncAvailableCustomDimensions();
      return {
        error
      };
    }
    yield {
      type: SET_CUSTOM_DIMENSIONS_BEING_CREATED,
      payload: {
        customDimensions: missingCustomDimensions
      }
    };

    // Create missing custom dimensions.
    for (const dimension of missingCustomDimensions) {
      const dimensionData = _constants__WEBPACK_IMPORTED_MODULE_11__.CUSTOM_DIMENSION_DEFINITIONS[dimension];
      if (dimensionData) {
        const {
          error
        } = yield fetchCreateCustomDimensionStore.actions.fetchCreateCustomDimension(propertyID, dimensionData);

        // If the custom dimension was created successfully, mark it as gathering
        // data immediately so that it doesn't cause unnecessary report requests.
        if (!error) {
          registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).receiveIsCustomDimensionGatheringData({
            customDimension: dimension,
            gatheringData: true
          });
        }
      }
    }

    // Sync available custom dimensions.
    if (missingCustomDimensions.length > 0) {
      yield fetchSyncAvailableCustomDimensionsStore.actions.fetchSyncAvailableCustomDimensions();
    }
    yield {
      type: SET_CUSTOM_DIMENSIONS_BEING_CREATED,
      payload: {
        customDimensions: []
      }
    };
    return {};
  },
  /**
   * Sets a schedule timeout ID for syncing available custom dimensions in state.
   *
   * @since 1.114.0
   *
   * @param {number} syncTimeoutID The timeout ID.
   * @return {Object} A redux-style action.
   */
  setSyncTimeoutID(syncTimeoutID) {
    return {
      payload: {
        syncTimeoutID
      },
      type: SET_SYNC_TIMEOUT_ID
    };
  },
  /**
   * Schedules a sync of available custom dimensions in state.
   *
   * @since 1.114.0
   */
  *scheduleSyncAvailableCustomDimensions() {
    yield {
      payload: {},
      type: SCHEDULE_SYNC_AVAILABLE_CUSTOM_DIMENSIONS
    };
  }
};
const baseControls = {
  [SCHEDULE_SYNC_AVAILABLE_CUSTOM_DIMENSIONS]: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistryControl)(({
    select,
    dispatch
  }) => () => {
    const {
      getSyncTimeoutID,
      isFetchingSyncAvailableCustomDimensions
    } = select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4);
    const {
      fetchSyncAvailableCustomDimensions,
      setSyncTimeoutID
    } = dispatch(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4);
    const syncTimeoutID = getSyncTimeoutID();
    const isSyncing = isFetchingSyncAvailableCustomDimensions();
    if (!!syncTimeoutID) {
      clearTimeout(syncTimeoutID);
      setSyncTimeoutID(undefined);
    }
    if (isSyncing) {
      return;
    }
    const timeoutID = setTimeout(async () => {
      await fetchSyncAvailableCustomDimensions();
      setSyncTimeoutID(undefined);
    }, 2000);
    setSyncTimeoutID(timeoutID);
  })
};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, action) => {
  switch (action.type) {
    case SET_CUSTOM_DIMENSIONS_BEING_CREATED:
      {
        state.customDimensionsBeingCreated = action.payload.customDimensions;
        break;
      }
    case SET_SYNC_TIMEOUT_ID:
      {
        state.syncTimeoutID = action.payload.syncTimeoutID;
        break;
      }
    default:
      break;
  }
});
const baseResolvers = {
  *getAvailableCustomDimensions() {
    const {
      select,
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const {
      isAuthenticated,
      hasCapability
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER);
    const isGA4Connected = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4));
    if (!isGA4Connected) {
      return;
    }

    // Wait for settings to be loaded before proceeding.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getSettings());
    const availableCustomDimensions = select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getAvailableCustomDimensions();
    if (availableCustomDimensions || !isAuthenticated()) {
      return;
    }

    // Wait for permissions to be loaded before checking if the user can manage options.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getCapabilities());
    if (!hasCapability(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.PERMISSION_MANAGE_OPTIONS)) {
      return;
    }
    yield fetchSyncAvailableCustomDimensionsStore.actions.fetchSyncAvailableCustomDimensions();
  },
  *getCustomDimensions(propertyID) {
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_10__.isValidPropertyID)(propertyID)) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const propertyCustomDimensions = registry.select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getCustomDimensions(propertyID);
    if (propertyCustomDimensions === undefined) {
      yield fetchGetCustomDimensionsStore.actions.fetchGetCustomDimensions(propertyID);
    }
  }
};
const baseSelectors = {
  /**
   * Checks whether the provided custom dimensions are available.
   *
   * @since 1.113.0
   *
   * @param {Object}               state            Data store's state.
   * @param {string|Array<string>} customDimensions Custom dimensions to check.
   * @return {(boolean|undefined)} True if all provided custom dimensions are available, otherwise false. Undefined if available custom dimensions are not loaded yet.
   */
  hasCustomDimensions: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, customDimensions) => {
    // Ensure customDimensions is always an array, even if a string is passed.
    const dimensionsToCheck = Array.isArray(customDimensions) ? customDimensions : [customDimensions];
    const availableCustomDimensions = select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getAvailableCustomDimensions();
    if (availableCustomDimensions === undefined || availableCustomDimensions === null) {
      return undefined;
    }
    if (!availableCustomDimensions) {
      return false;
    }
    return dimensionsToCheck.every(dimension => availableCustomDimensions.includes(dimension));
  }),
  /**
   * Gets the Site Kit custom dimensions available on the given property.
   *
   * Unlike `getAvailableCustomDimensions`, this reads any property's
   * dimensions, so it works for a property selected in a form but not yet
   * saved in settings.
   *
   * @since 1.182.0
   *
   * @param {Object} state      Data store's state.
   * @param {string} propertyID GA4 property ID to get the custom dimensions for.
   * @return {(Array.<string>|undefined)} List of `googlesitekit_`-prefixed parameter names, or undefined if they aren't loaded yet.
   */
  getCustomDimensions(state, propertyID) {
    return state.propertyCustomDimensions?.[propertyID];
  },
  /**
   * Checks whether the given property has all the provided custom dimensions.
   *
   * @since 1.182.0
   *
   * @param {Object}               state            Data store's state.
   * @param {string}               propertyID       GA4 property ID to check the custom dimensions on.
   * @param {string|Array<string>} customDimensions Custom dimensions to check.
   * @return {(boolean|undefined)} True if the property has all the provided dimensions, false if not. Undefined if they aren't loaded yet.
   */
  hasCustomDimensionsForProperty: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, propertyID, customDimensions) => {
    /**
     * The dimensions to check, as an array even when the caller passes
     * a single string.
     */
    const dimensionsToCheck = Array.isArray(customDimensions) ? customDimensions : [customDimensions];
    const propertyCustomDimensions = select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getCustomDimensions(propertyID);
    if (propertyCustomDimensions === undefined) {
      return undefined;
    }
    return dimensionsToCheck.every(dimension => propertyCustomDimensions.includes(dimension));
  }),
  /**
   * Checks whether the provided custom dimension is being created.
   *
   * @since 1.113.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} customDimension Custom dimensions to check.
   * @return {boolean} True the provided custom dimension is being created, otherwise false.
   */
  isCreatingCustomDimension(state, customDimension) {
    return !!state?.customDimensionsBeingCreated.includes(customDimension);
  },
  /**
   * Returns the error if encountered while creating the provided custom dimension.
   *
   * @since 1.113.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} customDimension Custom dimension to obtain creation error for.
   * @return {(Object|undefined)} Error object if exists, otherwise undefined.
   */
  getCreateCustomDimensionError: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, customDimension) => {
    const propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getPropertyID();
    return select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getErrorForAction('createCustomDimension', [propertyID, _constants__WEBPACK_IMPORTED_MODULE_11__.CUSTOM_DIMENSION_DEFINITIONS[customDimension]]);
  }),
  /**
   * Returns the error encountered while loading the property's custom dimensions.
   *
   * Custom dimension creation aborts early when this load fails (e.g. the user
   * lacks permission on the GA4 property), before any create error is recorded,
   * so this exposes that earlier failure.
   *
   * @since 1.183.0
   *
   * @param {Object} state      Data store's state.
   * @param {string} propertyID GA4 property ID to obtain the load error for.
   * @return {(Object|undefined)} Error object if exists, otherwise undefined.
   */
  getCustomDimensionsError: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, propertyID) => {
    return select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).getErrorForSelector('getCustomDimensions', [propertyID]);
  }),
  /**
   * Determines whether the available custom dimensions are being synced.
   *
   * @since 1.113.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean} TRUE if the available custom dimensions are being synced, otherwise FALSE.
   */
  isSyncingAvailableCustomDimensions: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => state => {
    return select(_constants__WEBPACK_IMPORTED_MODULE_11__.MODULES_ANALYTICS_4).isFetchingSyncAvailableCustomDimensions() || !!state?.syncTimeoutID;
  }),
  /**
   * Gets the sync timeout ID from state.
   *
   * @since 1.114.0
   *
   * @param {Object} state Data store's state.
   * @return {number|undefined} The timeout ID. Undefined if unset.
   */
  getSyncTimeoutID(state) {
    return state?.syncTimeoutID;
  }
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.combineStores)(fetchCreateCustomDimensionStore, fetchSyncAvailableCustomDimensionsStore, fetchGetCustomDimensionsStore, {
  initialState: baseInitialState,
  actions: baseActions,
  resolvers: baseResolvers,
  controls: baseControls,
  reducer: baseReducer,
  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/analytics-4/datastore/enhanced-measurement.js"
/*!******************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/enhanced-measurement.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 _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/factory.js");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* 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");
/* harmony import */ var _js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.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_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 _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: enhanced measurement.
 *
 * 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
 */







const enhancedMeasurementSettingsFields = ['name', 'streamEnabled', 'scrollsEnabled', 'outboundClicksEnabled', 'siteSearchEnabled', 'videoEngagementEnabled', 'fileDownloadsEnabled', 'pageChangesEnabled', 'formInteractionsEnabled', 'searchQueryParameter', 'uriQueryParameter'];
function validateEnhancedMeasurementSettings(enhancedMeasurementSettings) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(enhancedMeasurementSettings), 'Enhanced measurement settings must be an object.');
  Object.keys(enhancedMeasurementSettings).forEach(key => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(enhancedMeasurementSettingsFields.includes(key), `Enhanced measurement settings must contain only valid keys. Invalid key: "${key}"`);
  });
}
const fetchStoreReducerCallback = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, enhancedMeasurementSettings, {
  propertyID,
  webDataStreamID
}) => {
  if (!state.enhancedMeasurement[propertyID]) {
    state.enhancedMeasurement[propertyID] = {};
  }
  if (!state.enhancedMeasurement[propertyID][webDataStreamID]) {
    state.enhancedMeasurement[propertyID][webDataStreamID] = {};
  }
  state.enhancedMeasurement[propertyID][webDataStreamID].settings = enhancedMeasurementSettings;
  state.enhancedMeasurement[propertyID][webDataStreamID].savedSettings = enhancedMeasurementSettings;
});
const fetchGetEnhancedMeasurementSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'getEnhancedMeasurementSettings',
  controlCallback({
    propertyID,
    webDataStreamID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'enhanced-measurement-settings', {
      propertyID,
      webDataStreamID
    }, {
      useCache: false
    });
  },
  reducerCallback: fetchStoreReducerCallback,
  argsToParams(propertyID, webDataStreamID) {
    return {
      propertyID,
      webDataStreamID
    };
  },
  validateParams({
    propertyID,
    webDataStreamID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamID)(webDataStreamID), 'A valid GA4 webDataStreamID is required.');
  }
});
const fetchUpdateEnhancedMeasurementSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_5__.createFetchStore)({
  baseName: 'updateEnhancedMeasurementSettings',
  controlCallback: ({
    propertyID,
    webDataStreamID,
    enhancedMeasurementSettings
  }) => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'enhanced-measurement-settings', {
    propertyID,
    webDataStreamID,
    enhancedMeasurementSettings
  }),
  reducerCallback: fetchStoreReducerCallback,
  argsToParams: (propertyID, webDataStreamID, enhancedMeasurementSettings) => ({
    propertyID,
    webDataStreamID,
    enhancedMeasurementSettings
  }),
  validateParams: ({
    propertyID,
    webDataStreamID,
    enhancedMeasurementSettings
  }) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamID)(webDataStreamID), 'A valid GA4 webDataStreamID is required.');
    validateEnhancedMeasurementSettings(enhancedMeasurementSettings);
  },
  isAction: true
});

// Actions
const SET_ENHANCED_MEASUREMENT_SETTINGS = 'SET_ENHANCED_MEASUREMENT_SETTINGS';
const RESET_ENHANCED_MEASUREMENT_SETTINGS = 'RESET_ENHANCED_MEASUREMENT_SETTINGS';
const baseInitialState = {
  enhancedMeasurement: {}
};
const baseActions = {
  /**
   * Sets enhanced measurement settings.
   *
   * @since 1.110.0
   *
   * @param {string} propertyID      The GA4 property ID to set enhanced measurement settings for.
   * @param {string} webDataStreamID The GA4 web data stream ID to set enhanced measurement settings for.
   * @param {Object} settings        The GA4 enhanced measurement settings to set.
   * @return {Object} Redux-style action.
   */
  setEnhancedMeasurementSettings(propertyID, webDataStreamID, settings) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamID)(webDataStreamID), 'A valid GA4 webDataStreamID is required.');
    validateEnhancedMeasurementSettings(settings);
    return {
      type: SET_ENHANCED_MEASUREMENT_SETTINGS,
      payload: {
        propertyID,
        webDataStreamID,
        settings
      }
    };
  },
  /**
   * Sets the `streamEnabled` setting for a given web data stream.
   *
   * @since 1.110.0
   *
   * @param {Object}  settings                 The GA4 enhanced measurement settings to set.
   * @param {string}  settings.propertyID      The GA4 property ID to set enhanced measurement settings for.
   * @param {string}  settings.webDataStreamID The GA4 web data stream ID to set enhanced measurement settings for.
   * @param {boolean} settings.enabled         Whether the `streamEnabled` setting should be enabled or not.
   * @return {Object} Redux-style action.
   */
  setEnhancedMeasurementStreamEnabled: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__.createValidatedAction)(({
    propertyID,
    webDataStreamID,
    enabled
  }) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamID)(webDataStreamID), 'A valid GA4 webDataStreamID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(enabled !== undefined, 'enabled is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(typeof enabled === 'boolean', 'enabled must be a boolean.');
  }, function* ({
    propertyID,
    webDataStreamID,
    enabled
  }) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const currentSettings = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getEnhancedMeasurementSettings(propertyID, webDataStreamID));
    if (!currentSettings) {
      return null;
    }

    // TODO: Here we coerce `false` to `null`, for compatibility with the API response, which returns
    // `null` for all settings that are not enabled. This helps to ensure that we don't incorrectly consider
    // the setting to have changed in haveEnhancedMeasurementSettingsChanged().
    // We should address this in a more robust manner in future if we start using additional properties of
    // the settings object.
    const streamEnabled = enabled || null;
    const newSettings = {
      ...currentSettings,
      streamEnabled
    };
    return yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).setEnhancedMeasurementSettings(propertyID, webDataStreamID, newSettings));
  }),
  /**
   * Resets enhanced measurement settings to their saved values.
   *
   * @since 1.110.0
   *
   * @return {Object} Redux-style action.
   */
  resetEnhancedMeasurementSettings() {
    return {
      type: RESET_ENHANCED_MEASUREMENT_SETTINGS,
      payload: {}
    };
  },
  /**
   * Updates enhanced measurement settings in the server.
   *
   * @since 1.110.0
   *
   * @param {string} propertyID      The GA4 property ID to set enhanced measurement settings for.
   * @param {string} webDataStreamID The GA4 web data stream ID to set enhanced measurement settings for.
   * @return {Object} Redux-style action.
   */
  updateEnhancedMeasurementSettings: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_6__.createValidatedAction)((propertyID, webDataStreamID) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamID)(webDataStreamID), 'A valid GA4 webDataStreamID is required.');
  }, function* (propertyID, webDataStreamID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const currentSettings = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getEnhancedMeasurementSettings(propertyID, webDataStreamID));
    if (!currentSettings) {
      return null;
    }
    return yield fetchUpdateEnhancedMeasurementSettingsStore.actions.fetchUpdateEnhancedMeasurementSettings(propertyID, webDataStreamID, currentSettings);
  })
};
const baseControls = {};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, {
  type,
  payload
}) => {
  switch (type) {
    case SET_ENHANCED_MEASUREMENT_SETTINGS:
      {
        const {
          propertyID,
          webDataStreamID,
          settings
        } = payload;
        if (!state.enhancedMeasurement[propertyID]) {
          state.enhancedMeasurement[propertyID] = {};
        }
        if (!state.enhancedMeasurement[propertyID][webDataStreamID]) {
          state.enhancedMeasurement[propertyID][webDataStreamID] = {};
        }
        state.enhancedMeasurement[propertyID][webDataStreamID].settings = settings;
        break;
      }
    case RESET_ENHANCED_MEASUREMENT_SETTINGS:
      {
        for (const propertyID in state.enhancedMeasurement) {
          for (const webDataStreamID in state.enhancedMeasurement[propertyID]) {
            const currentWebDataStream = state.enhancedMeasurement[propertyID][webDataStreamID];
            if (currentWebDataStream.savedSettings) {
              currentWebDataStream.settings = currentWebDataStream.savedSettings;
            } else {
              delete state.enhancedMeasurement[propertyID][webDataStreamID];
            }
          }
        }
        break;
      }
    default:
      {
        break;
      }
  }
});
function* waitForEnhancedMeasurementSettings(propertyID, webDataStreamID) {
  const {
    resolveSelect
  } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
  yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getEnhancedMeasurementSettings(propertyID, webDataStreamID));
}
const baseResolvers = {
  *getEnhancedMeasurementSettings(propertyID, webDataStreamID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    // Only fetch enhanced measurement settings if there are none in the store for the given data stream.
    const enhancedMeasurementSettings = registry.select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getEnhancedMeasurementSettings(propertyID, webDataStreamID);
    if (enhancedMeasurementSettings === undefined) {
      yield fetchGetEnhancedMeasurementSettingsStore.actions.fetchGetEnhancedMeasurementSettings(propertyID, webDataStreamID);
    }
  },
  isEnhancedMeasurementStreamEnabled: waitForEnhancedMeasurementSettings,
  isEnhancedMeasurementStreamAlreadyEnabled: waitForEnhancedMeasurementSettings
};
const baseSelectors = {
  /**
   * Gets the enhanced measurement settings for a given web data stream.
   *
   * @since 1.110.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} propertyID      The GA4 property ID to fetch web data streams for.
   * @param {string} webDataStreamID The GA4 web data stream ID to fetch enhanced measurement settings for.
   * @return {(Object|undefined)} An object with enhanced measurement settings; `undefined` if not loaded.
   */
  getEnhancedMeasurementSettings(state, propertyID, webDataStreamID) {
    return state.enhancedMeasurement[propertyID]?.[webDataStreamID]?.settings;
  },
  /**
   * Checks if the `streamEnabled` setting is enabled for a given web data stream.
   *
   * @since 1.110.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} propertyID      The GA4 property ID to check.
   * @param {string} webDataStreamID The GA4 web data stream ID to check.
   * @return {boolean}               True if `streamEnabled` is on, otherwise false; `undefined` if not loaded.
   */
  isEnhancedMeasurementStreamEnabled: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, propertyID, webDataStreamID) => {
    const settings = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getEnhancedMeasurementSettings(propertyID, webDataStreamID);
    if (settings === undefined) {
      return undefined;
    }
    return !!settings.streamEnabled;
  }),
  /**
   * Checks if the `streamEnabled` setting is enabled for a given web data stream within the saved settings.
   *
   * @since 1.113.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} propertyID      The GA4 property ID to check.
   * @param {string} webDataStreamID The GA4 web data stream ID to check.
   * @return {boolean}               True if `streamEnabled` is on, otherwise false; `undefined` if not loaded.
   */
  isEnhancedMeasurementStreamAlreadyEnabled(state, propertyID, webDataStreamID) {
    const {
      savedSettings
    } = state.enhancedMeasurement[propertyID]?.[webDataStreamID] || {};
    if (savedSettings === undefined) {
      return undefined;
    }
    return !!savedSettings.streamEnabled;
  },
  /**
   * Checks if the settings have changed compared to the saved settings for a given web data stream.
   *
   * @since 1.110.0
   *
   * @param {Object} state           Data store's state.
   * @param {string} propertyID      The GA4 property ID to check.
   * @param {string} webDataStreamID The GA4 web data stream ID to check.
   * @return {boolean}               True if settings have changed, otherwise false.
   */
  haveEnhancedMeasurementSettingsChanged(state, propertyID, webDataStreamID) {
    const {
      settings,
      savedSettings
    } = state.enhancedMeasurement[propertyID]?.[webDataStreamID] || {};
    return !(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isEqual)(settings, savedSettings);
  },
  /**
   * This is a utility selector that checks if either the GA4 module settings, or the
   * current web data stream's enhanced measurement settings, have changed.
   *
   * @since 1.111.0
   *
   * @return {boolean} True if settings have changed, otherwise false.
   */
  haveAnyGA4SettingsChanged: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const {
      getPropertyID,
      getWebDataStreamID,
      haveEnhancedMeasurementSettingsChanged,
      haveSettingsChanged
    } = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4);
    if (haveSettingsChanged()) {
      return true;
    }
    const propertyID = getPropertyID();
    const webDataStreamID = getWebDataStreamID();
    if ((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID) && (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamID)(webDataStreamID) && haveEnhancedMeasurementSettingsChanged(propertyID, webDataStreamID)) {
      return true;
    }
    return false;
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.combineStores)(fetchGetEnhancedMeasurementSettingsStore, fetchUpdateEnhancedMeasurementSettingsStore, {
  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/analytics-4/datastore/index.js"
/*!***************************************************!*\
  !*** ./js/modules/analytics-4/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 _js_googlesitekit_data_create_snapshot_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/data/create-snapshot-store */ "./js/googlesitekit/data/create-snapshot-store.js");
/* harmony import */ var _accounts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./accounts */ "./js/modules/analytics-4/datastore/accounts.js");
/* harmony import */ var _advanced_data_breakdowns__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./advanced-data-breakdowns */ "./js/modules/analytics-4/datastore/advanced-data-breakdowns.ts");
/* harmony import */ var _audience_settings__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./audience-settings */ "./js/modules/analytics-4/datastore/audience-settings.js");
/* harmony import */ var _audiences__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./audiences */ "./js/modules/analytics-4/datastore/audiences.js");
/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./base */ "./js/modules/analytics-4/datastore/base.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _containers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./containers */ "./js/modules/analytics-4/datastore/containers.js");
/* harmony import */ var _conversion_reporting__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./conversion-reporting */ "./js/modules/analytics-4/datastore/conversion-reporting.js");
/* harmony import */ var _custom_dimensions__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./custom-dimensions */ "./js/modules/analytics-4/datastore/custom-dimensions.js");
/* harmony import */ var _custom_dimensions_gathering_data__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./custom-dimensions-gathering-data */ "./js/modules/analytics-4/datastore/custom-dimensions-gathering-data.js");
/* harmony import */ var _enhanced_measurement__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./enhanced-measurement */ "./js/modules/analytics-4/datastore/enhanced-measurement.js");
/* harmony import */ var _key_events__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./key-events */ "./js/modules/analytics-4/datastore/key-events.js");
/* harmony import */ var _module_data__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./module-data */ "./js/modules/analytics-4/datastore/module-data.js");
/* harmony import */ var _partial_data__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./partial-data */ "./js/modules/analytics-4/datastore/partial-data.js");
/* harmony import */ var _properties__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./properties */ "./js/modules/analytics-4/datastore/properties.js");
/* harmony import */ var _report__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./report */ "./js/modules/analytics-4/datastore/report.js");
/* harmony import */ var _service__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./service */ "./js/modules/analytics-4/datastore/service.js");
/* harmony import */ var _settings__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./settings */ "./js/modules/analytics-4/datastore/settings.js");
/* harmony import */ var _site_goals_breakdown__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./site-goals-breakdown */ "./js/modules/analytics-4/datastore/site-goals-breakdown.ts");
/* harmony import */ var _site_goals_settings__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./site-goals-settings */ "./js/modules/analytics-4/datastore/site-goals-settings.ts");
/* harmony import */ var _tags__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./tags */ "./js/modules/analytics-4/datastore/tags.js");
/* harmony import */ var _webdatastreams__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./webdatastreams */ "./js/modules/analytics-4/datastore/webdatastreams.js");
/**
 * `modules/analytics-4` 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)(_accounts__WEBPACK_IMPORTED_MODULE_2__["default"], _advanced_data_breakdowns__WEBPACK_IMPORTED_MODULE_3__["default"], _audiences__WEBPACK_IMPORTED_MODULE_5__["default"], _audience_settings__WEBPACK_IMPORTED_MODULE_4__["default"], _base__WEBPACK_IMPORTED_MODULE_6__["default"], _module_data__WEBPACK_IMPORTED_MODULE_14__["default"], _containers__WEBPACK_IMPORTED_MODULE_8__["default"], _key_events__WEBPACK_IMPORTED_MODULE_13__["default"], _conversion_reporting__WEBPACK_IMPORTED_MODULE_9__["default"], (0,_js_googlesitekit_data_create_snapshot_store__WEBPACK_IMPORTED_MODULE_1__.createSnapshotStore)(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4), _custom_dimensions__WEBPACK_IMPORTED_MODULE_10__["default"], _custom_dimensions_gathering_data__WEBPACK_IMPORTED_MODULE_11__["default"], _enhanced_measurement__WEBPACK_IMPORTED_MODULE_12__["default"], _partial_data__WEBPACK_IMPORTED_MODULE_15__["default"], _properties__WEBPACK_IMPORTED_MODULE_16__["default"], _report__WEBPACK_IMPORTED_MODULE_17__["default"], _settings__WEBPACK_IMPORTED_MODULE_19__["default"], _service__WEBPACK_IMPORTED_MODULE_18__["default"], _site_goals_breakdown__WEBPACK_IMPORTED_MODULE_20__["default"], _site_goals_settings__WEBPACK_IMPORTED_MODULE_21__["default"], _tags__WEBPACK_IMPORTED_MODULE_22__["default"], _webdatastreams__WEBPACK_IMPORTED_MODULE_23__["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_7__.MODULES_ANALYTICS_4, store);
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ },

/***/ "./js/modules/analytics-4/datastore/key-events.js"
/*!********************************************************!*\
  !*** ./js/modules/analytics-4/datastore/key-events.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 _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.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 _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: key events.
 *
 * 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
 */





const fetchGetKeyEventsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_2__.createFetchStore)({
  baseName: 'getKeyEvents',
  controlCallback: () => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_0__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ANALYTICS_4, 'key-events', {});
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createReducer)((state, keyEvents) => {
    state.keyEvents = keyEvents;
  })
});
const baseInitialState = {
  keyEvents: undefined
};
const baseResolvers = {
  *getKeyEvents() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const existingKeyEvents = registry.select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getKeyEvents();

    // If there are already `keyEvents` loaded in state, consider it fulfilled
    // and don't make an API request.
    if (existingKeyEvents) {
      return;
    }
    yield fetchGetKeyEventsStore.actions.fetchGetKeyEvents();
  }
};
const baseSelectors = {
  /**
   * Gets GA4 key events.
   *
   * @since 1.96.0
   * @since 1.99.0 Removed the `propertyID` parameter.
   * @since 1.155.0 Renamed from `getConversionEvents` to `getKeyEvents`.
   *
   * @param {Object} state Data store's state.
   * @return {(Array.<Object>|undefined)} GA4 key events; `undefined` if not loaded.
   */
  getKeyEvents(state) {
    return state.keyEvents;
  }
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.combineStores)(fetchGetKeyEventsStore, {
  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/analytics-4/datastore/module-data.js"
/*!*********************************************************!*\
  !*** ./js/modules/analytics-4/datastore/module-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 */   actions: () => (/* binding */ actions),
/* 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_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_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: module data.
 *
 * 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 getModuleDataProperty(propName) {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createRegistrySelector)(select => () => {
    const moduleData = select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getModuleData() || [];
    return moduleData[propName];
  });
}
const RECEIVE_MODULE_DATA = 'RECEIVE_MODULE_DATA';
const SET_RESOURCE_DATA_AVAILABILITY_DATE = 'SET_RESOURCE_DATA_AVAILABILITY_DATE';
const initialState = {
  moduleData: {
    newEvents: undefined,
    lostEvents: undefined,
    newBadgeEvents: undefined,
    hasMismatchedTag: undefined,
    isWebDataStreamUnavailable: undefined,
    resourceAvailabilityDates: undefined
  }
};
const actions = {
  /**
   * Stores module data in the datastore.
   *
   * @since 1.148.0
   * @private
   *
   * @param {Object} data Module data object.
   * @return {Object} Redux-style action.
   */
  receiveModuleData(data) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(data, 'data is required.');
    return {
      payload: data,
      type: RECEIVE_MODULE_DATA
    };
  },
  /**
   * Sets the data availability date for a specific resource.
   *
   * @since 1.127.0
   * @since 1.160.0 Moved to `module-data` store partial from `partial-data` store partial.
   *
   * @param {string} resourceSlug Resource slug.
   * @param {string} resourceType Resource type.
   * @param {number} date         Data availability date.
   * @return {Object} Redux-style action.
   */
  setResourceDataAvailabilityDate(resourceSlug, resourceType, date) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof resourceSlug && resourceSlug.length > 0, 'resourceSlug must be a non-empty string.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(_constants__WEBPACK_IMPORTED_MODULE_4__.RESOURCE_TYPES.includes(resourceType), 'resourceType must be a valid resource type.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Number.isInteger(date), 'date must be an integer.');
    return {
      payload: {
        resourceSlug,
        resourceType,
        date
      },
      type: SET_RESOURCE_DATA_AVAILABILITY_DATE
    };
  }
};
const reducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.createReducer)((state, {
  payload,
  type
}) => {
  switch (type) {
    case RECEIVE_MODULE_DATA:
      {
        const {
          tagIDMismatch,
          resourceAvailabilityDates,
          customDimensionsDataAvailable,
          newEvents,
          lostEvents,
          newBadgeEvents,
          isWebDataStreamUnavailable
        } = payload;

        // Replace empty array value with empty object in resourceAvailabilityDates object.
        const replacedResourceAvailabilityDates = Object.entries(resourceAvailabilityDates || {}).reduce((acc, [key, value]) => ({
          ...acc,
          [key]: Array.isArray(value) ? {} : value
        }), {});
        const moduleData = {
          hasMismatchedTag: !!tagIDMismatch,
          resourceAvailabilityDates: replacedResourceAvailabilityDates,
          customDimensionsDataAvailable,
          newEvents,
          lostEvents,
          newBadgeEvents,
          isWebDataStreamUnavailable
        };
        state.moduleData = moduleData;
        break;
      }
    case SET_RESOURCE_DATA_AVAILABILITY_DATE:
      {
        const {
          resourceSlug,
          resourceType,
          date
        } = payload;
        if (state.moduleData.resourceAvailabilityDates === undefined) {
          state.moduleData.resourceAvailabilityDates = {};
        }
        if (state.moduleData.resourceAvailabilityDates[resourceType] === undefined) {
          state.moduleData.resourceAvailabilityDates[resourceType] = {};
        }
        state.moduleData.resourceAvailabilityDates[resourceType][resourceSlug] = date;
        break;
      }
    default:
      {
        break;
      }
  }
});
const resolvers = {
  *getModuleData() {
    const {
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.getRegistry();
    const moduleData = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.commonActions.await(resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_MODULES).getModuleInlineData(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_3__.MODULE_SLUG_ANALYTICS_4));
    if (!moduleData) {
      return;
    }
    yield actions.receiveModuleData(moduleData);
  }
};
const selectors = {
  /**
   * Gets all module data from this data store.
   *
   * Not intended to be used publicly; this is largely here so other selectors can
   * request data using the selector/resolver pattern.
   *
   * @since 1.148.0
   * @private
   *
   * @param {Object} state Data store's state.
   * @return {(Object|undefined)} Module data.
   */
  getModuleData(state) {
    return state.moduleData;
  },
  /**
   * Checks if GA4 has mismatched Google Tag ID.
   *
   * @since 1.96.0
   * @since 1.148.0 Moved over from properties data store partial.
   *
   * @param {Object} state Data store's state.
   * @return {boolean} If GA4 has mismatched Google Tag ID.
   */
  hasMismatchedGoogleTagID: getModuleDataProperty('hasMismatchedTag'),
  /**
   * Gets the data availability date for all resources.
   *
   * @since 1.127.0
   * @since 1.160.0 Moved over from partial-data store partial.
   *
   * @param {Object} state Data store's state.
   * @return {Object} Resource data availability dates. Undefined if not loaded.
   */
  getResourceDataAvailabilityDates: getModuleDataProperty('resourceAvailabilityDates'),
  /**
   * Gets the custom dimensions data availability object.
   *
   * @since 1.160.0
   *
   * @param {Object} state Data store's state.
   * @return {Object|undefined} Object mapping custom dimension slugs to their data availability state.
   */
  getCustomDimensionsDataAvailable: getModuleDataProperty('customDimensionsDataAvailable'),
  /**
   * Gets new events data.
   *
   * @since 1.148.0
   *
   * @param {Object} state Data store's state.
   * @return {Array|undefined} New events array.
   */
  getNewEvents: getModuleDataProperty('newEvents'),
  /**
   * Gets lost events data.
   *
   * @since 1.148.0
   *
   * @param {Object} state Data store's state.
   * @return {Array|undefined} Lost events array.
   */
  getLostEvents: getModuleDataProperty('lostEvents'),
  /**
   * Gets new badge events data.
   *
   * @since 1.148.0
   *
   * @param {Object} state Data store's state.
   * @return {Array|undefined} New badge events array.
   */
  getNewBadgeEvents: getModuleDataProperty('newBadgeEvents'),
  /**
   * Checks if the Web Data Stream is unavailable.
   *
   * @since 1.159.0
   *
   * @return {boolean|undefined} TRUE if the Web Data Stream is unavailable, FALSE if available or not checked, undefined if not loaded.
   */
  isWebDataStreamUnavailable: getModuleDataProperty('isWebDataStreamUnavailable')
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
  initialState,
  actions,
  reducer,
  resolvers,
  selectors
});

/***/ },

/***/ "./js/modules/analytics-4/datastore/partial-data.js"
/*!**********************************************************!*\
  !*** ./js/modules/analytics-4/datastore/partial-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 */   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 _js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/data/create-fetch-store */ "./js/googlesitekit/data/create-fetch-store.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_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_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: partial data store.
 *
 * 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 fetchSaveResourceDataAvailabilityDateStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_3__.createFetchStore)({
  baseName: 'saveResourceDataAvailabilityDate',
  controlCallback: ({
    resourceSlug,
    resourceType,
    date
  }) => (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_1__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4, 'save-resource-data-availability-date', {
    resourceSlug,
    resourceType,
    date
  }),
  argsToParams: (resourceSlug, resourceType, date) => ({
    resourceSlug,
    resourceType,
    date
  }),
  validateParams: ({
    resourceSlug,
    resourceType,
    date
  }) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof resourceSlug && resourceSlug.length > 0, 'resourceSlug must be a non-empty string.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(_constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPES.includes(resourceType), 'resourceType must be a valid resource type.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Number.isInteger(date), 'date must be an integer.');
  },
  isAction: true
});
const baseActions = {};
const baseControls = {};
const baseResolvers = {
  *getResourceDataAvailabilityDate(resourceSlug, resourceType) {
    const {
      dispatch,
      select,
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    if (select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(resourceSlug, resourceType) !== undefined) {
      return;
    }

    // Module data needs to be resolved to determine the resource data availability date.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getModuleData());
    const resourceAvailabilityDates = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDates();
    if (resourceAvailabilityDates[resourceType][resourceSlug] === undefined) {
      // Ensure the settings are loaded.
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(Promise.all([resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getSettings(), resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getAudienceSettings()]));

      // Validate if the resourceSlug is a valid resource.
      switch (resourceType) {
        case _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_AUDIENCE:
          yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getOrSyncAvailableAudiences());
          if (!select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasAudiences(resourceSlug)) {
            return;
          }
          break;
        case _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_CUSTOM_DIMENSION:
          if (!select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).hasCustomDimensions(resourceSlug)) {
            return;
          }
          break;
        case _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_PROPERTY:
          if (select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyID() !== resourceSlug) {
            return;
          }
          break;
        default:
          return;
      }
      yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getAuthentication());

      // Return early if user is not authenticated.
      if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).isAuthenticated()) {
        yield dispatch(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).setResourceDataAvailabilityDate(resourceSlug, resourceType, 0);
        return;
      }
      const reportArgs = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPartialDataReportOptions(resourceSlug, resourceType));

      // Return early if reportArgs is not available.
      if (!reportArgs) {
        return;
      }
      const report = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getReport(reportArgs));
      const hasReportError = !!select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportArgs]);
      const isDataAvailable = !hasReportError && report?.rows?.[0]?.dimensionValues?.[0]?.value?.length;
      if (isDataAvailable) {
        const dataAvailabilityDate = Number(report.rows[0].dimensionValues[0].value);
        yield dispatch(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).setResourceDataAvailabilityDate(resourceSlug, resourceType, dataAvailabilityDate);
        yield fetchSaveResourceDataAvailabilityDateStore.actions.fetchSaveResourceDataAvailabilityDate(resourceSlug, resourceType, dataAvailabilityDate);
      } else {
        yield dispatch(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).setResourceDataAvailabilityDate(resourceSlug, resourceType, 0);
      }
    }
  },
  *getPartialDataReportOptions() {
    const {
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyCreateTime());
  }
};
const baseSelectors = {
  /**
   * Gets the data availability date for a specific resource.
   *
   * @since 1.127.0
   *
   * @param {Object} state        Data store's state.
   * @param {string} resourceSlug Resource slug.
   * @param {string} resourceType Resource type.
   * @return {number} Resource data availability date. Undefined if not loaded.
   */
  getResourceDataAvailabilityDate: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, resourceSlug, resourceType) => select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getModuleData()?.resourceAvailabilityDates?.[resourceType]?.[resourceSlug]),
  /**
   * Gets whether the given resource is in partial data state.
   *
   * @since 1.127.0
   *
   * @param {Object} state        Data store's state.
   * @param {string} resourceSlug Resource slug.
   * @param {string} resourceType Resource type.
   * @return {boolean} Returns TRUE if partial data, otherwise FALSE or undefined while loading.
   */
  isResourcePartialData: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, resourceSlug, resourceType) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()('string' === typeof resourceSlug && resourceSlug.length > 0, 'resourceSlug must be a non-empty string.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(_constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPES.includes(resourceType), 'resourceType must be a valid resource type.');
    const analyticsGatheringData = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isGatheringData();
    if (analyticsGatheringData === undefined) {
      return undefined;
    }

    // If the GA property is in gathering data state, the resource is in partial data state.
    if (analyticsGatheringData) {
      return true;
    }
    const dataAvailabilityDate = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getResourceDataAvailabilityDate(resourceSlug, resourceType);
    if (dataAvailabilityDate === undefined) {
      return undefined;
    }

    // Assume partial data if the data availability date is not available.
    if (dataAvailabilityDate === 0) {
      return true;
    }
    const {
      startDate
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getDateRangeDates();

    // TODO: use `replaceAll` instead when we upgrade our Node version.
    const startDateYYYYMMDD = Number(startDate.replace(/-/g, ''));
    return dataAvailabilityDate > startDateYYYYMMDD;
  }),
  /**
   * Gets whether the given audience is in partial data state.
   *
   * @since 1.127.0
   *
   * @param {Object} state                Data store's state.
   * @param {string} audienceResourceName Audience resource name.
   * @return {boolean} Returns TRUE if partial data, otherwise FALSE or undefined while loading.
   */
  isAudiencePartialData: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, audienceResourceName) => select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isResourcePartialData(audienceResourceName, _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_AUDIENCE)),
  /**
   * Gets whether the given custom dimension is in partial data state.
   *
   * @since 1.127.0
   *
   * @param {Object} state               Data store's state.
   * @param {string} customDimensionSlug Custom dimension slug.
   * @return {boolean} Returns TRUE if partial data, otherwise FALSE or undefined while loading.
   */
  isCustomDimensionPartialData: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, customDimensionSlug) => select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isResourcePartialData(customDimensionSlug, _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_CUSTOM_DIMENSION)),
  /**
   * Gets whether the given property is in partial data state.
   *
   * @since 1.127.0
   *
   * @param {Object} state      Data store's state.
   * @param {string} propertyID Property ID.
   * @return {boolean} Returns TRUE if partial data, otherwise FALSE or undefined while loading.
   */
  isPropertyPartialData: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, propertyID) => select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).isResourcePartialData(propertyID, _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_PROPERTY)),
  /**
   * Gets report options for determining data availability date for a given resource.
   *
   * @since 1.127.0
   *
   * @param {Object} state        Data store's state.
   * @param {string} resourceSlug Resource slug.
   * @param {string} resourceType Resource type.
   * @return {Object|undefined} Report options for determining data availability date. Undefined if not available.
   */
  getPartialDataReportOptions: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, resourceSlug, resourceType) => {
    const propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyID();
    if (!propertyID) {
      return undefined;
    }
    const propertyCreateTime = select(_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4).getPropertyCreateTime();
    if (!propertyCreateTime) {
      return undefined;
    }

    // Valid use of `new Date()` with an argument.
    // eslint-disable-next-line sitekit/no-direct-date
    const startDate = (0,_js_util__WEBPACK_IMPORTED_MODULE_6__.getDateString)(new Date(propertyCreateTime));
    const endDate = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_USER).getReferenceDate();
    switch (resourceType) {
      case _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_AUDIENCE:
        return {
          startDate,
          endDate,
          dimensions: ['date', 'audienceResourceName'],
          dimensionFilters: {
            audienceResourceName: resourceSlug
          },
          metrics: ['totalUsers'],
          orderby: [{
            dimension: {
              dimensionName: 'date'
            }
          }],
          limit: 1,
          reportID: 'analytics-4_get-partial-data-report-options_store:selector_RESOURCE_TYPE_AUDIENCE'
        };
      case _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_CUSTOM_DIMENSION:
        return {
          startDate,
          endDate,
          dimensions: ['date', `customEvent:${resourceSlug}`],
          metrics: ['eventCount'],
          limit: 1,
          reportID: 'analytics-4_get-partial-data-report-options_store:selector_RESOURCE_TYPE_CUSTOM_DIMENSION'
        };
      case _constants__WEBPACK_IMPORTED_MODULE_7__.RESOURCE_TYPE_PROPERTY:
        return {
          startDate,
          endDate,
          dimensions: ['date'],
          metrics: ['totalUsers'],
          limit: 1,
          reportID: 'analytics-4_get-partial-data-report-options_store:selector_RESOURCE_TYPE_PROPERTY'
        };
      default:
        return undefined;
    }
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.combineStores)(fetchSaveResourceDataAvailabilityDateStore, {
  actions: baseActions,
  controls: baseControls,
  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/analytics-4/datastore/properties.js"
/*!********************************************************!*\
  !*** ./js/modules/analytics-4/datastore/properties.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 _wordpress_data__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/data */ "../node_modules/@wordpress/data/build-module/factory.js");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! googlesitekit-api */ "googlesitekit-api");
/* harmony import */ var googlesitekit_api__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__);
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* 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_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_utils__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_modules_tagmanager_datastore_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/tagmanager/datastore/constants */ "./js/modules/tagmanager/datastore/constants.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: properties.
 *
 * 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 fetchGetPropertyStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'getProperty',
  controlCallback({
    propertyID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4, 'property', {
      propertyID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, property, {
    propertyID
  }) => {
    state.propertiesByID = state.propertiesByID || {};
    state.propertiesByID[propertyID] = property;
  }),
  argsToParams(propertyID) {
    return {
      propertyID
    };
  },
  validateParams({
    propertyID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(propertyID, 'propertyID is required.');
  }
});
const fetchGetPropertiesStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'getProperties',
  controlCallback({
    accountID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4, 'properties', {
      accountID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, properties, {
    accountID
  }) => {
    state.properties = state.properties || {};
    state.propertiesByID = state.propertiesByID || {};
    state.properties[accountID] = properties;
    for (const property of properties) {
      state.propertiesByID[property._id] = property;
    }
  }),
  argsToParams(accountID) {
    return {
      accountID
    };
  },
  validateParams({
    accountID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(accountID, 'accountID is required.');
  }
});
const fetchCreatePropertyStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'createProperty',
  controlCallback({
    accountID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4, 'create-property', {
      accountID
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, property, {
    accountID
  }) => {
    state.properties = state.properties || {};
    if (!state.properties[accountID]) {
      state.properties[accountID] = [];
    }
    state.properties[accountID].push(property);
  }),
  argsToParams(accountID) {
    return {
      accountID
    };
  },
  validateParams({
    accountID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(accountID, 'accountID is required.');
  },
  isAction: true
});
const fetchGetGoogleTagSettingsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'getGoogleTagSettings',
  controlCallback({
    measurementID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4, 'google-tag-settings', {
      measurementID
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, googleTagSettings, {
    measurementID
  }) => {
    if (!state.googleTagSettings) {
      state.googleTagSettings = {};
    }
    state.googleTagSettings[measurementID] = googleTagSettings;
  }),
  argsToParams(measurementID) {
    return {
      measurementID
    };
  },
  validateParams({
    measurementID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(measurementID, 'measurementID is required.');
  }
});
const fetchSetGoogleTagIDMismatch = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'setGoogleTagIDMismatch',
  controlCallback({
    hasMismatchedTag
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4, 'set-google-tag-id-mismatch', {
      hasMismatchedTag
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, hasMismatchedTag) => {
    if (!state.moduleData) {
      state.moduleData = {};
    }
    state.moduleData.hasMismatchedTag = !!hasMismatchedTag;
  }),
  argsToParams(hasMismatchedTag) {
    return {
      hasMismatchedTag
    };
  },
  validateParams({
    hasMismatchedTag
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isBoolean)(hasMismatchedTag), 'hasMismatchedTag must be boolean.');
  },
  isAction: true
});
const fetchSetIsWebDataStreamUnavailable = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_6__.createFetchStore)({
  baseName: 'setIsWebDataStreamUnavailable',
  controlCallback({
    isWebDataStreamUnavailable
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_3__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4, 'set-is-web-data-stream-unavailable', {
      isWebDataStreamUnavailable
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, isWebDataStreamUnavailable) => {
    state.moduleData.isWebDataStreamUnavailable = !!isWebDataStreamUnavailable;
  }),
  argsToParams(isWebDataStreamUnavailable) {
    return {
      isWebDataStreamUnavailable
    };
  },
  validateParams({
    isWebDataStreamUnavailable
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isBoolean)(isWebDataStreamUnavailable), 'isWebDataStreamUnavailable must be boolean.');
  },
  isAction: true
});

// Actions
const MATCHING_ACCOUNT_PROPERTY = 'MATCHING_ACCOUNT_PROPERTY';
const SET_HAS_MISMATCHED_TAG = 'SET_HAS_MISMATCHED_GOOGLE_TAG_ID';
const baseInitialState = {
  properties: {},
  propertiesByID: {},
  isMatchingAccountProperty: false
};
const baseActions = {
  /**
   * Creates a new GA4 property.
   *
   * @since 1.31.0
   *
   * @param {string} accountID Analytics account ID.
   * @return {Object} Object with `response` and `error`.
   */
  createProperty(accountID) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(accountID, 'accountID is required.');
    return function* () {
      const {
        dispatch
      } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
      const {
        response,
        error
      } = yield fetchCreatePropertyStore.actions.fetchCreateProperty(accountID);
      if (response) {
        // Refresh account summaries to load the new property.
        yield dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).resetAccountSummaries();
      }
      return {
        response,
        error
      };
    }();
  },
  /**
   * Sets the given property and related fields in the store.
   *
   * @since 1.31.0
   *
   * @param {string} propertyID GA4 property ID.
   * @return {Object} A Generator function.
   */
  selectProperty: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_7__.createValidatedAction)(propertyID => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertySelection)(propertyID), 'A valid propertyID selection is required.');
  }, function* (propertyID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const {
      setPropertyCreateTime,
      setSettings,
      setWebDataStreamID,
      updateSettingsForMeasurementID
    } = registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4);
    setSettings({
      propertyID,
      propertyCreateTime: 0
    });
    updateSettingsForMeasurementID('');
    if (_constants__WEBPACK_IMPORTED_MODULE_15__.PROPERTY_CREATE === propertyID) {
      setWebDataStreamID(_constants__WEBPACK_IMPORTED_MODULE_15__.WEBDATASTREAM_CREATE);
      return;
    }
    setWebDataStreamID('');
    if (propertyID) {
      const property = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getProperty(propertyID));
      if (property?.createTime) {
        setPropertyCreateTime(property.createTime);
      }
    }
    let webdatastream = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getMatchingWebDataStreamByPropertyID(propertyID));
    if (!webdatastream) {
      const webdatastreams = registry.select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getWebDataStreams(propertyID);
      if (webdatastreams?.length) {
        webdatastream = webdatastreams[0];
      }
    }
    if (webdatastream) {
      setWebDataStreamID(webdatastream._id);
      updateSettingsForMeasurementID(
      // eslint-disable-next-line sitekit/acronym-case
      webdatastream.webStreamData.measurementId);
      return;
    }
    // At this point there is no web data stream to set.
    setWebDataStreamID(_constants__WEBPACK_IMPORTED_MODULE_15__.WEBDATASTREAM_CREATE);
  }),
  /**
   * Finds a matching property and returns it.
   *
   * @since 1.36.0
   *
   * @return {Object|null} Matching property on success, otherwise NULL.
   */
  *findMatchedProperty() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const accounts = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getAccountSummaries());
    if (!Array.isArray(accounts) || accounts.length === 0) {
      return null;
    }
    const url = registry.select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getReferenceSiteURL();
    const propertyIDs = accounts.reduce((acc, {
      propertySummaries: properties
    }) => [...acc, ...(properties || []).map(({
      _id
    }) => _id)], []);
    return yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).matchPropertyByURL(propertyIDs, url));
  },
  /**
   * Matches a property for provided accountID.
   *
   * @since 1.38.0
   *
   * @param {string} accountID GA4 account ID.
   * @return {Object|null} Matched property object on success, otherwise NULL.
   */
  *matchAccountProperty(accountID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const referenceURL = registry.select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_SITE).getReferenceSiteURL();
    const propertySummaries = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getPropertySummaries(accountID));
    const property = yield baseActions.matchPropertyByURL((propertySummaries || []).map(({
      _id
    }) => _id), referenceURL);
    return property;
  },
  /**
   * Matches and selects a property for provided accountID.
   *
   * @since 1.34.0
   *
   * @param {string} accountID          GA4 account ID.
   * @param {string} fallbackPropertyID A fallback propertyID to use if a matched property is not found.
   * @return {Object|null} Matched property object on success, otherwise NULL.
   */
  *matchAndSelectProperty(accountID, fallbackPropertyID = '') {
    yield {
      payload: {
        isMatchingAccountProperty: true
      },
      type: MATCHING_ACCOUNT_PROPERTY
    };
    const property = yield baseActions.matchAccountProperty(accountID);
    const propertyID = property?._id || fallbackPropertyID;
    if (propertyID) {
      yield baseActions.selectProperty(propertyID);
    }
    yield {
      payload: {
        isMatchingAccountProperty: false
      },
      type: MATCHING_ACCOUNT_PROPERTY
    };
    return property;
  },
  /**
   * Matches a property by URL.
   *
   * @since 1.33.0
   *
   * @param {Array.<number>}        properties Array of property IDs.
   * @param {Array.<string>|string} url        A list of URLs or a signle URL to match properties.
   * @return {Object} A property object if found.
   */
  *matchPropertyByURL(properties, url) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const urls = (Array.isArray(url) ? url : [url]).filter(item => typeof item === 'string').map(_js_util__WEBPACK_IMPORTED_MODULE_14__.normalizeURL);
    for (let index = 0; index < properties.length; index += _constants__WEBPACK_IMPORTED_MODULE_15__.MAX_WEBDATASTREAMS_PER_BATCH) {
      const chunk = properties.slice(index, index + _constants__WEBPACK_IMPORTED_MODULE_15__.MAX_WEBDATASTREAMS_PER_BATCH);
      const webdatastreams = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getWebDataStreamsBatch(chunk));
      for (const propertyID in webdatastreams) {
        for (const webdatastream of webdatastreams[propertyID]) {
          for (const singleURL of urls) {
            if (singleURL === (0,_js_util__WEBPACK_IMPORTED_MODULE_14__.normalizeURL)(
            // eslint-disable-next-line sitekit/acronym-case
            webdatastream.webStreamData?.defaultUri)) {
              return yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getProperty(propertyID));
            }
          }
        }
      }
    }
    return null;
  },
  /**
   * Matches a property by measurement ID.
   *
   * @since 1.33.0
   *
   * @param {Array.<number>}        properties    Array of property IDs.
   * @param {Array.<string>|string} measurementID A list of measurement IDs or a signle measurement ID to match properties.
   * @return {Object} A property object if found.
   */
  *matchPropertyByMeasurementID(properties, measurementID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const measurementIDs = Array.isArray(measurementID) ? measurementID : [measurementID];
    for (let index = 0; index < properties.length; index += _constants__WEBPACK_IMPORTED_MODULE_15__.MAX_WEBDATASTREAMS_PER_BATCH) {
      const chunk = properties.slice(index, index + _constants__WEBPACK_IMPORTED_MODULE_15__.MAX_WEBDATASTREAMS_PER_BATCH);
      const webdatastreams = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getWebDataStreamsBatch(chunk));
      for (const propertyID in webdatastreams) {
        for (const webdatastream of webdatastreams[propertyID]) {
          for (const singleMeasurementID of measurementIDs) {
            if (singleMeasurementID === webdatastream.webStreamData?.measurementId // eslint-disable-line sitekit/acronym-case
            ) {
              return yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getProperty(propertyID));
            }
          }
        }
      }
    }
    return null;
  },
  /**
   * Updates settings for a given measurement ID.
   *
   * @since 1.94.0
   *
   * @param {string} measurementID Measurement ID.
   */
  *updateSettingsForMeasurementID(measurementID) {
    const {
      select,
      dispatch,
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    if (!measurementID) {
      dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).setSettings({
        measurementID,
        googleTagAccountID: '',
        googleTagContainerID: '',
        googleTagID: ''
      });
      return;
    }
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).setMeasurementID(measurementID);

    // Wait for authentication to be resolved to check scopes.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).getAuthentication());
    if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).hasScope(_js_modules_tagmanager_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.READ_SCOPE)) {
      return;
    }
    const googleTagSettings = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getGoogleTagSettings(measurementID));
    if (!googleTagSettings) {
      return;
    }
    const {
      googleTagAccountID,
      googleTagContainerID,
      googleTagID
    } = googleTagSettings;

    // Note that when plain actions are dispatched in a function where an await has occurred (this can be a regular async function that has awaited, or a generator function
    // action that yields to an async action), they are handled asynchronously when they would normally be synchronous. This means that following the usual pattern of dispatching
    // individual setter actions for the `googleTagAccountID`, `googleTagContainerID` and `googleTagID` settings each resulted in a rerender of the
    // GoogleTagIDMismatchNotification component, thus resulting in an erroneous call to the GET:container-destinations endpoint with mismatched settings. To mitigate this, we
    // dispatch a single action here to set all these settings at once. The same applies to the `setSettings()` call above.
    // See issue https://github.com/google/site-kit-wp/issues/6784 and the PR https://github.com/google/site-kit-wp/pull/6814.
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).setSettings({
      googleTagAccountID,
      googleTagContainerID,
      googleTagID
    });
  },
  /* eslint-disable-next-line sitekit/jsdoc-no-unnamed-boolean-params */
  /**
   * Sets if GA4 has mismatched Google Tag ID.
   *
   * @since 1.96.0
   * @since 1.130.0 Updated to send value to the endpoint.
   *
   * @param {boolean} hasMismatchedTag If GA4 has mismatched Google Tag.
   */
  *setHasMismatchedGoogleTagID(hasMismatchedTag) {
    yield fetchSetGoogleTagIDMismatch.actions.fetchSetGoogleTagIDMismatch(hasMismatchedTag);
  },
  /* eslint-disable-next-line sitekit/jsdoc-no-unnamed-boolean-params */
  /**
   * Sets if GA4 has mismatched Google Tag ID.
   *
   * @since 1.130.0
   *
   * @param {boolean} hasMismatchedTag If GA4 has mismatched Google Tag.
   * @return {Object} Redux-style action.
   */
  *receiveHasMismatchGoogleTagID(hasMismatchedTag) {
    return {
      type: SET_HAS_MISMATCHED_TAG,
      payload: {
        hasMismatchedTag: !!hasMismatchedTag
      }
    };
  },
  /* eslint-disable-next-line sitekit/jsdoc-no-unnamed-boolean-params */
  /**
   * Sets whether the Web Data Stream is unavailable.
   *
   * @since 1.99.0
   * @since 1.159.0 Updated to use the fetch store.
   *
   * @param {boolean} isWebDataStreamUnavailable Whether the Web Data Stream is unavailable.
   * @return {Object} Generator function.
   */
  *setIsWebDataStreamUnavailable(isWebDataStreamUnavailable) {
    return yield fetchSetIsWebDataStreamUnavailable.actions.fetchSetIsWebDataStreamUnavailable(isWebDataStreamUnavailable);
  },
  /**
   * Syncs Google Tag settings.
   *
   * @since 1.95.0
   */
  *syncGoogleTagSettings() {
    const {
      select,
      dispatch,
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const hasTagManagerReadScope = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_9__.CORE_USER).hasScope(_js_modules_tagmanager_datastore_constants__WEBPACK_IMPORTED_MODULE_13__.READ_SCOPE);
    if (!hasTagManagerReadScope) {
      return;
    }

    // Wait for modules to be available before selecting.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_MODULES).getModules());
    const {
      isModuleConnected
    } = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_MODULES);
    if (!isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4)) {
      return;
    }

    // Wait for module settings to be available before selecting.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getSettings());
    const {
      getGoogleTagID,
      getMeasurementID,
      getGoogleTagLastSyncedAtMs,
      getGoogleTagAccountID,
      getGoogleTagContainerID
    } = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4);
    const measurementID = getMeasurementID();
    if (!measurementID) {
      return;
    }
    const googleTagLastSyncedAtMs = getGoogleTagLastSyncedAtMs();

    // The "last synced" value should reflect the real time this action
    // was performed, so we don't use the reference date here.
    const timestamp = Date.now(); // eslint-disable-line sitekit/no-direct-date

    if (!!googleTagLastSyncedAtMs && timestamp - googleTagLastSyncedAtMs < _js_util__WEBPACK_IMPORTED_MODULE_14__.HOUR_IN_SECONDS * 1000) {
      return;
    }
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).setGoogleTagLastSyncedAtMs(timestamp);
    const googleTagID = getGoogleTagID();
    if (!!googleTagID) {
      const googleTagContainer = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getGoogleTagContainer(measurementID));
      yield baseActions.setIsWebDataStreamUnavailable(!googleTagContainer);
      if (googleTagContainer && !googleTagContainer.tagIds.includes(googleTagID)) {
        yield baseActions.setHasMismatchedGoogleTagID(true);
      }
    } else {
      yield baseActions.updateSettingsForMeasurementID(measurementID);
    }
    const googleTagAccountID = getGoogleTagAccountID();
    const googleTagContainerID = getGoogleTagContainerID();
    const googleTagContainerDestinations = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getGoogleTagContainerDestinations(googleTagAccountID, googleTagContainerID)) || []; // Fallback used in the event of an error.

    const googleTagContainerDestinationIDs = googleTagContainerDestinations?.map(
    // eslint-disable-next-line sitekit/acronym-case
    ({
      destinationId
    }) => destinationId);
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).setGoogleTagContainerDestinationIDs(googleTagContainerDestinationIDs);
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).saveSettings();
  }
};
const baseControls = {};
const baseReducer = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.createReducer)((state, {
  type,
  payload
}) => {
  switch (type) {
    case MATCHING_ACCOUNT_PROPERTY:
      {
        state.isMatchingAccountProperty = payload.isMatchingAccountProperty;
        break;
      }
    case SET_HAS_MISMATCHED_TAG:
      {
        state.moduleData = state.moduleData || {};
        state.moduleData.hasMismatchedTag = payload.hasMismatchedTag;
        break;
      }
    default:
      break;
  }
});
const baseResolvers = {
  *getProperties(accountID) {
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidAccountID)(accountID)) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    // Only fetch properties if there are none in the store for the given account.
    const properties = registry.select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getProperties(accountID);
    if (properties === undefined) {
      yield fetchGetPropertiesStore.actions.fetchGetProperties(accountID);
    }
  },
  *getProperty(propertyID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const property = registry.select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getProperty(propertyID);
    if (property === undefined) {
      yield fetchGetPropertyStore.actions.fetchGetProperty(propertyID);
    }
  },
  *getPropertySummaries() {
    const {
      resolveSelect
    } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getAccountSummaries());
  },
  *getPropertyCreateTime() {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    // Ensure settings are available to select.
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getSettings());
    const propertyID = registry.select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getPropertyID();
    const propertyCreateTime = registry.select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getPropertyCreateTime();
    if (propertyCreateTime || !(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertyID)(propertyID)) {
      return;
    }
    const cachedPropertyCreateTime = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await((0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_5__.getItem)(`analytics4-properties-getPropertyCreateTime-${propertyID}`));
    if (cachedPropertyCreateTime.cacheHit) {
      registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).setPropertyCreateTime(cachedPropertyCreateTime.value);
      return;
    }
    const property = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getProperty(propertyID));
    if (!property?.createTime) {
      return;
    }

    // Cache this value for 1 hour (the default cache time).
    yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.await((0,_js_googlesitekit_api_cache__WEBPACK_IMPORTED_MODULE_5__.setItem)(`analytics4-properties-getPropertyCreateTime-${propertyID}`, property.createTime));
    registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).setPropertyCreateTime(property.createTime);
  },
  *getGoogleTagSettings(measurementID) {
    if (!measurementID) {
      return null;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.commonActions.getRegistry();
    const googleTagSettings = registry.select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getGoogleTagSettings(measurementID);
    if (googleTagSettings !== undefined) {
      return googleTagSettings;
    }
    return yield fetchGetGoogleTagSettingsStore.actions.fetchGetGoogleTagSettings(measurementID);
  }
};
const baseSelectors = {
  /**
   * Gets all GA4 properties this account can access.
   *
   * @since 1.31.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The GA4 Account ID to fetch properties for.
   * @return {(Array.<Object>|undefined)} An array of GA4 properties; `undefined` if not loaded.
   */
  getProperties(state, accountID) {
    return state.properties[accountID];
  },
  /**
   * Gets a property with specific ID.
   *
   * @since 1.31.0
   *
   * @param {Object} state      Data store's state.
   * @param {string} propertyID The GA4 property ID to fetch property object for.
   * @return {(Object|undefined)} A property object; `undefined` if not loaded.
   */
  getProperty(state, propertyID) {
    return state.propertiesByID[propertyID];
  },
  /**
   * Gets all GA4 properties from the account summaries this account can access.
   *
   * @since 1.118.0
   *
   * @param {Object} state     Data store's state.
   * @param {string} accountID The GA4 Account ID to fetch properties for.
   * @return {(Array.<Object>|undefined)} An array of GA4 properties; `undefined` if not loaded.
   */
  getPropertySummaries: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, accountID) => {
    const accountSummaries = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getAccountSummaries();
    if (accountSummaries === undefined) {
      return undefined;
    }
    const account = accountSummaries.find(summary => summary._id === accountID);
    return account ? account.propertySummaries : [];
  }),
  /**
   * Gets Google tag settings.
   *
   * @since 1.150.0
   *
   * @param {Object} state         Data store's state.
   * @param {string} measurementID Measurement ID.
   * @return {(Object|undefined)} A Google tag settings object; `undefined` if not loaded.
   */
  getGoogleTagSettings(state, measurementID) {
    return state.googleTagSettings?.[measurementID];
  },
  /**
   * Determines whether we are matching account property or not.
   *
   * @since 1.98.0
   *
   * @param {Object} state Data store's state.
   * @return {boolean} TRUE if we matching account property right now, otherwise FALSE.
   */
  isMatchingAccountProperty(state) {
    return state.isMatchingAccountProperty;
  },
  /**
   * Checks if properties summaries are currently being loaded.
   *
   * This selector was introduced as a convenience for reusing the same loading logic across multiple
   * components, initially the `PropertySelect` and `SettingsEnhancedMeasurementSwitch` components.
   *
   * @since 1.118.0
   *
   * @return {boolean} TRUE if the properties summaries are currently being loaded, otherwise FALSE.
   */
  isLoadingPropertySummaries: (0,_wordpress_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    return !select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries') || select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).isMatchingAccountProperty() || select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).hasFinishedSelectingAccount() === false;
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.combineStores)(fetchCreatePropertyStore, fetchGetPropertiesStore, fetchGetPropertyStore, fetchGetGoogleTagSettingsStore, fetchSetGoogleTagIDMismatch, fetchSetIsWebDataStreamUnavailable, {
  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/analytics-4/datastore/report.js"
/*!****************************************************!*\
  !*** ./js/modules/analytics-4/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 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__);
/* 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 _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_get_report_resolver__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/create-get-report-resolver */ "./js/googlesitekit/data/create-get-report-resolver.ts");
/* 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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_googlesitekit_modules_create_gathering_data_store__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/googlesitekit/modules/create-gathering-data-store */ "./js/googlesitekit/modules/create-gathering-data-store.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/utils */ "./js/modules/analytics-4/utils/index.js");
/* harmony import */ var _js_modules_analytics_4_utils_page_titles_report__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/page-titles-report */ "./js/modules/analytics-4/utils/page-titles-report.ts");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_report_options__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/util/report-options */ "./js/util/report-options.ts");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: report.
 *
 * 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
 */














const fetchGetReportStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'getReport',
  controlCallback: ({
    options
  }, {
    signal
  } = {}) => {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4, 'report', (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_10__.normalizeReportOptions)(options), {
      signal
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, report, {
    options
  }) => {
    state.reports[(0,_js_util_report_options__WEBPACK_IMPORTED_MODULE_14__.getReportCacheKey)(options)] = report;
  }),
  argsToParams: options => {
    return {
      options: (0,_js_util_report_options__WEBPACK_IMPORTED_MODULE_14__.getCacheableReportOptions)(options)
    };
  },
  validateParams: ({
    options
  } = {}) => (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.validateReport)(options)
});
const gatheringDataStore = (0,_js_googlesitekit_modules_create_gathering_data_store__WEBPACK_IMPORTED_MODULE_8__.createGatheringDataStore)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_9__.MODULE_SLUG_ANALYTICS_4, {
  storeName: _constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4,
  dataAvailable: globalThis._googlesitekitModulesData?.['data_available_analytics-4'],
  selectDataAvailability: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
    // Disable reason: This needs to be run here in order for the report to be resolved.
    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
    const hasZeroData = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).hasZeroData();
    const args = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getSampleReportArgs();
    const hasResolvedReport = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [args]);
    if (!hasResolvedReport || hasZeroData === undefined) {
      return undefined;
    }
    const hasReportError = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [args]);

    // If there is an error, return `null` since we don't know if there is data or not.
    if (hasReportError) {
      return null;
    }
    if (hasZeroData === false) {
      return true;
    }
    const isAuthenticated = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).isAuthenticated();
    if (isAuthenticated === undefined) {
      return undefined;
    }
    if (!isAuthenticated) {
      return false;
    }
    const propertyCreateTime = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getPropertyCreateTime();
    if (undefined === propertyCreateTime) {
      return undefined;
    }

    // If the property is new and has no data, assume it's still gathering data.
    if (propertyCreateTime === 0) {
      return false;
    }

    // If the property was created within the last three days and has no data, assume it's still gathering data.
    const now = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getReferenceDate();
    const threeDaysAgo = (0,_js_util__WEBPACK_IMPORTED_MODULE_13__.dateSub)(now, 3 * _js_util__WEBPACK_IMPORTED_MODULE_13__.DAY_IN_SECONDS);
    if (propertyCreateTime > threeDaysAgo.getTime()) {
      return false;
    }
    return true;
  })
});
const baseInitialState = {
  reports: {}
};
const baseResolvers = {
  getReport: (0,_js_googlesitekit_data_create_get_report_resolver__WEBPACK_IMPORTED_MODULE_5__.createGetReportResolver)(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4)
};
const baseSelectors = {
  /**
   * Gets an Analytics report for the given options.
   *
   * @since 1.94.0
   * @since 1.111.0 Add metricFilters to the options list, to reflect added support for the metric filters.
   * @since 1.182.0 Accept optional fetch options as a second argument, such as `{ signal }` to cancel the report request.
   * @since 1.183.0 Treat report options that differ only in `reportID` as one report.
   *
   * @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. End date to query report data for as YYYY-mm-dd.
   * @param {Array.<string>} options.metrics            Required. List of metrics to query.
   * @param {string}         [options.compareStartDate] Optional. Start date to compare report data for as YYYY-mm-dd.
   * @param {string}         [options.compareEndDate]   Optional. End date to compare report data for as YYYY-mm-dd.
   * @param {Array.<string>} [options.dimensions]       Optional. List of dimensions to group results by. Default an empty array.
   * @param {Object}         [options.dimensionFilters] Optional. Map of dimension filters for filtering options on a dimension. Default an empty object.
   * @param {Object}         [options.metricFilters]    Optional. Map of metric filters for filtering options on a metric. Default an empty object.
   * @param {Array.<Object>} [options.orderby]          Optional. An order definition object, or a list of order definition objects, each one containing 'fieldName' and 'sortOrder'. 'sortOrder' must be either 'ASCENDING' or 'DESCENDING'. Default empty array.
   * @param {string}         [options.url]              Optional. URL to get a report for only this URL. Default an empty string.
   * @param {number}         [options.limit]            Optional. Maximum number of entries to return. Default 1000.
   * @param {Object}         [fetchOptions]             Optional. Fetch options that change how the request runs, such as `{ signal }` to cancel it.
   * @return {(Array.<Object>|undefined)} An Analytics report; `undefined` if not loaded.
   */
  // eslint-disable-next-line no-unused-vars -- The fetch options only change how the request runs, so the selector does not read them.
  getReport(state, options, fetchOptions) {
    const {
      reports
    } = state;
    return reports[(0,_js_util_report_options__WEBPACK_IMPORTED_MODULE_14__.getReportCacheKey)(options)];
  },
  /**
   * Gets a Page title to URL map for the given options.
   *
   * @since 1.96.0
   *
   * @param {Object} state             Data store's state.
   * @param {Object} report            A report from the getReport selector containing pagePaths.
   * @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, end date to query report data for as YYYY-mm-dd.
   * @return {(Object|undefined)} A map with url as the key and page title as the value. `undefined` if not loaded.
   */
  getPageTitles: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, report, {
    startDate,
    endDate
  } = {}) => {
    if (!(0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(report)) {
      return undefined;
    }
    const pagePaths = [];

    /*
     * Iterate over the report rows, finding the dimension containing the
     * pagePath value which we add to the array of pagePaths.
     */
    const {
      dimensionHeaders,
      rows
    } = report;
    if (Array.isArray(dimensionHeaders) && Array.isArray(rows)) {
      const pagePathIndex = dimensionHeaders.findIndex(({
        name
      }) => name === 'pagePath');
      rows.forEach(({
        dimensionValues
      }) => {
        if (!pagePaths.includes(dimensionValues[pagePathIndex].value)) {
          pagePaths.push(dimensionValues[pagePathIndex].value);
        }
      });
    }
    const urlTitleMap = {};
    if (!pagePaths.length) {
      return urlTitleMap;
    }
    const options = (0,_js_modules_analytics_4_utils_page_titles_report__WEBPACK_IMPORTED_MODULE_11__.getPageTitlesReportOptions)({
      startDate,
      endDate
    }, pagePaths);
    const pageTitlesReport = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getReport(options);
    if (undefined === pageTitlesReport) {
      return undefined;
    }
    (pageTitlesReport?.rows || []).forEach(({
      dimensionValues
    }) => {
      if (!urlTitleMap[dimensionValues[0].value]) {
        // key is the url, value is the page title.
        urlTitleMap[dimensionValues[0].value] = dimensionValues[1].value;
      }
    });
    pagePaths.forEach(pagePath => {
      if (!urlTitleMap[pagePath]) {
        // If we don't have a title for the pagePath, we use '(unknown)'.
        urlTitleMap[pagePath] = (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('(unknown)', 'google-site-kit');
      }
    });
    return urlTitleMap;
  }),
  /**
   * Determines whether any of the provided reports are currently loading.
   *
   * @since 1.179.0
   *
   * @param {Object}   state         Data store's state.
   * @param {Object[]} reportOptions Report options to check the loading state for. Each entry should be an object of options that would be passed to `getReport` selector.
   * @return {boolean|undefined} Returns `true` any of the provided reports are loading, `false` if none of the provided reports are loading.
   */
  areReportsLoading: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, ...reportOptions) => reportOptions.some(options => !select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [options]))),
  /**
   * Returns the first error found among the provided report options.
   *
   * @since 1.179.0
   *
   * @param {Object}   state         Data store's state.
   * @param {Object[]} reportOptions Report options to check for errors. Each entry should be an object of options that would be passed to `getReport` selector.
   * @return {(Object|undefined)} Returns the first error object found, or `undefined` if no errors exist.
   */
  getFirstReportError: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, ...reportOptions) => {
    for (const options of reportOptions) {
      const error = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [options]);
      if (error) {
        return error;
      }
    }
    return undefined;
  }),
  /**
   * Determines whether Analytics 4 has zero data or not.
   *
   * @since 1.95.0
   * @since 1.107.0 Returns `true` if the report request has an error to be consistent with `hasZeroData` selectors of other modules.
   * @since 1.128.0 Add optional `reportArgs` parameter to allow checking zero data for a specific report.
   *
   * @param {Object}           state      Data store's state.
   * @param {Object|undefined} reportArgs Optional. Options for generating the report.
   * @return {boolean|undefined} Returns `true` if the report is zero, otherwise `false`. Returns `undefined` while resolving.
   */
  hasZeroData: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, reportArgs) => {
    const args = reportArgs || select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getSampleReportArgs();

    // Disable reason: select needs to be called here or it will never run.
    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
    const report = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getReport(args);
    const hasResolvedReport = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [args]);
    if (!hasResolvedReport) {
      return undefined;
    }
    const hasReportError = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [args]);

    // If there is an error, we assume it's a zero report.
    if (hasReportError) {
      return true;
    }
    return (0,_js_modules_analytics_4_utils__WEBPACK_IMPORTED_MODULE_10__.isZeroReport)(report);
  }),
  /**
   * Returns report args for a sample report.
   *
   * @since 1.107.0
   * @since 1.124.0 Moved from the main analytics-4 datastore file to utils.
   * @since 1.136.0 Moved back to the main analytics-4 datastore file and updated to be a selector.
   *
   * @param {Function} select The select function of the registry.
   * @return {Object} Report args.
   */
  getSampleReportArgs: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => {
    const {
      compareStartDate: startDate,
      endDate
    } = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_USER).getDateRangeDates({
      compare: true
    });
    const args = {
      dimensions: ['date'],
      metrics: [{
        name: 'totalUsers'
      }],
      startDate,
      endDate
    };
    const url = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).getCurrentEntityURL();
    if (url) {
      args.url = url;
    }
    return args;
  }),
  /**
   * Gets a given report for each of the provided audiences.
   *
   * @since 1.126.0
   *
   * @param {Object}   state                 Data store's state.
   * @param {Object}   options               Options for generating the report.
   * @param {string[]} audienceResourceNames Audience resource names to get the report for.
   * @return {Array.<Object>} An array of report response objects for each provided audience resource name.
   */
  getReportForAllAudiences: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, options, audienceResourceNames) => {
    return audienceResourceNames?.map(audienceResourceName => {
      const partialDataSiteKitAudience = select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getPartialDataSiteKitAudience(audienceResourceName);
      if (partialDataSiteKitAudience === undefined) {
        return undefined;
      }
      const dimensionFilters = {};
      if (partialDataSiteKitAudience) {
        dimensionFilters.newVsReturning = partialDataSiteKitAudience.audienceSlug === 'new-visitors' ? 'new' : 'returning';
      } else {
        dimensionFilters.audienceResourceName = audienceResourceName;
      }
      return select(_constants__WEBPACK_IMPORTED_MODULE_15__.MODULES_ANALYTICS_4).getReport({
        ...options,
        dimensionFilters: {
          ...options.dimensionFilters,
          ...dimensionFilters
        }
      });
    });
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.combineStores)(fetchGetReportStore, gatheringDataStore, {
  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/analytics-4/datastore/service.js"
/*!*****************************************************!*\
  !*** ./js/modules/analytics-4/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 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_1__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.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_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_modules_analytics_4_utils_report_args__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/report-args */ "./js/modules/analytics-4/utils/report-args.js");
/* harmony import */ var _js_modules_analytics_4_utils_report_date_range_args__WEBPACK_IMPORTED_MODULE_6__ = __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_escape_uri__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/util/escape-uri */ "./js/util/escape-uri.ts");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: service.
 *
 * 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
 */







const selectors = {
  /**
   * Gets a URL to the service.
   *
   * @since 1.119.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_2__.createRegistrySelector)(select => (state, {
    path,
    query
  } = {}) => {
    let serviceURL = 'https://analytics.google.com/analytics/web/';
    if (query) {
      serviceURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.addQueryArgs)(serviceURL, {
        ...query,
        utm_source: 'sitekit'
      });
    }
    if (path) {
      const sanitizedPath = `/${path.replace(/^\//, '')}`;
      serviceURL = `${serviceURL}#${sanitizedPath}`;
    }
    const accountChooserBaseURI = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getAccountChooserURL(serviceURL);
    if (accountChooserBaseURI === undefined) {
      return undefined;
    }
    return accountChooserBaseURI;
  }),
  /**
   * Gets a URL for a specific Analytics 4 reporting view on the service.
   *
   * @since 1.98.0
   *
   * @param {Object} state        Data store's state.
   * @param {string} type         Report type.
   * @param {Object} [reportArgs] Report-specific arguments for targeting a specific sub-view.
   * @return {(string|undefined)} The service URL.
   */
  getServiceReportURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => (state, type, reportArgs = {}) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(type, 'type is required to get a service report URL.');
    const propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPropertyID();
    if (!propertyID) {
      return undefined;
    }
    const {
      dates,
      details = {},
      filters = {},
      otherArgs = {}
    } = reportArgs;
    const embeddedParams = {
      [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__.REPORT_ARGS_NAV_KEY]: 'maui',
      ...(dates ? (0,_js_modules_analytics_4_utils_report_date_range_args__WEBPACK_IMPORTED_MODULE_6__.generateDateRangeArgs)(dates) : {}),
      ...(0,_js_modules_analytics_4_utils_report_args__WEBPACK_IMPORTED_MODULE_5__.generateReportDetailArgs)(details),
      ...(0,_js_modules_analytics_4_utils_report_args__WEBPACK_IMPORTED_MODULE_5__.generateReportFilterArgs)(filters)
    };

    // Here we turn embeddedParams into a query string without any URI encoding, as the
    // result will be encoded by addQueryArgs, and we don't want to double-encode it.
    const params = Object.entries(embeddedParams).map(([key, value]) => `${key}=${value}`).join('&');
    const path = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_1__.addQueryArgs)((0,_js_util_escape_uri__WEBPACK_IMPORTED_MODULE_7__.escapeURI)`/p${propertyID}/reports/explorer`, {
      params,
      r: type,
      ...otherArgs
    });
    return select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceURL({
      query: {
        pli: 1
      },
      path
    });
  }),
  /**
   * Gets an entity access URL on the service.
   *
   * @since 1.109.0
   *
   * @param {Object} state Data store's state.
   * @return {string|undefined} The entity access URL to the service.
   */
  getServiceEntityAccessURL: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.createRegistrySelector)(select => () => {
    const accountID = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getAccountID();
    const propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getPropertyID();
    const webDataStreamID = select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getWebDataStreamID();
    if (!accountID || !propertyID || !webDataStreamID) {
      return undefined;
    }
    return select(_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getServiceURL({
      path: (0,_js_util_escape_uri__WEBPACK_IMPORTED_MODULE_7__.escapeURI)`/a${accountID}p${propertyID}/admin/streams/table/${webDataStreamID}`
    });
  })
};
const store = {
  selectors
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);

/***/ },

/***/ "./js/modules/analytics-4/datastore/settings.js"
/*!******************************************************!*\
  !*** ./js/modules/analytics-4/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_PROPERTY_SELECTION: () => (/* binding */ INVARIANT_INVALID_PROPERTY_SELECTION),
/* harmony export */   INVARIANT_INVALID_WEBDATASTREAM_ID: () => (/* binding */ INVARIANT_INVALID_WEBDATASTREAM_ID),
/* harmony export */   INVARIANT_INVALID_WEBDATASTREAM_NAME: () => (/* binding */ INVARIANT_INVALID_WEBDATASTREAM_NAME),
/* harmony export */   INVARIANT_WEBDATASTREAM_ALREADY_EXISTS: () => (/* binding */ INVARIANT_WEBDATASTREAM_ALREADY_EXISTS),
/* harmony export */   "default": () => (__WEBPACK_DEFAULT_EXPORT__),
/* harmony export */   rollbackChanges: () => (/* binding */ rollbackChanges),
/* harmony export */   submitChanges: () => (/* binding */ submitChanges),
/* harmony export */   validateCanSubmitChanges: () => (/* binding */ validateCanSubmitChanges),
/* harmony export */   validateHaveSettingsChanged: () => (/* binding */ validateHaveSettingsChanged)
/* 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 _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/data/create-settings-store */ "./js/googlesitekit/data/create-settings-store.js");
/* harmony import */ var _js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.js");
/* harmony import */ var _js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/forms/constants */ "./js/googlesitekit/datastore/forms/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_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/googlesitekit/notifications/constants */ "./js/googlesitekit/notifications/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` 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_INVALID_PROPERTY_SELECTION = 'a valid propertyID is required to submit changes';
const INVARIANT_INVALID_WEBDATASTREAM_ID = 'a valid webDataStreamID is required to submit changes';
const INVARIANT_INVALID_WEBDATASTREAM_NAME = 'a valid web data stream name is required to submit changes';
const INVARIANT_WEBDATASTREAM_ALREADY_EXISTS = 'a web data stream with the same name already exists';
const store = {
  selectors: {
    areSettingsEditDependenciesLoaded: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => () => select(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries'))
  }
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (store);
async function submitChanges({
  dispatch,
  select,
  resolveSelect
}) {
  let propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).getPropertyID();
  if (propertyID === _constants__WEBPACK_IMPORTED_MODULE_13__.PROPERTY_CREATE) {
    const accountID = select(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).getAccountID();
    const {
      response: property,
      error
    } = await dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).createProperty(accountID);
    if (error) {
      return {
        error
      };
    }
    propertyID = property._id;
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).setPropertyID(propertyID);
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).setWebDataStreamID(_constants__WEBPACK_IMPORTED_MODULE_13__.WEBDATASTREAM_CREATE);
    await dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).updateSettingsForMeasurementID('');
  }
  let webDataStreamID = select(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).getWebDataStreamID();
  if (propertyID && webDataStreamID === _constants__WEBPACK_IMPORTED_MODULE_13__.WEBDATASTREAM_CREATE) {
    const webDataStreamName = select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_FORMS).getValue(_constants__WEBPACK_IMPORTED_MODULE_13__.FORM_SETUP, 'webDataStreamName');
    let webDataStreamAlreadyExists = false;
    if ((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertyID)(propertyID)) {
      webDataStreamAlreadyExists = await resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).doesWebDataStreamExist(propertyID, webDataStreamName);
    }
    if ((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidWebDataStreamName)(webDataStreamName) && false === webDataStreamAlreadyExists) {
      const {
        response: webdatastream,
        error
      } = await dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).createWebDataStream(propertyID, webDataStreamName);
      if (error) {
        return {
          error
        };
      }
      webDataStreamID = webdatastream._id;
      dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).setWebDataStreamID(webDataStreamID);
      await dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).updateSettingsForMeasurementID(
      // eslint-disable-next-line sitekit/acronym-case
      webdatastream.webStreamData.measurementId);
    }
  }
  if ((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertyID)(propertyID) && (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidWebDataStreamID)(webDataStreamID)) {
    const isEnhancedMeasurementEnabled = select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_FORMS).getValue(_constants__WEBPACK_IMPORTED_MODULE_13__.ENHANCED_MEASUREMENT_FORM, _constants__WEBPACK_IMPORTED_MODULE_13__.ENHANCED_MEASUREMENT_ENABLED);

    // Only make the API request to enable the Enhanced Measurement setting, not to disable it.
    if (isEnhancedMeasurementEnabled) {
      const {
        error
      } = await updateEnhancedMeasurementSettings({
        select,
        dispatch,
        propertyID,
        webDataStreamID,
        isEnhancedMeasurementEnabled
      });
      if (error) {
        return {
          error
        };
      }
    }
  }
  const {
    error
  } = await saveSettings(select, dispatch);
  if (error) {
    return {
      error
    };
  }
  dispatch(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_8__.CORE_USER).resetUserAudienceSettings();
  await (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.invalidateCache)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_11__.MODULE_SLUG_ANALYTICS_4);
  return {};
}
async function saveSettings(select, dispatch) {
  const haveSettingsChanged = select(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).haveSettingsChanged();
  if (haveSettingsChanged) {
    const {
      error
    } = await dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).saveSettings();
    if (error) {
      return {
        error
      };
    }
  }
  const haveConversionTrackingSettingsChanged = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).haveConversionTrackingSettingsChanged();
  if (haveConversionTrackingSettingsChanged) {
    const {
      error
    } = await dispatch(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).saveConversionTrackingSettings();
    if (error) {
      return {
        error
      };
    }
  }
  const haveGoogleTagGatewaySettingsChanged = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).haveGoogleTagGatewaySettingsChanged();
  if (haveGoogleTagGatewaySettingsChanged) {
    const {
      error
    } = await dispatch(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).saveGoogleTagGatewaySettings();
    if (error) {
      return {
        error
      };
    }
    if (select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).isGoogleTagGatewayEnabled() && !select(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_NOTIFICATIONS).isNotificationDismissed(_js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_9__.GTG_SETUP_CTA_BANNER_NOTIFICATION)) {
      const {
        error: dismissError
      } = (await dispatch(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_NOTIFICATIONS).dismissNotification(_js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_9__.GTG_SETUP_CTA_BANNER_NOTIFICATION)) || {};
      if (dismissError) {
        return {
          error: dismissError
        };
      }
    }
  }
  return {};
}
async function updateEnhancedMeasurementSettings({
  select,
  dispatch,
  propertyID,
  webDataStreamID,
  isEnhancedMeasurementEnabled
}) {
  await dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).setEnhancedMeasurementStreamEnabled({
    propertyID,
    webDataStreamID,
    enabled: isEnhancedMeasurementEnabled
  });
  if (select(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).haveEnhancedMeasurementSettingsChanged(propertyID, webDataStreamID)) {
    const {
      error
    } = await dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).updateEnhancedMeasurementSettings(propertyID, webDataStreamID);
    if (error) {
      return {
        error
      };
    }
    const shouldDismissActivationBanner = select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_FORMS).getValue(_constants__WEBPACK_IMPORTED_MODULE_13__.ENHANCED_MEASUREMENT_FORM, _constants__WEBPACK_IMPORTED_MODULE_13__.ENHANCED_MEASUREMENT_SHOULD_DISMISS_ACTIVATION_BANNER);
    if (shouldDismissActivationBanner) {
      await dispatch(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_10__.CORE_NOTIFICATIONS).dismissNotification('enhanced-measurement-notification');
    }
  }
  return {};
}
function rollbackChanges({
  select,
  dispatch
}) {
  if (select(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).haveSettingsChanged()) {
    dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).rollbackSettings();
    dispatch(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).resetConversionTrackingSettings();
    dispatch(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).resetGoogleTagGatewaySettings();
  }
  dispatch(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4).resetEnhancedMeasurementSettings();
}
function validateCanSubmitChanges(select) {
  const {
    haveAnyGA4SettingsChanged,
    isDoingSubmitChanges,
    getPropertyID,
    getWebDataStreamID,
    doesWebDataStreamExist
  } = (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_5__.createStrictSelect)(select)(_constants__WEBPACK_IMPORTED_MODULE_13__.MODULES_ANALYTICS_4);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(haveAnyGA4SettingsChanged(), _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_4__.INVARIANT_SETTINGS_NOT_CHANGED);
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(!isDoingSubmitChanges(), _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_4__.INVARIANT_DOING_SUBMIT_CHANGES);
  const propertyID = getPropertyID();
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertySelection)(propertyID), INVARIANT_INVALID_PROPERTY_SELECTION);
  const webDataStreamID = getWebDataStreamID();
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidWebDataStreamSelection)(webDataStreamID), INVARIANT_INVALID_WEBDATASTREAM_ID);
  if (webDataStreamID === _constants__WEBPACK_IMPORTED_MODULE_13__.WEBDATASTREAM_CREATE) {
    const webDataStreamName = select(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_FORMS).getValue(_constants__WEBPACK_IMPORTED_MODULE_13__.FORM_SETUP, 'webDataStreamName');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidWebDataStreamName)(webDataStreamName), INVARIANT_INVALID_WEBDATASTREAM_NAME);
    if ((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_12__.isValidPropertyID)(propertyID)) {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()(false === doesWebDataStreamExist(propertyID, webDataStreamName), INVARIANT_WEBDATASTREAM_ALREADY_EXISTS);
    }
  }
}
function validateHaveSettingsChanged(select, state, keys) {
  const {
    settings,
    savedSettings
  } = state;
  const haveConversionTrackingSettingsChanged = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).haveConversionTrackingSettingsChanged();
  const haveGoogleTagGatewaySettingsChanged = select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_7__.CORE_SITE).haveGoogleTagGatewaySettingsChanged();
  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)) || haveConversionTrackingSettingsChanged || haveGoogleTagGatewaySettingsChanged, _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_4__.INVARIANT_SETTINGS_NOT_CHANGED);
  }
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(!(0,lodash__WEBPACK_IMPORTED_MODULE_1__.isEqual)(settings, savedSettings) || haveConversionTrackingSettingsChanged || haveGoogleTagGatewaySettingsChanged, _js_googlesitekit_data_create_settings_store__WEBPACK_IMPORTED_MODULE_4__.INVARIANT_SETTINGS_NOT_CHANGED);
}

/***/ },

/***/ "./js/modules/analytics-4/datastore/tags.js"
/*!**************************************************!*\
  !*** ./js/modules/analytics-4/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 */   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_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_data_create_existing_tag_store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/data/create-existing-tag-store */ "./js/googlesitekit/data/create-existing-tag-store.js");
/* harmony import */ var _js_modules_analytics_4_utils_tag_matchers__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/tag-matchers */ "./js/modules/analytics-4/utils/tag-matchers.js");
/* harmony import */ var _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/validation */ "./js/modules/analytics-4/utils/validation.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` 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 existingTagStore = (0,_js_googlesitekit_data_create_existing_tag_store__WEBPACK_IMPORTED_MODULE_1__.createExistingTagStore)({
  storeName: _constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4,
  tagMatchers: (0,_js_modules_analytics_4_utils_tag_matchers__WEBPACK_IMPORTED_MODULE_2__.getTagMatchers)(),
  isValidTag: _js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_3__.isValidMeasurementID
});

// Override the `getExistingTag()` resolver to provide the extended Google Tag behavior.
existingTagStore.resolvers.getExistingTag = function* () {
  const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.commonActions.getRegistry();
  let existingTag = registry.select(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getExistingTag();
  if (existingTag === undefined) {
    existingTag = yield existingTagStore.actions.fetchGetExistingTag();
  }

  // As it's not possible to directly look up a Google Tag container by one of its tag IDs, we look up the container by destination ID (the measurement ID).
  // We then check if the tag ID is included in the container's tag IDs. If so, we have confirmed the existing tag is a Google Tag pointing to the given measurement ID.
  // Otherwise, we ignore the existing tag (set it to null).
  if (existingTag !== null) {
    const container = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).getGoogleTagContainer(existingTag));
    if (!container?.tagIds?.includes(existingTag)) {
      existingTag = null;
    }
  }
  registry.dispatch(_constants__WEBPACK_IMPORTED_MODULE_4__.MODULES_ANALYTICS_4).receiveGetExistingTag(existingTag);
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.combineStores)(existingTagStore);
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/analytics-4/datastore/webdatastreams.js"
/*!************************************************************!*\
  !*** ./js/modules/analytics-4/datastore/webdatastreams.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 _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_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/data/utils */ "./js/googlesitekit/data/utils.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_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_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 _constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * `modules/analytics-4` data store: webdatastreams.
 *
 * 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 fetchGetWebDataStreamsStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'getWebDataStreams',
  controlCallback({
    propertyID
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'webdatastreams', {
      propertyID
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, webDataStreams, {
    propertyID
  }) => {
    state.webdatastreams[propertyID] = Array.isArray(webDataStreams) ? webDataStreams : [];
  }),
  argsToParams(propertyID) {
    return {
      propertyID
    };
  },
  validateParams({
    propertyID
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
  }
});
const fetchGetWebDataStreamsBatchStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'getWebDataStreamsBatch',
  controlCallback({
    propertyIDs
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.get)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'webdatastreams-batch', {
      propertyIDs
    }, {
      useCache: false
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, webDataStreams) => {
    state.webdatastreams = {
      ...state.webdatastreams,
      ...(webDataStreams || {})
    };
  }),
  argsToParams(propertyIDs) {
    return {
      propertyIDs
    };
  },
  validateParams({
    propertyIDs
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(propertyIDs), 'GA4 propertyIDs must be an array.');
    propertyIDs.forEach(propertyID => {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    });
  }
});
const fetchCreateWebDataStreamStore = (0,_js_googlesitekit_data_create_fetch_store__WEBPACK_IMPORTED_MODULE_4__.createFetchStore)({
  baseName: 'createWebDataStream',
  controlCallback({
    propertyID,
    displayName
  }) {
    return (0,googlesitekit_api__WEBPACK_IMPORTED_MODULE_2__.set)('modules', _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_7__.MODULE_SLUG_ANALYTICS_4, 'create-webdatastream', {
      propertyID,
      displayName
    });
  },
  reducerCallback: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createReducer)((state, webDataStream, {
    propertyID
  }) => {
    if (!state.webdatastreams[propertyID]) {
      state.webdatastreams[propertyID] = [];
    }
    state.webdatastreams[propertyID].push(webDataStream);
  }),
  argsToParams(propertyID, displayName) {
    return {
      propertyID,
      displayName
    };
  },
  isAction: true,
  validateParams({
    propertyID,
    displayName
  } = {}) {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidWebDataStreamName)(displayName), 'A valid web data stream name is required.');
  }
});
const baseInitialState = {
  webdatastreams: {}
};
const baseActions = {
  /**
   * Creates a new GA4 web data stream.
   *
   * @since 1.31.0
   * @since 1.124.0 Added displayName parameter.
   *
   * @param {string} propertyID  GA4 property ID.
   * @param {string} displayName A web data stream name.
   * @return {Object} Object with `response` and `error`.
   */
  createWebDataStream: (0,_js_googlesitekit_data_utils__WEBPACK_IMPORTED_MODULE_5__.createValidatedAction)((propertyID, displayName) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(propertyID, 'GA4 propertyID is required.');
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(displayName, 'Web data stream name is required.');
  }, function* (propertyID, displayName) {
    const {
      response,
      error
    } = yield fetchCreateWebDataStreamStore.actions.fetchCreateWebDataStream(propertyID, displayName);
    return {
      response,
      error
    };
  }),
  /**
   * Matches web data stream for provided property.
   *
   * @since 1.38.0
   *
   * @param {string} propertyID GA4 property ID.
   * @return {Object|null} Matched web data stream object on success, otherwise NULL.
   */
  *matchWebDataStream(propertyID) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    return yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(registry.resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getMatchingWebDataStreamByPropertyID(propertyID));
  }
};
const baseControls = {};
function* resolveGetWebDataStreams(propertyID) {
  const {
    resolveSelect
  } = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
  yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.await(resolveSelect(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getWebDataStreams(propertyID));
}
const baseResolvers = {
  *getWebDataStreams(propertyID) {
    if (!(0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID)) {
      return;
    }
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    // Only fetch web data streams if there are none in the store for the given property.
    const webdatastreams = registry.select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getWebDataStreams(propertyID);
    if (webdatastreams === undefined) {
      yield fetchGetWebDataStreamsStore.actions.fetchGetWebDataStreams(propertyID);
    }
  },
  *getWebDataStreamsBatch(propertyIDs) {
    const registry = yield googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.commonActions.getRegistry();
    const webdatastreams = registry.select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getWebDataStreamsBatch(propertyIDs) || {};
    const availablePropertyIDs = Object.keys(webdatastreams);
    const remainingPropertyIDs = (0,lodash__WEBPACK_IMPORTED_MODULE_1__.difference)(propertyIDs, availablePropertyIDs);
    if (remainingPropertyIDs.length > 0) {
      for (let index = 0; index < remainingPropertyIDs.length; index += _constants__WEBPACK_IMPORTED_MODULE_9__.MAX_WEBDATASTREAMS_PER_BATCH) {
        const chunk = remainingPropertyIDs.slice(index, index + _constants__WEBPACK_IMPORTED_MODULE_9__.MAX_WEBDATASTREAMS_PER_BATCH);
        yield fetchGetWebDataStreamsBatchStore.actions.fetchGetWebDataStreamsBatch(chunk);
      }
    }
  },
  getMatchingWebDataStreamByPropertyID: resolveGetWebDataStreams,
  doesWebDataStreamExist: resolveGetWebDataStreams
};
const baseSelectors = {
  /**
   * Gets all GA4 web data streams this account can access.
   *
   * @since 1.31.0
   *
   * @param {Object} state      Data store's state.
   * @param {string} propertyID The GA4 property ID to fetch web data streams for.
   * @return {(Array.<Object>|undefined)} An array of GA4 web data streams; `undefined` if not loaded.
   */
  getWebDataStreams(state, propertyID) {
    return state.webdatastreams[propertyID];
  },
  /**
   * Gets matched web data stream from a list of web data streams.
   *
   * @since 1.31.0
   * @since 1.90.0 Updated to match a data stream from a list of provided web data streams.
   *
   * @param {Object} state       Data store's state.
   * @param {Array}  datastreams A list of web data streams.
   * @return {(Object|null)} A web data stream object if found, otherwise null.
   */
  getMatchingWebDataStream: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, datastreams) => {
    const matchedWebDataStreams = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getMatchingWebDataStreams(datastreams);
    return matchedWebDataStreams[0] || null;
  }),
  /**
   * Gets web data streams that match the current reference URL.
   *
   * @since 1.98.0
   *
   * @param {Object} state       Data store's state.
   * @param {Array}  datastreams A list of web data streams.
   * @return {Array.<Object>} An array of found matched web data streams.
   */
  getMatchingWebDataStreams: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, datastreams) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(datastreams), 'datastreams must be an array.');
    const matchedWebDataStreams = [];
    for (const datastream of datastreams) {
      if (select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).isSiteURLMatch(
      // eslint-disable-next-line sitekit/acronym-case
      datastream.webStreamData?.defaultUri)) {
        matchedWebDataStreams.push(datastream);
      }
    }
    return matchedWebDataStreams;
  }),
  /**
   * Gets matched web data stream for selected property.
   *
   * @since 1.90.0
   *
   * @param {Object} state      Data store's state.
   * @param {string} propertyID The GA4 property ID to find matched web data stream.
   * @return {(Object|null|undefined)} A web data stream object if found, otherwise null; `undefined` if web data streams are not loaded.
   */
  getMatchingWebDataStreamByPropertyID: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (_state, propertyID) => {
    const datastreams = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getWebDataStreams(propertyID);
    if (datastreams === undefined) {
      return undefined;
    }
    const matchingDataStream = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getMatchingWebDataStream(datastreams);
    return matchingDataStream || null;
  }),
  /**
   * Gets web data streams in batch for selected properties.
   *
   * @since 1.32.0
   *
   * @param {Object}         state       Data store's state.
   * @param {Array.<string>} propertyIDs GA4 property IDs.
   * @return {Object} Web data streams.
   */
  getWebDataStreamsBatch(state, propertyIDs) {
    return (0,lodash__WEBPACK_IMPORTED_MODULE_1__.pick)(state.webdatastreams, propertyIDs);
  },
  /**
   * Gets the matched measurement IDs for the given property IDs.
   *
   * @since 1.88.0
   * @since 1.90.0 Use propertyIDs instead of property objects for matching.
   *
   * @param {Object}         state       Data store's state.
   * @param {Array.<string>} propertyIDs GA4 property IDs array of strings.
   * @return {(Object|undefined)} Object with matched property ID as the key and measurement ID as the value, or an empty object if no matches are found; `undefined` if web data streams are not loaded.
   */
  getMatchedMeasurementIDsByPropertyIDs: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (_state, propertyIDs) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()(Array.isArray(propertyIDs) && propertyIDs?.length, 'propertyIDs must be an array containing GA4 propertyIDs.');
    propertyIDs.forEach(propertyID => {
      invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    });
    const datastreams = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getWebDataStreamsBatch(propertyIDs);
    if (datastreams === undefined) {
      return undefined;
    }
    return propertyIDs.reduce((acc, currentPropertyID) => {
      if (!datastreams[currentPropertyID]?.length) {
        return acc;
      }
      const matchingDataStream = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getMatchingWebDataStream(datastreams[currentPropertyID]);
      if (!matchingDataStream) {
        return acc;
      }
      const measurementID =
      // eslint-disable-next-line sitekit/acronym-case
      matchingDataStream.webStreamData.measurementId;
      return {
        ...acc,
        [currentPropertyID]: measurementID
      };
    }, {});
  }),
  /**
   * Gets an Analytics config that matches one of provided measurement IDs.
   *
   * @since 1.94.0
   *
   * @param {Object}                state        Data store's state.
   * @param {string|Array.<string>} measurements Single GA4 measurement ID, or array of GA4 measurement ID strings.
   * @return {(Object|null|undefined)} An Analytics config that matches provided one of measurement IDs on success, NULL if no matching config is found, undefined if data hasn't been resolved yet.
   */
  getAnalyticsConfigByMeasurementIDs: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, measurements) => {
    const measurementIDs = Array.isArray(measurements) ? measurements : [measurements];
    let summaries = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAccountSummaries();
    if (!Array.isArray(summaries)) {
      return undefined;
    }

    // Sort summaries to have the current account at the very beginning,
    // so we can check it first because its more likely that the current
    // account will contain a measurement ID that we are looking for.
    const currentAccountID = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getAccountID();
    // Clone summaries to avoid mutating the original array.
    summaries = [...summaries].sort(({
      _id: accountID
    }) => accountID === currentAccountID ? -1 : 0);
    const info = {};
    const propertyIDs = [];
    summaries.forEach(({
      _id: accountID,
      propertySummaries = []
    }) => {
      propertySummaries.forEach(({
        _id: propertyID
      }) => {
        propertyIDs.push(propertyID);
        info[propertyID] = {
          accountID,
          propertyID
        };
      });
    });
    if (propertyIDs.length === 0) {
      return null;
    }

    // eslint-disable-next-line @wordpress/no-unused-vars-before-return
    const datastreams = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getWebDataStreamsBatch(propertyIDs);
    const resolvedDataStreams = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasFinishedResolution('getWebDataStreamsBatch', [propertyIDs]);

    // Return undefined if web data streams haven't been resolved yet.
    if (!resolvedDataStreams) {
      return undefined;
    }
    let firstlyFoundConfig;
    for (const propertyID in datastreams) {
      if (!datastreams[propertyID]?.length) {
        continue;
      }
      for (const datastream of datastreams[propertyID]) {
        const {
          _id: webDataStreamID,
          webStreamData
        } = datastream;
        const {
          defaultUri: defaultURI,
          // eslint-disable-line sitekit/acronym-case
          measurementId: measurementID // eslint-disable-line sitekit/acronym-case
        } = webStreamData;
        if (!measurementIDs.includes(measurementID)) {
          continue;
        }
        const config = {
          ...info[propertyID],
          webDataStreamID,
          measurementID
        };

        // Remember the firstly found config to return it at the end
        // if we don't manage to find the most suitable config.
        if (!firstlyFoundConfig) {
          firstlyFoundConfig = config;
        }

        // If only one measurement ID is provided, then we don't need
        // to check whether its default URI matches the current
        // reference URL. Otherwise, if we have many measurement IDs
        // then we need to find the one that matches the current
        // reference URL.
        if (measurementIDs.length === 1 || select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_SITE).isSiteURLMatch(defaultURI)) {
          return config;
        }
      }
    }
    return firstlyFoundConfig || null;
  }),
  /**
   * Checks if web data streams are currently being loaded.
   *
   * This selector was introduced as a convenience for reusing the same loading logic across multiple
   * components, initially the `WebDataStreamSelect` and `SettingsEnhancedMeasurementSwitch` components.
   *
   * @since 1.111.0
   *
   * @param {Object}  state                Data store's state.
   * @param {Object}  args                 Arguments object.
   * @param {boolean} args.hasModuleAccess Whether the current user has access to the Analytics module(s).
   */
  isLoadingWebDataStreams: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (state, {
    hasModuleAccess
  }) => {
    if (!select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasFinishedResolution('getAccountSummaries')) {
      return true;
    }
    const propertyID = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getPropertyID();
    const loadedWebDataStreams = (0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID) && hasModuleAccess ? select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasFinishedResolution('getWebDataStreams', [propertyID]) : true;
    if (!loadedWebDataStreams) {
      return true;
    }
    if (select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).hasFinishedSelectingAccount() === false) {
      return true;
    }
    if (select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isMatchingAccountProperty()) {
      return true;
    }
    return select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).isResolving('getProperty', [propertyID]);
  }),
  /**
   * Checks if a web data stream with the same name already exists.
   *
   * @since 1.124.0
   *
   * @param {Object} state             Data store's state.
   * @param {string} propertyID        GA4 property ID.
   * @param {string} webDataStreamName Web data stream name.
   * @return {(boolean|undefined)} TRUE if web data stream already exists, FALSE otherwise. Undefined if web data streams are not loaded yet.
   */
  doesWebDataStreamExist: (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.createRegistrySelector)(select => (_state, propertyID, webDataStreamName) => {
    invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,_js_modules_analytics_4_utils_validation__WEBPACK_IMPORTED_MODULE_8__.isValidPropertyID)(propertyID), 'A valid GA4 propertyID is required.');
    const webDataStreams = select(_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4).getWebDataStreams(propertyID);
    if (webDataStreams === undefined) {
      return undefined;
    }
    return webDataStreams.some(({
      displayName
    }) => displayName === webDataStreamName);
  })
};
const store = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.combineStores)(fetchGetWebDataStreamsStore, fetchGetWebDataStreamsBatchStore, fetchCreateWebDataStreamStore, {
  initialState: baseInitialState,
  actions: baseActions,
  controls: baseControls,
  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/analytics-4/hooks/useAllTrafficWidgetReport.js"
/*!*******************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useAllTrafficWidgetReport.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 */ useAllTrafficWidgetReport)
/* 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_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.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_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * Analytics useAllTrafficWidgetReport custom 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 report information for the Dashboard All Traffic GA4 widget.
 *
 * @since 1.153.0
 *
 * @param {Object} reportOptions Report options.
 * @return {Object} Report data.
 */
function useAllTrafficWidgetReport(reportOptions = {}) {
  const viewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_3__["default"])();
  const canViewSharedAnalytics4 = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (!viewOnly) {
      return true;
    }
    return select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).canViewSharedModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_4__.MODULE_SLUG_ANALYTICS_4);
  });
  const {
    startDate,
    endDate
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const entityURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_SITE).getCurrentEntityURL());
  const args = {
    startDate,
    endDate,
    metrics: [{
      name: 'totalUsers'
    }],
    ...reportOptions
  };
  if (entityURL) {
    args.url = entityURL;
  }
  const loaded = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => canViewSharedAnalytics4 && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [args]));
  const error = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [args]));
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => {
    return canViewSharedAnalytics4 && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_5__.MODULES_ANALYTICS_4).getReport(args);
  }, [canViewSharedAnalytics4, args]);
  return {
    error,
    loaded,
    report
  };
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useAudienceTilesReports.js"
/*!*****************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useAudienceTilesReports.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 */ useAudienceTilesReports)
/* 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.ts");
/* harmony import */ var _js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/audienceTilesReportOptions */ "./js/modules/analytics-4/utils/audienceTilesReportOptions.ts");
/**
 * Analytics useAudienceTilesReports custom 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
 */





/**
 * Checks if the audience reports are loaded for the given report options.
 *
 * @since 1.136.0
 *
 * @param {Object} reportOptions       Report options.
 * @param {Array}  configuredAudiences Configured audiences.
 * @return {boolean} Whether the report is loaded.
 */
function useReportsLoaded(reportOptions, configuredAudiences) {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => configuredAudiences.reduce((reportsLoaded, audienceResourceName) => {
    const partialDataSiteKitAudience = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getPartialDataSiteKitAudience(audienceResourceName);
    if (partialDataSiteKitAudience === undefined) {
      return {};
    }
    const dimensionFilters = {};
    if (partialDataSiteKitAudience) {
      dimensionFilters.newVsReturning = partialDataSiteKitAudience.audienceSlug === 'new-visitors' ? 'new' : 'returning';
    } else {
      dimensionFilters.audienceResourceName = audienceResourceName;
    }
    const isLoaded = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [{
      ...reportOptions,
      dimensionFilters: {
        ...reportOptions.dimensionFilters,
        ...dimensionFilters
      }
    }]);
    reportsLoaded[audienceResourceName] = isLoaded;
    return reportsLoaded;
  }, {}));
}

/**
 * Checks if there are errors for the audience reports with the given report options.
 *
 * @since 1.136.0
 *
 * @param {Object} reportOptions       Report options.
 * @param {Array}  configuredAudiences Configured audiences.
 * @return {Object} Object with the errors for each audience.
 */
function useReportErrors(reportOptions, configuredAudiences) {
  return (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    return configuredAudiences.reduce((acc, audienceResourceName) => {
      const partialDataSiteKitAudience = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getPartialDataSiteKitAudience(audienceResourceName);
      if (partialDataSiteKitAudience === undefined) {
        return acc;
      }
      const dimensionFilters = {};
      if (partialDataSiteKitAudience) {
        dimensionFilters.newVsReturning = partialDataSiteKitAudience.audienceSlug === 'new-visitors' ? 'new' : 'returning';
      } else {
        dimensionFilters.audienceResourceName = audienceResourceName;
      }
      const error = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [{
        ...reportOptions,
        dimensionFilters: {
          ...reportOptions.dimensionFilters,
          ...dimensionFilters
        }
      }]);
      if (error) {
        acc[audienceResourceName] = error;
      }
      return acc;
    }, {});
  });
}

/**
 * Fetch reports for audience tiles.
 *
 * @since 1.136.0
 *
 * @param {Object}  args                              Arguments for the hook.
 * @param {boolean} args.isSiteKitAudiencePartialData Whether the Site Kit audiences are partially loaded.
 * @param {Array}   args.siteKitAudiences             Site Kit audiences.
 * @param {Array}   args.otherAudiences               Other audiences.
 * @return {Object} Object with the report data.
 */
function useAudienceTilesReports({
  isSiteKitAudiencePartialData,
  siteKitAudiences,
  otherAudiences
}) {
  // An array of audience resource names.
  const configuredAudiences = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getConfiguredAudiences());
  const dates = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_1__.CORE_USER).getDateRangeDates({
    compare: true
  }));
  const shouldFetchReport = isSiteKitAudiencePartialData === undefined ? undefined : otherAudiences.length > 0 || isSiteKitAudiencePartialData === false;
  const shouldFetchSiteKitAudiencesReport = siteKitAudiences.length > 0 ? isSiteKitAudiencePartialData : false;
  const reportOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_3__.getAudienceTilesMetricsReportOptions)(dates, configuredAudiences);
  const report = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => {
    if (shouldFetchReport === undefined) {
      return undefined;
    }
    if (!shouldFetchReport) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getReport(reportOptions);
  }, [shouldFetchReport, reportOptions]);
  const reportLoaded = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (shouldFetchReport === undefined) {
      return undefined;
    }
    if (!shouldFetchReport) {
      // If we don't need to fetch the report, we can consider it loaded to simplify the loading state logic.
      return true;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [reportOptions]);
  });
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (shouldFetchReport === undefined) {
      return undefined;
    }
    if (!shouldFetchReport) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]);
  });
  const newVsReturningReportOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_3__.getAudienceTilesSiteKitAudiencesReportOptions)(dates);
  const siteKitAudiencesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => {
    if (shouldFetchSiteKitAudiencesReport === undefined) {
      return undefined;
    }
    if (!shouldFetchSiteKitAudiencesReport) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getReport(newVsReturningReportOptions);
  }, [shouldFetchSiteKitAudiencesReport, newVsReturningReportOptions]);
  const siteKitAudiencesReportLoaded = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (shouldFetchSiteKitAudiencesReport === undefined) {
      return undefined;
    }
    if (!shouldFetchSiteKitAudiencesReport) {
      // If we don't need to fetch the report, we can consider it loaded to simplify the loading state logic.
      return true;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [newVsReturningReportOptions]);
  });
  const siteKitAudiencesReportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => {
    if (shouldFetchSiteKitAudiencesReport === undefined) {
      return undefined;
    }
    if (!shouldFetchSiteKitAudiencesReport) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [newVsReturningReportOptions]);
  });
  const totalPageviewsReportOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_3__.getAudienceTilesTotalPageviewsReportOptions)(dates);
  const totalPageviewsReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => {
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getReport(totalPageviewsReportOptions);
  });
  const totalPageviewsReportLoaded = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).hasFinishedResolution('getReport', [totalPageviewsReportOptions]));
  const totalPageviewsReportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [totalPageviewsReportOptions]));
  const totalPageviews = Number(totalPageviewsReport?.totals?.[0]?.metricValues?.[0]?.value) || 0;
  const topCitiesReportOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_3__.getAudienceTilesTopCitiesReportOptions)(dates);
  const topCitiesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getReportForAllAudiences(topCitiesReportOptions, configuredAudiences));
  const topCitiesReportsLoaded = useReportsLoaded(topCitiesReportOptions, configuredAudiences);
  const topCitiesReportErrors = useReportErrors(topCitiesReportOptions, configuredAudiences);
  const topContentReportOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_3__.getAudienceTilesTopContentReportOptions)(dates);
  const topContentReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getReportForAllAudiences(topContentReportOptions, configuredAudiences));
  const topContentReportsLoaded = useReportsLoaded(topContentReportOptions, configuredAudiences);
  const topContentReportErrors = useReportErrors(topContentReportOptions, configuredAudiences);
  const topContentPageTitlesReportOptions = (0,_js_modules_analytics_4_utils_audienceTilesReportOptions__WEBPACK_IMPORTED_MODULE_3__.getAudienceTilesTopContentPageTitlesReportOptions)(dates);
  const topContentPageTitlesReport = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_0__.useInViewSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getReportForAllAudiences(topContentPageTitlesReportOptions, configuredAudiences));
  const topContentPageTitlesReportsLoaded = useReportsLoaded(topContentPageTitlesReportOptions, configuredAudiences);
  const topContentPageTitlesReportErrors = useReportErrors(topContentPageTitlesReportOptions, configuredAudiences);
  return {
    report,
    reportLoaded,
    reportError,
    siteKitAudiencesReport,
    siteKitAudiencesReportLoaded,
    siteKitAudiencesReportError,
    totalPageviews,
    totalPageviewsReportLoaded,
    totalPageviewsReportError,
    topCitiesReport,
    topCitiesReportsLoaded,
    topCitiesReportErrors,
    topContentReport,
    topContentReportsLoaded,
    topContentReportErrors,
    topContentPageTitlesReport,
    topContentPageTitlesReportsLoaded,
    topContentPageTitlesReportErrors
  };
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useCreateCustomDimensionForAudienceEffect.js"
/*!***********************************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useCreateCustomDimensionForAudienceEffect.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 */ useCreateCustomDimensionForAudienceEffect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * 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 useCreateCustomDimensionForAudienceEffect() {
  const isGA4Connected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_5__.MODULE_SLUG_ANALYTICS_4));
  const propertyID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4).getPropertyID());
  const hasAnalyticsEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.EDIT_SCOPE));
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_4__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'autoSubmit');
  const [, setIsAutoCreatingCustomDimensionsForAudience] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_4__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isAutoCreatingCustomDimensionsForAudience');
  const [, setIsRetrying] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_4__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.AUDIENCE_TILE_CUSTOM_DIMENSION_CREATE, 'isRetrying');
  const {
    fetchCreateCustomDimension,
    receiveIsCustomDimensionGatheringData,
    fetchSyncAvailableCustomDimensions
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    async function createDimensionsAndUpdateForm() {
      await fetchCreateCustomDimension(propertyID, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CUSTOM_DIMENSION_DEFINITIONS.googlesitekit_post_type);

      // If the custom dimension was created successfully, mark it as gathering
      // data immediately so that it doesn't cause unnecessary report requests.
      receiveIsCustomDimensionGatheringData({
        customDimension: 'googlesitekit_post_type',
        gatheringData: true
      });

      // Resync available custom dimensions to ensure the newly created custom dimension is available.
      await fetchSyncAvailableCustomDimensions();
      setIsAutoCreatingCustomDimensionsForAudience(false);
      setIsRetrying(false);
    }
    if (isGA4Connected && hasAnalyticsEditScope && autoSubmit) {
      setAutoSubmit(false);
      setIsAutoCreatingCustomDimensionsForAudience(true);
      createDimensionsAndUpdateForm();
    }
  }, [autoSubmit, fetchCreateCustomDimension, fetchSyncAvailableCustomDimensions, hasAnalyticsEditScope, isGA4Connected, propertyID, receiveIsCustomDimensionGatheringData, setAutoSubmit, setIsAutoCreatingCustomDimensionsForAudience, setIsRetrying]);
  return null;
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useCreateCustomDimensionsEffect.js"
/*!*************************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useCreateCustomDimensionsEffect.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 */ useCreateCustomDimensionsEffect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * 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 useCreateCustomDimensionsEffect() {
  const isKeyMetricsSetupCompleted = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_2__.CORE_SITE).isKeyMetricsSetupCompleted());
  const isGA4Connected = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_6__.MODULE_SLUG_ANALYTICS_4));
  const hasAnalyticsEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.EDIT_SCOPE));
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.FORM_CUSTOM_DIMENSIONS_CREATE, 'autoSubmit');
  const [customDimensions] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.FORM_CUSTOM_DIMENSIONS_CREATE, 'customDimensions');
  const [, setIsAutoCreatingCustomDimensions] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_5__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.FORM_CUSTOM_DIMENSIONS_CREATE, 'isAutoCreatingCustomDimensions');
  const {
    createCustomDimensions
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    async function createDimensionsAndUpdateForm() {
      await createCustomDimensions(customDimensions);
      setIsAutoCreatingCustomDimensions(false);
    }
    const hasExplicitCustomDimensions = Array.isArray(customDimensions) && customDimensions.length > 0;
    if ((isKeyMetricsSetupCompleted || hasExplicitCustomDimensions) && isGA4Connected && hasAnalyticsEditScope && autoSubmit) {
      setAutoSubmit(false);
      setIsAutoCreatingCustomDimensions(true);
      createDimensionsAndUpdateForm();
    }
  }, [autoSubmit, createCustomDimensions, customDimensions, hasAnalyticsEditScope, isKeyMetricsSetupCompleted, isGA4Connected, setAutoSubmit, setIsAutoCreatingCustomDimensions]);
  return null;
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useCustomDimensionsData.js"
/*!*****************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useCustomDimensionsData.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 */ useCustomDimensionsData)
/* 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_element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/react/index.js");
/* harmony import */ var _wordpress_url__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.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 _js_components_KeyMetrics_key_metrics_widgets__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/key-metrics-widgets */ "./js/components/KeyMetrics/key-metrics-widgets.js");
/* 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 _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_useFormValue__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/utils/custom-dimensions */ "./js/modules/analytics-4/utils/custom-dimensions.js");
/**
 * Custom hook for managing custom dimensions data and state.
 *
 * 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
 */








/**
 * Custom dimensions data and state.
 *
 * @since 1.181.0
 *
 * @typedef {Object} CustomDimensionsData
 * @property {Array<string>|null} customDimensions                    Custom dimensions for the wrapped metric.
 * @property {boolean|undefined}  hasCustomDimensions                 Whether all custom dimensions are available.
 * @property {boolean|undefined}  isAutoCreatingCustomDimensions      Whether custom dimensions are being auto-created.
 * @property {boolean}            isCreatingCustomDimensions          Whether custom dimensions are being created.
 * @property {Array<Object>}      customDimensionsCreationErrors      Custom dimension creation errors.
 * @property {boolean}            hasAnalyticsEditScope               Whether the user has the Analytics edit scope.
 * @property {boolean}            isSyncingAvailableCustomDimensions  Whether custom dimensions are being synced.
 * @property {boolean}            isNavigatingToOAuthURL              Whether the user is navigating to OAuth.
 * @property {Object|null}        reportOptions                       Report options for the wrapped metric.
 * @property {Object|null}        reportError                         Report error for the wrapped metric.
 * @property {boolean}            loading                             Whether custom dimension state is loading.
 * @property {boolean|null}       isGatheringData                     Whether custom dimensions are gathering data.
 * @property {Object}             dataAvailabilityReportErrors        Custom dimension data availability errors.
 * @property {boolean}            hasInvalidCustomDimensionError      Whether an invalid custom dimension error is present.
 * @property {Array<Object>}      invalidCustomDimensionReportOptions Report options with invalid custom dimension errors.
 * @property {string}             redirectURL                         OAuth redirect URL.
 */

/**
 * Gets custom dimensions data and state.
 *
 * @since 1.156.0
 *
 * @param {Object}                    options               Hook options.
 * @param {Array}                     options.dimensions    Custom dimensions array.
 * @param {string=}                   options.widgetSlug    Widget slug for getting widget configuration.
 * @param {Object|Function|undefined} options.reportOptions Report options for data fetching.
 * @return {CustomDimensionsData} Object containing custom dimensions data and state.
 */
function useCustomDimensionsData({
  dimensions,
  widgetSlug,
  reportOptions: wrappedReportOptions
}) {
  const {
    requiredCustomDimensions
  } = _js_components_KeyMetrics_key_metrics_widgets__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_WIDGETS[widgetSlug] || {};

  // Determine which custom dimensions to use.
  const customDimensions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useMemo)(() => {
    if (Array.isArray(dimensions) && dimensions.length) {
      return dimensions;
    }
    if (Array.isArray(requiredCustomDimensions) && requiredCustomDimensions.length) {
      return requiredCustomDimensions;
    }
    return null;
  }, [dimensions, requiredCustomDimensions]);
  const hasCustomDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !customDimensions || select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).hasCustomDimensions(customDimensions));
  const [isAutoCreatingCustomDimensions] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_7__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.FORM_CUSTOM_DIMENSIONS_CREATE, 'isAutoCreatingCustomDimensions');
  const isCreatingCustomDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (isAutoCreatingCustomDimensions) {
      return true;
    }
    return !!customDimensions && customDimensions.some(dimension => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isCreatingCustomDimension(dimension));
  });
  const customDimensionsCreationErrors = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!customDimensions) {
      return [];
    }
    const errors = [];
    customDimensions.forEach(dimension => {
      const error = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getCreateCustomDimensionError(dimension);
      if (error) {
        errors.push(error);
      }
    });
    return errors;
  });
  const hasAnalyticsEditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !!customDimensions && select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.EDIT_SCOPE));
  const isSyncingAvailableCustomDimensions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => !!customDimensions && select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isSyncingAvailableCustomDimensions());
  const redirectURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_2__.addQueryArgs)(globalThis.location.href, {
    notification: 'custom_dimensions'
  });
  const isNavigatingToOAuthURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const OAuthURL = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER).getConnectURL({
      additionalScopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.EDIT_SCOPE],
      redirectURL
    });
    if (!OAuthURL) {
      return false;
    }
    return select(_js_googlesitekit_datastore_location_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_LOCATION).isNavigatingTo(OAuthURL);
  });
  const reportOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!wrappedReportOptions) {
      return null;
    }
    return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isFunction)(wrappedReportOptions) ? wrappedReportOptions(select) : wrappedReportOptions;
  });
  const reportError = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!reportOptions) {
      return null;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getErrorForSelector('getReport', [reportOptions]);
  });
  const loading = isCreatingCustomDimensions || isSyncingAvailableCustomDimensions || isNavigatingToOAuthURL || hasCustomDimensions === undefined;
  const isGatheringData = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    const isGA4GatheringData = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).isGatheringData();
    if (isGA4GatheringData !== false) {
      return isGA4GatheringData;
    }
    if (loading || !hasCustomDimensions) {
      return null;
    }
    if (!customDimensions) {
      return false;
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).areCustomDimensionsGatheringData(customDimensions);
  });
  const dataAvailabilityReportErrors = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!customDimensions) {
      return {};
    }
    return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4).getDataAvailabilityReportErrors(customDimensions);
  });

  // Invalid custom dimension error handling.
  const hasInvalidCustomDimensionError = isGatheringData && Object.values(dataAvailabilityReportErrors).some(error => (0,_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_9__.isInvalidCustomDimensionError)(error)) || !isGatheringData && (0,_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_9__.isInvalidCustomDimensionError)(reportError);
  const invalidCustomDimensionReportOptions = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_3__.useSelect)(select => {
    if (!hasInvalidCustomDimensionError) {
      return [];
    }
    if (isGatheringData) {
      const {
        getDataAvailabilityReportOptions
      } = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_8__.MODULES_ANALYTICS_4);
      return Object.keys(dataAvailabilityReportErrors).filter(dimension => (0,_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_9__.isInvalidCustomDimensionError)(dataAvailabilityReportErrors[dimension])).map(dimension => getDataAvailabilityReportOptions(dimension));
    }
    if ((0,_js_modules_analytics_4_utils_custom_dimensions__WEBPACK_IMPORTED_MODULE_9__.isInvalidCustomDimensionError)(reportError)) {
      return [reportOptions];
    }
    return [];
  });
  return {
    customDimensions,
    hasCustomDimensions,
    isAutoCreatingCustomDimensions,
    isCreatingCustomDimensions,
    customDimensionsCreationErrors,
    hasAnalyticsEditScope,
    isSyncingAvailableCustomDimensions,
    isNavigatingToOAuthURL,
    reportOptions,
    reportError,
    loading,
    isGatheringData,
    dataAvailabilityReportErrors,
    hasInvalidCustomDimensionError,
    invalidCustomDimensionReportOptions,
    redirectURL
  };
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useEnableAudienceGroup.js"
/*!****************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useEnableAudienceGroup.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 */ useEnableAudienceGroup)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMountedState.js");
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_1__ = __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 _wordpress_url__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/add-query-args.js");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! googlesitekit-data */ "googlesitekit-data");
/* harmony import */ var googlesitekit_data__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__);
/* 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_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/hooks/useFormValue */ "./js/hooks/useFormValue.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/**
 * Analytics useEnableAudienceGroup custom 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.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */




/**
 * Internal dependencies
 */





function useEnableAudienceGroup({
  redirectURL,
  onSuccess,
  onError,
  onOAuthNavigation
} = {}) {
  const isMounted = (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])();
  const [apiErrors, setApiErrors] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  const [failedAudiences, setFailedAudiences] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)([]);
  const [isAudienceCreationError, setIsAudienceCreationError] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const [isSaving, setIsSaving] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useState)(false);
  const hasAnalytics4EditScope = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).hasScope(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.EDIT_SCOPE));
  const [autoSubmit, setAutoSubmit] = (0,_js_hooks_useFormValue__WEBPACK_IMPORTED_MODULE_6__["default"])(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.AUDIENCE_SEGMENTATION_SETUP_FORM, 'autoSubmit');
  const {
    setPermissionScopeError
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER);
  const {
    enableAudienceGroup,
    fetchSyncAvailableCustomDimensions,
    determineNeedForAnalytics4EditScope,
    syncAvailableAudiences
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_4__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.MODULES_ANALYTICS_4);
  if (!redirectURL) {
    redirectURL = (0,_wordpress_url__WEBPACK_IMPORTED_MODULE_3__.addQueryArgs)(globalThis.location.href, {
      notification: 'audience_segmentation'
    });
  }
  const maybeEnableAudienceGroup = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    const {
      error: syncAudiencesError
    } = await syncAvailableAudiences();
    if (syncAudiencesError) {
      return {
        error: syncAudiencesError
      };
    }
    const {
      error: syncDimensionsError
    } = await fetchSyncAvailableCustomDimensions();
    if (syncDimensionsError) {
      return {
        error: syncDimensionsError
      };
    }
    if (!hasAnalytics4EditScope) {
      const {
        error,
        needsScope
      } = await determineNeedForAnalytics4EditScope();
      if (error) {
        return {
          error
        };
      } else if (needsScope) {
        return {
          needsScope: true
        };
      }
    }
    setAutoSubmit(false);
    const {
      error,
      failedSiteKitAudienceSlugs,
      isAudienceCreationError: isCreationError
    } = (await enableAudienceGroup(failedAudiences)) || {};
    return {
      error,
      failedSiteKitAudienceSlugs,
      isAudienceCreationError: isCreationError
    };
  }, [enableAudienceGroup, failedAudiences, fetchSyncAvailableCustomDimensions, hasAnalytics4EditScope, determineNeedForAnalytics4EditScope, setAutoSubmit, syncAvailableAudiences]);
  const onEnableGroups = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(async () => {
    setIsSaving(true);
    const {
      error,
      needsScope,
      failedSiteKitAudienceSlugs,
      isAudienceCreationError: isCreationError
    } = await maybeEnableAudienceGroup();
    if (needsScope) {
      setAutoSubmit(true);
      await onOAuthNavigation?.();
      setPermissionScopeError({
        code: _js_util_errors__WEBPACK_IMPORTED_MODULE_8__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
        message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_2__.__)('Additional permissions are required to create new audiences in Analytics.', 'google-site-kit'),
        data: {
          status: 403,
          scopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_7__.EDIT_SCOPE],
          skipModal: true,
          skipDefaultErrorNotifications: true,
          redirectURL,
          errorRedirectURL: globalThis.location.href
        }
      });

      // Note that we don't set isSaving to false here, this is to ensure that, when the page begins to navigate to the OAuth flow:
      // - The in-progress state for the Audience Segmentation Setup CTA is retained.
      // - The OAuth error modal doesn't disappear when it's shown and the user clicks the "Retry" button.
      return;
    }
    if (!!error || !!failedSiteKitAudienceSlugs) {
      onError?.();
    } else {
      onSuccess?.();
    }
    if (isMounted()) {
      function newArrayIfNotEmpty(currentArray) {
        return currentArray.length ? [] : currentArray;
      }
      if (error) {
        setApiErrors([error]);
        setFailedAudiences(newArrayIfNotEmpty);
        setIsAudienceCreationError(!!isCreationError);
      } else if (Array.isArray(failedSiteKitAudienceSlugs)) {
        setFailedAudiences(failedSiteKitAudienceSlugs);
        setApiErrors(newArrayIfNotEmpty);
        setIsAudienceCreationError(true);
      } else {
        setApiErrors(newArrayIfNotEmpty);
        setFailedAudiences(newArrayIfNotEmpty);
        setIsAudienceCreationError(false);
      }
      setIsSaving(false);
    }
  }, [maybeEnableAudienceGroup, isMounted, setAutoSubmit, onOAuthNavigation, setPermissionScopeError, redirectURL, onError, onSuccess]);

  // If the user returns to the component using this hook with the required
  // scope granted, and already submitted the form, trigger the submit again.
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (hasAnalytics4EditScope && autoSubmit) {
      onEnableGroups();
    }
  }, [hasAnalytics4EditScope, autoSubmit, onEnableGroups]);
  return {
    apiErrors,
    failedAudiences,
    isAudienceCreationError,
    isSaving,
    onEnableGroups
  };
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useExistingTagEffect.js"
/*!**************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useExistingTagEffect.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 */ useExistingTagEffect)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * GA4 useExistingTagEffect custom 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
 */



/**
 * Toggles `useSnippet` depending on whether there is a existing tag matching the selected GA4 property.
 *
 * @since 1.75.0
 */
function useExistingTagEffect() {
  const {
    setUseSnippet
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4);
  const existingTag = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getExistingTag());
  const measurementID = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useSelect)(select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4).getMeasurementID());
  const skipEffect = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useRef)(true);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
    if (existingTag && measurementID !== undefined) {
      if (measurementID === '' || skipEffect.current) {
        skipEffect.current = false;
        return;
      }
      if (measurementID === existingTag) {
        // Disable the Analytics snippet if there is an existing tag that
        // matches the currently selected property.
        setUseSnippet(false);
      } else {
        // Otherwise enable the Analytics snippet again.
        setUseSnippet(true);
      }
    }
  }, [setUseSnippet, existingTag, measurementID]);
}

/***/ },

/***/ "./js/modules/analytics-4/hooks/useSyncGoogleTagEffect.js"
/*!****************************************************************!*\
  !*** ./js/modules/analytics-4/hooks/useSyncGoogleTagEffect.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 */ useSyncGoogleTagEffect)
/* harmony export */ });
/* harmony import */ var react_use__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! react-use */ "../node_modules/react-use/esm/useMount.js");
/* harmony import */ var _js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit-data */ "./js/googlesitekit-data.ts");
/* 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.ts");
/**
 * 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 useSyncGoogleTagEffect() {
  const {
    syncGoogleTagSettings
  } = (0,_js_googlesitekit_data__WEBPACK_IMPORTED_MODULE_1__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_2__.MODULES_ANALYTICS_4);
  (0,react_use__WEBPACK_IMPORTED_MODULE_0__["default"])(() => {
    // The sync action has its own guards internally,
    // so it's safe to use uncondionally here.
    syncGoogleTagSettings();
  });
  return null;
}

/***/ },

/***/ "./js/modules/analytics-4/index.js"
/*!*****************************************!*\
  !*** ./js/modules/analytics-4/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_9__.registerNotifications),
/* harmony export */   registerStore: () => (/* reexport safe */ _datastore__WEBPACK_IMPORTED_MODULE_7__.registerStore),
/* harmony export */   registerWidgets: () => (/* reexport safe */ _widgets__WEBPACK_IMPORTED_MODULE_8__.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 _svg_graphics_analytics_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/svg/graphics/analytics.svg */ "./svg/graphics/analytics.svg");
/* harmony import */ var _components_DashboardMainEffectComponent__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/DashboardMainEffectComponent */ "./js/modules/analytics-4/components/DashboardMainEffectComponent.js");
/* harmony import */ var _components_settings__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/settings */ "./js/modules/analytics-4/components/settings/index.js");
/* harmony import */ var _components_setup__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/setup */ "./js/modules/analytics-4/components/setup/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _datastore__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./datastore */ "./js/modules/analytics-4/datastore/index.js");
/* harmony import */ var _widgets__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./widgets */ "./js/modules/analytics-4/widgets/index.js");
/* harmony import */ var _notifications__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./notifications */ "./js/modules/analytics-4/notifications/index.js");
/**
 * Analytics-4 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_ANALYTICS_4, {
    storeName: _datastore_constants__WEBPACK_IMPORTED_MODULE_6__.MODULES_ANALYTICS_4,
    SettingsEditComponent: _components_settings__WEBPACK_IMPORTED_MODULE_3__.SettingsEdit,
    SettingsViewComponent: _components_settings__WEBPACK_IMPORTED_MODULE_3__.SettingsView,
    SetupLayout: _components_setup__WEBPACK_IMPORTED_MODULE_4__.SetupLayout,
    SetupComponent: _components_setup__WEBPACK_IMPORTED_MODULE_4__.SetupMain,
    DashboardMainEffectComponent: _components_DashboardMainEffectComponent__WEBPACK_IMPORTED_MODULE_2__["default"],
    Icon: _svg_graphics_analytics_svg__WEBPACK_IMPORTED_MODULE_1__["default"],
    features: [(0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Your site will no longer send data to Google Analytics', 'google-site-kit'), (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Analytics reports in Site Kit will be disabled', 'google-site-kit')]
  });
}

/***/ },

/***/ "./js/modules/analytics-4/notifications/index.js"
/*!*******************************************************!*\
  !*** ./js/modules/analytics-4/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 */   ANALYTICS_4_NOTIFICATIONS: () => (/* binding */ ANALYTICS_4_NOTIFICATIONS),
/* harmony export */   registerNotifications: () => (/* binding */ registerNotifications)
/* harmony export */ });
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/features */ "./js/features/index.js");
/* harmony import */ var _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/constants */ "./js/googlesitekit/constants.js");
/* harmony import */ var _js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/data-requirements */ "./js/googlesitekit/data-requirements/index.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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/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 _js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/notifications/datastore/constants */ "./js/googlesitekit/notifications/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_notifications_util_create_register_notifications__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/googlesitekit/notifications/util/create-register-notifications */ "./js/googlesitekit/notifications/util/create-register-notifications.js");
/* harmony import */ var _js_modules_ads_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/ads/constants */ "./js/modules/ads/constants.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_IntroductoryOverlayNotification__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/IntroductoryOverlayNotification */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/IntroductoryOverlayNotification.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_SetupCTABanner__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/SetupCTABanner */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/SetupCTABanner.js");
/* harmony import */ var _js_modules_analytics_4_components_dashboard__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/components/dashboard */ "./js/modules/analytics-4/components/dashboard/index.js");
/* harmony import */ var _js_modules_analytics_4_components_notifications__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/notifications */ "./js/modules/analytics-4/components/notifications/index.js");
/* harmony import */ var _js_modules_analytics_4_components_notifications_EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/components/notifications/EnhancedConversionsNotification */ "./js/modules/analytics-4/components/notifications/EnhancedConversionsNotification.js");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_notifications_IntroModalBanner__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner */ "./js/modules/analytics-4/components/site-goals/notifications/IntroModalBanner/index.tsx");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/* harmony import */ var _js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/modules/analytics-4/data-requirements */ "./js/modules/analytics-4/data-requirements/index.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_util__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_async__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @/js/util/async */ "./js/util/async.js");
/* harmony import */ var _js_util_welcome_modal__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @/js/util/welcome-modal */ "./js/util/welcome-modal.ts");
/**
 * Analytics 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.
 */

/**
 * Internal dependencies
 */






















const ANALYTICS_4_NOTIFICATIONS = {
  [_js_modules_analytics_4_components_audience_segmentation_dashboard_SetupCTABanner__WEBPACK_IMPORTED_MODULE_10__.AUDIENCE_SEGMENTATION_SETUP_CTA_NOTIFICATION]: {
    Component: _js_modules_analytics_4_components_audience_segmentation_dashboard_SetupCTABanner__WEBPACK_IMPORTED_MODULE_10__["default"],
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.PRIORITY.SETUP_CTA_LOW,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.DASHBOARD_TOP,
    groupID: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_GROUPS.SETUP_CTAS,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD],
    checkRequirements: (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAll)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAny)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireIsAuthenticated)(), (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireCanViewSharedModule)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4)), (0,_js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__.requireDataIsAvailableOnLoad)(), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequire)(false, (0,_js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__.requireAudienceSegmentationSetupCompleted)()), async ({
      resolveSelect,
      select
    }) => {
      if (!(0,_js_features__WEBPACK_IMPORTED_MODULE_0__.isFeatureEnabled)('setupFlowRefresh')) {
        return true;
      }
      await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getInitialSetupSettings();
      return !select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAnalyticsSetupComplete();
    }),
    isDismissible: true,
    dismissRetries: 1
  },
  'web-data-stream-not-available-notification': {
    Component: _js_modules_analytics_4_components_notifications__WEBPACK_IMPORTED_MODULE_12__.WebDataStreamNotAvailableNotification,
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.PRIORITY.ERROR_LOW,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.HEADER,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD],
    isDismissible: true,
    checkRequirements: (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAll)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleOwnership)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireScope)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.GTM_SCOPE),
    // Require connected datastream is NOT available.
    (0,_js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__.requireWebDataStreamUnavailable)())
  },
  'google-tag-id-mismatch': {
    Component: _js_modules_analytics_4_components_notifications__WEBPACK_IMPORTED_MODULE_12__.GoogleTagIDMismatchNotification,
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.PRIORITY.ERROR_LOW,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.HEADER,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD],
    isDismissible: false,
    checkRequirements: (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAll)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleOwnership)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireScope)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.GTM_SCOPE), (0,_js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__.requireMismatchedGoogleTag)())
  },
  'enhanced-measurement-notification': {
    Component: _js_modules_analytics_4_components_dashboard__WEBPACK_IMPORTED_MODULE_11__.EnhancedMeasurementActivationBanner,
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.PRIORITY.SETUP_CTA_LOW,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.DASHBOARD_TOP,
    groupID: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_GROUPS.SETUP_CTAS,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD],
    isDismissible: true,
    checkRequirements: (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAll)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4),
    // Check if the prompt with the legacy key used before the banner was refactored
    // to use the `notification ID` as the dismissal key, is dismissed.
    (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequire)(false, (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireItemDismissed)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.LEGACY_ENHANCED_MEASUREMENT_ACTIVATION_BANNER_DISMISSED_ITEM_KEY)), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAny)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleOwnership)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleAccess)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4)), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequire)(false, (0,_js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__.requireEnhancedMeasurementEnabled)()))
  },
  [_js_modules_analytics_4_components_audience_segmentation_dashboard_IntroductoryOverlayNotification__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SEGMENTATION_INTRODUCTORY_OVERLAY_NOTIFICATION]: {
    Component: _js_modules_analytics_4_components_audience_segmentation_dashboard_IntroductoryOverlayNotification__WEBPACK_IMPORTED_MODULE_9__["default"],
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.PRIORITY.SETUP_CTA_HIGH,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.OVERLAYS,
    groupID: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_GROUPS.SETUP_CTAS,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY],
    isDismissible: true,
    checkRequirements: (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAll)(({
      select,
      dispatch
    }) => {
      if (!(0,_js_features__WEBPACK_IMPORTED_MODULE_0__.isFeatureEnabled)('setupFlowRefresh') || !(0,_js_util_welcome_modal__WEBPACK_IMPORTED_MODULE_21__.isInitialWelcomeModalActive)()) {
        return true;
      }
      const isDismissing = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isDismissingItem(_js_modules_analytics_4_components_audience_segmentation_dashboard_IntroductoryOverlayNotification__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SEGMENTATION_INTRODUCTORY_OVERLAY_NOTIFICATION);
      if (!isDismissing) {
        dispatch(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_NOTIFICATIONS).dismissNotification(_js_modules_analytics_4_components_audience_segmentation_dashboard_IntroductoryOverlayNotification__WEBPACK_IMPORTED_MODULE_9__.AUDIENCE_SEGMENTATION_INTRODUCTORY_OVERLAY_NOTIFICATION);
      }
      return false;
    }, (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAny)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireIsAuthenticated)(), (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireCanViewSharedModule)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4)), (0,_js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__.requireAudienceSegmentationSetupCompleted)(), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequire)(false, (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireAudienceSegmentationWidgetHidden)()), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequire)(false, (0,_js_modules_analytics_4_data_requirements__WEBPACK_IMPORTED_MODULE_17__.requireAudienceSegmentationSetupCompletedByUser)()))
  },
  [_js_modules_analytics_4_components_notifications_EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_13__.ENHANCED_CONVERSIONS_NOTIFICATION_ANALYTICS]: {
    Component: _js_modules_analytics_4_components_notifications_EnhancedConversionsNotification__WEBPACK_IMPORTED_MODULE_13__["default"],
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.PRIORITY.SETUP_CTA_HIGH,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.DASHBOARD_TOP,
    groupID: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_GROUPS.SETUP_CTAS,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD],
    checkRequirements: (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAll)((0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4), (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequire)(false, (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_ads_constants__WEBPACK_IMPORTED_MODULE_8__.MODULE_SLUG_ADS))),
    isDismissible: true,
    featureFlag: 'gtagUserData'
  },
  [_js_modules_analytics_4_components_site_goals_notifications_IntroModalBanner__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_INTRO_MODAL_BANNER]: {
    Component: _js_modules_analytics_4_components_site_goals_notifications_IntroModalBanner__WEBPACK_IMPORTED_MODULE_15__["default"],
    // Shown after the welcome modal, which has a higher priority (lower
    // number), so the two modals never appear at the same time.
    priority: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.PRIORITY.SETUP_CTA_SITE_GOALS_INTRO_MODAL,
    areaSlug: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_AREAS.OVERLAYS,
    groupID: _js_googlesitekit_notifications_constants__WEBPACK_IMPORTED_MODULE_5__.NOTIFICATION_GROUPS.SETUP_MODALS,
    viewContexts: [_js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD, _js_googlesitekit_constants__WEBPACK_IMPORTED_MODULE_1__.VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY],
    isDismissible: true,
    featureFlag: 'siteGoals',
    checkRequirements: (0,_js_util_async__WEBPACK_IMPORTED_MODULE_20__.asyncRequireAll)(
    // The welcome modal takes precedence. When it is active, defer the
    // Site Goals intro modal for 72 hours so the two are never shown at
    // the same time. Modeled on the audience segmentation introductory
    // overlay above. `shouldNotificationBeAddedToQueue` already filters
    // dismissed/still-deferred notifications out before
    // `checkRequirements` runs, so once the 72-hour dismissal is set
    // this code won't run again until it expires. This way: no separate
    // "already dismissed" check is needed.
    ({
      select,
      dispatch
    }) => {
      if (!(0,_js_features__WEBPACK_IMPORTED_MODULE_0__.isFeatureEnabled)('setupFlowRefresh') || !(0,_js_util_welcome_modal__WEBPACK_IMPORTED_MODULE_21__.isInitialWelcomeModalActive)()) {
        return true;
      }
      const isDismissing = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isDismissingItem(_js_modules_analytics_4_components_site_goals_notifications_IntroModalBanner__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_INTRO_MODAL_BANNER);
      if (!isDismissing) {
        dispatch(_js_googlesitekit_notifications_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_NOTIFICATIONS).dismissNotification(_js_modules_analytics_4_components_site_goals_notifications_IntroModalBanner__WEBPACK_IMPORTED_MODULE_15__.SITE_GOALS_INTRO_MODAL_BANNER, {
          expiresInSeconds: 72 * _js_util__WEBPACK_IMPORTED_MODULE_19__.HOUR_IN_SECONDS
        });
      }
      return false;
    },
    // The modal introduces Analytics-backed widgets, so it should not
    // show for a disconnected module.
    //
    // Require Analytics 4 module to be connected to show this notifications.
    (0,_js_googlesitekit_data_requirements__WEBPACK_IMPORTED_MODULE_2__.requireModuleConnected)(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4),
    // At least one Site Goals widget must render. This is the same
    // condition the widget registrations apply, so the modal never
    // introduces a section that won't appear. `activeWidgets` comes from
    // the site goals settings endpoint, so that needs resolving too.
    async ({
      select,
      resolveSelect
    }) => {
      await Promise.all([resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).getSettings(), resolveSelect(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).getSiteGoalsSettings()]);
      return select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).isSiteGoalsWidgetRenderable(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_14__.GOAL_TYPES.ECOMMERCE) === true || select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_18__.MODULES_ANALYTICS_4).isSiteGoalsWidgetRenderable(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_14__.GOAL_TYPES.LEAD) === true;
    }, async ({
      select,
      resolveSelect
    }) => {
      await resolveSelect(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getAuthentication();

      // If the user is not signed in, the check is skipped.
      //
      // The shared dashboard already limits view-only users appropriately,
      // we don't need to check their access here.
      if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAuthenticated()) {
        return true;
      }

      // Make sure the user has access to the Analytics 4 module,
      // which is required to view the Site Goals modal.
      return (await resolveSelect(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).hasModuleAccess(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_16__.MODULE_SLUG_ANALYTICS_4)) === true;
    })
  }
};
function registerNotifications(notifications) {
  (0,_js_googlesitekit_notifications_util_create_register_notifications__WEBPACK_IMPORTED_MODULE_7__.createRegisterNotifications)(notifications, ANALYTICS_4_NOTIFICATIONS);
}

/***/ },

/***/ "./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_1__ = __webpack_require__(/*! @wordpress/url */ "../node_modules/@wordpress/url/build-module/is-url.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.ts");
/* harmony import */ var _countries_timezones__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./countries-timezones */ "./js/modules/analytics-4/utils/countries-timezones.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_1__.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_3__.countryCodesByTimezone[timezone] || _countries_timezones__WEBPACK_IMPORTED_MODULE_3__.countryCodesByTimezone[_fallbackTimezone],
    timezone: _countries_timezones__WEBPACK_IMPORTED_MODULE_3__.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 {Object}   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/custom-dimensions.js"
/*!***********************************************************!*\
  !*** ./js/modules/analytics-4/utils/custom-dimensions.js ***!
  \***********************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   isInvalidCustomDimensionError: () => (/* binding */ isInvalidCustomDimensionError),
/* harmony export */   provideCustomDimensionError: () => (/* binding */ provideCustomDimensionError)
/* harmony export */ });
/* 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.ts");
/**
 * 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
 */


/**
 * Provides custom dimension error data to the given registry.
 *
 * @since 1.113.0
 *
 * @param {Object} registry                The registry to set up.
 * @param {Object} options                 Error options.
 * @param {string} options.customDimension The custom dimension slug.
 * @param {Object} options.error           The error object.
 */
function provideCustomDimensionError(registry, {
  customDimension,
  error
}) {
  const propertyID = registry.select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ANALYTICS_4).getPropertyID();
  const options = [propertyID, _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.CUSTOM_DIMENSION_DEFINITIONS[customDimension]];
  registry.dispatch(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_0__.MODULES_ANALYTICS_4).setErrorForAction(error, 'createCustomDimension', options);
}

/**
 * Checks whether the given error is an invalid custom dimension error.
 *
 * @since 1.113.0
 *
 * @param {Object} error Error object instance.
 * @return {boolean} `true` if it is an invalid custom dimension error, otherwise `false`.
 */
function isInvalidCustomDimensionError(error) {
  return error?.code === 400 && error?.message?.includes('is not a valid dimension');
}

/***/ },

/***/ "./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__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _js_util_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/util/i18n */ "./js/util/i18n.js");
/* harmony import */ var _parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./parseDimensionStringToDate */ "./js/modules/analytics-4/utils/parseDimensionStringToDate.js");
/* harmony import */ var _partition_report__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./partition-report */ "./js/modules/analytics-4/utils/partition-report.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_5__["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_3__.numFmt)(x / 100, {
  style: 'percent',
  signDisplay: 'never',
  maximumFractionDigits: 2
}), x => (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.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_3__.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_6__.partitionAnalytics4Report)(rows, {
    dateRangeLength: days
  });
  const lastMonthData = reduceAnalytics4RowsData(currentRange, selectedStats);
  const previousMonthData = reduceAnalytics4RowsData(compareRange, selectedStats);
  const locale = (0,_js_util_i18n__WEBPACK_IMPORTED_MODULE_4__.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_3__.calculateDifferenceBetweenChartValues)(currentMonthDatum, prevMonth);
    const svgArrow = (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.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_3__.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_3__.convertSecondsToArray)(currentMonthDatum) : currentMonthDatum, isSessionDuration ? (0,_js_util__WEBPACK_IMPORTED_MODULE_3__.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/google-tag.js"
/*!****************************************************!*\
  !*** ./js/modules/analytics-4/utils/google-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 */   getBestTagID: () => (/* binding */ getBestTagID)
/* harmony export */ });
/**
 * Google Tag 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.
 */

/**
 * Determines the best Google Tag ID to use from the Google Tag IDs array present in a container response.
 *
 * @since 1.98.0
 *
 * @param {Array}  tagIDs        Array of tag IDs.
 * @param {string} measurementID This will be preferred over other tags that start with "G-" in the array.
 * @return {string} Gets the best possible Google Tag ID to set in the plugin from an array of Google Tag IDs.
 */
function getBestTagID(tagIDs, measurementID) {
  // If there is only one tag id in the array, return it.
  if (tagIDs.length === 1) {
    return tagIDs[0];
  }

  // If there are multiple tags, return the first one that starts with `GT-`.
  const gtTagID = tagIDs.find(tagID => tagID.substring(0, 3) === 'GT-');
  if (gtTagID) {
    return gtTagID;
  }

  // Otherwise, return the `measurement_id` if it is in the array.
  if (tagIDs.includes(measurementID)) {
    return measurementID;
  }

  // Otherwise, return the first one that starts with `G-`.
  const gTagID = tagIDs.find(tagID => tagID.substring(0, 2) === 'G-');
  if (gTagID) {
    return gTagID;
  }

  // If none of the above, return the first one.
  return tagIDs[0];
}

/***/ },

/***/ "./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/overall-page-metrics.js"
/*!**************************************************************!*\
  !*** ./js/modules/analytics-4/utils/overall-page-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 */   calculateOverallPageMetricsData: () => (/* binding */ calculateOverallPageMetricsData)
/* 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_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./parseDimensionStringToDate */ "./js/modules/analytics-4/utils/parseDimensionStringToDate.js");
/**
 * Overall Page Metrics 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
 */


/**
 * Internal dependencies
 */



/**
 * Parse Analytics 4 report into data suitable for rendering the data blocks in the Overall Page Metrics widget.
 *
 * @typedef {Object} OverallPageMetricsData
 * @property {string}         metric          - Google Analytics metric identifier.
 * @property {string}         title           - Translated metric title.
 * @property {Array.<Object>} sparkLineData   - Data for rendering the sparkline.
 * @property {string}         [datapointUnit] - Optional datapoint unit, e.g. '%', 's'.
 * @property {number}         total           - Total count for the metric.
 * @property {number}         change          - Monthly change for the metric.
 *
 * @since 1.96.0
 *
 * @param {Object} report    Analytics report data.
 * @param {string} startDate Start date for the report.
 * @return {Array.<OverallPageMetricsData>} Array of data for rendering the data blocks in the Overall Page Metrics widget.
 */

function calculateOverallPageMetricsData(report, startDate) {
  const metricsData = [{
    metric: 'screenPageViews',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Pageviews', 'google-site-kit'),
    sparkLineData: [[{
      type: 'date',
      label: 'Day'
    }, {
      type: 'number',
      label: 'Pageviews'
    }]],
    total: 0,
    change: 0
  }, {
    metric: 'sessions',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Sessions', 'google-site-kit'),
    sparkLineData: [[{
      type: 'date',
      label: 'Day'
    }, {
      type: 'number',
      label: 'Sessions'
    }]],
    total: 0,
    change: 0
  }, {
    metric: 'engagementRate',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Engagement Rate', 'google-site-kit'),
    sparkLineData: [[{
      type: 'date',
      label: 'Day'
    }, {
      type: 'number',
      label: 'Engagement Rate'
    }]],
    datapointUnit: '%',
    total: 0,
    change: 0
  }, {
    metric: 'averageSessionDuration',
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Session Duration', 'google-site-kit'),
    sparkLineData: [[{
      type: 'date',
      label: 'Day'
    }, {
      type: 'number',
      label: 'Session Duration'
    }]],
    datapointUnit: 's',
    total: 0,
    change: 0
  }];
  const {
    totals = [],
    rows = []
  } = report || {};
  const lastMonth = totals[0]?.metricValues || [];
  const previousMonth = totals[1]?.metricValues || [];
  const startDateTime = (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.stringToDate)(startDate).getTime();
  const currentDateRangeRows = rows.filter(({
    dimensionValues
  }) => {
    if (dimensionValues[1].value !== 'date_range_0') {
      return false;
    }

    // We only want half of the date range, as having a comparison date range in the query doubles the range.
    // In order to achieve this, we filter out entries before the start date (the comparison start date will be earlier).
    const rowDate = (0,_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_2__["default"])(dimensionValues[0].value);
    return rowDate.getTime() >= startDateTime;
  });
  return metricsData.map(({
    datapointDivider = 1,
    ...metricData
  }, index) => {
    currentDateRangeRows.forEach(({
      dimensionValues,
      metricValues
    }) => {
      const dateString = dimensionValues[0].value;
      const date = (0,_parseDimensionStringToDate__WEBPACK_IMPORTED_MODULE_2__["default"])(dateString);
      metricData.sparkLineData.push([date, metricValues[index].value]);
    });
    metricData.total = (lastMonth[index]?.value || 0) / datapointDivider;
    metricData.change = (0,_js_util__WEBPACK_IMPORTED_MODULE_1__.calculateChange)(previousMonth[index]?.value || 0, lastMonth[index]?.value || 0);
    return metricData;
  });
}

/***/ },

/***/ "./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-args.js"
/*!*****************************************************!*\
  !*** ./js/modules/analytics-4/utils/report-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 */   generateReportDetailArgs: () => (/* binding */ generateReportDetailArgs),
/* harmony export */   generateReportFilterArgs: () => (/* binding */ generateReportFilterArgs)
/* 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_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/modules/analytics-4/constants */ "./js/modules/analytics-4/constants.js");
/**
 * Google Analytics 4 report argument 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
 */


/**
 * Generates a set of report detail arguments for a Google Analytics 4 report.
 *
 * @since 1.98.0
 *
 * @param {Object} details Report details.
 * @return {Object} Report detail arguments.
 */
function generateReportDetailArgs(details) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(details), 'A valid details object is required.');
  const {
    metric,
    dimension
  } = details;
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(!metric || typeof metric === 'string', 'A valid metric string is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(!dimension || typeof dimension === 'string', 'A valid dimension string is required.');
  if ((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isEmpty)(details)) {
    return {};
  }
  const detailArgs = {};
  if (metric) {
    detailArgs[_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_2__.REPORT_ARGS_SELECTED_METRIC_KEY] = JSON.stringify([metric]);
  }
  if (dimension) {
    detailArgs[_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_2__.REPORT_ARGS_SELECTED_DIMENSION_KEY] = JSON.stringify([dimension]);
  }
  return detailArgs;
}

/**
 * Generates a set of report filter arguments for a Google Analytics 4 report.
 *
 * @since 1.98.0
 *
 * @param {Object} filters Report filters.
 * @return {Object} Report filter arguments.
 */
function generateReportFilterArgs(filters) {
  invariant__WEBPACK_IMPORTED_MODULE_0___default()((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isPlainObject)(filters), 'A valid filters object is required.');
  invariant__WEBPACK_IMPORTED_MODULE_0___default()(Reflect.ownKeys(filters).every(dimensionName => {
    const dimensionValue = filters[dimensionName];
    return typeof dimensionName === 'string' && typeof dimensionValue === 'string';
  }), 'A valid set of dimension names and values is required.');
  if ((0,lodash__WEBPACK_IMPORTED_MODULE_1__.isEmpty)(filters)) {
    return {};
  }
  const dataFilters = Object.entries(filters).map(([dimensionName, dimensionValue]) => ({
    type: 1,
    fieldName: dimensionName,
    evaluationType: 1,
    expressionList: [dimensionValue],
    complement: false,
    isCaseSensitive: true,
    expression: ''
  }));
  return {
    [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_2__.REPORT_ARGS_DATA_FILTERS_KEY]: JSON.stringify(dataFilters)
  };
}

/***/ },

/***/ "./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 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__);
/**
 * 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_1___default()(({
  metrics,
  dimensions,
  ...options
} = {}) => {
  return {
    metrics: normalizeMetrics(metrics),
    dimensions: normalizeDimensions(dimensions),
    ...options
  };
});
function normalizeMetrics(metrics) {
  return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.castArray)(metrics).map(metric => typeof metric === 'string' ? {
    name: metric
  } : metric).filter(metric => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(metric));
}
function normalizeDimensions(dimensions) {
  return (0,lodash__WEBPACK_IMPORTED_MODULE_0__.castArray)(dimensions).map(dimension => typeof dimension === 'string' ? {
    name: dimension
  } : dimension).filter(dimension => (0,lodash__WEBPACK_IMPORTED_MODULE_0__.isPlainObject)(dimension));
}

/***/ },

/***/ "./js/modules/analytics-4/utils/report-rows-with-set-values.js"
/*!*********************************************************************!*\
  !*** ./js/modules/analytics-4/utils/report-rows-with-set-values.js ***!
  \*********************************************************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   reportRowsWithSetValues: () => (/* binding */ reportRowsWithSetValues)
/* harmony export */ });
/**
 * Utility to filter out Analytics report rows which don't have a value set.
 *
 * 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.
 */

function reportRowsWithSetValues(rows, maxRows = 3) {
  const rowsWithSetValues = rows.filter(({
    dimensionValues
  }) => dimensionValues[0].value !== '(not set)' && dimensionValues[0].value !== '');
  return rowsWithSetValues.slice(0, maxRows);
}

/***/ },

/***/ "./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/tag-matchers.js"
/*!******************************************************!*\
  !*** ./js/modules/analytics-4/utils/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 */   getTagMatchers: () => (/* binding */ getTagMatchers)
/* 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.
 */

/**
 * Returns GA4 tag matchers.
 *
 * @since 1.35.0
 *
 * @return {Array.<RegExp>} Array of RegExp objects.
 */
function getTagMatchers() {
  const tagMatchers = [/__gaTracker\s*\(\s*['|"]create['|"]\s*,\s*['|"](G-[a-zA-Z0-9]+)['|"], ?['|"]auto['|"]\s*\)/i, /_gaq\.push\s*\(\s*\[\s*['|"][^_]*_setAccount['|"]\s*,\s*['|"](G-[a-zA-Z0-9]+)['|"]\s*],?\s*\)/i, /<amp-analytics\s+[^>]*type="gtag"[^>]*>[^<]*<script\s+type="application\/json">[^<]*"gtag_id"\s*:\s*"(G-[a-zA-Z0-9]+)"/i, /<amp-analytics\s+[^>]*type="googleanalytics"[^>]*>[^<]*<script\s+type="application\/json">[^<]*"account"\s*:\s*"(G-[a-zA-Z0-9]+)"/i];
  for (const subdomain of ['', 'www\\.']) {
    tagMatchers.push(new RegExp(`<script\\s+[^>]*src=['|"]https?://${subdomain}googletagmanager\\.com/gtag/js\\?id=(G-[a-zA-Z0-9]+)['|"][^>]*></script>`, 'i'), new RegExp(`<script\\s+[^>]*src=['|"]https?://${subdomain}googletagmanager\\.com/gtag/js\\?id=(G-[a-zA-Z0-9]+)['|"][^/]*/>`, 'i'));
  }
  for (const func of ['__gaTracker', 'ga', 'gtag']) {
    tagMatchers.push(new RegExp(`${func}\\s*\\(\\s*['|"]create['|"]\\s*,\\s*['|"](G-[a-zA-Z0-9]+)['|"],\\s*['|"]auto['|"]\\s*\\)`, 'i'), new RegExp(`${func}\\s*\\(\\s*['|"]config['|"]\\s*,\\s*['|"](G-[a-zA-Z0-9]+)['|"]\\s*\\)`, 'i'));
  }
  return tagMatchers;
}
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (getTagMatchers());

/***/ },

/***/ "./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.ts");
/* 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/analytics-4/utils/withCustomDimensions.js"
/*!**************************************************************!*\
  !*** ./js/modules/analytics-4/utils/withCustomDimensions.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 */ withCustomDimensions)
/* harmony export */ });
/* harmony import */ var _wordpress_element__WEBPACK_IMPORTED_MODULE_0__ = __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_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_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/KeyMetrics */ "./js/components/KeyMetrics/index.js");
/* harmony import */ var _js_components_KeyMetrics_key_metrics_widgets__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/KeyMetrics/key-metrics-widgets */ "./js/components/KeyMetrics/key-metrics-widgets.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_user_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/datastore/user/constants */ "./js/googlesitekit/datastore/user/constants.js");
/* harmony import */ var _js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/hooks/useViewOnly */ "./js/hooks/useViewOnly.js");
/* harmony import */ var _js_modules_analytics_4_components_key_metrics__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/key-metrics */ "./js/modules/analytics-4/components/key-metrics/index.js");
/* harmony import */ var _js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/* harmony import */ var _js_modules_analytics_4_hooks_useCustomDimensionsData__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/hooks/useCustomDimensionsData */ "./js/modules/analytics-4/hooks/useCustomDimensionsData.js");
/* harmony import */ var _js_util_errors__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/util/errors */ "./js/util/errors.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! react/jsx-runtime */ "../node_modules/react/jsx-runtime.js");
/**
 * `withCustomDimensions` HOC.
 *
 * 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 withCustomDimensions(options = {}) {
  const {
    dimensions,
    infoTooltip,
    reportOptions: wrappedReportOptions,
    title
  } = options;
  return WrappedComponent => {
    function WithCustomDimensionsComponent(props) {
      const isViewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__["default"])();
      const {
        Widget,
        widgetSlug
      } = props;
      const {
        description,
        infoTooltip: definedInfoTooltip,
        title: definedTitle
      } = _js_components_KeyMetrics_key_metrics_widgets__WEBPACK_IMPORTED_MODULE_4__.KEY_METRICS_WIDGETS[widgetSlug] || {};
      const tileTitle = title || definedTitle;
      const tileInfoTooltip = infoTooltip || definedInfoTooltip || description;
      const {
        customDimensions,
        hasCustomDimensions,
        customDimensionsCreationErrors,
        hasAnalyticsEditScope,
        isSyncingAvailableCustomDimensions,
        loading,
        isGatheringData,
        hasInvalidCustomDimensionError,
        invalidCustomDimensionReportOptions,
        redirectURL
      } = (0,_js_modules_analytics_4_hooks_useCustomDimensionsData__WEBPACK_IMPORTED_MODULE_10__["default"])({
        dimensions,
        widgetSlug,
        reportOptions: wrappedReportOptions
      });
      const {
        clearSelectorError,
        scheduleSyncAvailableCustomDimensions
      } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.MODULES_ANALYTICS_4);
      const {
        setValues
      } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_forms_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_FORMS);
      const {
        setPermissionScopeError
      } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_USER);
      const handleCreateCustomDimensions = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useCallback)(() => {
        if (loading) {
          return;
        }
        setValues(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.FORM_CUSTOM_DIMENSIONS_CREATE, {
          autoSubmit: true
        });
        if (!hasAnalyticsEditScope) {
          setPermissionScopeError({
            code: _js_util_errors__WEBPACK_IMPORTED_MODULE_11__.ERROR_CODE_MISSING_REQUIRED_SCOPE,
            message: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Additional permissions are required to create new Analytics custom dimensions', 'google-site-kit'),
            data: {
              status: 403,
              scopes: [_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_9__.EDIT_SCOPE],
              skipModal: true,
              redirectURL
            }
          });
        }
      }, [hasAnalyticsEditScope, loading, setPermissionScopeError, setValues, redirectURL]);

      // If the list of available custom dimensions is outdated, sync it.
      (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_0__.useEffect)(() => {
        if (!customDimensions || !hasInvalidCustomDimensionError || isSyncingAvailableCustomDimensions || isViewOnly) {
          return;
        }
        (async () => {
          // Clear report errors so that the useEffect isn't
          // triggered multiple times.
          await Promise.all(invalidCustomDimensionReportOptions.map(args => {
            return clearSelectorError('getReport', [args]);
          }));

          // Sync available custom dimensions.
          scheduleSyncAvailableCustomDimensions();
        })();
      }, [clearSelectorError, customDimensions, hasInvalidCustomDimensionError, invalidCustomDimensionReportOptions, isSyncingAvailableCustomDimensions, isViewOnly, scheduleSyncAvailableCustomDimensions]);

      // Return early if the wrapped widget doesn't need custom dimensions.
      if (!customDimensions) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(WrappedComponent, {
          ...props
        });
      }

      // Show loading state.
      if (loading || isGatheringData === undefined) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__.MetricTileWrapper, {
          infoTooltip: tileInfoTooltip,
          moduleSlug: "analytics-4",
          title: tileTitle,
          Widget: Widget,
          loading: true
        });
      }
      const commonErrorProps = {
        headerText: tileTitle,
        infoTooltip: tileInfoTooltip
      };
      if (customDimensionsCreationErrors?.some(_js_util_errors__WEBPACK_IMPORTED_MODULE_11__.isInsufficientPermissionsError)) {
        // Handle permissions error encountered while creating
        // custom dimensions.
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__.InsufficientPermissionsError, {
          ...commonErrorProps,
          moduleSlug: "analytics-4",
          onRetry: handleCreateCustomDimensions
        });
      } else if (customDimensionsCreationErrors?.length > 0) {
        // Handle generic errors encountered while creating
        // custom dimensions.
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_key_metrics__WEBPACK_IMPORTED_MODULE_8__.AnalyticsUpdateError, {
          ...commonErrorProps,
          error: customDimensionsCreationErrors[0],
          onRetry: handleCreateCustomDimensions
        });
      } else if (false === hasCustomDimensions) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_modules_analytics_4_components_key_metrics__WEBPACK_IMPORTED_MODULE_8__.CustomDimensionsMissingError, {
          ...commonErrorProps,
          onRetry: handleCreateCustomDimensions
        });
      }
      if (isGatheringData) {
        return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(_js_components_KeyMetrics__WEBPACK_IMPORTED_MODULE_3__.MetricTileTable, {
          infoTooltip: tileInfoTooltip,
          moduleSlug: "analytics-4",
          title: tileTitle,
          Widget: Widget,
          ZeroState: () => /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)("span", {
            children: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Setup successful: Analytics is gathering data for this metric', 'google-site-kit')
          })
        });
      }
      return /*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_12__.jsx)(WrappedComponent, {
        ...props
      });
    }
    WithCustomDimensionsComponent.displayName = 'WithCustomDimensions';
    if (WrappedComponent.displayName || WrappedComponent.name) {
      WithCustomDimensionsComponent.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return WithCustomDimensionsComponent;
  };
}

/***/ },

/***/ "./js/modules/analytics-4/widgets/index.js"
/*!*************************************************!*\
  !*** ./js/modules/analytics-4/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 _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_pdf_export_lazy_with_preload__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/lazy-with-preload */ "./js/components/pdf-export/lazy-with-preload.ts");
/* harmony import */ var _js_features__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/features */ "./js/features/index.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_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/googlesitekit/modules/datastore/constants */ "./js/googlesitekit/modules/datastore/constants.js");
/* harmony import */ var _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-areas */ "./js/googlesitekit/widgets/default-areas.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/index.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationBackNotice__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationBackNotice */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSegmentationBackNotice.tsx");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceSelectionPanel/constants.js");
/* harmony import */ var _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_getPDFData__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/getPDFData */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/getPDFData.ts");
/* harmony import */ var _js_modules_analytics_4_components_dashboard__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @/js/modules/analytics-4/components/dashboard */ "./js/modules/analytics-4/components/dashboard/index.js");
/* harmony import */ var _js_modules_analytics_4_components_dashboard_DashboardAllTrafficWidgetGA4_getPDFData__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @/js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/getPDFData */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/getPDFData.ts");
/* harmony import */ var _js_modules_analytics_4_components_module__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @/js/modules/analytics-4/components/module */ "./js/modules/analytics-4/components/module/index.js");
/* harmony import */ var _js_modules_analytics_4_components_module_ModulePopularPagesWidgetGA4_getPDFData__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @/js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/getPDFData */ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/getPDFData.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/goal-drivers/constants */ "./js/modules/analytics-4/components/site-goals/goal-drivers/constants.ts");
/* harmony import */ var _js_modules_analytics_4_components_site_goals_widgets__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @/js/modules/analytics-4/components/site-goals/widgets */ "./js/modules/analytics-4/components/site-goals/widgets/index.ts");
/* harmony import */ var _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @/js/modules/analytics-4/components/widgets */ "./js/modules/analytics-4/components/widgets/index.js");
/* harmony import */ var _js_modules_analytics_4_components_widgets_ConversionReportingNotificationCTAWidget__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @/js/modules/analytics-4/components/widgets/ConversionReportingNotificationCTAWidget */ "./js/modules/analytics-4/components/widgets/ConversionReportingNotificationCTAWidget.js");
/* harmony import */ var _js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__ = __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_19__ = __webpack_require__(/*! @/js/modules/analytics-4/datastore/constants */ "./js/modules/analytics-4/datastore/constants.ts");
/**
 * Analytics 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.
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




















/**
 * Lazy-loaded PDF component for the Your visitor groups widget.
 */
const PDFYourVisitorGroups = (0,_js_components_pdf_export_lazy_with_preload__WEBPACK_IMPORTED_MODULE_1__["default"])(() => Promise.all(/*! import() | googlesitekit-vendor-lazy-pdf */[__webpack_require__.e("vendors-node_modules_react-pdf_renderer_lib_react-pdf_browser_js"), __webpack_require__.e("googlesitekit-vendor-lazy-pdf")]).then(__webpack_require__.bind(__webpack_require__, /*! @/js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFYourVisitorGroups */ "./js/modules/analytics-4/components/audience-segmentation/dashboard/AudienceTilesWidget/PDFYourVisitorGroups.tsx")));
const DashboardAllTrafficWidgetGA4PDF = (0,_js_components_pdf_export_lazy_with_preload__WEBPACK_IMPORTED_MODULE_1__["default"])(() => Promise.all(/*! import() | googlesitekit-vendor-lazy-pdf */[__webpack_require__.e("vendors-node_modules_react-pdf_renderer_lib_react-pdf_browser_js"), __webpack_require__.e("googlesitekit-vendor-lazy-pdf")]).then(__webpack_require__.bind(__webpack_require__, /*! @/js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/indexPDF */ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/indexPDF.tsx")));

/**
 * Lazy-loaded PDF component for the Top content over time widget.
 */
const ModulePopularPagesWidgetGA4PDF = (0,_js_components_pdf_export_lazy_with_preload__WEBPACK_IMPORTED_MODULE_1__["default"])(() => Promise.all(/*! import() | googlesitekit-vendor-lazy-pdf */[__webpack_require__.e("vendors-node_modules_react-pdf_renderer_lib_react-pdf_browser_js"), __webpack_require__.e("googlesitekit-vendor-lazy-pdf")]).then(__webpack_require__.bind(__webpack_require__, /*! @/js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/ModulePopularPagesWidgetGA4PDF */ "./js/modules/analytics-4/components/module/ModulePopularPagesWidgetGA4/ModulePopularPagesWidgetGA4PDF.tsx")));
function registerWidgets(widgets) {
  // Register Analytics 4 Widgets.
  widgets.registerWidget('analyticsAllTrafficGA4', {
    Component: _js_modules_analytics_4_components_dashboard__WEBPACK_IMPORTED_MODULE_10__.DashboardAllTrafficWidgetGA4,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    pdf: {
      Component: DashboardAllTrafficWidgetGA4PDF,
      getData: _js_modules_analytics_4_components_dashboard_DashboardAllTrafficWidgetGA4_getPDFData__WEBPACK_IMPORTED_MODULE_11__["default"],
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Site traffic over time', 'google-site-kit')
    }
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_TRAFFIC_PRIMARY, _js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_ENTITY_DASHBOARD_TRAFFIC_PRIMARY]);
  if ((0,_js_features__WEBPACK_IMPORTED_MODULE_2__.isFeatureEnabled)('setupFlowRefresh')) {
    widgets.registerWidget('analyticsAudienceSegmentationBackNotice', {
      Component: _js_modules_analytics_4_components_audience_segmentation_dashboard__WEBPACK_IMPORTED_MODULE_6__.AudienceSegmentationBackNotice,
      width: widgets.WIDGET_WIDTHS.FULL,
      priority: 0,
      wrapWidget: false,
      modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
      isActive: select => {
        const isWidgetHidden = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getRawAudienceSegmentationWidgetHidden();
        const isDismissed = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isItemDismissed(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSegmentationBackNotice__WEBPACK_IMPORTED_MODULE_7__.AUDIENCE_SEGMENTATION_BACK_NOTICE_SLUG);
        return isWidgetHidden === true && isDismissed === false;
      }
    }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION]);
  }
  widgets.registerWidget('analyticsAudienceTiles', {
    Component: _js_modules_analytics_4_components_audience_segmentation_dashboard__WEBPACK_IMPORTED_MODULE_6__.AudienceTilesWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => {
      if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).hasAccessToShareableModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4)) {
        return false;
      }
      const configuredAudiences = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getConfiguredAudiences();
      return !!configuredAudiences;
    },
    pdf: {
      Component: PDFYourVisitorGroups,
      getData: _js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceTilesWidget_getPDFData__WEBPACK_IMPORTED_MODULE_9__["default"],
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Visitor groups', 'google-site-kit'),
      // The PDF row needs two cards, so it renders only for two or
      // more audiences. The dashboard tile keeps its own `isActive`,
      // which allows a single audience.
      isActive: select => (select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getConfiguredAudiences()?.length ?? 0) >= 2
    }
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION]);
  widgets.registerWidget('analyticsAudienceSecondaryUserSetup', {
    Component: _js_modules_analytics_4_components_audience_segmentation_dashboard__WEBPACK_IMPORTED_MODULE_6__.SecondaryUserSetupWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => {
      const hasAccessToShareableModule = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).hasAccessToShareableModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4);
      if (!hasAccessToShareableModule) {
        return false;
      }
      const isAnalyticsConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4);
      if (!isAnalyticsConnected) {
        return false;
      }
      const isItemDismissed = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isItemDismissed(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SEGMENTATION_SETUP_DISMISSED_SLUG);
      if (isItemDismissed !== false) {
        return false;
      }
      const availableAudiences = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_19__.MODULES_ANALYTICS_4).getAvailableAudiences();
      const configuredAudiences = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getConfiguredAudiences();
      const audienceSegmentationSetupCompletedBy = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_19__.MODULES_ANALYTICS_4).getAudienceSegmentationSetupCompletedBy();
      return availableAudiences?.length && configuredAudiences === null && audienceSegmentationSetupCompletedBy !== null;
    }
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION]);
  widgets.registerWidget('analyticsAudiencePrimaryUserSetup', {
    Component: _js_modules_analytics_4_components_audience_segmentation_dashboard__WEBPACK_IMPORTED_MODULE_6__.PrimaryUserSetupWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => {
      if (!(0,_js_features__WEBPACK_IMPORTED_MODULE_2__.isFeatureEnabled)('setupFlowRefresh')) {
        return false;
      }
      const hasAccessToShareableModule = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).hasAccessToShareableModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4);
      if (!hasAccessToShareableModule) {
        return false;
      }
      const isAnalyticsConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4);
      if (!isAnalyticsConnected) {
        return false;
      }
      const isItemDismissed = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isItemDismissed(_js_modules_analytics_4_components_audience_segmentation_dashboard_AudienceSelectionPanel_constants__WEBPACK_IMPORTED_MODULE_8__.AUDIENCE_SEGMENTATION_SETUP_DISMISSED_SLUG);
      if (isItemDismissed !== false) {
        return false;
      }
      const isAnalyticsSetupComplete = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAnalyticsSetupComplete();
      const audienceSegmentationSetupCompletedBy = select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_19__.MODULES_ANALYTICS_4).getAudienceSegmentationSetupCompletedBy();
      return isAnalyticsSetupComplete && !audienceSegmentationSetupCompletedBy;
    }
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION]);
  widgets.registerWidget('audienceConnectAnalyticsCTA', {
    Component: _js_modules_analytics_4_components_audience_segmentation_dashboard__WEBPACK_IMPORTED_MODULE_6__.ConnectAnalyticsCTAWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => {
      if (!select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).hasAccessToShareableModule(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4)) {
        return false;
      }
      const isAnalyticsConnected = select(_js_googlesitekit_modules_datastore_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_MODULES).isModuleConnected(_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4);
      const configuredAudiences = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).getConfiguredAudiences();
      const isAudienceSegmentationWidgetHidden = select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isAudienceSegmentationWidgetHidden();
      return configuredAudiences?.length > 0 && isAudienceSegmentationWidgetHidden === false && !isAnalyticsConnected;
    }
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION]);
  widgets.registerWidget('analyticsAudienceInfoNotice', {
    Component: _js_modules_analytics_4_components_audience_segmentation_dashboard__WEBPACK_IMPORTED_MODULE_6__.InfoNoticeWidget,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 2,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_TRAFFIC_AUDIENCE_SEGMENTATION]);
  widgets.registerWidget('analyticsOverallPageMetricsGA4', {
    Component: _js_modules_analytics_4_components_dashboard__WEBPACK_IMPORTED_MODULE_10__.DashboardOverallPageMetricsWidgetGA4,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 3,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_ENTITY_DASHBOARD_CONTENT_PRIMARY]);
  widgets.registerWidget('analyticsModulePopularPagesGA4', {
    Component: _js_modules_analytics_4_components_module__WEBPACK_IMPORTED_MODULE_12__.ModulePopularPagesWidgetGA4,
    width: widgets.WIDGET_WIDTHS.FULL,
    priority: 4,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    pdf: {
      Component: ModulePopularPagesWidgetGA4PDF,
      getData: _js_modules_analytics_4_components_module_ModulePopularPagesWidgetGA4_getPDFData__WEBPACK_IMPORTED_MODULE_13__["default"],
      label: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_0__.__)('Top content', 'google-site-kit')
    }
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_CONTENT_PRIMARY]);

  /*
   * Key metrics widgets.
   */
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopRecentTrendingPagesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_RECENT_TRENDING_PAGES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_POPULAR_AUTHORS, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.PopularAuthorsWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_POPULAR_AUTHORS)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CATEGORIES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopCategoriesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CATEGORIES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_POPULAR_CONTENT, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.PopularContentWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_POPULAR_CONTENT)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_POPULAR_PRODUCTS, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.PopularProductsWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_POPULAR_PRODUCTS)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_PAGES_PER_VISIT, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.PagesPerVisitWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_PAGES_PER_VISIT)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_VISIT_LENGTH, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.VisitLengthWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_VISIT_LENGTH)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_VISITS_PER_VISITOR, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.VisitsPerVisitorWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_VISITS_PER_VISITOR)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_MOST_ENGAGING_PAGES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.MostEngagingPagesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_MOST_ENGAGING_PAGES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_LEAST_ENGAGING_PAGES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.LeastEngagingPagesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_LEAST_ENGAGING_PAGES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopReturningVisitorPages,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_RETURNING_VISITOR_PAGES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_NEW_VISITORS, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.NewVisitorsWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_NEW_VISITORS)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_RETURNING_VISITORS, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.ReturningVisitorsWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_RETURNING_VISITORS)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopTrafficSourceWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopTrafficSourceDrivingAddToCartWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_ADD_TO_CART)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopTrafficSourceDrivingLeadsWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_LEADS)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopTrafficSourceDrivingPurchasesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_TRAFFIC_SOURCE_DRIVING_PURCHASES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.EngagedTrafficSourceWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopConvertingTrafficSourceWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CONVERTING_TRAFFIC_SOURCE)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopCitiesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopCitiesDrivingLeadsWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_LEADS)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopPagesDrivingLeadsWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_PAGES_DRIVING_LEADS)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopCitiesDrivingAddToCartWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_ADD_TO_CART)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopCitiesDrivingPurchasesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_CITIES_DRIVING_PURCHASES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopDeviceDrivingPurchasesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_DEVICE_DRIVING_PURCHASES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_COUNTRIES, {
    Component: _js_modules_analytics_4_components_widgets__WEBPACK_IMPORTED_MODULE_16__.TopCountriesWidget,
    width: widgets.WIDGET_WIDTHS.QUARTER,
    priority: 1,
    wrapWidget: false,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
    isActive: select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_USER).isKeyMetricActive(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_3__.KM_ANALYTICS_TOP_COUNTRIES)
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);
  widgets.registerWidget('keyMetricsEventDetectionCalloutNotification', {
    Component: _js_modules_analytics_4_components_widgets_ConversionReportingNotificationCTAWidget__WEBPACK_IMPORTED_MODULE_17__["default"],
    width: [widgets.WIDGET_WIDTHS.FULL],
    priority: 0,
    modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4]
  }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY]);

  /*
   * Site Goals widgets.
   *
   * Not registering these widgets when the feature flag is disabled will
   * ensure that the new Widget Area and Widget Context for Site Goals, including
   * the Navigation chip, will not be rendered when the feature is disabled.
   */
  if ((0,_js_features__WEBPACK_IMPORTED_MODULE_2__.isFeatureEnabled)('siteGoals')) {
    widgets.registerWidget('analyticsOnlineStorePerformance', {
      Component: _js_modules_analytics_4_components_site_goals_widgets__WEBPACK_IMPORTED_MODULE_15__.OnlineStorePerformanceWidget,
      width: widgets.WIDGET_WIDTHS.FULL,
      priority: 1,
      wrapWidget: false,
      modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
      isActive: select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_19__.MODULES_ANALYTICS_4).isSiteGoalsWidgetRenderable(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_14__.GOAL_TYPES.ECOMMERCE) === true
    }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_SITE_GOALS_PRIMARY]);
    widgets.registerWidget('analyticsLeadGenerationPerformance', {
      Component: _js_modules_analytics_4_components_site_goals_widgets__WEBPACK_IMPORTED_MODULE_15__.LeadGenerationPerformanceWidget,
      width: widgets.WIDGET_WIDTHS.FULL,
      priority: 2,
      wrapWidget: false,
      modules: [_js_modules_analytics_4_constants__WEBPACK_IMPORTED_MODULE_18__.MODULE_SLUG_ANALYTICS_4],
      isActive: select => select(_js_modules_analytics_4_datastore_constants__WEBPACK_IMPORTED_MODULE_19__.MODULES_ANALYTICS_4).isSiteGoalsWidgetRenderable(_js_modules_analytics_4_components_site_goals_goal_drivers_constants__WEBPACK_IMPORTED_MODULE_14__.GOAL_TYPES.LEAD) === true
    }, [_js_googlesitekit_widgets_default_areas__WEBPACK_IMPORTED_MODULE_5__.AREA_MAIN_DASHBOARD_SITE_GOALS_PRIMARY]);
  }
}

/***/ },

/***/ "./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 */   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';

/***/ },

/***/ "./js/modules/tagmanager/datastore/constants.js"
/*!******************************************************!*\
  !*** ./js/modules/tagmanager/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 */   CONTAINER_CREATE: () => (/* binding */ CONTAINER_CREATE),
/* harmony export */   CONTEXT_AMP: () => (/* binding */ CONTEXT_AMP),
/* harmony export */   CONTEXT_WEB: () => (/* binding */ CONTEXT_WEB),
/* harmony export */   EDIT_SCOPE: () => (/* binding */ EDIT_SCOPE),
/* harmony export */   FORM_SETUP: () => (/* binding */ FORM_SETUP),
/* harmony export */   MODULES_TAGMANAGER: () => (/* binding */ MODULES_TAGMANAGER),
/* harmony export */   READ_SCOPE: () => (/* binding */ READ_SCOPE),
/* harmony export */   SETUP_MODE_WITH_ANALYTICS: () => (/* binding */ SETUP_MODE_WITH_ANALYTICS)
/* harmony export */ });
/**
 * `modules/tagmanager` 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_TAGMANAGER = 'modules/tagmanager';

// A special Account ID value used for the "Set up a new account" option.
const ACCOUNT_CREATE = 'account_create';
// A special Container ID value used for the "Set up a new container" option.
const CONTAINER_CREATE = 'container_create';
// Usage context for web containers.
const CONTEXT_WEB = 'web';
// Usage context for AMP containers.
const CONTEXT_AMP = 'amp';
// Form ID for the module setup form.
const FORM_SETUP = 'tagmanagerSetup';
// OAuth scope needed for viewing containers.
const READ_SCOPE = 'https://www.googleapis.com/auth/tagmanager.readonly';
// OAuth scope needed for creating containers.
const EDIT_SCOPE = 'https://www.googleapis.com/auth/tagmanager.edit.containers';
// A special setupMode value for when completing setup with Analytics.
const SETUP_MODE_WITH_ANALYTICS = 'SETUP_WITH_ANALYTICS';

/***/ },

/***/ "./js/util/async.js"
/*!**************************!*\
  !*** ./js/util/async.js ***!
  \**************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   asyncRequire: () => (/* binding */ asyncRequire),
/* harmony export */   asyncRequireAll: () => (/* binding */ asyncRequireAll),
/* harmony export */   asyncRequireAny: () => (/* binding */ asyncRequireAny),
/* harmony export */   racePrioritizedAsyncTasks: () => (/* binding */ racePrioritizedAsyncTasks)
/* harmony export */ });
/**
 * 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.
 */

/**
 * Defines async task.
 *
 * @since 1.142.0
 *
 * @typedef {Object} AsyncTask
 * @property {number}     priority          Priority of task – executed in ascending order.
 * @property {function(): Promise<boolean>} check Async function that resolves to a boolean. `true` if its checks pass, otherwise `false`.
 */

/**
 * Finds the highest priority task from a collection of tasks with async checks.
 *
 * @since 1.142.0
 *
 * @param {AsyncTask[]} tasks List of task objects.
 * @return {Promise<Object|null>} Promise that resolves to the highest priority task object which finishes its check first or `null` if no checks pass.
 */
async function racePrioritizedAsyncTasks(tasks) {
  // Group tasks by priority
  const priorityGroups = tasks.reduce((grouped, task) => {
    const priority = parseInt(task.priority, 10);
    grouped[priority] = grouped[priority] || [];
    grouped[priority].push(task.check().then(result => ({
      task,
      result: !!result
    })).catch(() => ({
      result: false
    })));
    return grouped;
  }, {});

  // Collect all given priorities in ascending order.
  const priorities = Object.keys(priorityGroups).sort((a, b) => a - b);

  // Process priority groups sequentially.
  for (const priority of priorities) {
    // Initialize a copy of the priority group to allow for mutation.
    let group = [...priorityGroups[priority]];
    do {
      const winner = await Promise.race(group);
      if (winner.result) {
        return winner.task;
      }

      // If we got here, then the fastest task's check did not pass.
      // Filter out all tasks with completed failed checks.
      for (const index in group) {
        const task = group[index];
        if ((await isPromiseResolved(task)) && false === (await task).result) {
          delete group[index];
        }
      }

      // Filter out empty elements for the next iteration.
      group = group.filter(item => item);
    } while (group.length);
    // Move on to the next priority group.
  }
  return null;
}

/**
 * Checks if the given promise is resolved.
 *
 * A resolved promise is either settled or rejected, but not pending.
 *
 * @since 1.144.0
 *
 * @param {Promise} promise Promise to test.
 * @return {boolean} True if resolved, otherwise false.
 */
async function isPromiseResolved(promise) {
  const CONTROL = 'SECRETVALUETHATNOPROMISESHOULDEVERRESOLVETO';
  // If the given value isn't a Promise, wrap it in one.
  if (!(promise instanceof Promise)) {
    promise = Promise.resolve(promise);
  }
  // Important: while Promise.race works with non-promises, it doesn't work
  // consistently in some environments with client-side instrumentation tooling.
  return CONTROL !== (await Promise.race([promise, Promise.resolve(CONTROL)]));
}

/* eslint-disable jsdoc/no-undefined-types */
/**
 * Returns a function which can process N asynchronous requirements in sequence, stopping at the first to return false.
 *
 * @since 1.166.0
 *
 * @param {...Function} requirements Async requirement function checks.
 * @return {function(WPDataRegistry, ...Promise<boolean>[]): Promise<boolean>} Function which processes all requirements in sequence.
 */
/* eslint-enable jsdoc/no-undefined-types */
function asyncRequireAll(...requirements) {
  return async function (...args) {
    for (const predicate of requirements) {
      if (false === (await predicate(...args))) {
        return false;
      }
    }
    return true;
  };
}

/**
 * Returns a function which can process N asynchronous requirements in sequence, stopping at the first to return true.
 *
 * If any predicates return true, it returns true, otherwise it returns false.
 *
 * @since 1.166.0
 *
 * @param {...Function} requirements Async requirement function checks.
 * @return {function(): Promise<boolean>} Function which processes all requirements in sequence.
 */
function asyncRequireAny(...requirements) {
  return async function (...args) {
    for (const predicate of requirements) {
      if (true === (await predicate(...args))) {
        return true;
      }
    }
    return false;
  };
}

/**
 * Returns a predicate function which proxies the given function and returns `true` only if the given function's return equals the given value.
 *
 * @since 1.166.0
 *
 * @param {*}        want Value to match against predicate return.
 * @param {Function} func Function to proxy and check return value of.
 * @return {function(): Promise<boolean>} Predicate function.
 */
function asyncRequire(want, func) {
  return async function (...args) {
    return want === (await func(...args));
  };
}

/***/ },

/***/ "./js/util/case-insensitive-sort.js"
/*!******************************************!*\
  !*** ./js/util/case-insensitive-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 */   caseInsensitiveListSort: () => (/* binding */ caseInsensitiveListSort)
/* harmony export */ });
/**
 * Sorting functions.
 *
 * 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 the provided list in a case-insensitive manner.
 *
 * @since 1.138.0
 *
 * @param {Array}  listToSort The list to sort (Array of objects or arrays).
 * @param {string} orderBy    The field by which the list should be ordered.
 * @return {Array} The sorted list.
 */
function caseInsensitiveListSort(listToSort, orderBy) {
  return [...listToSort].sort((a, b) => {
    const nameA = a[orderBy]?.toLowerCase() || '';
    const nameB = b[orderBy]?.toLowerCase() || '';
    return nameA.localeCompare(nameB);
  });
}

/***/ },

/***/ "./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_0__ = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/serialize.js");
/* harmony import */ var _js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/ChangeArrow */ "./js/components/ChangeArrow.js");
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__ = __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_0__["default"])(/*#__PURE__*/(0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_2__.jsx)(_js_components_ChangeArrow__WEBPACK_IMPORTED_MODULE_1__["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 ?? 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) ? stringToDate(relativeDate).getTime() : 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/geometry.js"
/*!*****************************!*\
  !*** ./js/util/geometry.js ***!
  \*****************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   elementsOverlap: () => (/* binding */ elementsOverlap)
/* harmony export */ });
/**
 * Geometry related 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.
 */

/**
 * Checks if one element overlaps another.
 *
 * @since 1.114.0
 *
 * @param {Element} element1 The first element.
 * @param {Element} element2 The second element.
 * @return {boolean} Returns if the first and second elements overlap each other.
 */
function elementsOverlap(element1, element2) {
  const rect1 = element1.getBoundingClientRect();
  const rect2 = element2.getBoundingClientRect();
  if (rect1.bottom < rect2.top || rect2.bottom < rect1.top || rect1.right < rect2.left || rect2.right < rect1.left) {
    return false;
  }
  return true;
}

/***/ },

/***/ "./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 = globalThis) {
  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 ***!
  \*********************************************/
() {

/**
 * 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(globalThis, 'google')) {
  globalThis.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_features__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/features */ "./js/features/index.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_search_console_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/modules/search-console/constants */ "./js/modules/search-console/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
 */


/**
 * Internal 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_3__.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);
  }
  const setupFlowRefreshPhase4Enabled = (0,_js_features__WEBPACK_IMPORTED_MODULE_1__.isFeatureEnabled)('setupFlowRefreshPhase4');
  if (owner && owner.login) {
    userInfo = setupFlowRefreshPhase4Enabled ? (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) : (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 = setupFlowRefreshPhase4Enabled ? (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') : (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/negate.js"
/*!***************************!*\
  !*** ./js/util/negate.js ***!
  \***************************/
(__unused_webpack_module, __webpack_exports__, __webpack_require__) {

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   negateDefined: () => (/* binding */ negateDefined)
/* harmony export */ });
/**
 * Negation utils.
 *
 * 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.
 */

/**
 * Negates a defined value.
 *
 * @since 1.99.0
 *
 * @param {*} value The value to negate.
 * @return {(boolean|undefined)} The negated value, if defined.
 */
function negateDefined(value) {
  if (value === undefined) {
    return undefined;
  }
  return !value;
}

/***/ },

/***/ "./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()(globalThis);

/***/ },

/***/ "./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 */   getWordPressAdminBarHeight: () => (/* binding */ getWordPressAdminBarHeight)
/* 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 + globalThis.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 && globalThis.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 = globalThis[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 = globalThis.sessionStorage;
    } else if (storageAvailable('localStorage')) {
      storageObj = globalThis.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.ts");
/* 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 _wordpress_url__WEBPACK_IMPORTED_MODULE_4__ = __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_5__ = __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_3__.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_5__.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_4__.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 _js_features_index__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @/js/features/index */ "./js/features/index.js");
/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constants */ "./js/util/tracking/constants.js");
/* harmony import */ var _createDataLayerPush__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./createDataLayerPush */ "./js/util/tracking/createDataLayerPush.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_2__["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
    } = globalThis;
    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_0__.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 = globalThis, _global = globalThis) {
  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.
 */

/**
 * Internal dependencies
 */

const {
  activeModules = [],
  isSiteKitScreen,
  trackingEnabled,
  trackingID,
  referenceSiteURL,
  userIDHash,
  isAuthenticated,
  userRoles
} = globalThis._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.185.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);

/* eslint-disable-next-line sitekit/jsdoc-no-unnamed-boolean-params */
/**
 * 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/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_data_transform_case__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/googlesitekit/data/transform-case */ "./js/googlesitekit/data/transform-case.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 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_2__.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_1__.hyphenCaseToPascalCase)(moduleName)}Active`;
    if (WrappedComponent.displayName || WrappedComponent.name) {
      WhenActiveComponent.displayName += `(${WrappedComponent.displayName || WrappedComponent.name})`;
    }
    return WhenActiveComponent;
  };
}

/***/ },

/***/ "./svg/graphics/banner-audience-segmentation-setup-cta-mobile.svg?url"
/*!****************************************************************************!*\
  !*** ./svg/graphics/banner-audience-segmentation-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-audience-segmentation-setup-cta.svg?url"
/*!*********************************************************************!*\
  !*** ./svg/graphics/banner-audience-segmentation-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-enhanced-measurement-setup-cta-mobile.svg?url"
/*!***************************************************************************!*\
  !*** ./svg/graphics/banner-enhanced-measurement-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-enhanced-measurement-setup-cta.svg?url"
/*!********************************************************************!*\
  !*** ./svg/graphics/banner-enhanced-measurement-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, ");

/***/ },

/***/ "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;

/***/ },

/***/ "@wordpress/i18n"
/*!*****************************************!*\
  !*** external ["googlesitekit","i18n"] ***!
  \*****************************************/
(module) {

"use strict";
module.exports = googlesitekit.i18n;

/***/ },

/***/ "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-analytics-4.ts")));
/******/ var __webpack_exports__ = __webpack_require__.O();
/******/ }
]);
//# sourceMappingURL=googlesitekit-modules-analytics-4.js.map