38 lines
168 KiB
JavaScript
38 lines
168 KiB
JavaScript
|
|
"use strict";(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[15,290],{718:(e,t,i)=>{i.d(t,{gy:()=>SelectionPanelFooter,W4:()=>SelectionPanelHeader,y3:()=>SelectionPanelItem,DW:()=>SelectionPanelItems,Ay:()=>j});var n=i(4452),o=i.n(n),s=i(62688),r=i.n(s),a=i(4544),l=i.n(a),c=i(21795),g=i(78174),d=i(63696),u=i(19266),p=i(14007),m=i(62540);function SideSheet({className:e,children:t,isOpen:i,isLoading:n,onOpen:s=()=>{},closeSheet:r=()=>{},focusTrapOptions:a={}}){const h=(0,d.useRef)();return(0,d.useEffect)(()=>{i?(s(),document.body.classList.add("googlesitekit-side-sheet-scroll-lock")):document.body.classList.remove("googlesitekit-side-sheet-scroll-lock")},[i,s]),(0,c.A)(h,r),(0,g.A)(e=>i&&u._f===e.keyCode,r),(0,m.jsxs)(p.A,{children:[(0,m.jsx)(l(),{active:!!i&&!n,focusTrapOptions:{fallbackFocus:"body",...a},children:(0,m.jsx)("section",{ref:h,className:o()("googlesitekit-side-sheet",e,{"googlesitekit-side-sheet--open":i}),role:"dialog","aria-modal":"true","aria-hidden":!i,tabIndex:"0",children:t})}),i&&(0,m.jsx)("span",{className:"googlesitekit-side-sheet-overlay"})]})}function SelectionPanel({children:e,isOpen:t,isLoading:i,onOpen:n,closePanel:s,className:r}){const a=r?.split(/\s+/).map(e=>`.${e}`).join(""),l=a?`${a} .googlesitekit-selection-panel-item .googlesitekit-selection-box input`:".googlesitekit-selection-panel-item .googlesitekit-selection-box input";return(0,m.jsx)(SideSheet,{className:o()("googlesitekit-selection-panel",r),isOpen:t,isLoading:i,onOpen:n,closeSheet:s,focusTrapOptions:{initialFocus:l},children:e})}SideSheet.propTypes={className:r().string,children:r().node,isOpen:r().bool,isLoading:r().bool,onOpen:r().func,closeSheet:r().func,focusTrapOptions:r().object},SelectionPanel.propTypes={children:r().node,isOpen:r().bool,isLoading:r().bool,onOpen:r().func,closePanel:r().func,className:r().string};var h=i(20898),f=i(72545),k=i(15167);function SelectionPanelHeader({children:e,title:t,onCloseClick:i}){return(0,m.jsxs)("header",{className:"googlesitekit-selection-panel-header",children:[(0,m.jsxs)("div",{className:"googlesitekit-selection-panel-header__row",children:[(0,m.jsx)(k.A,{as:"h3",size:"small",type:"headline",children:t}),(0,m.jsx)(h.A,{className:"googlesitekit-selection-panel-header__close",onClick:i,linkButton:!0,children:(0,m.jsx)(f.A,{width:"15",height:"15"})})]}),e]})}SelectionPanelHeader.propTypes={children:r().node,title:r().string,onCloseClick:r().func};var y=i(82871),v=i(49383);function SelectionBox({badge:e,checked:t,children:i,disabled:n,id:s,onChange:r,title:a,value:l}){return(0,m.jsx)("div",{className:o()("googlesitekit-selection-box",{"googlesitekit-selection-box--disabled":n}),children:(0,m.jsx)(v.Checkbox,{checked:t,description:i,disabled:n,id:s,name:s,onChange:r,value:l,badge:e,children:a})})}SelectionBox.propTypes={badge:r().node,checked:r().bool,children:r().node,disabled:r().bool,id:r().string,onChange:r().func,title:r().string,value:r().string};var _=i(2362);function SelectionPanelItem({children:e,id:t,slug:i,title:n,description:o,isItemSelected:s,isItemDisabled:r,onCheckboxChange:a,subtitle:l,suffix:c,badge:g,isNewlyDetected:d}){return(0,m.jsxs)("div",{className:"googlesitekit-selection-panel-item",children:[(0,m.jsxs)(SelectionBox,{badge:g,checked:s,disabled:r,id:t,onChange:a,title:n,value:i,children:[l&&(0,m.jsx)("span",{className:"googlesitekit-selection-panel-item__subtitle",children:l}),o,e]}),d&&(0,m.jsx)(_.A,{label:(0,y.__)("New","google-site-kit")}),c&&(0,m.jsx)("span",{className:"googlesitekit-selection-panel-item__suffix",children:c})]})}function SelectionPanelItems({currentSelectionTitle:e=(0,y.__)("Current selection","google-site-kit"),availableItemsTitle:t=(0,y.__)("Additional items","google-site-kit"),savedItemSlugs:i=[],availableSavedItems:n={},availableUnsavedItems:o={},ItemComponent:s,notice:r}){function a(e){return Object.keys(e).map(t=>(0,m.jsx)(s,{slug:t,savedItemSlugs:i,...e[t]},t))}const l=Object.keys(o).length;return(0,m.jsxs)("div",{className:"googlesitekit-selection-panel-items",children:[0!==i.length&&(0,m.js
|
||
|
|
(0,y.__)("%1$d selected <MaxCount>(up to %2$d)</MaxCount>","google-site-kit"),w,o),{MaxCount:(0,m.jsx)("span",{className:"googlesitekit-selection-panel-footer__item-count--max-count"})})});return(0,m.jsx)("footer",{className:"googlesitekit-selection-panel-footer",children:(0,m.jsxs)("div",{className:"googlesitekit-selection-panel-footer__content",children:[E,(0,m.jsxs)("div",{className:"googlesitekit-selection-panel-footer__actions",children:[(0,m.jsx)(v.Button,{onClick:M,disabled:s,tertiary:!0,children:(0,y.__)("Cancel","google-site-kit")}),(0,m.jsx)(v.SpinnerButton,{onClick:j,isSaving:s,disabled:w<n||w>o||s||!l&&p,children:g||_})]})]})})}SelectionPanelFooter.propTypes={savedItemSlugs:r().array,selectedItemSlugs:r().array,saveSettings:r().func,minSelectedItemCount:r().number,maxSelectedItemCount:r().number,isBusy:r().bool,onSaveSuccess:r().func,onCancel:r().func,isOpen:r().bool,closePanel:r().func};const j=SelectionPanel},1102:(e,t,i)=>{i.d(t,{w:()=>a});var n=i(35470),o=i(63696),s=i(2422);function r(){}function a(e,t){const i=(0,s.W)({sticky:!0}),a=(0,o.useRef)(),l=(0,o.useCallback)(e,t),c=(0,n.A)(i?l:r);return i&&(a.current=c),a.current}},2362:(e,t,i)=>{i.d(t,{A:()=>g});var n=i(4452),o=i.n(n),s=i(62688),r=i.n(s),a=i(63696),l=i(62540);const c=(0,a.forwardRef)(({label:e,className:t,hasLeftSpacing:i=!1,...n},s)=>(0,l.jsx)("span",{ref:s,...n,className:o()("googlesitekit-badge",t,{"googlesitekit-badge--has-left-spacing":i}),children:e}));c.displayName="Badge",c.propTypes={label:r().string.isRequired,hasLeftSpacing:r().bool};const g=c},2422:(e,t,i)=>{i.d(t,{W:()=>l});var n=i(79257),o=i(35470),s=i(63696),r=i(6732),a=i(7081);function l({sticky:e=!1}={}){const t=(0,s.useContext)(r.A),[i,l]=(0,s.useState)(!1),c=(0,o.A)(e=>e(a.n).getInViewResetCount()),g=(0,o.A)(e=>e(a.n).getValue("forceInView"));return(0,s.useEffect)(()=>{t.value&&!i&&l(!0)},[i,t,l]),(0,s.useEffect)(()=>{g&&l(!0)},[g]),(0,n.A)(()=>{l(!1)},[c]),!(!e||!i)||!!t.value}},2522:(e,t,i)=>{i.d(t,{D:()=>s});var n=i(32091),o=i.n(n);function s(e,{dateRangeLength:t}){o()(Array.isArray(e),"report must be an array to partition."),o()(Number.isInteger(t)&&t>0,"dateRangeLength must be a positive integer.");const i=-1*t;return{currentRange:e.slice(i),compareRange:e.slice(2*i,i)}}},3288:(e,t,i)=>{i.d(t,{Q:()=>n});const n="emailReportingUserSettingsSelectionPanelOpened"},3714:(e,t,i)=>{i.d(t,{Kk:()=>s,SZ:()=>n,Yw:()=>r,oJ:()=>a,tT:()=>o});const n="body",o=[n,"display","headline","label","title"],s="small",r="medium",a=[s,r,"large"]},3782:(e,t,i)=>{i.d(t,{A:()=>CTAButton});var n=i(62688),o=i.n(n),s=i(49383),r=i(83366),a=i(62540);function CTAButton({label:e,ariaLabel:t,disabled:i,inProgress:n,onClick:o,href:l,external:c=!1,hideExternalIndicator:g=!1}){if(!e||!o&&!l)return null;let d;return c&&!g&&(d=(0,a.jsx)(r.A,{width:14,height:14})),(0,a.jsx)(s.SpinnerButton,{className:"googlesitekit-banner__cta","aria-label":t,disabled:i||n,isSaving:n,onClick:o,href:l,target:c?"_blank":void 0,trailingIcon:d,children:e})}CTAButton.propTypes={label:o().string,ariaLabel:o().string,disabled:o().bool,inProgress:o().bool,onClick:o().func,href:o().string,dismissOnClick:o().bool,dismissOptions:o().shape({expiresInSeconds:o().number,skipHidingFromQueue:o().bool})}},4445:(e,t,i)=>{i.d(t,{A:()=>d});var n=i(62688),o=i.n(n),s=i(63696),r=i(81276),a=i(49383),l=i(8420),c=i(62540);let g=null;function RefocusableModalDialog({dialogActive:e=!1,refocusQuerySelector:t=null,...i}){const n=(0,s.useCallback)(()=>{setTimeout(()=>{const e=t?document.querySelector(t):g;e&&document.body.contains(e)&&e.focus(),t||(g=null)})},[t]),o=(0,r.A)(e);return(0,s.useEffect)(()=>(!0===o&&!1===e&&n(),()=>{n()}),[o,e,n]),(0,c.jsx)(l.A,{dialogActive:e,...i})}!function(){function e(e){const t=e.target.closest("button, a, input");t&&!t.classList.contains("mdc-dialog__cancel-button")&&(g=t)}void 0!==i.g&&i.g.document&&!i.g._googlesitekitModalFocusTrackerInitialized&&(i.g.document.addEventListener("mousedown",e),i.g.document.addEventListener("keydown",t=>{"Enter"!==t.key&&" "!==t.key||e(t)}),i.g._googlesitekitModalFocusTrackerInitialized=!0)
|
||
|
|
(0,c.__)("<strong>Note:</strong> %s","google-site-kit"),k),{strong:(0,u.jsx)("strong",{})})})]}),(0,u.jsxs)(g.DialogFooter,{children:[(0,u.jsx)(g.Button,{className:"mdc-dialog__cancel-button",onClick:i,disabled:v,tertiary:!0,children:(0,c.__)("Cancel","google-site-kit")}),I?(0,u.jsx)(g.Button,{href:I,onClick:m,target:"_blank",danger:y,children:f}):(0,u.jsx)(g.SpinnerButton,{onClick:m,danger:y,disabled:v,isSaving:v,children:f||(0,c.__)("Disconnect","google-site-kit")})]})]})}ModalDialog.displayName="Dialog",ModalDialog.propTypes={className:o().string,dialogActive:o().bool,handleDialog:o().func,handleConfirm:o().func.isRequired,onOpen:o().func,onClose:o().func,title:o().string,confirmButton:o().string,danger:o().bool,small:o().bool,medium:o().bool,buttonLink:o().string};const p=ModalDialog},11106:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(63696),o=i(65214);const s=(0,n.createContext)(o.t)},12108:(e,t,i)=>{i.d(t,{YJ:()=>s,Eq:()=>r});var n=i(32947),o=i(17243);function s(e,t){const n=document.querySelector(e);if(!n)return 0;const o=n.getBoundingClientRect().top,s=r(t);return o+i.g.scrollY-s}function r(e){let t=function(e){let t=0;const s=document.querySelector(".googlesitekit-header");t=s&&"sticky"===i.g.getComputedStyle(s).position?function(e){const t=document.querySelector(".googlesitekit-header");if(t){if(e===n.mp)return t.offsetHeight;const i=t.getBoundingClientRect().bottom;return i<0?0:i}return 0}(e):function(e){const t=document.querySelector("#wpadminbar");if(t&&e!==n.mp)return t.offsetHeight;return 0}(e);return t=function(e){return(0,o.isFinite)(e)?e:0}(t),t<0?0:t}(e);const s=document.querySelectorAll(".googlesitekit-navigation, .googlesitekit-entity-header");return t+=Array.from(s).reduce((e,t)=>e+t.offsetHeight,0),t}},12701:(e,t,i)=>{i.d(t,{A:()=>Root});var n=i(62688),o=i.n(n),s=i(44010),r=i(77105),a=i(63696),l=i(50539),c=i.n(l),g=i(82871),d=i(54312),u=i(61991),p=i(90007),m=i(12850),h=i(62540);class ErrorHandler extends a.Component{constructor(e){super(e),this.state={error:null,info:null,copied:!1}}componentDidCatch(e,t){i.g.console.error("Caught an error:",e,t),this.setState({error:e,info:t}),(0,m.sx)("react_error",`handle_${this.context||"unknown"}_error`,`${e?.message}\n${t?.componentStack}`.slice(0,500))}render(){const{children:e}=this.props,{error:t,info:i}=this.state;return t?(0,h.jsx)(p.A,{notificationID:"googlesitekit-error",className:"googlesitekit-error-handler",type:"error",title:(0,g.__)("Site Kit encountered an error","google-site-kit"),description:(0,h.jsxs)(a.Fragment,{children:[(0,h.jsx)(d.A,{message:t.message,componentStack:i.componentStack}),(0,h.jsxs)("pre",{className:"googlesitekit-overflow-auto",children:[t.message,i.componentStack]})]})}):e}}ErrorHandler.contextType=u.Ay,ErrorHandler.propTypes={children:o().node.isRequired};const f=ErrorHandler;var k=i(11106);const{Consumer:y,Provider:v}=k.A,_=v;var b=i(65214),I=i(4445),x=i(78340),N=i(45472),S=i(58116),A=i(64067),j=i(14007);const M=function AuthenticatedPermissionsModal(){const e=(0,l.useRegistry)(),t=(0,l.useSelect)(e=>e(S.oR).getPermissionScopeError()),n=(0,l.useSelect)(e=>e(S.oR).getUnsatisfiedScopes()),o=(0,l.useSelect)(e=>e(S.oR).getConnectURL({additionalScopes:t?.data?.scopes,redirectURL:t?.data?.redirectURL||i.g.location.href,errorRedirectURL:t?.data?.errorRedirectURL})),{clearPermissionScopeError:s}=(0,l.useDispatch)(S.oR),{navigateTo:r}=(0,l.useDispatch)(N.M),{setValues:c}=(0,l.useDispatch)(x.s),d=(0,a.useCallback)(()=>{s()},[s]),u=(0,a.useCallback)(async()=>{c(S.$8,{permissionsError:t}),await(0,A.mR)(e),r(o)},[e,o,r,t,c]);return(0,a.useEffect)(()=>{!async function(){t?.data?.skipModal&&t?.data?.scopes?.length&&await u()}()},[u,t]),t?t?.data?.scopes?.length?t?.data?.skipModal||n&&t?.data?.scopes.every(e=>n.includes(e))?null:(0,h.jsx)(j.A,{children:(0,h.jsx)(I.A,{title:(0,g.__)("Additional Permissions Required","google-site-kit"),subtitle:t.message,confirmButton:(0,g.__)("Proceed","google-site-kit"),handleConfirm:u,handleCancel:d,onClose:d,dialogActive:!0,medium:!0})}):(i.g.console.warn("permissionsError lacks scopes array to use for redirect,
|
||
|
|
(0,g.__)("Google Account for %1$s (Email: %2$s)","google-site-kit"),o,i)),o&&!i&&(Z=(0,g.sprintf)(/* translators: Account info text. 1: User's (full) name. */ /* translators: Account info text. 1: User's (full) name. */
|
||
|
|
(0,g.__)("Google Account for %1$s","google-site-kit"),o)),!o&&i&&(Z=(0,g.sprintf)(/* translators: Account info text. 1: User's email address. */ /* translators: Account info text. 1: User's email address. */
|
||
|
|
(0,g.__)("Google Account (Email: %1$s)","google-site-kit"),i)),(0,x.jsxs)(d.Fragment,{children:[(0,x.jsxs)("div",{ref:N,className:"googlesitekit-user-selector googlesitekit-dropdown-menu googlesitekit-dropdown-menu__icon-menu mdc-menu-surface--anchor",children:[(0,x.jsx)(k.Button,{disabled:r,ref:A,className:"googlesitekit-header__dropdown mdc-button--dropdown googlesitekit-border-radius-round--tablet googlesitekit-border-radius-round--phone googlesitekit-border-radius-round googlesitekit-button-icon",onClick:w,icon:!!n&&(0,x.jsx)("i",{className:"mdc-button__icon mdc-button__account","aria-hidden":"true",children:(0,x.jsx)("img",{className:"mdc-button__icon--image",src:n,alt:(0,g.__)("User Avatar","google-site-kit")})}),"aria-haspopup":"menu","aria-expanded":c,"aria-controls":"user-menu","aria-label":r?void 0:(0,g.__)("Account","google-site-kit"),tooltipEnterDelayInMS:500,customizedTooltip:r?null:(0,x.jsxs)("span",{"aria-label":Z,children:[(0,x.jsx)("strong",{children:(0,g.__)("Google Account","google-site-kit")}),(0,x.jsx)("br",{}),(0,x.jsx)("br",{}),o,o&&(0,x.jsx)("br",{}),i]}),text:!0,tooltip:!0}),(0,x.jsxs)(k.Menu,{className:"googlesitekit-user-menu",menuOpen:c,onSelected:L,id:"user-menu",children:[(0,x.jsx)("li",{children:(0,x.jsx)(Details,{})}),e&&(0,x.jsx)("li",{id:"manage-email-reports",className:"mdc-list-item",role:"menuitem",children:(0,x.jsx)(Item,{icon:(0,x.jsx)(P,{width:"24"}),label:(0,g.__)("Manage email reports","google-site-kit")})}),!!t&&(0,x.jsx)("li",{id:"manage-sites",className:"mdc-list-item",role:"menuitem",children:(0,x.jsx)(Item,{icon:(0,x.jsx)(E,{width:"24"}),label:(0,g.__)("Manage Sites","google-site-kit")})}),(0,x.jsx)("li",{id:"disconnect",className:"mdc-list-item",role:"menuitem",children:(0,x.jsx)(Item,{icon:(0,x.jsx)(S,{width:"24"}),label:(0,g.__)("Disconnect","google-site-kit")})})]})]}),(0,x.jsx)(b.A,{children:(0,x.jsx)(y.A,{dialogActive:a,handleConfirm:R,handleCancel:T,onClose:T,title:(0,g.__)("Disconnect","google-site-kit"),subtitle:(0,g.__)("Disconnecting Site Kit by Google will remove your access to all services. After disconnecting, you will need to re-authorize to restore service.","google-site-kit"),confirmButton:(0,g.__)("Disconnect","google-site-kit"),danger:!0,small:!0})})]})}var Z=i(55527),Q=i(35323),$=i(29898),X=i(15844),q=i(39525),K=i(30521),J=i(24558),ee=i(73874),te=i(12108),ie=i(32947);var ne=i(44949),oe=i(86134);const se={[ee.Oo]:{[J.SH]:ne.CONTEXT_MAIN_DASHBOARD_KEY_METRICS,[J.OT]:ne.CONTEXT_MAIN_DASHBOARD_TRAFFIC,[J.en]:ne.CONTEXT_MAIN_DASHBOARD_CONTENT,[J.Ej]:ne.CONTEXT_MAIN_DASHBOARD_SPEED,[J.Gw]:ne.CONTEXT_MAIN_DASHBOARD_MONETIZATION},[ee.oE]:{[J.OT]:ne.CONTEXT_ENTITY_DASHBOARD_TRAFFIC,[J.en]:ne.CONTEXT_ENTITY_DASHBOARD_CONTENT,[J.Ej]:ne.CONTEXT_ENTITY_DASHBOARD_SPEED,[J.Gw]:ne.CONTEXT_ENTITY_DASHBOARD_MONETIZATION}};var re;function ae(){return ae=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},ae.apply(null,arguments)}const le=e=>d.createElement("svg",ae({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 18 18"},e),re||(re=d.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M18 16V2c0-1.1-1-2-2.222-2H2.222C1 0 0 .9 0 2v14c0 1.1 1 2 2.222 2h13.556C17 18 18 17.1 18 16M9 7h5V5H9zm7-5H2v14h14zM4 4h4v4H4zm10 7H9v2h5zM4 10h4v4H4z",clipRule:"evenodd"})));var ce,ge,de,ue;function pe(){return pe=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},pe.apply(null,arguments)}const me=e=>d.createElement("svg",pe({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 13 12"},e),ce||(ce=d.createElement("rect",{width:5,height:5,x:.5,fill:"currentColor",rx:1})),ge||(ge=d.createElement("rect",{width:5,height:5,x:7.5,fill:"currentColor",rx:1})),de||(de=d.createElement("rect",{width:5,height:5,x:.5,y:7,fill:"currentColor",rx:1})),ue||(ue=d.createElement("rect",{width:5,height:5,x:7.5,y:7,fill:"currentColor",rx:1})));var h
|
||
|
|
(0,g.__)("Shared by <strong>%s</strong>","google-site-kit"),n.login),{strong:(0,x.jsx)("strong",{title:n.login})})})]})}Service.propTypes={module:r().string.isRequired};var ze=i(15167);function SharedServices(){const e=(0,u.useSelect)(e=>e(I.oR).getViewableModules());return void 0===e?null:(0,x.jsxs)("li",{className:"googlesitekit-view-only-menu__list-item",children:[(0,x.jsx)(ze.A,{as:"h4",size:"large",type:"title",children:(0,g.__)("Shared services","google-site-kit")}),(0,x.jsx)("ul",{children:e.map(e=>(0,x.jsx)(Service,{module:e},e))})]})}var Be=i(82167);function Tracking(){const e=(0,V.A)();return(0,x.jsxs)("li",{className:"googlesitekit-view-only-menu__list-item",children:[(0,x.jsx)(Ce.A,{children:(0,Re.A)((0,g.__)("Thanks for using Site Kit!<br />Help us make it even better","google-site-kit"),{br:(0,x.jsx)("br",{})})}),(0,x.jsx)(Be.A,{trackEventCategory:`${e}_headerbar_viewonly`,alignCheckboxLeft:!0})]})}var Ge=i(74595);function ManageEmailReports(){const{setValue:e}=(0,Ge.wA)(B.n);return(0,x.jsxs)(d.Fragment,{children:[(0,x.jsx)("li",{className:"mdc-list-divider",role:"separator"}),(0,x.jsx)("li",{className:"googlesitekit-view-only-menu__list-item googlesitekit-view-only-menu__email-reporting",children:(0,x.jsx)("ul",{className:"googlesitekit-view-only-menu",children:(0,x.jsx)("li",{className:"googlesitekit-view-only-menu__email-reporting-item",children:(0,x.jsx)(k.Button,{onClick:()=>e(H.Q,!0),icon:(0,x.jsx)("span",{className:"googlesitekit-view-only-menu__email-reporting-item--icon",children:(0,x.jsx)(P,{width:"24"})}),tertiary:!0,children:(0,x.jsx)("span",{className:"googlesitekit-view-only-menu__email-reporting-item--name",children:(0,g.__)("Manage email reports","google-site-kit")})})})})})]})}function ViewOnlyMenu(){const e=(0,W.i)("proactiveUserEngagement"),[t,i]=(0,d.useState)(!1),n=(0,d.useRef)(),o=(0,V.A)();(0,m.A)(n,()=>i(!1)),(0,F.l)([f._f,f.wn],n,()=>i(!1));const s=(0,d.useCallback)(()=>{t||(0,v.sx)(`${o}_headerbar`,"open_viewonly"),i(!t)},[t,o]),r=(0,u.useSelect)(e=>e(I.oR).hasCapability(I.ej));return(0,x.jsxs)("div",{ref:n,className:l()("googlesitekit-view-only-menu","googlesitekit-dropdown-menu","googlesitekit-dropdown-menu__icon-menu","mdc-menu-surface--anchor",{"googlesitekit-view-only-menu--user-can-authenticate":r}),children:[(0,x.jsx)(k.Button,{className:"googlesitekit-header__dropdown mdc-button--dropdown googlesitekit-border-radius-round--phone googlesitekit-button-icon",onClick:s,icon:(0,x.jsx)("span",{className:"mdc-button__icon","aria-hidden":"true",children:(0,x.jsx)(Le,{className:"mdc-button__icon--image"})}),"aria-haspopup":"menu","aria-expanded":t,"aria-controls":"view-only-menu","aria-label":(0,g.__)("View only","google-site-kit"),tooltipEnterDelayInMS:500,text:!0,tooltip:!0,children:(0,g.__)("View only","google-site-kit")}),(0,x.jsxs)(k.Menu,{menuOpen:t,onSelected:s,id:"view-only-menu",nonInteractive:!0,children:[(0,x.jsx)(Description,{}),(0,x.jsx)(SharedServices,{}),e&&(0,x.jsx)(ManageEmailReports,{}),(0,x.jsx)("li",{className:"mdc-list-divider",role:"separator"}),(0,x.jsx)(Tracking,{})]})]})}var Ue=i(71423),He=i(53137),Fe=i(77513);function CoreSiteBannerNotification({id:e,...t}){const{dismissNotification:i,acceptNotification:n}=(0,u.useDispatch)(z.O4),o=(0,d.useCallback)(()=>{n(e)},[e,n]),s=(0,d.useCallback)(()=>{i(e)},[e,i]);return(0,x.jsx)(Fe.A,{onCTAClick:o,onDismissClick:s,...t,id:e})}CoreSiteBannerNotification.propTypes={content:r().string,ctaLabel:r().string,ctaTarget:r().string,ctaURL:r().string,dismissLabel:r().string,dismissible:r().bool,gaTrackingEventArgs:r().object,id:r().string.isRequired,learnMoreLabel:r().string,learnMoreURL:r().string,title:r().string.isRequired},CoreSiteBannerNotification.defaultProps={content:"",ctaLabel:"",ctaTarget:"",ctaURL:"",dismissLabel:(0,g.__)("OK, Got it!","google-site-kit"),dismissible:!0,learnMoreLabel:"",learnMoreURL:""};const Ve=CoreSiteBannerNotification;const Ye=function CoreSiteBannerNotifications(){const e=(0,V.A)(),[t,i]=(0,d.useState)(!1),[n,o]=(0,d.useState)(!1),s=(0,d.useRef)(Date.now()),r=(0,u.useSelect)(e=>e(z.O4).isUsin
|
||
|
|
(0,v._n)("Last %s day","Last %s days",e,"google-site-kit"),e)}return{"last-7-days":{slug:"last-7-days",label:e(7),days:7},"last-14-days":{slug:"last-14-days",label:e(14),days:14},"last-28-days":{slug:"last-28-days",label:e(28),days:28},"last-90-days":{slug:"last-90-days",label:e(90),days:90}}}function M(e=""){if(!(0,n.isString)(e))return!1;if(3!==e.split("-").length)return!1;const t=new Date(e);return(0,n.isDate)(t)&&!isNaN(t)}function T(e){y()((0,n.isDate)(e)&&!isNaN(e),_);const t=`${e.getMonth()+1}`,i=`${e.getDate()}`;return[e.getFullYear(),t.length<2?`0${t}`:t,i.length<2?`0${i}`:i].join("-")}function C(e){y()(M(e),b);const[t,i,n]=e.split("-");return new Date(t,i-1,n)}function w(e,t){return T(D(e,t*S))}function E(e){const t=e.split("-");return 3===t.length&&"last"===t[0]&&!Number.isNaN(t[1])&&!Number.isNaN(parseFloat(t[1]))&&"days"===t[2]}function D(e,t){y()(M(e)||(0,n.isDate)(e)&&!isNaN(e),b);const i=M(e)?Date.parse(e):e.getTime();return new Date(i-1e3*t)}var O=i(69743),L=i(94552),R=i(62540);function P(e,t={}){if(Number.isNaN(Number(e)))return"";const{invertColor:i=!1}=t;return(0,O.Ay)((0,R.jsx)(L.A,{direction:e>0?"up":"down",invertColor:i}))}function z(e,t){return e>0&&t>0?e/t-1:e>0?1:t>0?-1:0}var B=i(8143);function G(e){const t=parseFloat(e)||0;return!!Number.isInteger(t)&&t>0}function U(e){if("number"==typeof e)return!0;const t=(e||"").toString();return!!t&&!isNaN(t)}function H(e){return Array.isArray(e)?[...e].sort():e}var F=i(2522);function V(e,t){function i(e){return"0"===e||0===e}if(i(e)&&i(t))return 0;if(i(e)||Number.isNaN(e))return null;const n=(t-e)/e;return Number.isNaN(n)||!Number.isFinite(n)?null:n}function Y(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}}function W(e){if(!e)return"";const t=e.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(t)).replace(/(\\)/g,"");return(0,n.unescape)(t)}},14007:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(47209),o=i(62688),s=i.n(o),r=i(63696),a=i(78325);function Portal({children:e,slug:t}){const[i]=(0,r.useState)(document.createElement("div"));return(0,n.A)(()=>{t&&i.classList.add(`googlesitekit-portal-${t}`);const e=document.querySelector(".googlesitekit-plugin")||document.body;return e.appendChild(i),()=>e.removeChild(i)}),(0,a.createPortal)(e,i)}Portal.propTypes={slug:s().string,children:s().node},Portal.defaultProps={slug:"",children:null};const l=Portal},15167:(e,t,i)=>{i.d(t,{A:()=>Typography});var n=i(62688),o=i.n(n),s=i(4452),r=i.n(s),a=i(3714),l=i(62540);function Typography({className:e,type:t,size:i,as:n="span",children:o,...s}){return(0,l.jsx)(n,{className:r()("googlesitekit-typography",e,{[`googlesitekit-typography--${t}`]:t&&a.tT.includes(t),[`googlesitekit-typography--${i}`]:i&&a.oJ.includes(i)}),...s,children:o})}Typography.propTypes={className:o().string,type:o().oneOf(a.tT),size:o().oneOf(a.oJ),as:o().oneOfType([o().string,o().elementType])}},15210:(e,t,i)=>{i.d(t,{O:()=>o});var n=i(31234);const o=i.n(n)()(i.g)},15577:(e,t,i)=>{i.d(t,{SO:()=>c});var n=i(55620),o=i(99123);const s={},r=void 0===i.g?null:i.g;function a(){return[i.g.innerWidth,i.g.innerHeight]}function l(e=s){const{fps:t,leading:i,initialWidth:l=0,initialHeight:c=0}=e,[g,d]=(0,n._)("undefined"==typeof document?[l,c]:a,t,i);function u(){return d(a)}return(0,o.A)(r,"resize",u),(0,o.A)(r,"orientationchange",u),g}function c(e){return l(e)[0]}},16196:(e,t,i)=>{i.d(t,{A:()=>a});var n=i(50539),o=i(37226),s=i(71769),r=i(62540);function a({moduleName:e,FallbackComponent:t,IncompleteComponent:i}){return a=>{function WhenActiveComponent(s){const l=(0,n.useSelect)(t=>t(o.i).getModule(e),[e]);if(!l)return null;const c=t||s.WidgetNull||null;if(!1===l.active)return c&&(0,r.jsx)(c,{...s});if(!1===l.connected){const e=i||c;return e&&(0,r.jsx)(e,{...s})}return(0,r.jsx)(a,{...s})}return WhenActiveComponent.displayName=`When${(0,s.Uf)(e)}Active`,(a.displayName||a.name)&&(WhenActiveComponent.displayName+=`(${a.displayName||a.name})`),WhenActiveComponent}}},16834:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(62688),o=i.n(n),s=i(4452),r=i.n(s),a=i(62540);function VisuallyHidden({className:e,children:t,...i}){return t?(0,a.jsx)("s
|
||
|
|
(0,c.__)("Select up to %d metrics","google-site-kit"),h.Hl),onCloseClick:e,children:!t&&(0,b.jsx)(_.A,{children:(0,x.A)((0,c.__)("Edit your personalized goals or deactivate this widget in <link><strong>Settings</strong></link>","google-site-kit"),{link:(0,b.jsx)(A.A,{onClick:s,disabled:n,secondary:!0}),strong:(0,b.jsx)("strong",{})})})})}Header.propTypes={closePanel:a().func.isRequired};var T=i(78340),C=i(37226),w=i(67150),E=i(77766),D=i(64067),O=i(12850),L=i(49383),R=i(23224);function SelectionPanelFooter({savedItemSlugs:e=[],selectedItemSlugs:t=[],saveSettings:i=()=>{},minSelectedItemCount:n=0,maxSelectedItemCount:o=0,isBusy:r,onSaveSuccess:a=()=>{},onCancel:g=()=>{},isOpen:u,closePanel:m=()=>{},isFullScreen:h=!1}){const[f,k]=(0,l.useState)(null),[y,v]=(0,l.useState)(!1),_=(0,d.useSelect)(e=>e(p.K9).isFetchingSyncAvailableAudiences()),I=(0,l.useMemo)(()=>!(0,s.isEqual)((0,O.N9)(t),(0,O.N9)(e)),[e,t]);let N=e?.length>0&&I?(0,c.__)("Apply changes","google-site-kit"):(0,c.__)("Save selection","google-site-kit");h&&(N=(0,c.__)("Complete setup","google-site-kit"));const S=(0,l.useCallback)(async()=>{const{error:e}=await i(t);e||(a(),m(),h||(k(N),v(!0)))},[i,t,a,m,h,N]),A=(0,l.useCallback)(()=>{m(),g()},[m,g]),[j,M]=(0,l.useState)(null);(0,l.useEffect)(()=>{null!==j&&j!==u&&u&&(k(null),v(!1)),M(u)},[u,j]);const T=t?.length||0,C=_?(0,b.jsx)(R.A,{width:"89px",height:"20px"}):(0,b.jsx)("p",{className:"googlesitekit-selection-panel-footer__item-count",children:(0,x.A)((0,c.sprintf)(/* translators: 1: Number of selected items. 2: Maximum number of items that can be selected. */ /* translators: 1: Number of selected items. 2: Maximum number of items that can be selected. */
|
||
|
|
(0,c.__)("%1$d selected <MaxCount>(up to %2$d)</MaxCount>","google-site-kit"),T,o),{MaxCount:(0,b.jsx)("span",{className:"googlesitekit-selection-panel-footer__item-count--max-count"})})});return(0,b.jsx)("footer",{className:"googlesitekit-selection-panel-footer",children:(0,b.jsx)("div",{className:"googlesitekit-selection-panel-footer__content",children:(0,b.jsxs)("div",{className:"googlesitekit-selection-panel-footer__actions",children:[(0,b.jsx)(L.Button,{onClick:A,disabled:r,tertiary:!0,children:(0,c.__)("Cancel","google-site-kit")}),C,(0,b.jsx)(L.SpinnerButton,{onClick:S,isSaving:r,disabled:T<n||T>o||r||!u&&y,children:f||N})]})})})}function Footer({isOpen:e,closePanel:t=s.noop,savedMetrics:i,onNavigationToOAuthURL:n=()=>{},isFullScreen:o=!1}){const r=(0,d.useRegistry)(),a=(0,E.A)(),g=(0,v.A)(h.Is,h.Y0),k=(0,d.useSelect)(e=>e(u.oR).isSavingKeyMetricsSettings()),y=`${a}_kmw-sidebar`,_=g?.flatMap(e=>{const t=f.G[e];return t?.requiredCustomDimensions||[]}),I=(0,d.useInViewSelect)(e=>{if(!_?.length)return!1;return!e(p.K9).hasCustomDimensions(_)},[_]),x=(0,d.useInViewSelect)(e=>e(u.oR).hasScope(p.S9)),A=(0,d.useSelect)(e=>e(C.i).isModuleConnected(m.L1)),j=(0,d.useSelect)(e=>e(S.O4).getAdminURL("googlesitekit-dashboard",{notification:"custom_dimensions"})),M=(0,d.useSelect)(e=>{const t=e(u.oR).getConnectURL({additionalScopes:[p.S9],redirectURL:j});return!!t&&e(N.M).isNavigatingTo(t)}),L=(0,d.useSelect)(e=>e(S.O4).getAdminURL("googlesitekit-dashboard")),R=(0,d.useSelect)(e=>!!L&&e(N.M).isNavigatingTo(L)),{saveKeyMetricsSettings:P,setPermissionScopeError:z}=(0,d.useDispatch)(u.oR),{setValues:B}=(0,d.useDispatch)(T.s),{navigateTo:G}=(0,d.useDispatch)(N.M),U=(0,d.useSelect)(e=>e(p.K9).getKeyMetricsConversionEventWidgets()),H=(0,l.useCallback)(async e=>{const{error:t}=await P({widgetSlugs:e});return{error:t}},[P]),F=(0,l.useCallback)(async e=>{if(Object.values(U).flat().some(t=>e.includes(t))?(0,O.sx)(y,"metrics_sidebar_save","conversion_reporting"):(0,O.sx)(y,"metrics_sidebar_save"),A&&I){if(B(p.Kr,{autoSubmit:!0}),!x)return n(),t(),void z({code:w.db,message:(0,c.__)("Additional permissions are required to create new Analytics custom dimensions","google-site-kit"),data:{status:403,scopes:[p.S9],skipModal:!0,redirectURL:j}});o&&await(0,D.mR)(r)}o&&G(L)},[U,A,I,o,y,B,x,n,t,z,j,r,G,L]),V=(0,l.useCallback)(()=>{(0,O.sx)(y,"metrics_sidebar_cancel"),o&&G(L)},[o,L,G,y]);return(0,b.jsx)(SelectionPanelFooter,{savedItemSlugs:i,selectedItemSlugs:g,saveSettings:H,minSelectedItemCount:h.LO,maxSelectedItemCount:h.Hl,isBusy:k||M||R&&o,onSaveSuccess:()=>{F(g)},onCancel:V,isOpen:e,closePanel:t,isFullScreen:o})}SelectionPanelFooter.propTypes={savedItemSlugs:a().array,selectedItemSlugs:a().array,saveSettings:a().func,saveError:a().object,minSelectedItemCount:a().number,maxSelectedItemCount:a().number,isBusy:a().bool,onSaveSuccess:a().func,onCancel:a().func,isOpen:a().bool,closePanel:a().func,isFullScreen:a().bool},Footer.propTypes={isOpen:a().bool,closePanel:a().func,savedMetrics:a().array,onNavigationToOAuthURL:a().func,isFullScreen:a().bool};var P=i(54593);function SelectionPanelItems({savedItemSlugs:e=[],allMetricItems:t}){return(0,b.jsx)("div",{className:"googlesitekit-selection-panel-items",children:(0,b.jsx)(P.A,{savedItemSlugs:e,allMetricItems:t})})}function MetricItems({savedMetrics:e}){const t=(0,M.A)(),{isKeyMetricAvailable:i}=(0,d.useSelect)(e=>e(u.oR)),n=(0,d.useInViewSelect)(e=>i=>f.G[i].displayInSelectionPanel({select:e,isViewOnlyDashboard:t,slug:i}),[t]);const o=Object.keys(f.G).reduce(function(e,t){if(!i(t))return e;if(void 0===n||"function"==typeof f.G[t].displayInSelectionPanel&&!n(t))return e;const{title:o,description:s,metadata:{group:r}}=f.G[t];return{...e,[t]:{title:o,description:s,group:r}}},{});return(0,b.jsx)(SelectionPanelItems,{savedItemSlugs:e,allMetricItems:o})}SelectionPanelItems.propTypes={savedItemSlugs:a().array,allMetricItems:a().object.isRequired},MetricItems.propTypes={savedMetrics:a().array};var z=i(67768);const B=(0,y.A)({moduleName:m.L1})(function KeyMetricsError({savedMetrics:e}){const t=(0,v.A)(h.Is,h.Y0
|
||
|
|
(0,c.__)("Select at least %1$d metrics (%2$d selected)","google-site-kit"),h.LO,r):r>h.Hl&&(a=(0,c.sprintf)(/* translators: 1: Maximum number of metrics that can be selected. 2: Number of selected metrics. */ /* translators: 1: Maximum number of metrics that can be selected. 2: Number of selected metrics. */
|
||
|
|
(0,c.__)("Select up to %1$d metrics (%2$d selected)","google-site-kit"),h.Hl,r));let g=o;return n&&a&&(g={message:a}),(0,b.jsx)(z.A,{error:g,skipRetryMessage:!!a})});function PanelContent({isOpen:e=!1,closePanel:t,savedViewableMetrics:i,showHeader:n=!0,setIsNavigatingToOAuthURL:r=s.noop,isFullScreen:a=!1}){return(0,b.jsxs)(l.Fragment,{children:[n&&(0,b.jsx)(Header,{closePanel:t}),(0,b.jsx)(MetricItems,{savedMetrics:i}),(0,b.jsx)(I,{}),(0,b.jsxs)("div",{className:o()("googlesitekit-user-input__footer-container",{"googlesitekit-user-input__footer-container--fullscreen":a}),children:[(0,b.jsx)(B,{savedMetrics:i}),(0,b.jsx)(Footer,{isOpen:e,closePanel:t,savedMetrics:i,onNavigationToOAuthURL:()=>{r(!0)},isFullScreen:a})]})]})}PanelContent.propTypes={isOpen:a().bool,closePanel:a().func,savedViewableMetrics:a().array,showHeader:a().bool,setIsNavigatingToOAuthURL:a().func,isFullScreen:a().bool}},27333:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(35470),o=i(78340);function s(e,t){return(0,n.A)(i=>{const{getValue:n}=i(o.s);return n(e,t)},[e,t])}},29584:(e,t,i)=>{i.d(t,{A:()=>DismissButton});var n=i(62688),o=i.n(n),s=i(82871),r=i(49383),a=i(62540);function DismissButton({className:e,label:t=(0,s.__)("Maybe later","google-site-kit"),onClick:i,disabled:n,tertiary:o=!0}){return i?(0,a.jsx)(r.Button,{className:e,onClick:i,disabled:n,tertiary:o,children:t}):null}DismissButton.propTypes={className:o().string,label:o().string,onClick:o().func,disabled:o().bool,tertiary:o().bool,dismissOptions:o().shape({expiresInSeconds:o().number,skipHidingFromQueue:o().bool})}},29898:(e,t,i)=>{i.d(t,{A:()=>LoadingWrapper});var n=i(62688),o=i.n(n),s=i(23224),r=i(62540);function LoadingWrapper({loading:e,children:t,...i}){return e?(0,r.jsx)(s.A,{...i}):t}LoadingWrapper.propTypes={loading:o().bool,children:o().node,...s.A.propTypes}},30823:(e,t,i)=>{i.d(t,{A:()=>LearnMoreLink});var n=i(62688),o=i.n(n),s=i(82871),r=i(20898),a=i(62540);function LearnMoreLink({href:e,className:t,label:i=(0,s.__)("Learn more","google-site-kit"),external:n=!0,onClick:o=()=>{}}){return e?(0,a.jsx)(r.A,{href:e,className:t,onClick:o,external:n,children:i}):null}LearnMoreLink.propTypes={href:o().string.isRequired,className:o().string,label:o().string,external:o().bool,onClick:o().func}},32947:(e,t,i)=>{i.d(t,{Fo:()=>s,Lg:()=>r,Qb:()=>o,dv:()=>l,mp:()=>a});var n=i(15577);const o="xlarge",s="desktop",r="tablet",a="small";function l(){const e=(0,n.SO)();return e>1280?o:e>960?s:e>600?r:a}},35323:(e,t,i)=>{i.d(t,{A:()=>s});var n=i(24558),o=i(77766);function s(){const e=(0,o.A)();return n.Nn.includes(e)}},37226:(e,t,i)=>{i.d(t,{U:()=>o,i:()=>n});const n="core/modules",o="insufficient_module_dependencies"},39771:(e,t,i)=>{i.d(t,{Ay:()=>TourTooltips,R0:()=>h,ei:()=>k});var n=i(15844),o=i(36703),s=i(62688),r=i.n(s),a=i(82871),l=i(50539),c=i(7081),g=i(58116),d=i(89318),u=i(60592),p=i(77766),m=i(62540);const h={options:{arrowColor:"#3c7251",backgroundColor:"#3c7251",overlayColor:"rgba(0, 0, 0, 0.6)",textColor:"#fff",zIndex:2e4},spotlight:{border:"2px solid #3c7251",backgroundColor:"#fff"}},f={back:(0,a.__)("Back","google-site-kit"),close:(0,a.__)("Close","google-site-kit"),last:(0,a.__)("Got it","google-site-kit"),next:(0,a.__)("Next","google-site-kit")},k={disableAnimation:!0,styles:{arrow:{length:8,margin:56,spread:16},floater:{filter:"drop-shadow(rgba(60, 64, 67, 0.3) 0px 1px 2px) drop-shadow(rgba(60, 64, 67, 0.15) 0px 2px 6px)"}}},y={VIEW:"feature_tooltip_view",NEXT:"feature_tooltip_advance",PREV:"feature_tooltip_return",DISMISS:"feature_tooltip_dismiss",COMPLETE:"feature_tooltip_complete"};function TourTooltips({steps:e,tourID:t,gaEventCategory:s,callback:r}){const a=`${t}-step`,v=`${t}-run`,{setValue:_}=(0,l.useDispatch)(c.n),{dismissTour:b}=(0,l.useDispatch)(g.oR),I=(0,l.useRegistry)(),x=(0,p.A)(),N=(0,l.useSelect)(e=>e(c.n).getValue(a)||0),S=(0,l.useSelect)(e=>e(c.n).getValue(v)&&!1===e(g.oR).isTourDismissed(t));(0,n.A)(function(){i.g.document.body.classList.add("googlesitekit-showing-feature-tour",`googlesitekit-showing-feature-tour--${t}`),_(v,!0)});const A=e.map(e=>({disableBeacon:!0,isFixe
|
||
|
|
(0,X._n)("%s is disconnected, no data to show","%s are disconnected, no data to show",c.length,"google-site-kit"),c.join((0,X.__)(" and ","google-site-kit")))})})}function J(){return J=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},J.apply(null,arguments)}MetricItem.propTypes={slug:y().string.isRequired,title:y().string.isRequired,description:y().string.isRequired,isNewlyDetected:y().bool,savedItemSlugs:y().array};const key_metrics_no_selected_items=e=>n.createElement("svg",J({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 383 238"},e),M||(M=n.createElement("path",{fill:"#B8E6CA",d:"M59.238 58.571c-2.136 20.178 4.272 29.099 20.48 53.216 16.209 24.118-29.092 62.914 5.475 101.268 33.827 37.532 69.419.009 111.314-4.555 29.443-3.208 57.819 12.98 90.86 5.9s46.385-42.599 43.153-68.059c-5.59-44.041-26.24-49.107-34.893-66.461s2.902-52.997-30.287-73.16-76.71 14.42-112.503 12.37c-20.651-1.182-40.932-4.995-59.264.86-18.53 5.918-32.662 22.571-34.335 38.621"})),T||(T=n.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__a)"},n.createElement("rect",{width:130.621,height:89.651,x:242.455,y:45.266,fill:"#fff",rx:10.957,transform:"rotate(15 242.455 45.266)"}))),C||(C=n.createElement("rect",{width:24.903,height:7.969,x:253.726,y:64.785,fill:"#EBEEF0",rx:3.985,transform:"rotate(15 253.726 64.785)"})),w||(w=n.createElement("rect",{width:49.806,height:19.923,x:249.342,y:81.144,fill:"#FFDED3",rx:9.961,transform:"rotate(15 249.342 81.144)"})),E||(E=n.createElement("rect",{width:99.428,height:8.773,x:240.436,y:114.357,fill:"#EBEEF0",rx:3.985,transform:"rotate(15 240.436 114.357)"})),D||(D=n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.494,d:"m256.195 90.198 4.644 8.044m0 0 1.412-4.986m-1.412 4.986-5.023-1.27"})),O||(O=n.createElement("rect",{width:19.923,height:5.977,x:268.706,y:93.551,fill:"#fff",rx:1.992,transform:"rotate(15 268.706 93.55)"})),L||(L=n.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__b)"},n.createElement("rect",{width:130.621,height:89.68,x:13.887,y:79.094,fill:"#fff",rx:10.957,transform:"rotate(-15 13.887 79.094)"}))),R||(R=n.createElement("rect",{width:62.386,height:7.798,x:32.989,y:90.122,fill:"#EBEEF0",rx:3.899,transform:"rotate(-15 32.99 90.122)"})),P||(P=n.createElement("rect",{width:49.806,height:19.923,x:37.691,y:106.902,fill:"#FFDED3",rx:9.961,transform:"rotate(-15 37.691 106.902)"})),z||(z=n.createElement("rect",{width:99.428,height:7.798,x:46.612,y:140.967,fill:"#EBEEF0",rx:3.899,transform:"rotate(-15 46.612 140.967)"})),B||(B=n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.494,d:"m48.152 111.318 8.044 4.645m0 0-1.27-5.024m1.27 5.024-4.986 1.411"})),G||(G=n.createElement("rect",{width:19.923,height:5.977,x:60.663,y:107.966,fill:"#fff",rx:1.992,transform:"rotate(-15 60.663 107.966)"})),U||(U=n.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__c)"},n.createElement("rect",{width:130.621,height:89.68,x:126.251,y:37.4,fill:"#fff",rx:10.957}))),H||(H=n.createElement("rect",{width:98.333,height:7.867,x:143.013,y:53.134,fill:"#EBEEF0",rx:3.933})),F||(F=n.createElement("rect",{width:49.806,height:19.923,x:142.369,y:70.423,fill:"#B8E6CA",rx:9.961})),V||(V=n.createElement("rect",{width:33.04,height:7.867,x:143.013,y:105.84,fill:"#EBEEF0",rx:3.933})),Y||(Y=n.createElement("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.494,d:"m151.336 84.036 6.568-6.567m0 0-5.182-.073m5.182.073.073 5.18"})),W||(W=n.createElement("rect",{width:19.923,height:5.977,x:164.287,y:77.395,fill:"#fff",rx:1.992})),n.createElement("mask",{id:"key-metrics-no-selected-items_svg__d",width:273,height:230,x:58,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},Z||(Z=n.createElement("path",{fill:"#B8E6CA",d:"M59.237 58.571C57.1 78.75 63.509 87.67 79.717 111.787c16.209 24.118-29.091 62.914 5.475 101.268 33.827 37.532 69.419.009 111.314-4.555 2
|
||
|
|
(0,r.__)("%s (Please try again.)","google-site-kit"),_)),p||(_=(0,r.sprintf)(/* translators: $%s: Error message */ /* translators: $%s: Error message */
|
||
|
|
(0,r.__)("Error: %s","google-site-kit"),_));const b=t?.data?.reconnectURL;b&&(0,a.m)(b)&&(_=(0,r.sprintf)(/* translators: 1: Original error message 2: Reconnect URL */ /* translators: 1: Original error message 2: Reconnect URL */
|
||
|
|
(0,r.__)('%1$s To fix this, <a href="%2$s">redo the plugin setup</a>.',"google-site-kit"),_,b));return(0,u.jsx)(g.A,{className:e,type:g.A.TYPES.ERROR,description:(0,u.jsx)("span",{dangerouslySetInnerHTML:(0,d.p9)(_,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href"]})}),ctaButton:v?{label:(0,r.__)("Retry","google-site-kit"),onClick:y}:void 0,hideIcon:h})}ErrorNotice.propTypes={className:o().string,error:o().shape({message:o().string}),hasButton:o().bool,storeName:o().string,message:o().string,noPrefix:o().bool,skipRetryMessage:o().bool,hideIcon:o().bool}},78340:(e,t,i)=>{i.d(t,{s:()=>n});const n="core/forms"},79829:(e,t,i)=>{i.d(t,{Eo:()=>d,JK:()=>h,K5:()=>m,jq:()=>p,mK:()=>g});var n=i(17243),o=i(50532),s=i.n(o),r=i(82871);function a(e,t={}){const{formatUnit:i,formatDecimal:n}=function(e,t={}){const{hours:i,minutes:n,seconds:o}=l(e);return{hours:i,minutes:n,seconds:o,formatUnit(){const{unitDisplay:s="short",...a}=t,l={unitDisplay:s,...a,style:"unit"};return 0===e?p(o,{...l,unit:"second"}):(0,r.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */ /* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
||
|
|
(0,r._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?p(o,{...l,unit:"second"}):"",n?p(n,{...l,unit:"minute"}):"",i?p(i,{...l,unit:"hour"}):"").trim()},formatDecimal(){const t=(0,r.sprintf)(
|
||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
||
|
|
(0,r.__)("%ds","google-site-kit"),o);if(0===e)return t;const s=(0,r.sprintf)(
|
||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
||
|
|
(0,r.__)("%dm","google-site-kit"),n),a=(0,r.sprintf)(
|
||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
||
|
|
(0,r.__)("%dh","google-site-kit"),i);return(0,r.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */ /* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
||
|
|
(0,r._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?t:"",n?s:"",i?a:"").trim()}}}(e,t);try{return i()}catch{return n()}}function l(e){e=parseInt(e,10),Number.isNaN(e)&&(e=0);return{hours:Math.floor(e/60/60),minutes:Math.floor(e/60%60),seconds:Math.floor(e%60)}}function c(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e}function g(e){let t={};return"%"===e?t={style:"percent",maximumFractionDigits:2}:"s"===e?t={style:"duration",unitDisplay:"narrow"}:e&&"string"==typeof e?t={style:"currency",currency:e}:(0,n.isPlainObject)(e)&&(t={...e}),t}function d(e,t={}){e=(0,n.isFinite)(e)?e:Number(e),(0,n.isFinite)(e)||(console.warn("Invalid number",e,typeof e),e=0);const i=g(t),{style:o="metric"}=i;return"metric"===o?function(e){const t={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?(0,r.sprintf)(
|
||
|
|
// translators: %s: an abbreviated number in millions.
|
||
|
|
// translators: %s: an abbreviated number in millions.
|
||
|
|
(0,r.__)("%sM","google-site-kit"),p(c(e),e%10==0?{}:t)):1e4<=e?(0,r.sprintf)(
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
(0,r.__)("%sK","google-site-kit"),p(c(e))):1e3<=e?(0,r.sprintf)(
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
// translators: %s: an abbreviated number in thousands.
|
||
|
|
(0,r.__)("%sK","google-site-kit"),p(c(e),e%10==0?{}:t)):p(e,{signDisplay:"never",maximumFractionDigits:1})}(e):"duration"===o?a(e,i):"durationISO"===o?function(e){let{hours:t,minutes:i,seconds:n}=l(e);return n=("0"+n).slice(-2),i=("0"+i).slice(-2),t=("0"+t).slice(-2),"00"===t?`${i}:${n}`:`${t}:${i}:${n}`}(e):p(e,i)}const u=s()(console.warn);function p(e,t={}){const{locale:i=h(),...n}=t;try{return new Intl.NumberFormat(i,n).format(e)}catch(t){u(`Site Kit numberFormat error: Intl.NumberFormat( ${JSON.stringify(i)}, ${JSON.stringify(n)} ).format( ${typeof e} )`,t.message)}const o={currencyDisplay:"narrow",currencySign:"accounting",style:"unit"},s=["signDisplay","compactDisplay"],r={};for(const[e,t]of Object.entries(n))o[e]&&t===o[e]||s.includes(e)||(r[e]=t);try{return new Intl.NumberFormat(i,r).format(e)}catch{return new Intl.NumberFormat(i).format(e)}}function m(e,t={}){const{locale:i=h(),style:n="long",type:o="conjunction"}=t;if(Intl.ListFormat){return new Intl.ListFormat(i,{style:n,type:o}).format(e)}
|
||
|
|
/* translators: used between list items, there is a space after the comma. */const s=(0,r.__)(", ","google-site-kit");return e.join(s)}function h(e=i.g){const t=(0,n.get)(e,["_googlesitekitLegacyData","locale"]);if(t){const e=t.match(/^(\w{2})?(_)?(\w{2})/);if(e&&e[0])return e[0].replace(/_/g,"-")}return e.navigator.language}},80035:(e,t,i)=>{i.d(t,{A:()=>v});var n,o=i(62688),s=i.n(o),r=i(4452),a=i.n(r),l=i(63696),c=i(19793);function g(){return g=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},g.apply(null,arguments)}const warning_notice=e=>l.createElement("svg",g({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),n||(n=l.createElement("path",{fill:"currentColor",d:"M12 1c6.075 0 11 4.925 11 11s-4.925 11-11 11S1 18.075 1 12 5.925 1 12 1m0 14a1.5 1.5 0 1 0 0 3 1.5 1.5 0 0 0 0-3m-1-2h2V6h-2z"})));var d=i(42343),u=i(49655),p=i(62540);const m={[u.Q.NEW]:d.A,[u.Q.SUCCESS]:c.A,[u.Q.INFO]:warning_notice,[u.Q.WARNING]:warning_notice,[u.Q.ERROR]:warning_notice};function Icon({type:e}){const t=m[e]||warning_notice;return(0,p.jsx)(t,{width:24,height:24})}function Title({className:e,children:t}){return(0,p.jsx)("p",{className:a()("googlesitekit-notice__title",e),children:t})}function Description({className:e,children:t}){return(0,p.jsx)("p",{className:a()("googlesitekit-notice__description",e),children:t})}Icon.propTypes={type:s().oneOf(Object.values(u.Q))},Title.propTypes={className:s().string,children:s().node},Description.propTypes={className:s().string,children:s().node};var h=i(49383),f=i(83366);function CTAButton({label:e,disabled:t,inProgress:i,onClick:n,href:o,external:s=!1,hideExternalIndicator:r=!1}){let a;return s&&!r&&(a=(0,p.jsx)(f.A,{width:14,height:14})),(0,p.jsx)(h.SpinnerButton,{className:"googlesitekit-notice__cta",disabled:t,isSaving:i,onClick:n,href:o,target:s?"_blank":void 0,trailingIcon:a,children:e})}CTAButton.propTypes={label:s().string.isRequired,disabled:s().bool,inProgress:s().bool,onClick:s().func,href:s().string,external:s().bool,hideExternalIndicator:s().bool};var k=i(82871);function DismissButton({label:e=(0,k.__)("Got it","google-site-kit"),onClick:t,disabled:i}){return(0,p.jsx)(h.Button,{onClick:t,disabled:i,tertiary:!0,children:e})}DismissButton.propTypes={label:s().string,onClick:s().func.isRequired,disabled:s().bool};const y=(0,l.forwardRef)(({className:e,title:t,description:i,dismissButton:n,ctaButton:o,type:s=u.Q.INFO,children:r,hideIcon:l},c)=>(0,p.jsxs)("div",{ref:c,className:a()("googlesitekit-notice",`googlesitekit-notice--${s}`,e),children:[!l&&(0,p.jsx)("div",{className:"googlesitekit-notice__icon",children:(0,p.jsx)(Icon,{type:s})}),(0,p.jsxs)("div",{className:"googlesitekit-notice__content",children:[t&&(0,p.jsx)(Title,{children:t}),i&&(0,p.jsx)(Description,{children:i})]}),(n?.label||n?.onClick||o?.label&&(o?.onClick||o?.href)||r)&&(0,p.jsxs)("div",{className:"googlesitekit-notice__action",children:[r,(n?.label||n?.onClick)&&(0,p.jsx)(DismissButton,{label:n.label,onClick:n.onClick,disabled:n.disabled}),o?.label&&(o?.onClick||o?.href)&&(0,p.jsx)(CTAButton,{label:o.label,onClick:o.onClick,inProgress:o.inProgress,disabled:o.disabled,href:o.href,external:o.external,hideExternalIndicator:o.hideExternalIndicator})]})]}));y.TYPES=u.Q,y.propTypes={className:s().string,title:s().oneOfType([s().string,s().object]),description:s().node,type:s().oneOf(Object.values(u.Q)),dismissButton:s().shape(DismissButton.propTypes),ctaButton:s().shape({...CTAButton.propTypes,label:s().string}),children:s().node,hideIcon:s().bool};const v=y},80452:(e,t,i)=>{i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var n,o=i(63696);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},s.apply(null,arguments)}const __WEBPACK_DEFAULT_EXPORT__=e=>o.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 12 9"},e),n||(n=o.createE
|
||
|
|
(0,l.__)("Source: %s","google-site-kit"),`<a>${e}</a>`),{a:(0,d.jsx)(c.A,{href:t,external:n},"link")})})}SourceLink.propTypes={name:o().string,href:o().string,className:o().string,external:o().bool},SourceLink.defaultProps={name:"",href:"",className:"",external:!1};const u=SourceLink},93896:(e,t,i)=>{i.d(t,{O4:()=>n,OQ:()=>s,qc:()=>o});const n="core/site",o="primary",s="secondary"},94552:(e,t,i)=>{i.d(t,{A:()=>l});var n=i(62688),o=i.n(n),s=i(4452),r=i.n(s),a=i(62540);function ChangeArrow({direction:e,invertColor:t,width:i,height:n}){return(0,a.jsx)("svg",{className:r()("googlesitekit-change-arrow",`googlesitekit-change-arrow--${e}`,{"googlesitekit-change-arrow--inverted-color":t}),width:i,height:n,viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:(0,a.jsx)("path",{d:"M5.625 10L5.625 2.375L9.125 5.875L10 5L5 -1.76555e-07L-2.7055e-07 5L0.875 5.875L4.375 2.375L4.375 10L5.625 10Z",fill:"currentColor"})})}ChangeArrow.propTypes={direction:o().string,invertColor:o().bool,width:o().number,height:o().number},ChangeArrow.defaultProps={direction:"up",invertColor:!1,width:9,height:9};const l=ChangeArrow},95267:(e,t,i)=>{i.d(t,{A:()=>PageHeader});var n=i(4452),o=i.n(n),s=i(62688),r=i.n(s),a=i(55527),l=i(24560),c=i(18418),g=i(84385),d=i(15167),u=i(62540);function PageHeader(e){const{title:t,icon:i,className:n,status:s,statusText:r,fullWidth:p,children:m}=e,h=p?{size:12}:{smSize:4,mdSize:4,lgSize:6},f=""!==s||Boolean(m);return(0,u.jsx)("header",{className:"googlesitekit-page-header",children:(0,u.jsxs)(a.fI,{children:[t&&(0,u.jsxs)(a.fh,{...h,children:[i,(0,u.jsx)(d.A,{as:"h1",className:o()("googlesitekit-page-header__title",n),size:"medium",type:"title",children:t})]}),f&&(0,u.jsx)(a.fh,{smSize:4,mdSize:4,lgSize:6,alignBottom:!0,mdAlignRight:!0,children:(0,u.jsxs)("div",{className:"googlesitekit-page-header__details",children:[s&&(0,u.jsxs)("span",{className:o()("googlesitekit-page-header__status",`googlesitekit-page-header__status--${s}`),children:[r,(0,u.jsx)(g.A,{children:"connected"===s?(0,u.jsx)(l.A,{width:10,height:8}):(0,u.jsx)(c.A,{width:2,height:12})})]}),m]})})]})})}PageHeader.propTypes={title:r().string,icon:r().node,className:r().string,status:r().string,statusText:r().string,fullWidth:r().bool},PageHeader.defaultProps={title:"",icon:null,className:"googlesitekit-heading-3",status:"",statusText:"",fullWidth:!1}},99235:(e,t,i)=>{i.d(t,{l:()=>o});var n=i(78174);function o(e,t,i){(0,n.A)(i=>e.includes(i.keyCode)&&t.current.contains(i.target),i)}},99455:(e,t,i)=>{i.d(t,{A:()=>d});var n,o=i(82871),s=i(88933),r=i(63696);function a(){return a=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},a.apply(null,arguments)}const l=e=>r.createElement("svg",a({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 80 21"},e),n||(n=r.createElement("path",{fill:"#5F6368",d:"M62.09 1.664h3.038v.1L58.34 9.593l7.241 10.224v.1H62.7L56.755 11.4 53.95 14.64v5.278h-2.351V1.664h2.35v9.415h.1zM69.985 3.117c0 .454-.167.853-.488 1.175-.322.322-.71.488-1.176.488-.455 0-.854-.166-1.175-.488a1.6 1.6 0 0 1-.488-1.175c0-.466.166-.854.488-1.176s.71-.488 1.175-.488c.455 0 .854.166 1.176.488.332.333.487.72.487 1.176m-.477 4.313v12.498h-2.351V7.43zM77.016 20.128c-1.02 0-1.864-.31-2.54-.943q-1.014-.948-1.031-2.628V9.57h-2.196V7.43h2.196V3.603h2.35V7.43h3.061v2.14h-3.06v6.222c0 .831.166 1.397.488 1.696.321.3.687.444 1.097.444.189 0 .366-.022.555-.067.188-.044.344-.1.499-.166l.743 2.096c-.632.222-1.342.333-2.162.333M2.673 18.952C1.375 18.009.488 16.678 0 14.97l2.883-1.176c.289 1.076.799 1.94 1.542 2.628.732.677 1.619 1.02 2.65 1.02.965 0 1.774-.244 2.45-.742.677-.5 1.01-1.187 1.01-2.052 0-.798-.3-1.453-.887-1.974q-.883-.781-3.094-1.564l-1.22-.432Q3.371 9.997 2.04 8.716C1.153 7.862.71 6.742.71 5.346c0-.966.266-1.853.787-2.673S2.75 1.209 3.693.72C4.624.244 5.678 0 6.864 0c1.708 0 3.072.41 4.081 1.242 1.02.832 1.697 1.752 2.04 2.795L10.236 5.2c-.2-.621-.576-1.164-1.142-1.63-.565-.477-1.286-.71-2.173-.71s-1.641.222-2.2
|