(globalThis["__googlesitekit_webpackJsonp"] = globalThis["__googlesitekit_webpackJsonp"] || []).push([["googlesitekit-vendor-lazy-pdf"],{

/***/ "./js/components/pdf-export/PDFExportOrchestrator.tsx"
/*!************************************************************!*\
  !*** ./js/components/pdf-export/PDFExportOrchestrator.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.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_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/googlesitekit/datastore/pdf/constants */ "./js/googlesitekit/datastore/pdf/constants.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_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_datastore_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @/js/googlesitekit/widgets/datastore/constants */ "./js/googlesitekit/widgets/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__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _pdf_fonts_react__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pdf-fonts-react */ "./js/components/pdf-export/pdf-fonts-react.ts");
/* harmony import */ var _pdf_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./pdf-utils */ "./js/components/pdf-export/pdf-utils.ts");
/* harmony import */ var _section_icons__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./section-icons */ "./js/components/pdf-export/section-icons.ts");
/* harmony import */ var _shared_react_pdf_components_DashboardReport__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./shared-react-pdf-components/DashboardReport */ "./js/components/pdf-export/shared-react-pdf-components/DashboardReport.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDF export orchestrator: drives the MVP export pipeline.
 *
 * 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 STAGE_IDLE = 'IDLE';
const STAGE_LOADING = 'LOADING';
const STAGE_BUILDING = 'BUILDING';
const STAGE_COMPLETE = 'COMPLETE';
const STAGE_ERROR = 'ERROR';
const VALID_TRANSITIONS = {
  [STAGE_IDLE]: [STAGE_LOADING],
  [STAGE_LOADING]: [STAGE_BUILDING, STAGE_ERROR, STAGE_IDLE],
  [STAGE_BUILDING]: [STAGE_COMPLETE, STAGE_ERROR, STAGE_IDLE],
  [STAGE_COMPLETE]: [],
  [STAGE_ERROR]: []
};
const LOADING_TIMEOUT_MS = 45 * 1000;
const BUILDING_TIMEOUT_MS = 15 * 1000;
const COMPLETE_UNMOUNT_DELAY_MS = 2 * 1000;
const BLOB_REVOKE_DELAY_MS = 30 * 1000;
// Progress budget reserved for the data-loading stage; BUILDING fills the rest.
const LOADING_PROGRESS_MAX = 90;
/**
 * Determines whether a registry widget declares a PDF export configuration.
 *
 * @since 1.181.0
 *
 * @param widget Registry widget.
 * @return `true` when the widget has a `pdf` config.
 */
function hasPDFConfig(widget) {
  return !!widget.pdf;
}
const initialState = {
  stage: STAGE_IDLE
};

/**
 * Validates and applies stage transitions for the export state machine.
 *
 * @since 1.181.0
 *
 * @param state  Current reducer state.
 * @param action Dispatched action with a `nextStage` payload.
 * @return Next state, unchanged when the transition is invalid.
 */
function reducer(state, action) {
  if (action.type === 'TRANSITION') {
    const allowed = VALID_TRANSITIONS[state.stage];
    if (!allowed.includes(action.nextStage)) {
      return state;
    }
    return {
      stage: action.nextStage
    };
  }
  return state;
}

/**
 * Determines whether the given error is an `AbortError` DOMException.
 *
 * @since 1.181.0
 *
 * @param error The caught value.
 * @return `true` when the error is an AbortError.
 */
function isAbortError(error) {
  return error instanceof DOMException && error.name === 'AbortError';
}

// Throws an `AbortError` when the signal has been aborted. `getData` swallows
// abort and resolves normally, so the orchestrator cannot rely on its return
// value to detect cancellation: it must check the signal after every await.
function throwIfAborted(signal) {
  if (signal.aborted) {
    throw new DOMException('Aborted', 'AbortError');
  }
}

/**
 * Returns a promise that resolves on the next animation frame, or rejects
 * if the signal is aborted before the frame fires.
 *
 * @since 1.181.0
 *
 * @param signal Abort signal to observe.
 * @return Resolves on the next frame, rejects on abort.
 */
function nextFrame(signal) {
  return new Promise((resolve, reject) => {
    if (signal.aborted) {
      reject(new DOMException('Aborted', 'AbortError'));
      return;
    }
    function onAbort() {
      globalThis.cancelAnimationFrame(frameID);
      reject(new DOMException('Aborted', 'AbortError'));
    }
    const frameID = globalThis.requestAnimationFrame(() => {
      signal.removeEventListener('abort', onAbort);
      resolve();
    });
    signal.addEventListener('abort', onAbort, {
      once: true
    });
  });
}
const PDFExportOrchestrator = ({
  onComplete
}) => {
  const [, dispatch] = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useReducer)(reducer, initialState);
  const registry = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useRegistry)();
  const {
    setStatus,
    setProgress,
    setBlob,
    clearExport,
    clearCancelRequest
  } = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useDispatch)(_js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_PDF);
  const viewOnly = (0,_js_hooks_useViewOnly__WEBPACK_IMPORTED_MODULE_7__["default"])();
  const cancelRequested = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_PDF).isCancelRequested(), []);
  const siteName = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getSiteName(), []);
  const referenceSiteURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getReferenceSiteURL(), []);
  const dateRange = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getDateRange(), []);
  const dashboardURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getGoLinkURL('dashboard'), []);
  // A golink with this key opens the Site Kit dashboard with the email
  // reporting setup panel. The key is registered in
  // `Email_Reporting::register()`.
  const emailReportingSetupURL = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_site_constants__WEBPACK_IMPORTED_MODULE_4__.CORE_SITE).getGoLinkURL('manage-subscription-email-reporting'), []);
  const selectedContextSlugs = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => select(_js_googlesitekit_datastore_pdf_constants__WEBPACK_IMPORTED_MODULE_3__.CORE_PDF).getSelectedContextSlugs(), []);
  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 PDF reporting period excludes the current day, so end the
    // range on the day before the reference date.
    referenceDate: (0,_js_util__WEBPACK_IMPORTED_MODULE_8__.getPreviousDate)(select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getReferenceDate(), 1)
  }), []);
  const viewableModules = (0,googlesitekit_data__WEBPACK_IMPORTED_MODULE_2__.useSelect)(select => viewOnly ? select(_js_googlesitekit_datastore_user_constants__WEBPACK_IMPORTED_MODULE_5__.CORE_USER).getViewableModules() : undefined, [viewOnly]);
  const abortControllerRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  const stageTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  const completeTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  const revokeTimeoutRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(null);
  const timeoutAbortRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(false);
  const onCompleteRef = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useRef)(onComplete);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    onCompleteRef.current = onComplete;
  }, [onComplete]);
  const clearStageTimeout = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(() => {
    if (stageTimeoutRef.current !== null) {
      clearTimeout(stageTimeoutRef.current);
      stageTimeoutRef.current = null;
    }
  }, []);
  const armStageTimeout = (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useCallback)(durationMS => {
    clearStageTimeout();
    stageTimeoutRef.current = setTimeout(() => {
      stageTimeoutRef.current = null;
      timeoutAbortRef.current = true;
      abortControllerRef.current?.abort();
    }, durationMS);
  }, [clearStageTimeout]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    if (cancelRequested) {
      abortControllerRef.current?.abort();
      clearCancelRequest();
    }
  }, [cancelRequested, clearCancelRequest]);
  (0,_wordpress_element__WEBPACK_IMPORTED_MODULE_1__.useEffect)(() => {
    const controller = new AbortController();
    abortControllerRef.current = controller;
    const {
      signal
    } = controller;
    function beforeUnloadHandler(event) {
      event.preventDefault();
      // Most browsers ignore the string, but assigning it keeps the legacy contract.
      event.returnValue = '';
    }
    globalThis.addEventListener('beforeunload', beforeUnloadHandler);
    const reportSiteName = typeof siteName === 'string' ? siteName : '';
    const referenceName = reportSiteName.length > 0 ? reportSiteName : referenceSiteURL || '';
    async function run() {
      try {
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_LOADING
        });
        setStatus('progress');
        setProgress(0);
        armStageTimeout(LOADING_TIMEOUT_MS);
        // Yield a frame so the progress snackbar paints before loading.
        await nextFrame(signal);

        // Discovery: walk the registry inline (the orchestrator owns the
        // contexts → areas → widgets walk; there is no centralised
        // PDF-aware selector). `selectedContextSlugs`, `dates` and
        // `viewableModules` are snapshotted once above; nothing below
        // re-reads reactive state.
        const widgetsSelect = registry.select(_js_googlesitekit_widgets_datastore_constants__WEBPACK_IMPORTED_MODULE_6__.CORE_WIDGETS);
        const discoveredAreas = [];
        // An area can be assigned to more than one context; track the
        // slugs already discovered so a shared area is not rendered (and
        // chipped) twice when multiple of its contexts are selected.
        const discoveredAreaSlugs = new Set();
        selectedContextSlugs.forEach(contextSlug => {
          const contextAreas = widgetsSelect.getWidgetAreas(contextSlug) || [];
          contextAreas.forEach(area => {
            if (discoveredAreaSlugs.has(area.slug)) {
              return;
            }
            const pdfWidgets = widgetsSelect.getWidgets(area.slug, {
              modules: viewableModules || undefined
            }).filter(hasPDFConfig);
            if (pdfWidgets.length === 0) {
              return;
            }
            discoveredAreaSlugs.add(area.slug);
            discoveredAreas.push({
              areaSlug: area.slug,
              areaContextSlug: contextSlug,
              areaTitle: area.pdfTitle || area.title || '',
              widgets: pdfWidgets
            });
          });
        });
        const flatWidgets = discoveredAreas.flatMap(area => area.widgets);
        if (flatWidgets.length === 0) {
          throw new Error('No PDF-capable widgets to export.');
        }

        // Loading: resolve each widget's data sequentially. A failing
        // widget is isolated and renders a placeholder; the export only
        // errors when every widget fails.
        const loaded = new Map();
        let failureCount = 0;
        for (let index = 0; index < flatWidgets.length; index++) {
          const widget = flatWidgets[index];
          try {
            // Resolve the lazy component chunk up front: @react-pdf
            // does not honour Suspense, so the document tree must
            // hold a concrete component.
            let Component = widget.pdf.Component;
            if (typeof Component.preload === 'function') {
              const loadedModule = await Component.preload();
              throwIfAborted(signal);
              Component = loadedModule.default;
            }
            const result = await widget.pdf.getData({
              registry,
              dates,
              signal
            });
            throwIfAborted(signal);
            loaded.set(widget.slug, {
              Component,
              data: result?.data ?? null,
              chartImages: result?.chartImages
            });
          } catch (error) {
            if (isAbortError(error)) {
              throw error;
            }
            failureCount++;
            loaded.set(widget.slug, {
              Component: null,
              data: null,
              chartImages: undefined
            });
          }
          setProgress(Math.round((index + 1) / flatWidgets.length * LOADING_PROGRESS_MAX));
        }
        if (failureCount === flatWidgets.length) {
          throw new Error('All PDF widgets failed to load.');
        }
        throwIfAborted(signal);
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_BUILDING
        });
        armStageTimeout(BUILDING_TIMEOUT_MS);
        (0,_pdf_fonts_react__WEBPACK_IMPORTED_MODULE_9__.registerPDFFonts)();
        throwIfAborted(signal);
        const areas = discoveredAreas.map(area => ({
          areaSlug: area.areaSlug,
          areaTitle: area.areaTitle,
          widgets: area.widgets.map(widget => {
            const entry = loaded.get(widget.slug);
            return {
              slug: widget.slug,
              label: widget.pdf.label,
              Component: entry?.Component ?? null,
              data: entry?.data ?? null,
              chartImages: entry?.chartImages
            };
          })
        }));

        // One header chip per area, in area order, with the icon looked
        // up by the area's dashboard context slug.
        const sections = discoveredAreas.map(area => ({
          slug: area.areaSlug,
          label: area.areaTitle,
          Icon: _section_icons__WEBPACK_IMPORTED_MODULE_11__.SECTION_ICONS[area.areaContextSlug]
        }));
        const filename = (0,_pdf_utils__WEBPACK_IMPORTED_MODULE_10__.getPDFFilename)(referenceName, typeof dateRange === 'string' ? dateRange : undefined);
        const document = /*#__PURE__*/React.createElement(_shared_react_pdf_components_DashboardReport__WEBPACK_IMPORTED_MODULE_12__["default"], {
          siteName: reportSiteName,
          siteURL: referenceSiteURL || '',
          dashboardURL: dashboardURL || '',
          dateRange: {
            startDate: dates.startDate,
            endDate: dates.endDate
          },
          sections: sections,
          helpCenterURL: "https://sitekit.withgoogle.com/support/?doc=get-support",
          privacyPolicyURL: "https://policies.google.com/privacy",
          areas: areas,
          emailReportingSetupURL: emailReportingSetupURL
        });
        const blob = await (0,_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.pdf)(document).toBlob();
        if (signal.aborted) {
          throw new DOMException('Aborted', 'AbortError');
        }
        const blobURL = URL.createObjectURL(blob);
        setBlob({
          url: blobURL,
          filename
        });
        (0,_pdf_utils__WEBPACK_IMPORTED_MODULE_10__.triggerDownload)(blobURL, filename);
        revokeTimeoutRef.current = setTimeout(() => {
          revokeTimeoutRef.current = null;
          URL.revokeObjectURL(blobURL);
        }, BLOB_REVOKE_DELAY_MS);
        clearStageTimeout();
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_COMPLETE
        });
        setStatus('success');
        completeTimeoutRef.current = setTimeout(() => {
          completeTimeoutRef.current = null;
          onCompleteRef.current();
        }, COMPLETE_UNMOUNT_DELAY_MS);
      } catch (error) {
        clearStageTimeout();

        // User cancel is silent (IDLE). Timeout abort routes to ERROR
        // so the snackbar shows the failure.
        if (isAbortError(error) && !timeoutAbortRef.current) {
          dispatch({
            type: 'TRANSITION',
            nextStage: STAGE_IDLE
          });
          clearExport();
          onCompleteRef.current();
          return;
        }

        // Stop any request that is still running, so it ends now
        // instead of finishing in the background after the user sees
        // the error. On the stage-timeout path, `abort()` already ran,
        // so this call does nothing.
        abortControllerRef.current?.abort();
        dispatch({
          type: 'TRANSITION',
          nextStage: STAGE_ERROR
        });
        setStatus('error');
        onCompleteRef.current();
      }
    }
    run();
    return () => {
      globalThis.removeEventListener('beforeunload', beforeUnloadHandler);
      clearStageTimeout();
      if (completeTimeoutRef.current !== null) {
        clearTimeout(completeTimeoutRef.current);
        completeTimeoutRef.current = null;
      }
      if (revokeTimeoutRef.current !== null) {
        clearTimeout(revokeTimeoutRef.current);
        revokeTimeoutRef.current = null;
      }
      controller.abort();
    };
    // Runs once on mount. Site and user data are read at start, not re-fetched mid-export.
    // eslint-disable-next-line react-hooks/exhaustive-deps
  }, []);
  return null;
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFExportOrchestrator);

/***/ },

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   registerPDFFonts: () => (/* binding */ registerPDFFonts)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _fonts_google_sans_display_regular_ttf__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./fonts/google-sans-display-regular.ttf */ "./js/components/pdf-export/fonts/google-sans-display-regular.ttf");
/* harmony import */ var _fonts_google_sans_text_medium_ttf__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fonts/google-sans-text-medium.ttf */ "./js/components/pdf-export/fonts/google-sans-text-medium.ttf");
/* harmony import */ var _fonts_google_sans_text_regular_ttf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fonts/google-sans-text-regular.ttf */ "./js/components/pdf-export/fonts/google-sans-text-regular.ttf");
/* harmony import */ var _pdf_theme__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/**
 * PDF font registration for @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.
 */

/**
 * External dependencies
 */


/**
 * Internal dependencies
 */




let fontsRegistered = false;

/**
 * Registers Site Kit's brand fonts with @react-pdf/renderer.
 *
 * Embeds Google Sans Display (400) and Google Sans Text (400, 500) so the
 * generated PDF renders in the dashboard's typography. The font binaries are
 * emitted as hashed static assets by webpack and fetched by @react-pdf at
 * render time (not when this function runs), so the dashboard's page load is
 * unaffected. Registration is idempotent for the lifetime of the session.
 *
 * Errors are intentionally not caught: a failure propagates so the orchestrator
 * transitions to its ERROR stage rather than silently rendering in a fallback
 * typeface.
 *
 * @since n.e.x.t
 *
 * @return {string} The display font family name.
 */
function registerPDFFonts() {
  if (fontsRegistered) {
    return _pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_FONT_FAMILY_DISPLAY;
  }
  _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Font.register({
    family: _pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_FONT_FAMILY_DISPLAY,
    fonts: [{
      src: _fonts_google_sans_display_regular_ttf__WEBPACK_IMPORTED_MODULE_1__,
      fontWeight: 400
    }]
  });
  _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Font.register({
    family: _pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_FONT_FAMILY_TEXT,
    fonts: [{
      src: _fonts_google_sans_text_regular_ttf__WEBPACK_IMPORTED_MODULE_3__,
      fontWeight: 400
    }, {
      src: _fonts_google_sans_text_medium_ttf__WEBPACK_IMPORTED_MODULE_2__,
      fontWeight: 500
    }]
  });

  // Disable hyphenation so words wrap whole rather than being split.
  _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Font.registerHyphenationCallback(word => [word]);
  fontsRegistered = true;
  return _pdf_theme__WEBPACK_IMPORTED_MODULE_4__.PDF_FONT_FAMILY_DISPLAY;
}

/***/ },

/***/ "./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_COLOR_BORDER: () => (/* binding */ PDF_COLOR_BORDER),
/* harmony export */   PDF_COLOR_LINK: () => (/* binding */ PDF_COLOR_LINK),
/* harmony export */   PDF_COLOR_TEXT_MUTED: () => (/* binding */ PDF_COLOR_TEXT_MUTED),
/* harmony export */   PDF_COLOR_TEXT_PRIMARY: () => (/* binding */ PDF_COLOR_TEXT_PRIMARY),
/* harmony export */   PDF_COLOR_TEXT_SECONDARY: () => (/* binding */ PDF_COLOR_TEXT_SECONDARY),
/* 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_HEADER_COLORS: () => (/* binding */ PDF_HEADER_COLORS),
/* harmony export */   colors: () => (/* binding */ colors),
/* harmony export */   fontSizes: () => (/* binding */ fontSizes),
/* harmony export */   spacing: () => (/* binding */ spacing)
/* 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.
 */

/**
 * Registered @react-pdf font family for display sizes and headings.
 *
 * Maps to Google Sans Display (regular / 400 only).
 */
const PDF_FONT_FAMILY_DISPLAY = 'GoogleSansDisplay';

/**
 * Registered @react-pdf font family for body text and captions.
 *
 * Maps to Google Sans Text (regular / 400 and medium / 500).
 */
const PDF_FONT_FAMILY_TEXT = 'GoogleSansText';
const PDF_COLOR_TEXT_PRIMARY = '#161b18';
const PDF_COLOR_TEXT_SECONDARY = '#5f6368';
const PDF_COLOR_TEXT_MUTED = '#6C726E';
const PDF_COLOR_LINK = '#108080';
const PDF_COLOR_BORDER = '#dadce0';

/**
 * Header-specific colour tokens for the PDF report header strip.
 *
 * @since n.e.x.t
 */
const PDF_HEADER_COLORS = {
  logo: PDF_COLOR_TEXT_SECONDARY,
  title: PDF_COLOR_TEXT_PRIMARY,
  subtitle: PDF_COLOR_TEXT_SECONDARY,
  siteURL: PDF_COLOR_TEXT_MUTED,
  link: PDF_COLOR_LINK,
  chipBorder: PDF_COLOR_BORDER,
  chipText: PDF_COLOR_TEXT_PRIMARY,
  chipIcon: PDF_COLOR_TEXT_PRIMARY
};

/**
 * Colour tokens shared across the PDF report header, footer, and tiles.
 *
 * @since n.e.x.t
 */
const colors = {
  text: '#202124',
  secondary: '#5f6368',
  onSurfaceVariant: '#6c726e'
};

/**
 * Font-size tokens shared across the PDF report components.
 *
 * @since n.e.x.t
 */
const fontSizes = {
  small: 12,
  body: 12,
  subheading: 16,
  heading: 20
};

/**
 * Spacing tokens shared across the PDF report components.
 *
 * @since n.e.x.t
 */
const spacing = {
  /** Gap above the footer links (Figma: 44px above the footer). */
  footerMarginTop: 44,
  /**
   * Horizontal gap between footer links. Centring the links with a fixed gap
   * (rather than spreading them edge-to-edge) keeps the group in the middle of
   * the page and lets it grow for longer translated labels. Approximates the
   * ~49.5px gap implied by the Figma layout.
   */
  footerLinkGap: 48,
  /** Vertical gap between footer links when they wrap (Figma: gap-y 4px). */
  footerLinkRowGap: 4
};

/***/ },

/***/ "./js/components/pdf-export/pdf-utils.ts"
/*!***********************************************!*\
  !*** ./js/components/pdf-export/pdf-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 */   getPDFFilename: () => (/* binding */ getPDFFilename),
/* harmony export */   triggerDownload: () => (/* binding */ triggerDownload)
/* harmony export */ });
/**
 * PDF export 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.
 */

/**
 * Sanitizes a free-form string into a lowercase, hyphen-separated slug
 * suitable for use inside a filename.
 *
 * @since 1.181.0
 *
 * @param value Input string. Empty and non-string values become an empty slug.
 * @return The sanitized slug.
 */
function slugify(value) {
  if (typeof value !== 'string' || value.length === 0) {
    return '';
  }
  const withoutScheme = value.replace(/^[a-z][a-z0-9+\-.]*:\/\//i, '');
  return withoutScheme.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-+|-+$/g, '');
}

/**
 * Returns the current date as `YYYY-MM-DD` using the local timezone.
 *
 * @since 1.181.0
 *
 * @param [now] Optional date instance, defaults to `new Date()`.
 * @return The formatted date.
 */
function getISODate(
// The filename's date stamp is the actual generation moment, not the
// dashboard's analytics reference date.
// eslint-disable-next-line sitekit/no-direct-date
now = new Date()) {
  const year = now.getFullYear();
  const month = String(now.getMonth() + 1).padStart(2, '0');
  const day = String(now.getDate()).padStart(2, '0');
  return `${year}-${month}-${day}`;
}

/**
 * Builds a sanitized PDF filename for the dashboard export.
 *
 * The result is `site-kit-<site>-<dateRange>-<date>.pdf` when a date range
 * is supplied, or `site-kit-<site>-<date>.pdf` otherwise. The site and date
 * range are passed through `slugify` so the filename is filesystem-safe on
 * every supported OS.
 *
 * @since 1.181.0
 *
 * @param siteName    Site name or URL.
 * @param [dateRange] Optional date range slug, e.g. `last-28-days`.
 * @param [now]       Optional date instance, defaults to `new Date()`.
 * @return The composed filename.
 */
function getPDFFilename(siteName, dateRange,
// The filename's date stamp is the actual generation moment, not the
// dashboard's analytics reference date.
// eslint-disable-next-line sitekit/no-direct-date
now = new Date()) {
  const siteSlug = slugify(siteName) || 'report';
  const rangeSlug = slugify(dateRange);
  const date = getISODate(now);
  const segments = ['site-kit', siteSlug];
  if (rangeSlug) {
    segments.push(rangeSlug);
  }
  segments.push(date);
  return `${segments.join('-')}.pdf`;
}

/**
 * Triggers a browser download for the given blob URL by creating a temporary
 * anchor element with the `download` attribute, clicking it programmatically,
 * and removing it from the DOM.
 *
 * @since 1.181.0
 *
 * @param  url      Blob URL pointing to the generated file.
 * @param  filename Suggested filename for the downloaded file.
 * @return {void}
 */
function triggerDownload(url, filename) {
  const link = globalThis.document.createElement('a');
  link.href = url;
  link.download = filename;
  link.rel = 'noopener';
  link.style.display = 'none';
  globalThis.document.body.appendChild(link);
  link.click();
  globalThis.document.body.removeChild(link);
}

/***/ },

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

"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */   SECTION_ICONS: () => (/* binding */ SECTION_ICONS)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! react */ "../node_modules/react/index.js");
/* harmony import */ var _js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/googlesitekit/widgets/default-contexts */ "./js/googlesitekit/widgets/default-contexts.js");
/* harmony import */ var _pdf_theme__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/**
 * PDF report section icons for @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.
 */

/**
 * External dependencies
 */



/**
 * Internal dependencies
 */


const DEFAULT_SIZE = 12;

/**
 * Builds a section icon component from inlined SVG children.
 *
 * @since n.e.x.t
 *
 * @param renderChildren Receives the resolved fill colour, returns the SVG children.
 * @return Section icon component.
 */
function makeIcon(renderChildren) {
  return function Icon({
    size = DEFAULT_SIZE,
    color
  }) {
    return /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, {
      width: size,
      height: size,
      viewBox: '0 0 20 20'
    }, renderChildren(color ?? _pdf_theme__WEBPACK_IMPORTED_MODULE_3__.PDF_HEADER_COLORS.chipIcon));
  };
}
const KeyMetricsIcon = makeIcon(color =>
// A 2×2 grid of rounded squares; only the x/y offsets differ.
[[3, 3], [11.167, 3], [3, 11.167], [11.167, 11.167]].map(([x, y], index) => /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Rect, {
  key: index,
  width: 5.833,
  height: 5.833,
  x,
  y,
  rx: 1.167,
  fill: color
})));
const TrafficIcon = makeIcon(color => /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.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',
  fill: color
}));
const ContentIcon = makeIcon(color => /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.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',
  fill: color
}));
const SpeedIcon = makeIcon(color => /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.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',
  fill: color
}));
const MonetizationIcon = makeIcon(color => /*#__PURE__*/(0,react__WEBPACK_IMPORTED_MODULE_1__.createElement)(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.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',
  fill: color
}));

/**
 * Maps a dashboard context slug to its section icon.
 *
 * Keyed by the main-dashboard context slugs that surface in the PDF; contexts
 * without a nav icon (e.g. site goals) are intentionally absent. Entity-dashboard
 * contexts are also omitted because PDF export is main-dashboard only today; add
 * them here when entity-context export lands, otherwise those chips render
 * label-only (handled gracefully by `PDFHeaderSectionChip`).
 *
 * @since n.e.x.t
 */
const SECTION_ICONS = {
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_KEY_METRICS]: KeyMetricsIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_TRAFFIC]: TrafficIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_CONTENT]: ContentIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_SPEED]: SpeedIcon,
  [_js_googlesitekit_widgets_default_contexts__WEBPACK_IMPORTED_MODULE_2__.CONTEXT_MAIN_DASHBOARD_MONETIZATION]: MonetizationIcon
};

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/DashboardReport.tsx"
/*!**********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/DashboardReport.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.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_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_shared_react_pdf_components_PDFFooter__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFFooter */ "./js/components/pdf-export/shared-react-pdf-components/PDFFooter.tsx");
/* harmony import */ var _PDFEmailReportingNotice__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PDFEmailReportingNotice */ "./js/components/pdf-export/shared-react-pdf-components/PDFEmailReportingNotice.tsx");
/* harmony import */ var _PDFHeader__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PDFHeader */ "./js/components/pdf-export/shared-react-pdf-components/PDFHeader.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * DashboardReport: minimal `react-pdf` Document used by the MVP 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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




const DEFAULT_PAGE_HEIGHT = 792;
const styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  page: {
    paddingTop: 24,
    paddingBottom: 24,
    paddingHorizontal: 24,
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_TEXT,
    fontSize: 12,
    backgroundColor: '#f3f5f7'
  },
  body: {
    flexGrow: 1
  },
  section: {
    marginBottom: 24
  },
  sectionTitle: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_DISPLAY,
    fontSize: 24,
    fontWeight: 'normal',
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLOR_TEXT_PRIMARY,
    marginBottom: 12
  },
  emptyText: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_TEXT,
    fontSize: 11,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_COLOR_TEXT_SECONDARY
  }
});
const DashboardReport = ({
  siteName,
  siteURL,
  dashboardURL,
  dateRange,
  sections,
  helpCenterURL,
  privacyPolicyURL,
  pageHeight = DEFAULT_PAGE_HEIGHT,
  areas = [],
  emailReportingSetupURL
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Document, {
    title: siteName ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %s: Site name. */
    (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('%s – Site Kit report', 'google-site-kit'), siteName) : (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Site Kit Dashboard Report', 'google-site-kit'),
    author: "Site Kit by Google"
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Page, {
    size: [612, pageHeight],
    style: styles.page,
    wrap: false
  }, /*#__PURE__*/React.createElement(_PDFHeader__WEBPACK_IMPORTED_MODULE_5__["default"], {
    siteURL: siteURL,
    dashboardURL: dashboardURL,
    dateRange: dateRange,
    sections: sections
  }), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.body
  }, areas.length === 0 && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.emptyText
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No report data available.', 'google-site-kit')), areas.map(({
    areaSlug,
    areaTitle,
    widgets
  }) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: `section-${areaSlug}`,
    style: styles.section
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.sectionTitle
  }, areaTitle), widgets.map(({
    slug,
    Component,
    data,
    chartImages
  }) => {
    if (!Component) {
      return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
        key: slug,
        style: styles.emptyText
      }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Data unavailable.', 'google-site-kit'));
    }
    return /*#__PURE__*/React.createElement(Component, {
      key: slug,
      data: data,
      chartImages: chartImages
    });
  })))), /*#__PURE__*/React.createElement(_PDFEmailReportingNotice__WEBPACK_IMPORTED_MODULE_4__["default"], {
    emailReportingSetupURL: emailReportingSetupURL
  }), /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFFooter__WEBPACK_IMPORTED_MODULE_3__["default"], {
    dashboardURL: dashboardURL,
    helpCenterURL: helpCenterURL,
    privacyPolicyURL: privacyPolicyURL
  })));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DashboardReport);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFEmailReportingNotice.tsx"
/*!******************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFEmailReportingNotice.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.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_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFEmailReportingNotice: Email Reporting setup notice for the PDF 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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */

const COLORS = {
  background: '#e3d1ff',
  text: '#462083',
  buttonBackground: '#462083',
  buttonText: '#ffffff'
};

// The star path from `assets/svg/icons/star-fill.svg`. Importing the SVG
// file produces a DOM component, which @react-pdf cannot render in a PDF.
// So the path data is inlined here and rendered with @react-pdf's own
// <Svg> and <Path> components.
const STAR_ICON_PATH = 'M5.825 22L8.15 14.4L2 10H9.6L12 2L14.4 10H22L15.85 14.4L18.175 22L12 17.3L5.825 22Z';
const baseTextStyle = {
  fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_TEXT,
  fontSize: 7,
  lineHeight: 1.43,
  color: COLORS.text
};
const styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  container: {
    flexDirection: 'row',
    alignItems: 'center',
    backgroundColor: COLORS.background,
    borderRadius: 8,
    paddingVertical: 7,
    paddingHorizontal: 12,
    marginBottom: 22
  },
  textColumn: {
    flexGrow: 1,
    flexShrink: 1,
    marginLeft: 8,
    marginRight: 55
  },
  title: {
    ...baseTextStyle,
    fontWeight: 500
  },
  body: {
    ...baseTextStyle,
    letterSpacing: 0.125
  },
  button: {
    flexShrink: 0,
    backgroundColor: COLORS.buttonBackground,
    borderRadius: 8,
    paddingVertical: 3,
    paddingHorizontal: 8
  },
  buttonLink: {
    textDecoration: 'none'
  },
  buttonText: {
    ...baseTextStyle,
    fontWeight: 500,
    color: COLORS.buttonText
  }
});
const PDFEmailReportingNotice = ({
  emailReportingSetupURL
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.container
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, {
    width: 12,
    height: 12,
    viewBox: "0 0 24 24"
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
    d: STAR_ICON_PATH,
    fill: COLORS.text
  })), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.textColumn
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.title
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Get your site’s most important insights delivered to your inbox', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.body
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Stay updated with a summary of your site’s performance, key trends, and tailored metrics sent directly to your inbox.', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.body
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('This feature is available exclusively to Site Kit users.', 'google-site-kit'))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.button
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
    src: emailReportingSetupURL,
    style: styles.buttonLink
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.buttonText
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Set up email reports', 'google-site-kit')))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFEmailReportingNotice);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFFooter.tsx"
/*!****************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFFooter.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.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_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.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
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */

const styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  footer: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    justifyContent: 'center',
    alignItems: 'flex-start',
    columnGap: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.spacing.footerLinkGap,
    rowGap: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.spacing.footerLinkRowGap,
    marginTop: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.spacing.footerMarginTop
  },
  link: {
    fontSize: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.fontSizes.small,
    // Matches the design's label/small token (12/16): react-pdf lineHeight
    // is a unitless multiple of the font size, so 16 / 12 yields a 16pt line.
    lineHeight: 16 / 12,
    letterSpacing: 0.2,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.colors.onSurfaceVariant,
    textDecoration: 'none'
  }
});
const PDFFooter = ({
  dashboardURL,
  helpCenterURL,
  privacyPolicyURL
}) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
  style: styles.footer
}, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
  src: dashboardURL,
  style: styles.link
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View dashboard', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
  src: helpCenterURL,
  style: styles.link
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Help center', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
  src: privacyPolicyURL,
  style: styles.link
}, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Privacy Policy', 'google-site-kit')));
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFFooter);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFHeader.tsx"
/*!****************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFHeader.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.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_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_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/util */ "./js/util/index.js");
/* harmony import */ var _PDFHeaderSectionChip__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./PDFHeaderSectionChip */ "./js/components/pdf-export/shared-react-pdf-components/PDFHeaderSectionChip.tsx");
/* harmony import */ var _PDFSiteKitLogo__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./PDFSiteKitLogo */ "./js/components/pdf-export/shared-react-pdf-components/PDFSiteKitLogo.tsx");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFHeader: report header strip rendered with @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.
 */

/**
 * External dependencies
 */

/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */





// Material "chevron_right" geometry (viewBox 0 0 24 24).
const CHEVRON_RIGHT_PATH = 'M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z';

/**
 * Extracts the host (e.g. "www.example.com") from the reference site URL for
 * display as the header's site address.
 *
 * @since n.e.x.t
 *
 * @param {string} siteURL The reference site URL.
 * @return {string} The host, or the original value when it cannot be parsed.
 */
function getSiteHost(siteURL) {
  try {
    return new URL(siteURL).host;
  } catch {
    return siteURL;
  }
}

/**
 * Formats a `YYYY-MM-DD` date as a localized short date, e.g. "Jan 1, 2021".
 *
 * Returns an empty string for missing/invalid input: `stringToDate` throws on a
 * non-`YYYY-MM-DD` string, which would otherwise abort the whole PDF render.
 *
 * @since n.e.x.t
 *
 * @param {string} dateString The date in `YYYY-MM-DD` format.
 * @return {string} The localized date, or an empty string.
 */
function formatHeaderDate(dateString) {
  if (!(0,_js_util__WEBPACK_IMPORTED_MODULE_3__.isValidDateString)(dateString)) {
    return '';
  }
  return new Intl.DateTimeFormat((0,_js_util__WEBPACK_IMPORTED_MODULE_3__.getLocale)(), {
    month: 'short',
    day: 'numeric',
    year: 'numeric'
  }).format((0,_js_util__WEBPACK_IMPORTED_MODULE_3__.stringToDate)(dateString));
}
const styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  header: {
    backgroundColor: '#FFFFFF',
    marginTop: -24,
    marginHorizontal: -24,
    marginBottom: 24,
    paddingTop: 16,
    paddingHorizontal: 24,
    paddingBottom: 6
  },
  topRow: {
    flexDirection: 'row',
    alignItems: 'center',
    marginBottom: 16
  },
  divider: {
    width: 1,
    height: 28,
    backgroundColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_HEADER_COLORS.chipBorder,
    marginHorizontal: 12
  },
  titleBlock: {
    flexGrow: 1,
    flexShrink: 1
  },
  title: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_TEXT,
    fontSize: 14,
    lineHeight: 20 / 14,
    letterSpacing: 0.25,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_HEADER_COLORS.subtitle,
    marginBottom: 2
  },
  dateRange: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_DISPLAY,
    fontSize: 22,
    fontWeight: 400,
    lineHeight: 28 / 22,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_HEADER_COLORS.title
  },
  siteBlock: {
    flexShrink: 0,
    marginLeft: 16,
    alignItems: 'flex-end'
  },
  siteLink: {
    textDecoration: 'none'
  },
  siteURL: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_TEXT,
    fontSize: 14,
    fontWeight: 400,
    lineHeight: 20 / 14,
    letterSpacing: 0.25,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_HEADER_COLORS.siteURL
  },
  chipRow: {
    flexDirection: 'row',
    alignItems: 'flex-start',
    justifyContent: 'space-between'
  },
  chips: {
    flexDirection: 'row',
    flexWrap: 'wrap',
    flexGrow: 1,
    flexShrink: 1
  },
  chipWrapper: {
    marginRight: 8,
    marginBottom: 8
  },
  viewDashboard: {
    flexShrink: 0,
    flexDirection: 'row',
    alignItems: 'center',
    marginLeft: 8,
    textDecoration: 'none'
  },
  viewDashboardText: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_TEXT,
    fontSize: 14,
    fontWeight: 500,
    lineHeight: 20 / 14,
    letterSpacing: 0,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_HEADER_COLORS.link,
    marginRight: 2
  }
});
const PDFHeader = ({
  siteURL,
  dashboardURL,
  dateRange,
  sections
}) => {
  const startDate = formatHeaderDate(dateRange.startDate);
  const endDate = formatHeaderDate(dateRange.endDate);
  // Avoid a dangling " - " when one (or both) of the dates is invalid.
  const formattedDateRange = startDate && endDate ? `${startDate} - ${endDate}` : startDate || endDate;
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.header
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.topRow
  }, /*#__PURE__*/React.createElement(_PDFSiteKitLogo__WEBPACK_IMPORTED_MODULE_5__["default"], null), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.divider
  }), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.titleBlock
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.title
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)("Your site's performance", 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.dateRange
  }, formattedDateRange)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.siteBlock
  }, dashboardURL ? /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
    src: dashboardURL,
    style: styles.siteLink
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.siteURL
  }, getSiteHost(siteURL))) : /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.siteURL
  }, getSiteHost(siteURL)))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.chipRow
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.chips
  }, sections.map(({
    slug,
    label,
    Icon
  }) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    key: slug,
    style: styles.chipWrapper
  }, /*#__PURE__*/React.createElement(_PDFHeaderSectionChip__WEBPACK_IMPORTED_MODULE_4__["default"], {
    label: label,
    Icon: Icon
  })))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Link, {
    src: dashboardURL,
    style: styles.viewDashboard
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.viewDashboardText
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('View dashboard in Site Kit', 'google-site-kit')), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, {
    width: 10,
    height: 10,
    viewBox: "0 0 24 24"
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
    d: CHEVRON_RIGHT_PATH,
    fill: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_HEADER_COLORS.link
  })))));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFHeader);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFHeaderSectionChip.tsx"
/*!***************************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFHeaderSectionChip.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFHeaderSectionChip: a section pill rendered in the PDF report header.
 *
 * 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 styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  chip: {
    flexDirection: 'row',
    alignItems: 'center',
    borderWidth: 1,
    borderColor: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_HEADER_COLORS.chipBorder,
    borderRadius: 100,
    paddingVertical: 4,
    paddingHorizontal: 8
  },
  label: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
    fontSize: 12,
    fontWeight: 500,
    lineHeight: 16 / 12,
    letterSpacing: 0.5,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_HEADER_COLORS.chipText
  },
  // Only offset the label from the icon; without one it would be off-centre.
  labelWithIcon: {
    marginLeft: 4
  }
});
const PDFHeaderSectionChip = ({
  label,
  Icon
}) => {
  // Rendered as a plain pill for now: the chip has no jump-to-section target
  // yet, so wrapping it in a srcless <Link> would only risk an empty/broken
  // link annotation in the PDF. #12553 wires the anchor by wrapping this in a
  // `<Link src={ `#${ slug }` } />` plus matching section ids. A bare "#" is
  // NOT used because @react-pdf treats any non-`#id` src as an external URI
  // and would emit a broken clickable link in every PDF.
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.chip
  }, Icon && /*#__PURE__*/React.createElement(Icon, {
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_HEADER_COLORS.chipIcon
  }), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: Icon ? [styles.label, styles.labelWithIcon] : styles.label
  }, label));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFHeaderSectionChip);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricTile.tsx"
/*!********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFMetricTile.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFMetricTile component for @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.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

const COLORS = {
  text: '#161b18',
  secondary: '#6c726e',
  positiveBackground: '#d8ffc0',
  positiveText: '#1f4c04',
  negativeBackground: '#ffded3',
  negativeText: '#7a1e00'
};
const tileStyles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  container: {
    flexDirection: 'row',
    justifyContent: 'space-between',
    alignItems: 'flex-start'
  },
  metric: {
    flexDirection: 'column'
  },
  title: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
    fontSize: 12,
    fontWeight: 'normal',
    color: COLORS.text,
    marginBottom: 6
  },
  value: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
    fontSize: 24,
    fontWeight: 400,
    color: COLORS.text
  },
  aside: {
    flexDirection: 'column',
    alignItems: 'flex-end'
  },
  chip: {
    borderRadius: 10,
    paddingVertical: 4,
    paddingHorizontal: 8
  },
  chipText: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
    fontSize: 10
  },
  changeLabel: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
    fontSize: 10,
    color: COLORS.secondary,
    marginTop: 8
  }
});
const PDFMetricTile = ({
  title,
  value,
  change,
  isNegative = false,
  changeLabel
}) => {
  const chipBackground = isNegative ? COLORS.negativeBackground : COLORS.positiveBackground;
  const chipColor = isNegative ? COLORS.negativeText : COLORS.positiveText;
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.container
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.metric
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: tileStyles.title
  }, title), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: tileStyles.value
  }, value)), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: tileStyles.aside
  }, !!change && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: [tileStyles.chip, {
      backgroundColor: chipBackground
    }]
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: [tileStyles.chipText, {
      color: chipColor
    }]
  }, change)), !!changeLabel && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: tileStyles.changeLabel
  }, changeLabel)));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFMetricTile);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFSiteKitLogo.tsx"
/*!*********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFSiteKitLogo.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFSiteKitLogo: Site Kit brand mark rendered with @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.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */


// Mirrors the `Logo` component (`assets/js/components/Logo.js`): the colour
// Google "G" (`assets/svg/graphics/logo-g.svg`) next to the "Site Kit" wordmark
// (`assets/svg/graphics/logo-sitekit.svg`). The geometry is inlined because the
// webpack SVG import yields a DOM component @react-pdf cannot render in a PDF;
// it is drawn here with @react-pdf's own <Svg>/<Path> primitives.
const G_PATHS = [{
  d: 'M2.25253805,12.2519409 L9.65186195,17.9102474 C9.228777,19.1952969 9,20.5700374 9,22 C9,23.4299626 9.228777,24.8047031 9.65186195,26.0897526 L2.25253805,31.7480591 C0.809393905,28.8140208 0,25.5061199 0,22 C0,18.4938801 0.809393905,15.1859792 2.25253805,12.2519409 Z',
  fill: '#FBBC05'
}, {
  d: 'M9.65186195,17.9102474 L2.25253805,12.2519409 C5.83100163,4.97661119 13.3061199,0 22,0 C27.6,0 32.6,2.1 36.5,5.5 L30.1,11.9 C27.9,10.1 25.1,9 22,9 C16.2299626,9 11.3590507,12.7249484 9.65186195,17.9102474 Z',
  fill: '#EA4335'
}, {
  d: 'M2.24956066,31.7420035 L9.64586796,26.0715012 C11.3476258,31.2663086 16.223195,35 22,35 C28.1,35 32.7,31.9 33.8,26.5 L22,26.5 L22,18 L42.5,18 C42.8,19.3 43,20.7 43,22 C43,36 33,44 22,44 C13.3037079,44 5.82685413,39.0206271 2.24956066,31.7420035 Z',
  fill: '#34A853'
}, {
  d: 'M36.3394527,38.5208666 L29.3149064,33.0825082 C31.6117078,31.6329963 33.209743,29.3976252 33.8,26.5 L22,26.5 L22,18 L42.5,18 C42.8,19.3 43,20.7 43,22 C43,29.170479 40.3767465,34.7670059 36.3394527,38.5208666 Z',
  fill: '#4285F4'
}];
const styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  logo: {
    flexDirection: 'row',
    alignItems: 'center',
    flexShrink: 0
  },
  wordmark: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_DISPLAY,
    fontSize: 22,
    fontWeight: 400,
    color: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_COLOR_TEXT_PRIMARY,
    lineHeight: 28 / 22,
    marginLeft: 7
  }
});
const PDFSiteKitLogo = () => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.logo
  }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Svg, {
    width: 21,
    height: 22,
    viewBox: "0 0 43 44"
  }, G_PATHS.map(({
    d,
    fill
  }, index) => /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Path, {
    key: index,
    d: d,
    fill: fill
  }))), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.wordmark
  }, "Site Kit"));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFSiteKitLogo);

/***/ },

/***/ "./js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection.tsx"
/*!***********************************************************************************!*\
  !*** ./js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection.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_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.js");
/* harmony import */ var _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @/js/components/pdf-export/pdf-theme */ "./js/components/pdf-export/pdf-theme.ts");
/* provided dependency */ var React = __webpack_require__(/*! @wordpress/element */ "../node_modules/@wordpress/element/build-module/index.js");
/**
 * PDFWidgetSection: widget heading + white card wrapper for the PDF 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.
 */

/**
 * External dependencies
 */

/**
 * Internal dependencies
 */

const styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  heading: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_1__.PDF_FONT_FAMILY_TEXT,
    fontSize: 13,
    color: '#6c726e',
    marginBottom: 8
  },
  card: {
    backgroundColor: '#ffffff',
    borderRadius: 14,
    padding: 20,
    marginBottom: 20
  }
});
const PDFWidgetSection = ({
  heading,
  children
}) => {
  return /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, null, !!heading && /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.heading
  }, heading), /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.View, {
    style: styles.card
  }, children));
};
/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (PDFWidgetSection);

/***/ },

/***/ "./js/googlesitekit/datastore/pdf/constants.ts"
/*!*****************************************************!*\
  !*** ./js/googlesitekit/datastore/pdf/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 */   CORE_PDF: () => (/* binding */ CORE_PDF)
/* 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 CORE_PDF = 'core/pdf';

/***/ },

/***/ "./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/indexPDF.tsx"
/*!***********************************************************************************************!*\
  !*** ./js/modules/analytics-4/components/dashboard/DashboardAllTrafficWidgetGA4/indexPDF.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 */ DashboardAllTrafficWidgetGA4PDF)
/* harmony export */ });
/* harmony import */ var _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @react-pdf/renderer */ "../node_modules/@react-pdf/renderer/lib/react-pdf.browser.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_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_shared_react_pdf_components_PDFMetricTile__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFMetricTile */ "./js/components/pdf-export/shared-react-pdf-components/PDFMetricTile.tsx");
/* harmony import */ var _js_components_pdf_export_shared_react_pdf_components_PDFWidgetSection__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @/js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection */ "./js/components/pdf-export/shared-react-pdf-components/PDFWidgetSection.tsx");
/* 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");
/**
 * DashboardAllTrafficWidgetGA4 PDF component for @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.
 */

/**
 * External dependencies
 */


/**
 * WordPress dependencies
 */


/**
 * Internal dependencies
 */




const styles = _react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.StyleSheet.create({
  chart: {
    width: '100%',
    height: 200,
    marginTop: 12
  },
  noData: {
    fontFamily: _js_components_pdf_export_pdf_theme__WEBPACK_IMPORTED_MODULE_2__.PDF_FONT_FAMILY_TEXT,
    fontSize: 9,
    color: '#646464'
  }
});
function DashboardAllTrafficWidgetGA4PDF({
  data,
  chartImages
}) {
  const trafficData = data;
  if (!trafficData) {
    return /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFWidgetSection__WEBPACK_IMPORTED_MODULE_4__["default"], {
      heading: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Your site traffic over time', 'google-site-kit')
    }, /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
      style: styles.noData
    }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No data available.', 'google-site-kit')));
  }
  const {
    totalsReport,
    graphReport
  } = trafficData;
  const [current, previous] = totalsReport?.totals || [];
  const currentValue = Number(current?.metricValues?.[0]?.value);
  const previousValue = Number(previous?.metricValues?.[0]?.value);
  const change = (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.calculateChange)(previousValue, currentValue);
  const changeText = typeof change === 'number' ? (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.numFmt)(change, {
    style: 'percent',
    signDisplay: 'exceptZero',
    maximumFractionDigits: 1
  }) : undefined;
  const graphRowCount = graphReport?.rows?.length || 0;
  const comparisonLabel = graphRowCount > 0 ? (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.sprintf)(/* translators: %d: number of days in the comparison period */
  (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Vs. prev. %d days', 'google-site-kit'), graphRowCount) : undefined;
  const formattedValue = (0,_js_util__WEBPACK_IMPORTED_MODULE_5__.numFmt)(currentValue || 0);
  const lineChart = chartImages?.lineChart;
  return /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFWidgetSection__WEBPACK_IMPORTED_MODULE_4__["default"], {
    heading: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('Your site traffic over time', 'google-site-kit')
  }, /*#__PURE__*/React.createElement(_js_components_pdf_export_shared_react_pdf_components_PDFMetricTile__WEBPACK_IMPORTED_MODULE_3__["default"], {
    title: (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('All visitors', 'google-site-kit'),
    value: formattedValue,
    change: changeText,
    isNegative: typeof change === 'number' && change < 0,
    changeLabel: comparisonLabel
  }), lineChart ? /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Image, {
    src: lineChart,
    style: styles.chart
  }) : /*#__PURE__*/React.createElement(_react_pdf_renderer__WEBPACK_IMPORTED_MODULE_0__.Text, {
    style: styles.noData
  }, (0,_wordpress_i18n__WEBPACK_IMPORTED_MODULE_1__.__)('No data available.', 'google-site-kit')));
}

/***/ },

/***/ "./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/components/pdf-export/fonts/google-sans-display-regular.ttf"
/*!************************************************************************!*\
  !*** ./js/components/pdf-export/fonts/google-sans-display-regular.ttf ***!
  \************************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "fonts/google-sans-display-regular-67843392439f681fdbfd.ttf";

/***/ },

/***/ "./js/components/pdf-export/fonts/google-sans-text-medium.ttf"
/*!********************************************************************!*\
  !*** ./js/components/pdf-export/fonts/google-sans-text-medium.ttf ***!
  \********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "fonts/google-sans-text-medium-53980445227ada4764a7.ttf";

/***/ },

/***/ "./js/components/pdf-export/fonts/google-sans-text-regular.ttf"
/*!*********************************************************************!*\
  !*** ./js/components/pdf-export/fonts/google-sans-text-regular.ttf ***!
  \*********************************************************************/
(module, __unused_webpack_exports, __webpack_require__) {

"use strict";
module.exports = __webpack_require__.p + "fonts/google-sans-text-regular-0d01ceaea2903216c4ee.ttf";

/***/ },

/***/ "?69d4"
/*!************************!*\
  !*** buffer (ignored) ***!
  \************************/
() {

/* (ignored) */

/***/ },

/***/ "?1709"
/*!************************!*\
  !*** crypto (ignored) ***!
  \************************/
() {

/* (ignored) */

/***/ }

}]);
//# sourceMappingURL=googlesitekit-vendor-lazy-pdf.js.map