(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[290,505],{80:(e,t,i)=>{"use strict";i.d(t,{CV:()=>_,Cu:()=>k,K9:()=>o,Kr:()=>h,Lf:()=>m,Oh:()=>n,PW:()=>j,Rx:()=>E,S9:()=>I,TQ:()=>g,Vt:()=>C,Wl:()=>N,ZC:()=>a,ZY:()=>r,_p:()=>D,ag:()=>p,aj:()=>u,bz:()=>b,dq:()=>x,f2:()=>c,fB:()=>v,fV:()=>T,iB:()=>d,kc:()=>l,mo:()=>A,nc:()=>S,rm:()=>f,to:()=>s,wo:()=>y,yn:()=>M});const o="modules/analytics-4",a="account_create",s="property_create",n="webdatastream_create",r="analyticsSetup",l=10,c=0,d="https://www.googleapis.com/auth/tagmanager.readonly",g="enhanced-measurement-form",u="enhanced-measurement-enabled",m="enhanced-measurement-should-dismiss-activation-banner",p="analyticsAccountCreate",h="analyticsCustomDimensionsCreate",I="https://www.googleapis.com/auth/analytics.edit",y="dashboardAllTrafficWidgetDimensionName",A="dashboardAllTrafficWidgetDimensionColor",M="dashboardAllTrafficWidgetDimensionValue",N="dashboardAllTrafficWidgetActiveRowIndex",f="dashboardAllTrafficWidgetLoaded",k={googlesitekit_post_date:{parameterName:"googlesitekit_post_date",displayName:"WordPress Post Date",description:"Created by Site Kit: Date when a post was published",scope:"EVENT"},googlesitekit_post_author:{parameterName:"googlesitekit_post_author",displayName:"WordPress Post Author",description:"Created by Site Kit: WordPress name of the post author",scope:"EVENT"},googlesitekit_post_categories:{parameterName:"googlesitekit_post_categories",displayName:"WordPress Post Categories",description:"Created by Site Kit: Names of categories assigned to a post",scope:"EVENT"},googlesitekit_post_type:{parameterName:"googlesitekit_post_type",displayName:"WordPress Post Type",description:"Created by Site Kit: Content type of a post",scope:"EVENT"}},S={ADD_TO_CART:"add_to_cart",PURCHASE:"purchase",SUBMIT_LEAD_FORM:"submit_lead_form",GENERATE_LEAD:"generate_lead",CONTACT:"contact"},T=[S.CONTACT,S.GENERATE_LEAD,S.SUBMIT_LEAD_FORM],v={"new-visitors":{description:"People who visited the site for the first time",displayName:"New visitors",membershipDurationDays:-1,filterClauses:[{clauseType:"INCLUDE",simpleFilter:{scope:"AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS",filterExpression:{andGroup:{filterExpressions:[{orGroup:{filterExpressions:[{dimensionOrMetricFilter:{fieldName:"newVsReturning",stringFilter:{matchType:"EXACT",value:"new"}}}]}},{orGroup:{filterExpressions:[{notExpression:{dimensionOrMetricFilter:{fieldName:"groupId",stringFilter:{matchType:"EXACT",value:"created_by_googlesitekit:new_visitors"}}}}]}}]}}}}]},"returning-visitors":{description:"People who have visited your site at least once before",displayName:"Returning visitors",membershipDurationDays:-1,filterClauses:[{clauseType:"INCLUDE",simpleFilter:{scope:"AUDIENCE_FILTER_SCOPE_ACROSS_ALL_SESSIONS",filterExpression:{andGroup:{filterExpressions:[{orGroup:{filterExpressions:[{dimensionOrMetricFilter:{fieldName:"newVsReturning",stringFilter:{matchType:"EXACT",value:"returning"}}}]}},{orGroup:{filterExpressions:[{notExpression:{dimensionOrMetricFilter:{fieldName:"groupId",stringFilter:{matchType:"EXACT",value:"created_by_googlesitekit:returning_visitors"}}}}]}}]}}}}]}},j="audiencePermissionsSetup",_="audienceTileCustomDimensionCreate",b="audience-selection-panel-expirable-new-badge-",x="audience",C="customDimension",D="property",E=[x,C,D]},674:(e,t,i)=>{"use strict";i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o,a,s=i(63696);function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;ts.createElement("svg",n({xmlns:"http://www.w3.org/2000/svg",fill:"currentColor",viewBox:"0 0 22 22"},e),o||(o=s.createElement("path",{fillRule:"evenodd",d:"m12.149 7.96-5.166 5.166a.34.34 0 0 0-.094.176l-.35 1.755a.344.344 0 0 0 .404.404l1.755-.35a.34.34 0 0 0 .175-.095l5.166-5.165zm2.301-1.814a1.03 1.03 0 0 0-1.458 0L6.497 12.64a1.03 1.03 0 0 0-.282.527l-.35 1.755a1.03 1.03 0 0 0 1.213 1.213l1.754-.35c.2-.04.383-.139.527-.283l6.495-6.494a1.03 1.03 0 0 0 0-1.459z",clipRule:"evenodd"})),a||(a=s.createElement("path",{d:"m12.149 7.96.117-.116a.165.165 0 0 0-.234 0zm-5.166 5.166-.116-.116zm-.094.176.162.033zm-.35 1.755.161.032zm.404.404.032.162zm1.755-.35.032.161zm.175-.095.117.117zm5.166-5.165.116.116a.165.165 0 0 0 0-.233zm-1.047-3.705.116.116zm1.458 0-.116.116zM6.497 12.64l.117.117zm-.282.527-.162-.032zm-.35 1.755.161.032zm1.213 1.213-.033-.162zm1.754-.35.033.161zm.527-.283.117.117zm6.495-6.494-.117-.117zm0-1.459.117-.116zm-3.822.295L6.867 13.01l.233.233 5.166-5.165zM6.867 13.01a.5.5 0 0 0-.14.26l.324.065a.2.2 0 0 1 .05-.092zm-.14.26-.35 1.754.323.065.351-1.755zm-.35 1.754a.51.51 0 0 0 .598.599l-.064-.324a.18.18 0 0 1-.21-.21zm.598.599 1.755-.35-.065-.325-1.754.351zm1.755-.35a.5.5 0 0 0 .26-.14l-.233-.233a.2.2 0 0 1-.092.048zm.26-.14 5.165-5.166-.233-.233L8.757 14.9zm3.042-7.055 1.89 1.89.233-.234-1.89-1.89zm1.076-1.816a.866.866 0 0 1 1.226 0l.233-.233a1.196 1.196 0 0 0-1.692 0zm-6.494 6.495 6.494-6.495-.233-.233-6.494 6.495zm-.237.443a.87.87 0 0 1 .237-.443l-.233-.233c-.167.167-.281.38-.328.61zm-.35 1.754.35-1.754-.324-.065-.35 1.755zm1.018 1.02a.866.866 0 0 1-1.019-1.02l-.323-.065a1.196 1.196 0 0 0 1.407 1.408zm1.755-.351-1.755.35.065.324 1.755-.35zm.443-.237a.87.87 0 0 1-.443.237l.065.323c.231-.046.444-.16.611-.327zm6.494-6.495-6.494 6.495.233.233 6.495-6.494zm0-1.225a.866.866 0 0 1 0 1.225l.234.234a1.196 1.196 0 0 0 0-1.692zm-1.403-1.404 1.403 1.404.234-.233-1.404-1.404z"})))},1641:(e,t,i)=>{"use strict";i.d(t,{A:()=>ReportErrorActions});var o=i(62688),a=i.n(o),s=i(63696),n=i(13606),r=i(82871),l=i(50539),c=i(49383),d=i(29785),g=i(88273),u=i(13137),m=i(4124),p=i(38432),h=i(62540);function ReportErrorActions(e){const{moduleSlug:t,error:i,GetHelpLink:o,hideGetHelpLink:a,buttonVariant:I,onRetry:y,onRequestAccess:A,getHelpClassName:M,RequestAccessButton:N,RetryButton:f}=e,k=(0,m.A)(),S=(0,l.useSelect)(e=>e(g.i).getModuleStoreName(t)),T=(0,l.useSelect)(e=>"function"==typeof e(S)?.getServiceEntityAccessURL?e(S).getServiceEntityAccessURL():null),v=Array.isArray(i)?i:[i],j=(0,l.useSelect)(e=>v.map(t=>{const i=e(S)?.getSelectorDataForError(t);return{...t,selectorData:i}})),_=j?.filter(e=>(0,u.vl)(e,e.selectorData)&&"getReport"===e.selectorData.name),b=!!_.length,x=(0,l.useSelect)(e=>{const i={...b?_[0]:v[0]};return(0,u.SG)(i)&&(i.code=`${t}_insufficient_permissions`),e(d.O4).getErrorTroubleshootingLinkURL(i)}),C=(0,l.useDispatch)(),D=v.some(e=>(0,u.SG)(e)),E=(0,s.useCallback)(()=>{_.forEach(e=>{const{selectorData:t}=e;C(t.storeName).invalidateResolution(t.name,t.args)}),y?.()},[C,_,y]),w=T&&D&&!k;return(0,h.jsxs)("div",{className:"googlesitekit-report-error-actions",children:[w&&("function"==typeof N?(0,h.jsx)(N,{requestAccessURL:T}):(0,h.jsx)(c.Button,{onClick:A,href:T,target:"_blank",danger:"danger"===I,tertiary:"tertiary"===I,children:(0,r.__)("Request access","google-site-kit")})),b&&(0,h.jsxs)(s.Fragment,{children:["function"==typeof f?(0,h.jsx)(f,{handleRetry:E}):(0,h.jsx)(c.Button,{onClick:E,danger:"danger"===I,tertiary:"tertiary"===I,children:(0,r.__)("Retry","google-site-kit")}),!a&&(0,h.jsx)("span",{className:"googlesitekit-error-retry-text",children:(0,n.A)((0,r.__)("Retry didn’t work? ","google-site-kit"),{HelpLink:(0,h.jsx)(p.A,{href:x,external:!0,hideExternalIndicator:!0,children:(0,r.__)("Get help","google-site-kit")})})})]}),!b&&!a&&(0,h.jsx)("div",{className:M,children:"function"==typeof o?(0,h.jsx)(o,{linkURL:x}):(0,h.jsx)(p.A,{href:x,external:!0,hideExternalIndicator:!0,children:(0,r.__)("Get help","google-site-kit")})})]})}ReportErrorActions.propTypes={moduleSlug:a().string.isRequired,error:a().oneOfType([a().arrayOf(a().object),a().object]).isRequired,GetHelpLink:a().elementType,hideGetHelpLink:a().bool,buttonVariant:a().string,onRetry:a().func,onRequestAccess:a().func,getHelpClassName:a().string,RequestAccessButton:a().elementType,RetryButton:a().elementType}},3170:(e,t,i)=>{"use strict";i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o,a=i(63696);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 19"},e),o||(o=a.createElement("path",{fill:"currentColor",d:"M0 19h22L11 0zm12-3h-2v-2h2zm0-4h-2V8h2z"})))},4124:(e,t,i)=>{"use strict";i.d(t,{A:()=>s});var o=i(20697),a=i(62659);function s(){const e=(0,a.A)();return o.Nn.includes(e)}},4169:(e,t,i)=>{"use strict";i.d(t,{N$:()=>a,aO:()=>s,qB:()=>o});const o={BOXES:"boxes",COMPOSITE:"composite"},a={QUARTER:"quarter",HALF:"half",FULL:"full"},s="core/widgets"},4751:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var o=i(62688),a=i.n(o),s=i(4452),n=i.n(s),r=i(97513),l=i(62540);function PreviewBlock({className:e,width:t,height:i,shape:o,padding:a,smallWidth:s,smallHeight:c,tabletWidth:d,tabletHeight:g,desktopWidth:u,desktopHeight:m}){const p=(0,r.dv)(),h={width:{[r.mp]:s,[r.Lg]:d,[r.Fo]:u,[r.Qb]:u},height:{[r.mp]:c,[r.Lg]:g,[r.Fo]:m,[r.Qb]:u}};return(0,l.jsx)("div",{className:n()("googlesitekit-preview-block",e,{"googlesitekit-preview-block--padding":a}),style:{width:h.width[p]||t,height:h.height[p]||i},children:(0,l.jsx)("div",{className:n()("googlesitekit-preview-block__wrapper",{"googlesitekit-preview-block__wrapper--circle":"circular"===o})})})}PreviewBlock.propTypes={className:a().string,width:a().string,height:a().string,shape:a().string,padding:a().bool,smallWidth:a().string,smallHeight:a().string,tabletWidth:a().string,tabletHeight:a().string,desktopWidth:a().string,desktopHeight:a().string},PreviewBlock.defaultProps={className:void 0,width:"100px",height:"100px",shape:"square",padding:!1,smallWidth:void 0,smallHeight:void 0,tabletWidth:void 0,tabletHeight:void 0,desktopWidth:void 0,desktopHeight:void 0};const c=PreviewBlock},5664:(e,t,i)=>{"use strict";i.d(t,{$:()=>a});var o=i(63696);function a(e,t=0){(0,o.useEffect)(()=>{let o,a=!1;function s(){o=i.g.setTimeout(()=>{a=!0},t)}function n(){i.g.clearTimeout(o),a&&(a=!1,e())}return i.g.addEventListener("focus",n),i.g.addEventListener("blur",s),()=>{i.g.removeEventListener("focus",n),i.g.removeEventListener("blur",s),i.g.clearTimeout(o)}},[t,e])}},5704:(e,t,i)=>{"use strict";i.d(t,{c:()=>a,v:()=>s});var o=i(9577);function a(e){if((0,o.X)(e))return e.match(/pub-\d+$/)[0]}function s(e){if((0,o.H)(e))return e.match(/pub-\d+$/)[0]}},5855:(e,t,i)=>{"use strict";i.d(t,{A:()=>d});var o=i(4452),a=i.n(o),s=i(62688),n=i.n(s),r=i(63696),l=i(62540);const c=(0,r.forwardRef)(({label:e,className:t,hasLeftSpacing:i=!1,...o},s)=>(0,l.jsx)("span",{ref:s,...o,className:a()("googlesitekit-badge",t,{"googlesitekit-badge--has-left-spacing":i}),children:e}));c.displayName="Badge",c.propTypes={label:n().string.isRequired,hasLeftSpacing:n().bool};const d=c},6730:(e,t,i)=>{"use strict";i.d(t,{A:()=>GenericErrorHandlerActions});var o=i(62688),a=i.n(o),s=i(82871),n=i(38432),r=i(38021),l=i.n(r),c=i(63696),d=i(12417),g=i(1027),u=i(65123),m=i(49383),p=i(62540);function ReportErrorButton({message:e,componentStack:t}){const[i,o]=(0,c.useState)(!1);return(0,p.jsx)(m.Button,{"aria-label":i?(0,s.__)("Error message copied to clipboard. Click to copy the error message again.","google-site-kit"):void 0,onClick:function(){l()(`\`\`\`\n${e}\n${t}\n\`\`\``),o(!0)},trailingIcon:(0,p.jsx)(d.A,{className:"mdc-button__icon",icon:i?g.A:u.A}),children:i?(0,s.__)("Copied to clipboard","google-site-kit"):(0,s.__)("Copy error contents","google-site-kit")})}ReportErrorButton.propTypes={message:a().string,componentStack:a().string};const h=ReportErrorButton;function GenericErrorHandlerActions({message:e,componentStack:t}){return(0,p.jsxs)("div",{className:"googlesitekit-generic-error-handler-actions",children:[(0,p.jsx)(h,{message:e,componentStack:t}),(0,p.jsx)(n.A,{href:"https://wordpress.org/support/plugin/google-site-kit/",external:!0,children:(0,s.__)("Report this problem","google-site-kit")})]})}GenericErrorHandlerActions.propTypes={message:a().string,componentStack:a().string}},7076:(e,t,i)=>{"use strict";i.d(t,{d:()=>n});var o=i(18117),a=i(17243),s=i(63696);function n(...e){const t=(0,o.MA)(()=>(0,a.debounce)(...e),e);return(0,s.useEffect)(()=>()=>t.cancel(),[t]),t}},7144:(e,t,i)=>{"use strict";i.d(t,{EA:()=>s,GF:()=>y,Hl:()=>g,IX:()=>p,Is:()=>n,KD:()=>m,LO:()=>d,NO:()=>c,Nl:()=>l,QJ:()=>u,Uf:()=>a,XU:()=>I,Y0:()=>r,hs:()=>A,wb:()=>h});var o=i(82871);const a="key-metrics-setup-cta-widget",s="googlesitekit-key-metrics-selection-panel-opened",n="key-metrics-selection-form",r="key-metrics-selected",l="key-metrics-effective-selection",c="key-metrics-unstaged-selection",d=2,g=8,u={SLUG:"current-selection",LABEL:(0,o.__)("Current selection","google-site-kit")},m={SLUG:"suggested",LABEL:(0,o.__)("Suggested","google-site-kit")},p={SLUG:"visitors",LABEL:(0,o.__)("Visitors","google-site-kit")},h={SLUG:"driving-traffic",LABEL:(0,o.__)("Driving traffic","google-site-kit")},I={SLUG:"generating-leads",LABEL:(0,o.__)("Generating leads","google-site-kit")},y={SLUG:"selling-products",LABEL:(0,o.__)("Selling products","google-site-kit")},A={SLUG:"content-performance",LABEL:(0,o.__)("Content performance","google-site-kit")}},7551:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>r,Oo:()=>s,oE:()=>n});var o=i(20697),a=i(62659);const s=o.jU,n=o.f7;function r(){const e=(0,a.A)();return e===o.jU||e===o.Ax?s:e===o.f7||e===o.Is?n:null}},7972:(e,t,i)=>{"use strict";i.d(t,{F:()=>a,n:()=>o});const o="core/ui",a="activeContextID"},8084:(e,t,i)=>{"use strict";i.d(t,{$C:()=>_,RF:()=>j,WI:()=>T,_5:()=>f,jU:()=>N,o3:()=>M,x0:()=>S});var o=i(32091),a=i.n(o),s=i(50532),n=i.n(s),r=i(17243),l=i(78913);const c="GET_REGISTRY",d="AWAIT";function g(...e){const t=e.reduce((e,t)=>({...e,...t}),{}),i=k(e.reduce((e,t)=>[...e,...Object.keys(t)],[]));return a()(0===i.length,`collect() cannot accept collections with duplicate keys. Your call to collect() contains the following duplicated functions: ${i.join(", ")}. Check your data stores for duplicates.`),t}const u=g,m=g;function p(...e){const t=[...e];let i;return"function"!=typeof t[0]&&(i=t.shift()),(e=i,o={})=>t.reduce((e,t)=>t(e,o),e)}const h=g,I=g,y=g;function A(e){return e}function M(...e){const t=y(...e.map(e=>e.initialState||{}));return{initialState:t,controls:m(...e.map(e=>e.controls||{})),actions:u(...e.map(e=>e.actions||{})),reducer:p(t,...e.map(e=>e.reducer||A)),resolvers:h(...e.map(e=>e.resolvers||{})),selectors:I(...e.map(e=>e.selectors||{}))}}const N={getRegistry:()=>({payload:{},type:c}),*await(e){return{payload:{value:e},type:d}}},f={[c]:(0,l.b)(e=>()=>e),[d]:({payload:e})=>e.value};function k(e){const t=[],i={};for(let o=0;o=1?i[a]+1:1,i[a]>1&&t.push(a)}return t}const S={actions:N,controls:f,reducer:A};function T(e){return t=>v(e(t))}const v=n()(e=>(0,r.mapValues)(e,(e,t)=>(...i)=>{const o=e(...i);return a()(void 0!==o,`${t}(...) is not resolved`),o}));function j(e,{negate:t=!1}={}){return{safeSelector:(0,l.N)(i=>(o,...a)=>{const s=!t,n=!!t;try{return e(i,o,...a),s}catch{return n}}),dangerousSelector:(0,l.N)(t=>(i,...o)=>{e(t,i,...o)})}}function _(e,t){return a()("function"==typeof e,"a validator function is required."),a()("function"==typeof t,"an action creator function is required."),a()("Generator"!==e[Symbol.toStringTag]&&"GeneratorFunction"!==e[Symbol.toStringTag],"an action’s validator function must not be a generator."),(...i)=>(e(...i),t(...i))}},8513:(e,t,i)=>{"use strict";i.d(t,{Kk:()=>s,SZ:()=>o,Yw:()=>n,oJ:()=>r,tT:()=>a});const o="body",a=[o,"display","headline","label","title"],s="small",n="medium",r=[s,n,"large"]},8732:(e,t,i)=>{"use strict";i.d(t,{$:()=>s,D:()=>a});var o=i(20697);const a="core/notifications",s=[o.uR,o.jU,o.f7,o.Ax,o.Is]},9279:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>TrackingExclusionSwitches,BN:()=>m});var o=i(63696),a=i(82871),s=i(50539),n=i(49383),r=i(80),l=i(33052),c=i(83880),d=i(62540);const g="loggedinUsers",u="contentCreators",m={[g]:(0,a.__)("All logged-in users","google-site-kit"),[u]:(0,a.__)("Users that can write posts","google-site-kit")};function TrackingExclusionSwitches(){const e=(0,s.useSelect)(e=>e(r.K9).getTrackingDisabled()),{setTrackingDisabled:t}=(0,s.useDispatch)(r.K9);let i;i=e&&e.includes(g)?(0,a.__)("All logged-in users will be excluded from Analytics tracking","google-site-kit"):e&&e.includes(u)?(0,a.__)("Users that can write posts will be excluded from Analytics tracking","google-site-kit"):(0,a.__)("All logged-in users will be included in Analytics tracking","google-site-kit");const p=(0,o.useCallback)((i,o)=>{const a=o?e.concat(i):e.filter(e=>e!==i);t(a)},[e,t]),h=(0,o.useCallback)(e=>{const{checked:t}=e.target;p(u,t)},[p]),I=(0,o.useCallback)(e=>{const{checked:t}=e.target;p(g,t)},[p]);return Array.isArray(e)?(0,d.jsxs)("div",{className:"googlesitekit-settings-module__fields-group",children:[(0,d.jsx)(l.A,{as:"h4",size:"small",type:"title",className:"googlesitekit-settings-module__fields-group-title",children:(0,a.__)("Exclude Analytics","google-site-kit")}),(0,d.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,d.jsxs)("div",{className:"googlesitekit-settings-module__inline-items",children:[(0,d.jsx)("div",{className:"googlesitekit-settings-module__inline-item",children:(0,d.jsx)(n.Switch,{label:m[g],checked:e.includes(g),onClick:I,hideLabel:!1})}),!e.includes(g)&&(0,d.jsx)("div",{className:"googlesitekit-settings-module__inline-item",children:(0,d.jsx)(n.Switch,{label:m[u],checked:e.includes(u),onClick:h,hideLabel:!1})})]}),(0,d.jsx)(c.A,{children:i})]})]}):null}},9577:(e,t,i)=>{"use strict";function o(e){return"string"==typeof e&&/^pub-\d+$/.test(e)}function a(e){return"string"==typeof e&&/^ca-pub-\d+$/.test(e)}i.d(t,{H:()=>o,X:()=>a})},9616:(e,t,i)=>{"use strict";i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});const __WEBPACK_DEFAULT_EXPORT__=function(e){if("string"==typeof e&&e.match(/[0-9]{8}/)){const t=e.slice(0,4),i=Number(e.slice(4,6))-1,o=e.slice(6,8);return new Date(t,i.toString(),o)}return!1}},10626:(e,t,i)=>{"use strict";i.d(t,{A:()=>WebStoriesAdUnitSelect});var o=i(63696),a=i(82871),s=i(49383),n=i(50539),r=i(35952),l=i(62540);function WebStoriesAdUnitSelect(){const e=(0,n.useSelect)(e=>e(r.wl).getAccountID()),t=(0,n.useSelect)(e=>e(r.wl).getClientID()),i=(0,n.useSelect)(e=>e(r.wl).getWebStoriesAdUnit()),c=(0,n.useSelect)(i=>i(r.wl).getAdUnits(e,t)),d=(0,n.useSelect)(i=>i(r.wl).hasFinishedResolution("getAdUnits",[e,t])),{setWebStoriesAdUnit:g}=(0,n.useDispatch)(r.wl),u=(0,o.useCallback)((e,t)=>{const o=t.dataset.value;i!==o&&g(o)},[i,g]);return d?(0,l.jsxs)(s.Select,{className:"googlesitekit-adsense__select-field",label:(0,a.__)("Web Stories Ad Unit","google-site-kit"),value:i,onEnhancedChange:u,enhanced:!0,outlined:!0,children:[(0,l.jsx)(s.Option,{value:"",children:(0,a.__)("Select ad unit","google-site-kit")}),(c||[]).map(({_id:e,displayName:t})=>(0,l.jsx)(s.Option,{value:e,children:t},e))]}):(0,l.jsx)(s.ProgressBar,{small:!0})}},10740:(e,t,i)=>{"use strict";i.d(t,{$z:()=>a.$,CR:()=>r.C,Cf:()=>l.DialogContent,Es:()=>l.DialogFooter,Nv:()=>o.N,P3:()=>n.P,Si:()=>s.S,fI:()=>d.fI,fh:()=>d.fh,lG:()=>c.a,xA:()=>d.xA});var o=i(91046),a=i(3412),s=i(30454),n=i(26569),r=i(56655),l=i(12786),c=i.n(l),d=i(84984)},11193:(e,t,i)=>{"use strict";i.d(t,{D:()=>s});var o=i(32091),a=i.n(o);function s(e,{dateRangeLength:t}){a()(Array.isArray(e),"report must be an array to partition."),a()(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)}}},11883:(e,t,i)=>{"use strict";i.d(t,{YJ:()=>s,Eq:()=>n});var o=i(97513),a=i(17243);function s(e,t){const o=document.querySelector(e);if(!o)return 0;const a=o.getBoundingClientRect().top,s=n(t);return a+i.g.scrollY-s}function n(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===o.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!==o.mp)return t.offsetHeight;return 0}(e);return t=function(e){return(0,a.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}},11974:(e,t,i)=>{"use strict";i.d(t,{A:()=>OptIn});var o=i(62688),a=i.n(o),s=i(4452),n=i.n(s),r=i(63696),l=i(13606),c=i(82871),d=i(50539),g=i(97345),u=i(65054),m=i(38432),p=i(62659),h=i(7076),I=i(49383),y=i(62540);function LayoutDefault({checkboxProps:e,label:t}){return(0,y.jsx)(I.Checkbox,{...e,children:t})}function LayoutStacked({checkboxProps:e,title:t,description:i}){return(0,y.jsxs)(r.Fragment,{children:[(0,y.jsx)(I.Checkbox,{...e,children:t}),(0,y.jsx)("div",{className:"googlesitekit-opt-in__description",children:i})]})}LayoutDefault.propTypes={checkboxProps:a().object.isRequired,label:a().node.isRequired},LayoutStacked.propTypes={checkboxProps:a().object.isRequired,title:a().node.isRequired,description:a().node.isRequired};const A="default",M="stacked";function OptIn({id:e="googlesitekit-opt-in",name:t="optIn",className:i,layout:o=A,title:a=null,description:s=null,trackEventCategory:I,trackEventAction:N="tracking_optin"}){const[f,k]=(0,r.useState)(),S=(0,d.useSelect)(e=>e(g.oR).isTrackingEnabled()),T=(0,d.useSelect)(e=>e(g.oR).getErrorForAction("setTrackingEnabled",[!S])),{setTrackingEnabled:v}=(0,d.useDispatch)(g.oR),j=(0,p.A)(),_=(0,r.useCallback)(async e=>{const{response:t,error:i}=await v(e);i?k(S):((0,u.M9)(t.enabled),t.enabled&&(0,u.sx)(I||j,N))},[S,v,I,N,j]);(0,r.useEffect)(()=>{void 0!==S&&void 0===f&&k(S)},[S,f]);const b=(0,h.d)(_,300),x=(0,r.useCallback)(e=>{const t=e.target.checked;k(t),b(t)},[b]),C=null!=a?a:(0,y.jsx)("span",{children:(0,c.__)("Help us improve Site Kit by sharing anonymous usage data.","google-site-kit")}),D=null!=s?s:(0,l.A)((0,c.__)("All collected data is treated in accordance with the Google Privacy Policy","google-site-kit"),{a:(0,y.jsx)(m.A,{href:"https://policies.google.com/privacy",external:!0},"link"),span:(0,y.jsx)("span",{})}),E={id:e,name:t,value:"1",checked:f,onChange:x,loading:void 0===S};return(0,y.jsxs)("div",{className:n()("googlesitekit-opt-in",i,o===M&&"googlesitekit-opt-in--layout-stacked"),children:[o===M?(0,y.jsx)(LayoutStacked,{checkboxProps:E,title:C,description:D}):(0,y.jsx)(LayoutDefault,{checkboxProps:E,label:(0,y.jsxs)(r.Fragment,{children:[C," ",D]})}),T?.message&&(0,y.jsx)("div",{className:"googlesitekit-error-text",children:T?.message})]})}OptIn.propTypes={id:a().string,name:a().string,className:a().string,title:a().node,description:a().node,layout:a().oneOf([A,M]),trackEventCategory:a().string}},11999:(e,t,i)=>{"use strict";i.d(t,{s:()=>o});const o="core/forms"},12317:(e,t,i)=>{"use strict";i.d(t,{A:()=>g});var o=i(62688),a=i.n(o),s=i(4452),n=i.n(s),r=i(49383),l=i(38432),c=i(33052),d=i(62540);function CTA({title:e,headerText:t,headerContent:i,description:o,ctaLink:a,ctaLabel:s,ctaLinkExternal:g,ctaType:u,error:m,onClick:p,"aria-label":h,children:I}){return(0,d.jsxs)("div",{className:n()("googlesitekit-cta",{"googlesitekit-cta--error":m}),children:[(t||i)&&(0,d.jsxs)("div",{className:"googlesitekit-cta__header",children:[t&&(0,d.jsx)(c.A,{as:"h2",size:"small",type:"label",className:"googlesitekit-cta__header_text",children:t}),i]}),(0,d.jsxs)("div",{className:"googlesitekit-cta__body",children:[e&&(0,d.jsx)(c.A,{as:"h3",size:"small",type:"title",className:"googlesitekit-cta__title",children:e}),o&&"string"==typeof o&&(0,d.jsx)("p",{className:"googlesitekit-cta__description",children:o}),o&&"string"!=typeof o&&(0,d.jsx)("div",{className:"googlesitekit-cta__description",children:o}),s&&"button"===u&&(0,d.jsx)(r.Button,{"aria-label":h,href:a,onClick:p,children:s}),s&&"link"===u&&(0,d.jsx)(l.A,{href:a,onClick:p,"aria-label":h,external:g,hideExternalIndicator:g,arrow:!0,children:s}),I]})]})}CTA.propTypes={title:a().string.isRequired,headerText:a().string,description:a().oneOfType([a().string,a().node]),ctaLink:a().string,ctaLinkExternal:a().bool,ctaLabel:a().string,ctaType:a().string,"aria-label":a().string,error:a().bool,onClick:a().func,children:a().node,headerContent:a().node},CTA.defaultProps={title:"",headerText:"",headerContent:"",description:"",ctaLink:"",ctaLabel:"",ctaType:"link",error:!1,onClick:()=>{}};const g=CTA},12666:(e,t,i)=>{"use strict";i.d(t,{A:()=>ChipTabGroup});var o=i(63696),a=i(81276),s=i(50539),n=i(7144),r=i(11999),l=i(80),c=i(22942),d=i(7972),g=i(97345),u=i(88273),m=i(97513),p=i(68832);var h=i(31589),I=i(7076);var y=i(62688),A=i.n(y),M=i(49383),N=i(4452),f=i.n(N),k=i(80452),S=i(42343),T=i(64515),v=i(62540);const j={[n.QJ.SLUG]:k.A,[n.KD.SLUG]:S.A};function Chip({slug:e,label:t,isActive:i,onClick:o,hasNewBadge:a=!1,selectedCount:s=0}){const n=j[e]||T.A;return(0,v.jsxs)(M.Button,{className:f()("googlesitekit-chip-tab-group__chip-item",{"googlesitekit-chip-tab-group__chip-item--active":i}),icon:(0,v.jsx)(n,{width:12,height:12,className:`googlesitekit-chip-tab-group__chip-item-svg googlesitekit-chip-tab-group__chip-item-svg__${e}`}),trailingIcon:s>0?(0,v.jsxs)("span",{className:"googlesitekit-chip-tab-group__chip-item-count",children:["(",s,")"]}):null,onClick:()=>o(e),children:[t,a&&(0,v.jsx)("span",{className:"googlesitekit-chip-tab-group__chip-item-new-dot"})]})}Chip.propTypes={slug:A().string.isRequired,label:A().string.isRequired,isActive:A().bool,hasNewBadge:A().bool,selectedCount:A().number,onClick:A().func.isRequired};const _={[n.QJ.SLUG]:k.A,[n.KD.SLUG]:S.A};function TabItems({containerRef:e,isMobileBreakpoint:t,chipItemRows:i,allGroups:o,isActive:a,onChipChange:s,selectedCounts:n,newlyDetectedMetrics:r,activeGroupIndex:l}){return(0,v.jsxs)("div",{className:"googlesitekit-chip-tab-group__tab-items",ref:e,children:[!t&&i.map(e=>(0,v.jsx)("div",{className:"googlesitekit-chip-tab-group__tab-items-row",children:e.map(e=>(0,v.jsx)(Chip,{slug:e.SLUG,label:e.LABEL,hasNewBadge:!!r?.[e.SLUG],isActive:e.SLUG===a,onClick:s,selectedCount:n[e.SLUG]},e.SLUG))},`row-${e[0].SLUG}`)),t&&(0,v.jsx)(M.TabBar,{activeIndex:l,handleActiveIndexUpdate:e=>s(null,e),children:o.map((e,t)=>{const i=_[e.SLUG]||T.A;return(0,v.jsxs)(M.Tab,{"aria-label":e.LABEL,children:[(0,v.jsx)(i,{width:12,height:12,className:`googlesitekit-chip-tab-group__chip-item-svg googlesitekit-chip-tab-group__tab-item-mobile-svg googlesitekit-chip-tab-group__chip-item-svg__${e.SLUG}`}),e.LABEL,n[e.SLUG]>0&&(0,v.jsxs)("span",{className:"googlesitekit-chip-tab-group__chip-item-count",children:["(",n[e.SLUG],")"]}),!!r?.[e.SLUG]&&(0,v.jsx)("span",{className:"googlesitekit-chip-tab-group__chip-item-new-dot"})]},t)})})]})}TabItems.propTypes={containerRef:A().object,isMobileBreakpoint:A().bool,chipItemRows:A().array.isRequired,allGroups:A().array.isRequired,isActive:A().string.isRequired,onChipChange:A().func.isRequired,selectedCounts:A().object.isRequired,newlyDetectedMetrics:A().object.isRequired,activeGroupIndex:A().number.isRequired};var b,x,C,D,E,w,Z,R,L,G,z,O,P,B,U,W,H,V,Y,F,Q,J,X=i(82871),q=i(4169),K=i(15650);function MetricItem({slug:e,title:t,description:i,isNewlyDetected:a,savedItemSlugs:l=[]}){const c=(0,s.useSelect)(t=>{const{getModule:i}=t(u.i),o=t(q.aO).getWidget(e);return o?.modules.reduce((e,t)=>{const o=i(t);return o?.connected||!o?.name?e:[...e,o.name]},[])}),d=(0,p.A)(n.Is,n.Y0),{getValue:g}=(0,s.useSelect)(e=>e(r.s)),{setValues:m}=(0,s.useDispatch)(r.s),h=(0,o.useCallback)(t=>{const i=g(n.Is,n.Y0),o=t.target.checked?i.concat([e]):i.filter(t=>t!==e);m(n.Is,{[n.Y0]:o,[n.NO]:o})},[g,m,e]),I=d?.includes(e),y=!l.includes(e)&&c.length>0,A=`key-metric-selection-checkbox-${e}`;return(0,v.jsx)(K.y3,{id:A,slug:e,title:t,description:i,isNewlyDetected:a,isItemSelected:I,isItemDisabled:y,onCheckboxChange:h,children:c.length>0&&(0,v.jsx)("div",{className:"googlesitekit-selection-panel-item-error",children:(0,X.sprintf)(/* translators: %s: module names. */ /* translators: %s: module names. */ (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 $(){return $=Object.assign?Object.assign.bind():function(e){for(var t=1;to.createElement("svg",$({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 383 238"},e),b||(b=o.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"})),x||(x=o.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__a)"},o.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=o.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)"})),D||(D=o.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=o.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)"})),w||(w=o.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"})),Z||(Z=o.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)"})),R||(R=o.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__b)"},o.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)"}))),L||(L=o.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)"})),G||(G=o.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=o.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)"})),O||(O=o.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"})),P||(P=o.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)"})),B||(B=o.createElement("g",{filter:"url(#key-metrics-no-selected-items_svg__c)"},o.createElement("rect",{width:130.621,height:89.68,x:126.251,y:37.4,fill:"#fff",rx:10.957}))),U||(U=o.createElement("rect",{width:98.333,height:7.867,x:143.013,y:53.134,fill:"#EBEEF0",rx:3.933})),W||(W=o.createElement("rect",{width:49.806,height:19.923,x:142.369,y:70.423,fill:"#B8E6CA",rx:9.961})),H||(H=o.createElement("rect",{width:33.04,height:7.867,x:143.013,y:105.84,fill:"#EBEEF0",rx:3.933})),V||(V=o.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"})),Y||(Y=o.createElement("rect",{width:19.923,height:5.977,x:164.287,y:77.395,fill:"#fff",rx:1.992})),o.createElement("mask",{id:"key-metrics-no-selected-items_svg__d",width:273,height:230,x:58,y:0,maskUnits:"userSpaceOnUse",style:{maskType:"alpha"}},F||(F=o.createElement("path",{fill:"#B8E6CA",d:"M59.237 58.571C57.1 78.75 63.509 87.67 79.717 111.787c16.209 24.118-29.091 62.914 5.475 101.268 33.827 37.532 69.419.009 111.314-4.555 29.444-3.208 57.82 12.98 90.86 5.9s46.385-42.599 43.153-68.059c-5.59-44.041-26.24-49.107-34.893-66.461s2.902-52.997-30.287-73.16-76.71 14.42-112.503 12.37c-20.651-1.182-40.932-4.995-59.264.86C75.042 25.868 60.91 42.52 59.237 58.57"}))),Q||(Q=o.createElement("g",{mask:"url(#key-metrics-no-selected-items_svg__d)"},o.createElement("path",{stroke:"#CBD0D3",strokeMiterlimit:10,strokeWidth:3.147,d:"m227.674 108.973 11.312-8.418M218.925 98.852l2.868-12.68M205.623 102.87l-5.375-13.037"}),o.createElement("path",{stroke:"#3C7251",strokeLinejoin:"round",strokeWidth:9.44,d:"M63.953 190.487c16.127 12.193 38.716 10.349 55.335 5.162 16.618-5.187 31.107-14.61 45.314-23.791 6.717-4.337 13.617-8.738 21.496-11.119s17.057-2.39 22.958 1.658c3.392 2.328 5.205 5.923 5.36 9.702"}),o.createElement("path",{stroke:"#CBD0D3",strokeLinecap:"round",strokeMiterlimit:10,strokeWidth:9.44,d:"m215.831 109.67-19.169 71.73"}),o.createElement("path",{stroke:"#161B18",strokeMiterlimit:10,strokeWidth:9.44,d:"m213.975 116.472-19.169 71.731"}))),J||(J=o.createElement("defs",null,o.createElement("filter",{id:"key-metrics-no-selected-items_svg__a",width:176.33,height:147.36,x:205.773,y:35.772,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},o.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),o.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),o.createElement("feOffset",{dy:3.985}),o.createElement("feGaussianBlur",{stdDeviation:7.969}),o.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),o.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"}),o.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_2200_11981"}),o.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_2200_11981",result:"shape"})),o.createElement("filter",{id:"key-metrics-no-selected-items_svg__b",width:176.337,height:147.388,x:.409,y:35.793,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},o.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),o.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),o.createElement("feOffset",{dy:3.985}),o.createElement("feGaussianBlur",{stdDeviation:7.969}),o.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),o.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"}),o.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_2200_11981"}),o.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_2200_11981",result:"shape"})),o.createElement("filter",{id:"key-metrics-no-selected-items_svg__c",width:162.497,height:121.556,x:110.313,y:25.447,colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse"},o.createElement("feFlood",{floodOpacity:0,result:"BackgroundImageFix"}),o.createElement("feColorMatrix",{in:"SourceAlpha",result:"hardAlpha",values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"}),o.createElement("feOffset",{dy:3.985}),o.createElement("feGaussianBlur",{stdDeviation:7.969}),o.createElement("feComposite",{in2:"hardAlpha",operator:"out"}),o.createElement("feColorMatrix",{values:"0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.15 0"}),o.createElement("feBlend",{in2:"BackgroundImageFix",result:"effect1_dropShadow_2200_11981"}),o.createElement("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_2200_11981",result:"shape"})))));var ee=i(83880);function TabContent({activeMetricItems:e,newlyDetectedMetrics:t,savedItemSlugs:i}){return(0,v.jsxs)("div",{className:"googlesitekit-chip-tab-group__tab-item",children:[Object.keys(e).map(o=>{const a=e[o].group,s=t?.[a]?.includes(o);return(0,v.jsx)(MetricItem,{slug:o,savedItemSlugs:i,isNewlyDetected:s,...e[o]},o)}),!Object.keys(e).length&&(0,v.jsxs)("div",{className:"googlesitekit-chip-tab-group__graphic",children:[(0,v.jsx)(key_metrics_no_selected_items,{height:250}),(0,v.jsx)(ee.A,{children:(0,X.__)("No metrics were selected yet","google-site-kit")})]})]})}TabContent.propTypes={activeMetricItems:A().object.isRequired,newlyDetectedMetrics:A().object.isRequired,savedItemSlugs:A().array};const te=Object.freeze([]);function ChipTabGroup({allMetricItems:e,savedItemSlugs:t}){const i=(0,o.useRef)(),[y,A]=(0,o.useState)(n.QJ.SLUG),[M,N]=(0,o.useState)(0),f=(0,m.dv)()===m.mp,k=(0,p.A)(n.Is,n.Y0),S=(0,p.A)(n.Is,n.Nl)||te,T=(0,p.A)(n.Is,n.NO)||te,j=(0,s.useSelect)(e=>e(g.oR).isUserInputCompleted()),_=(0,s.useSelect)(e=>{const t=e(g.oR).getUserPickedMetrics();if(t?.length){const i=e(l.K9).getKeyMetricsConversionEventWidgets();return Object.keys(i).filter(e=>t.some(t=>i[e].includes(t)))}const i=e(g.oR).getUserInputSettings();return i?.includeConversionEvents?.values}),b=(0,s.useSelect)(e=>e(u.i).isModuleConnected(c.L1)),x=(0,s.useSelect)(e=>b?e(l.K9).getDetectedEvents():[]),C=(0,s.useSelect)(e=>e(g.oR).getAnswerBasedMetrics(null,[..._||[],...x||[]])),{keyMetricsGroups:D,dynamicGroups:E}=function({detectedEvents:e=[],currentlyActiveEvents:t=[],isUserInputCompleted:i,answerBasedMetrics:a=[]}){const s=[l.nc.SUBMIT_LEAD_FORM,l.nc.CONTACT,l.nc.GENERATE_LEAD].filter(i=>e?.includes(i)||t?.includes(i)),r=[l.nc.ADD_TO_CART,l.nc.PURCHASE].filter(i=>e?.includes(i)||t?.includes(i)),c=(0,o.useMemo)(()=>[n.IX,n.wb,...s?.length?[n.XU]:[],...r?.length?[n.GF]:[],n.hs],[s,r]),d=(0,o.useMemo)(()=>i&&a?.length?[n.QJ,n.KD]:[n.QJ],[i,a]);return{hasGeneratingLeadsGroup:s,hasSellingProductsGroup:r,keyMetricsGroups:c,dynamicGroups:d}}({detectedEvents:x,currentlyActiveEvents:_,isUserInputCompleted:j,answerBasedMetrics:C}),w=(0,o.useMemo)(()=>[...E,...D],[E,D]),Z=(0,s.useSelect)(e=>{if(!e(u.i).isModuleConnected(c.L1))return[];const t=e(l.K9).getDetectedEvents(),i=e(l.K9).getNewBadgeEvents();if(t?.length&&i?.length){const e=t.filter(e=>l.fV.includes(e)),o=i.filter(e=>l.fV.includes(e)),a=i.filter(e=>!l.fV.includes(e));if(e?.length>1&&o.length>0)return a}return i}),R=(0,s.useSelect)(e=>b?e(l.K9).getKeyMetricsConversionEventWidgets():[]),{selectedCounts:L,activeMetricItems:G,newlyDetectedMetrics:z}=function({allMetricItems:e={},isActive:t,effectiveSelection:i=[],answerBasedMetrics:a=[],selectedMetrics:s=[],newBadgeEvents:r=[],conversionReportingEventWidgets:l={}}){return(0,o.useMemo)(()=>{const o={[n.QJ.SLUG]:0},c={},d={};for(const u in e){const m=e[u].group;if((m===t||t===n.QJ.SLUG&&i.includes(u))&&(c[u]=e[u]),t===n.KD.SLUG&&a.includes(u)&&a.includes(u)&&(c[u]=e[u]),!o[m]){const t=Object.keys(e).filter(t=>!(e[t].group!==m||!s?.includes(t))).length;o[m]=t}var g;if(r?.length)r.some(e=>l[e].includes(u))&&(d[m]=[...null!==(g=d[m])&&void 0!==g?g:[],u])}return{selectedCounts:o,activeMetricItems:c,newlyDetectedMetrics:d}},[e,t,i,a,s,r,l])}({allMetricItems:e,isActive:y,effectiveSelection:S,answerBasedMetrics:C,selectedMetrics:k,newBadgeEvents:Z,conversionReportingEventWidgets:R}),{setValues:O}=(0,s.useDispatch)(r.s),P=(0,o.useCallback)(()=>{O(n.Is,{[n.Y0]:k,[n.Nl]:[...S,...T],[n.NO]:[]})},[k,S,T,O]),B=(0,o.useCallback)((e,t)=>{if(e)A(e);else{const e=w[t];N(t),A(e.SLUG)}T.length&&P()},[w,T,A,P]),U=(0,s.useSelect)(e=>e(d.n).getValue(n.EA)),W=(0,a.A)(U),H=Object.keys(z);(0,o.useEffect)(()=>{if(!W&&U)if(A(n.QJ.SLUG),N(0),H.length&&f){const e=w.find(e=>e.SLUG===H[0]);N(w.indexOf(e)),A(e.SLUG)}else N(0),A(n.QJ.SLUG);W&&!U&&P()},[U,W,T,w,f,H,P]),function({containerRef:e,isMobileBreakpoint:t,isSelectionPanelOpen:i,isSelectionPanelOpenPrevious:a}){const s=(0,o.useCallback)(()=>{const i=e.current?.querySelector(".mdc-tab-scroller__scroll-content");if(!t)return;const o=e.current?.querySelectorAll(".googlesitekit-chip-tab-group__tab-items .mdc-tab");if(!o?.length||!i)return;const a=e.current?.getBoundingClientRect(),n=[];o.forEach((e,t)=>{const i=e.getBoundingClientRect();i.left>=a.left&&i.right<=a.right&&n.push(t)});const r=o[n.length];if(!r)return;const l=r.getBoundingClientRect();(l.left>=a.right||l.left-a.right<0&&-(l.left-a.right)<=20)&&("2px"===i.style.columnGap?i.style.columnGap="20px":i.style.columnGap="2px",s())},[e,t]),n=(0,I.d)(s,50);(0,h.A)("resize",n),(0,o.useEffect)(()=>{!a&&i&&s()},[i,a,s])}({containerRef:i,isMobileBreakpoint:f,isSelectionPanelOpen:U,isSelectionPanelOpenPrevious:W});const V=[[...E,...D.slice(0,2)],[...D.slice(2)]];return(0,v.jsxs)("div",{className:"googlesitekit-chip-tab-group",children:[(0,v.jsx)(TabItems,{containerRef:i,isMobileBreakpoint:f,chipItemRows:V,allGroups:w,isActive:y,onChipChange:B,selectedCounts:L,newlyDetectedMetrics:z,activeGroupIndex:M}),(0,v.jsx)(TabContent,{activeMetricItems:G,newlyDetectedMetrics:z,savedItemSlugs:t})]})}},12813:(e,t,i)=>{"use strict";i.d(t,{A:()=>u});var o=i(50539),a=i(88273),s=i(7972),n=i(97345),r=i(7144),l=i(80),c=i(22942),d=i(49481),g=i(32803);function u(){const e=(0,o.useSelect)(e=>e(s.n).getValue("keepKeyMetricsSetupCTAWidgetVisible")),t=(0,o.useSelect)(e=>{const t=e(n.oR).isItemDismissed(r.Uf),i=e(n.oR).isDismissingItem(r.Uf),o=m(e,g.Y,d.n),a=m(e,c.L1,l.K9);return!1===t&&!1===i&&o&&a},[]);return e||t}function m(e,t,i){if(e(a.i).isModuleConnected(t)){const{isGatheringData:t,isDataAvailableOnLoad:o}=e(i);return t(),o()}return!1}},12896:(e,t,i)=>{"use strict";i.d(t,{l:()=>a});var o=i(78174);function a(e,t,i){(0,o.A)(i=>e.includes(i.keyCode)&&t.current.contains(i.target),i)}},13047:(e,t,i)=>{"use strict";i.d(t,{tt:()=>y.tt,Jg:()=>y.Jg,Gp:()=>y.Gp,GH:()=>y.GH,r0:()=>y.r0,Du:()=>y.Du,Zf:()=>b,Cn:()=>k,G7:()=>I,vH:()=>h,N_:()=>y.N_,zh:()=>C,mK:()=>d.mK,Ql:()=>y.Ql,vY:()=>f,sq:()=>y.sq,VZ:()=>S.VZ,JK:()=>d.JK,IS:()=>y.IS,pH:()=>S.pH,kf:()=>v,O5:()=>y.O5,Qr:()=>y.Qr,x6:()=>T,K5:()=>d.K5,S_:()=>p,dc:()=>S.dc,Eo:()=>d.Eo,jq:()=>d.jq,DK:()=>_.D,N9:()=>j,p9:()=>s.p,XH:()=>y.XH,Zm:()=>l,sx:()=>a.sx,BI:()=>a.BI,CZ:()=>s.C,BG:()=>x});var o=i(17243),a=i(65054),s=i(50477),n=i(10523),r=i.n(n);function l(e){return r()(JSON.stringify(c(e)))}function c(e){const t={};return Object.keys(e).sort().forEach(i=>{let o=e[i];o&&"object"==typeof o&&!Array.isArray(o)&&(o=c(o)),t[i]=o}),t}var d=i(49746);function g(e){return e.replace(new RegExp("\\[([^\\]]+)\\]\\((https?://[^/]+\\.\\w+/?.*?)\\)","gi"),'$1')}function u(e){return`

${e.replace(/\n{2,}/g,"

")}

`}function m(e){return e.replace(/\n/gi,"
")}function p(e){const t=[g,u,m];let i=e;for(const e of t)i=e(i);return i}function h(e){return e=parseFloat(e),isNaN(e)||0===e?[0,0,0,0]:[Math.floor(e/60/60),Math.floor(e/60%60),Math.floor(e%60),Math.floor(1e3*e)-1e3*Math.floor(e)]}function I(e){const t=e&&!Number.isInteger(e)?new Date(e).getTime():e;return isNaN(t)||!t?0:t}var y=i(51193),A=i(78159),M=i(38017),N=i(62540);function f(e,t={}){if(Number.isNaN(Number(e)))return"";const{invertColor:i=!1}=t;return(0,A.Ay)((0,N.jsx)(M.A,{direction:e>0?"up":"down",invertColor:i}))}function k(e,t){return e>0&&t>0?e/t-1:e>0?1:t>0?-1:0}var S=i(48276);function T(e){const t=parseFloat(e)||0;return!!Number.isInteger(t)&&t>0}function v(e){if("number"==typeof e)return!0;const t=(e||"").toString();return!!t&&!isNaN(t)}function j(e){return Array.isArray(e)?[...e].sort():e}var _=i(11193);function b(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 o=(t-e)/e;return Number.isNaN(o)||!Number.isFinite(o)?null:o}function x(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}}function C(e){if(!e)return"";const t=e.replace(/&#(\d+);/g,(e,t)=>String.fromCharCode(t)).replace(/(\\)/g,"");return(0,o.unescape)(t)}},13113:(e,t,i)=>{"use strict";i.d(t,{A:()=>d,v:()=>c});var o=i(62688),a=i.n(o),s=i(4452),n=i.n(s),r=i(82871),l=i(62540);const c={DEFAULT:"default",OVERLAY:"overlay",SMALL:"small",SMALL_OVERLAY:"small-overlay",LARGE:"large"};function GatheringDataNotice({style:e}){return(0,l.jsx)("div",{className:n()("googlesitekit-gathering-data-notice",{[`googlesitekit-gathering-data-notice--has-style-${e}`]:!!e}),children:(0,l.jsx)("span",{children:(0,r.__)("Gathering data…","google-site-kit")})})}GatheringDataNotice.propTypes={style:a().oneOf(Object.values(c))};const d=GatheringDataNotice},13137:(e,t,i)=>{"use strict";i.d(t,{G:()=>c,HY:()=>g,SG:()=>d,db:()=>a,e4:()=>m,vl:()=>u});i(17243);var o=i(82871);const a="missing_required_scopes",s="insufficientPermissions",n="forbidden",r="internal_server_error",l="invalid_json";function c(e){return e?.code===a}function d(e){return[s,n].includes(e?.data?.reason)}function g(e){return!!e?.data?.reconnectURL}function u(e,t){return!(!t?.storeName||d(e)||c(e)||g(e))}function m(e){return e?.code===r?(0,o.__)("There was a critical error on this website while fetching data","google-site-kit"):e?.code===l?(0,o.__)("The server provided an invalid response","google-site-kit"):e?.message}},13620:e=>{"use strict";e.exports=googlesitekit.modules},14307:(e,t,i)=>{"use strict";i.d(t,{A:()=>AccessibleWarningIcon});var o=i(62688),a=i.n(o),s=i(63696),n=i(82871),r=i(55989),l=i(3170),c=i(62540);function AccessibleWarningIcon({height:e=12,screenReaderText:t=(0,n.__)("Error","google-site-kit"),width:i=14}){return(0,c.jsxs)(s.Fragment,{children:[(0,c.jsx)(r.A,{children:t}),(0,c.jsx)(l.A,{width:i,height:e})]})}AccessibleWarningIcon.propTypes={height:a().number,screenReaderText:a().string,width:a().number}},14578:(e,t,i)=>{"use strict";i.d(t,{A:()=>c});var o=i(62688),a=i.n(o),s=i(4452),n=i.n(s),r=i(4751),l=i(62540);function PreviewTable({rows:e,rowHeight:t,padding:i}){const o=[];for(let i=0;e>i;i++)o.push((0,l.jsx)("div",{className:"googlesitekit-preview-table__row",children:(0,l.jsx)(r.A,{width:"100%",height:t+"px"})},"table-row-"+i));return(0,l.jsx)("div",{className:n()("googlesitekit-preview-table",{"googlesitekit-preview-table--padding":i}),children:o})}PreviewTable.propTypes={rows:a().number,rowHeight:a().number,padding:a().bool},PreviewTable.defaultProps={rows:11,rowHeight:35,padding:!1};const c=PreviewTable},15345:(e,t,i)=>{"use strict";i.d(t,{A:()=>ConnectModuleCTATile});var o=i(62688),a=i.n(o),s=i(82871),n=i(63696),r=i(50539),l=i(88273),c=i(4169),d=i(69908),g=i(65929),u=i(4124),m=i(38432),p=i(4751),h=i(91013),I=i(62540);const y=(0,n.lazy)(()=>i.e(909).then(i.bind(i,4290)));function GhostCardGreenSVG(){return(0,I.jsx)(n.Suspense,{fallback:(0,I.jsx)(p.A,{width:"100%",height:"90px"}),children:(0,I.jsx)(h.A,{errorMessage:(0,s.__)("Failed to load graphic","google-site-kit"),children:(0,I.jsx)(y,{})})})}const A=(0,n.lazy)(()=>i.e(146).then(i.bind(i,6146)));function GhostCardRedSVG(){return(0,I.jsx)(n.Suspense,{fallback:(0,I.jsx)(p.A,{width:"100%",height:"90px"}),children:(0,I.jsx)(h.A,{errorMessage:(0,s.__)("Failed to load graphic","google-site-kit"),children:(0,I.jsx)(A,{})})})}var M=i(25064),N=i(50454);function ConnectModuleCTATile({moduleSlug:e}){const t=(0,u.A)(),i=(0,g.A)(e),o=(0,r.useSelect)(t=>t(l.i).getModule(e)),a=(0,r.useSelect)(t=>t(l.i).getModuleIcon(e)),p=(0,r.useSelect)(e=>e(c.aO).getWidgets(d.AREA_MAIN_DASHBOARD_KEY_METRICS_PRIMARY)||[]).filter(t=>t.modules.includes(e)),h=N.G[p[0]?.slug],y=p.length>1;return o?(0,I.jsxs)("div",{className:`googlesitekit-widget--connectModuleCTATile googlesitekit-km-widget-tile ${y&&" googlesitekit-km-widget-tile--combined"}`,children:[!y&&(0,I.jsx)(M.A,{title:h?.title,infoTooltip:h?.description,loading:!1}),(0,I.jsx)("div",{className:"googlesitekit-km-widget-tile__body",children:(0,I.jsxs)("div",{className:"googlesitekit-km-connect-module-cta-tile",children:[a&&(0,I.jsx)("div",{className:"googlesitekit-km-connect-module-cta-tile__icon",children:(0,I.jsx)(a,{width:"32",height:"32"})}),(0,I.jsxs)("div",{className:"googlesitekit-km-connect-module-cta-tile__content",children:[(0,I.jsx)("p",{className:"googlesitekit-km-connect-module-cta-tile__text",children:y?(0,s.sprintf)(/* translators: %s: module name */ /* translators: %s: module name */ (0,s.__)("%s is disconnected, some of your metrics can’t be displayed","google-site-kit"),o.name):(0,s.sprintf)(/* translators: %s: module name */ /* translators: %s: module name */ (0,s.__)("%s is disconnected, metric can’t be displayed","google-site-kit"),o.name)}),!t&&(0,I.jsx)(m.A,{onClick:i,secondary:!0,children:(0,s.sprintf)(/* translators: %s: module name */ /* translators: %s: module name */ (0,s.__)("Connect %s","google-site-kit"),o.name)})]})]})}),y&&(0,I.jsxs)(n.Fragment,{children:[(0,I.jsx)("div",{className:"googlesitekit-km-connect-module-cta-tile__ghost-card",children:(0,I.jsx)(GhostCardGreenSVG,{})}),(0,I.jsx)("div",{className:"googlesitekit-km-connect-module-cta-tile__ghost-card",children:(0,I.jsx)(GhostCardGreenSVG,{})}),(0,I.jsx)("div",{className:"googlesitekit-km-connect-module-cta-tile__ghost-card",children:(0,I.jsx)(GhostCardRedSVG,{})})]})]}):null}ConnectModuleCTATile.propTypes={moduleSlug:a().string.isRequired}},15650:(e,t,i)=>{"use strict";i.d(t,{kA:()=>SelectionPanelContent,gy:()=>SelectionPanelFooter,W4:()=>SelectionPanelHeader,y3:()=>SelectionPanelItem,DW:()=>SelectionPanelItems,Ay:()=>_});var o=i(4452),a=i.n(o),s=i(62688),n=i.n(s),r=i(4544),l=i.n(r),c=i(21795),d=i(78174),g=i(63696),u=i(19266),m=i(94656),p=i(62540);function SideSheet({className:e,children:t,isOpen:o,isLoading:s,onOpen:n=()=>{},closeSheet:r=()=>{},focusTrapOptions:h={}}){const I=(0,g.useRef)(),[y,A]=(0,g.useState)(0);return(0,g.useEffect)(()=>{o?(A(function(){const e=i.g.document?.getElementById("wpadminbar");if(!e)return 0;const{top:t,bottom:o,height:a}=e.getBoundingClientRect();return t<0||o<=0?0:a}()),n(),document.body.classList.add("googlesitekit-side-sheet-scroll-lock")):(A(0),document.body.classList.remove("googlesitekit-side-sheet-scroll-lock"))},[o,n]),(0,c.A)(I,function(e){e.target.closest?.(".googlesitekit-tooltip-popper")||r()}),(0,d.A)(e=>o&&u._f===e.keyCode,r),(0,p.jsxs)(m.A,{children:[(0,p.jsx)(l(),{active:!!o&&!s,focusTrapOptions:{fallbackFocus:"body",allowOutsideClick:function(e){return!!e.target.closest?.(".googlesitekit-tooltip-popper")},...h},children:(0,p.jsx)("section",{ref:I,className:a()("googlesitekit-side-sheet",e,{"googlesitekit-side-sheet--open":o}),role:"dialog","aria-modal":"true","aria-hidden":!o,tabIndex:"0",style:{"--googlesitekit-side-sheet-top":`${y}px`},children:t})}),o&&(0,p.jsx)("span",{className:"googlesitekit-side-sheet-overlay"})]})}function SelectionPanel({children:e,isOpen:t,isLoading:i,onOpen:o,closePanel:s,className:n}){const r=n?.split(/\s+/).map(e=>`.${e}`).join(""),l=r?`${r} .googlesitekit-selection-panel-item .googlesitekit-selection-box input`:".googlesitekit-selection-panel-item .googlesitekit-selection-box input";return(0,p.jsx)(SideSheet,{className:a()("googlesitekit-selection-panel",n),isOpen:t,isLoading:i,onOpen:o,closeSheet:s,focusTrapOptions:{initialFocus:l},children:e})}SideSheet.propTypes={className:n().string,children:n().node,isOpen:n().bool,isLoading:n().bool,onOpen:n().func,closeSheet:n().func,focusTrapOptions:n().object},SelectionPanel.propTypes={children:n().node,isOpen:n().bool,isLoading:n().bool,onOpen:n().func,closePanel:n().func,className:n().string};var h=i(38432),I=i(72545),y=i(33052);function SelectionPanelHeader({children:e,title:t,onCloseClick:i}){return(0,p.jsxs)("header",{className:"googlesitekit-selection-panel-header",children:[(0,p.jsxs)("div",{className:"googlesitekit-selection-panel-header__row",children:[(0,p.jsx)(y.A,{as:"h3",size:"small",type:"headline",children:t}),(0,p.jsx)(h.A,{className:"googlesitekit-selection-panel-header__close",onClick:i,linkButton:!0,children:(0,p.jsx)(I.A,{width:"15",height:"15"})})]}),e]})}SelectionPanelHeader.propTypes={children:n().node,title:n().string,onCloseClick:n().func};var A=i(82871),M=i(49383);function SelectionBox({badge:e,checked:t,children:i,disabled:o,id:s,onChange:n,title:r,value:l}){return(0,p.jsx)("div",{className:a()("googlesitekit-selection-box",{"googlesitekit-selection-box--disabled":o}),children:(0,p.jsx)(M.Checkbox,{checked:t,description:i,disabled:o,id:s,name:s,onChange:n,value:l,badge:e,children:r})})}SelectionBox.propTypes={badge:n().node,checked:n().bool,children:n().node,disabled:n().bool,id:n().string,onChange:n().func,title:n().string,value:n().string};var N=i(5855);function SelectionPanelItem({children:e,id:t,slug:i,title:o,description:a,isItemSelected:s,isItemDisabled:n,onCheckboxChange:r,subtitle:l,suffix:c,badge:d,isNewlyDetected:g}){return(0,p.jsxs)("div",{className:"googlesitekit-selection-panel-item",children:[(0,p.jsxs)(SelectionBox,{badge:d,checked:s,disabled:n,id:t,onChange:r,title:o,value:i,children:[l&&(0,p.jsx)("span",{className:"googlesitekit-selection-panel-item__subtitle",children:l}),a,e]}),g&&(0,p.jsx)(N.A,{label:(0,A.__)("New","google-site-kit")}),c&&(0,p.jsx)("span",{className:"googlesitekit-selection-panel-item__suffix",children:c})]})}function SelectionPanelItems({currentSelectionTitle:e=(0,A.__)("Current selection","google-site-kit"),availableItemsTitle:t=(0,A.__)("Additional items","google-site-kit"),savedItemSlugs:i=[],availableSavedItems:o={},availableUnsavedItems:a={},ItemComponent:s,notice:n}){function r(e){return Object.keys(e).map(t=>(0,p.jsx)(s,{slug:t,savedItemSlugs:i,...e[t]},t))}const l=Object.keys(a).length;return(0,p.jsxs)("div",{className:"googlesitekit-selection-panel-items",children:[0!==i.length&&(0,p.jsxs)(g.Fragment,{children:[(0,p.jsx)("p",{className:"googlesitekit-selection-panel-items__subheading",children:e}),(0,p.jsx)("div",{className:"googlesitekit-selection-panel-items__subsection",children:r(o)}),l>0&&(0,p.jsx)("p",{className:"googlesitekit-selection-panel-items__subheading",children:t})]}),l>0&&(0,p.jsx)("div",{className:"googlesitekit-selection-panel-items__subsection",children:r(a)}),n]})}SelectionPanelItem.propTypes={children:n().node,id:n().string,slug:n().string,title:n().string,description:n().string,isItemSelected:n().bool,isItemDisabled:n().bool,onCheckboxChange:n().func,subtitle:n().string,suffix:n().node,badge:n().node,isNewlyDetected:n().bool},SelectionPanelItems.propTypes={currentSelectionTitle:n().string,availableItemsTitle:n().string,savedItemSlugs:n().array,availableSavedItems:n().object,availableUnsavedItems:n().object,ItemComponent:n().elementType,notice:n().node};var f=i(17243),k=i(13606),S=i(50539),T=i(13047),v=i(80),j=i(4751);function SelectionPanelFooter({savedItemSlugs:e=[],selectedItemSlugs:t=[],saveSettings:i=()=>{},minSelectedItemCount:o=0,maxSelectedItemCount:a=0,isBusy:s,onSaveSuccess:n=()=>{},onCancel:r=()=>{},isOpen:l,closePanel:c=()=>{}}){const[d,u]=(0,g.useState)(null),[m,h]=(0,g.useState)(!1),I=(0,S.useSelect)(e=>e(v.K9).isFetchingSyncAvailableAudiences()),y=(0,g.useMemo)(()=>!(0,f.isEqual)((0,T.N9)(t),(0,T.N9)(e)),[e,t]),N=e?.length>0&&y?(0,A.__)("Apply changes","google-site-kit"):(0,A.__)("Save selection","google-site-kit"),_=(0,g.useCallback)(async()=>{const{error:e}=await i(t);e||(n(),c(),u(N),h(!0))},[i,t,n,c,N]),b=(0,g.useCallback)(()=>{c(),r()},[c,r]),[x,C]=(0,g.useState)(null);(0,g.useEffect)(()=>{null!==x&&x!==l&&l&&(u(null),h(!1)),C(l)},[l,x]);const D=t?.length||0,E=I?(0,p.jsx)(j.A,{width:"89px",height:"20px"}):(0,p.jsx)("p",{className:"googlesitekit-selection-panel-footer__item-count",children:(0,k.A)((0,A.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,A.__)("%1$d selected (up to %2$d)","google-site-kit"),D,a),{MaxCount:(0,p.jsx)("span",{className:"googlesitekit-selection-panel-footer__item-count--max-count"})})});return(0,p.jsx)("footer",{className:"googlesitekit-selection-panel-footer",children:(0,p.jsxs)("div",{className:"googlesitekit-selection-panel-footer__content",children:[E,(0,p.jsxs)("div",{className:"googlesitekit-selection-panel-footer__actions",children:[(0,p.jsx)(M.Button,{onClick:b,disabled:s,tertiary:!0,children:(0,A.__)("Cancel","google-site-kit")}),(0,p.jsx)(M.SpinnerButton,{onClick:_,isSaving:s,disabled:Da||s||!l&&m,children:d||N})]})]})})}function SelectionPanelContent({children:e,className:t}){return(0,p.jsx)("div",{className:a()("googlesitekit-selection-panel__content",t),children:e})}SelectionPanelFooter.propTypes={savedItemSlugs:n().array,selectedItemSlugs:n().array,saveSettings:n().func,minSelectedItemCount:n().number,maxSelectedItemCount:n().number,isBusy:n().bool,onSaveSuccess:n().func,onCancel:n().func,isOpen:n().bool,closePanel:n().func},SelectionPanelContent.propTypes={children:n().node,className:n().string};const _=SelectionPanel},17443:(e,t,i)=>{"use strict";i.d(t,{r:()=>AdminScreenTooltip,i:()=>o.i});var o=i(52274),a=i(63696),s=i(50539),n=i(62688),r=i(36703),l=i(40960),c=i(83202),d=i(94656),g=i(71264),u=i(97513),m=i(62540);function JoyrideTooltip(e){const{title:t,content:o,dismissLabel:s,disableOverlay:n=!0,target:p,cta:h=!1,className:I,styles:y={},slug:A="",placement:M="auto",onDismiss:N=()=>{},onView:f=()=>{},onTourStart:k=()=>{},onTourEnd:S=()=>{}}=e;function T(){return!!i.g.document.querySelector(p)}const[v,j]=(0,a.useState)(T),_=(0,u.dv)(),b=_===u.mp||_===u.Lg,[x,C]=(0,a.useState)(!0),D=(0,a.useRef)(b);if((0,l.A)(()=>{T()&&j(!0)},v?null:250),(0,a.useEffect)(()=>{let e=()=>{};if("function"==typeof i.g.ResizeObserver){const t=i.g.document.querySelector(p);if(t){const o=new ResizeObserver(()=>{i.g.dispatchEvent(new Event("resize"))});o.observe(t),e=()=>o.disconnect()}}return e},[p,v]),(0,a.useEffect)(()=>{let e;return D.current!==b&&(C(!1),e=setTimeout(()=>{C(!0)},50),D.current=b),()=>{e&&clearTimeout(e)}},[b]),!v)return null;const E=[{title:t,target:p,content:o,disableBeacon:!0,isFixed:!0,placement:M,cta:h,className:I}],w={close:s,last:s};return(0,m.jsx)(d.A,{slug:A,children:(0,m.jsx)(r.Ay,{callback:function({type:e}){switch(e){case r.qY.TOUR_START:k(),i.g.document.body.classList.add("googlesitekit-showing-tooltip");break;case r.qY.TOUR_END:S(),i.g.document.body.classList.remove("googlesitekit-showing-tooltip");break;case r.qY.STEP_AFTER:N();break;case r.qY.TOOLTIP:f()}},disableOverlay:n,spotlightPadding:0,floaterProps:g.ei,locale:w,steps:E,styles:{...g.R0,...y,options:{...g.R0.options,...y?.options},spotlight:{...g.R0.spotlight,...y?.spotlight}},tooltipComponent:c.A,run:x,disableScrolling:!0})})}JoyrideTooltip.propTypes={title:n.PropTypes.node,content:n.PropTypes.string,disableOverlay:n.PropTypes.bool,dismissLabel:n.PropTypes.string,target:n.PropTypes.string.isRequired,onDismiss:n.PropTypes.func,onShow:n.PropTypes.func,className:n.PropTypes.string,styles:n.PropTypes.object,slug:n.PropTypes.string,placement:n.PropTypes.string,onView:n.PropTypes.func};var p=i(7972),h=i(13047),I=i(62659);function AdminScreenTooltip(){const e=(0,I.A)(),{setValue:t}=(0,s.useDispatch)(p.n),i=(0,u.dv)(),{isTooltipVisible:o=!1,target:n,placement:r,className:l,tooltipSlug:c,title:d,content:g,dismissLabel:y,gaTrackingEventLabel:A}=(0,s.useSelect)(e=>e(p.n).getValue("admin-screen-tooltip")||{isTooltipVisible:!1});const M=(0,a.useCallback)(()=>{c&&(0,h.sx)(`${e}_${c}`,"tooltip_dismiss",A),t("admin-screen-tooltip",void 0)},[t,c,e,A]);if(!o)return null;const N=i===u.mp||i===u.Lg,f=null!=n?n:'#adminmenu [href*="page=googlesitekit-settings"]',k=null!=r?r:"right";return(0,m.jsx)(JoyrideTooltip,{target:N?"body":f,placement:N?"center":k,className:N?"googlesitekit-tour-tooltip__modal_step":l||(n?void 0:"googlesitekit-tour-tooltip__fixed-settings-tooltip"),disableOverlay:!N,slug:"admin-screen-tooltip",title:d,content:g,dismissLabel:y,onView:function(){(0,h.sx)(`${e}_${c}`,"tooltip_view",A)},onDismiss:M})}},18418:(e,t,i)=>{"use strict";i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o,a=i(63696);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 2 12"},e),o||(o=a.createElement("g",{fill:"currentColor",fillRule:"evenodd"},a.createElement("path",{d:"M0 0h2v7H0zM0 10h2v2H0z"}))))},19793:(e,t,i)=>{"use strict";i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o,a=i(63696);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),o||(o=a.createElement("path",{fill:"currentColor",fillRule:"evenodd",d:"M12 1C5.925 1 1 5.925 1 12s4.925 11 11 11 11-4.925 11-11S18.075 1 12 1m4.806 8.592.592-.806-1.612-1.184-.592.806-3.89 5.296c-.166.226-.36.296-.512.296s-.346-.07-.512-.296l-1.474-2.007-.592-.806-1.612 1.184.592.806 1.474 2.007C9.191 15.6 9.971 16 10.792 16s1.6-.4 2.124-1.112z",clipRule:"evenodd"})))},19826:(e,t,i)=>{"use strict";i.d(t,{Ay:()=>n,Kq:()=>s});const o=(0,i(63696).createContext)(""),{Consumer:a,Provider:s}=o,n=o},20697:(e,t,i)=>{"use strict";i.d(t,{Ax:()=>s,CZ:()=>d,Ej:()=>S,Gw:()=>T,Is:()=>n,KK:()=>u,Nn:()=>j,OT:()=>f,SH:()=>N,Y$:()=>m,ZS:()=>r,bg:()=>I,en:()=>k,ep:()=>h,f7:()=>a,hi:()=>p,jU:()=>o,k$:()=>A,kz:()=>v,ly:()=>l,mo:()=>y,s3:()=>M,uR:()=>c,zx:()=>g});const o="mainDashboard",a="entityDashboard",s="mainDashboardViewOnly",n="entityDashboardViewOnly",r="userInput",l="activation",c="splash",d="adminBar",g="adminBarViewOnly",u="settings",m="adBlockingRecovery",p="wpDashboard",h="wpDashboardViewOnly",I="moduleSetup",y="metricSelection",A="wpBlockEditor",M="keyMetricsSetup",N="key-metrics",f="traffic",k="content",S="speed",T="monetization",v=[o,a,s,n,r,c,u,I,y],j=[s,n,g,h]},21018:(e,t,i)=>{"use strict";i.d(t,{A:()=>MetricTileText});var o=i(62688),a=i.n(o),s=i(74655),n=i(13047),r=i(95806),l=i(62540);function MetricTileText({metricValue:e,metricValueFormat:t,subText:i,previousValue:o,currentValue:a,...c}){const d=(0,n.mK)(t);return(0,l.jsxs)(r.A,{className:"googlesitekit-km-widget-tile--text",...c,children:[(0,l.jsxs)("div",{className:"googlesitekit-km-widget-tile__metric-container",children:[(0,l.jsx)("div",{className:"googlesitekit-km-widget-tile__metric",children:e}),(0,l.jsx)("p",{className:"googlesitekit-km-widget-tile__subtext",children:i})]}),(0,l.jsx)("div",{className:"googlesitekit-km-widget-tile__metric-change-container",children:(0,l.jsx)(s.A,{previousValue:o,currentValue:a,isAbsolute:"percent"===d?.style})})]})}MetricTileText.propTypes={metricValue:a().oneOfType([a().string,a().number]),subtext:a().string,previousValue:a().number,currentValue:a().number}},21492:(e,t,i)=>{"use strict";i.d(t,{A:()=>StepHint});var o=i(62688),a=i.n(o),s=i(82267),n=i(62540);function StepHint({leadingText:e,tooltipText:t}){return(0,n.jsxs)("div",{className:"googlesitekit-setup__step-hint",children:[(0,n.jsx)("p",{children:e}),(0,n.jsx)(s.A,{tooltipClassName:"googlesitekit-setup__step-hint-tooltip",title:t})]})}StepHint.propTypes={leadingText:a().oneOfType([a().string,a().element]).isRequired,tooltipText:a().oneOfType([a().string,a().element]).isRequired}},22942:(e,t,i)=>{"use strict";i.d(t,{A_:()=>d,DF:()=>u,L1:()=>m,M0:()=>n,Mc:()=>r,Ok:()=>c,U9:()=>l,iW:()=>s,ue:()=>a,wq:()=>o,xR:()=>g});const o=1,a=2,s=3,n="enhanced-measurement-activation-banner-tooltip-state",r="enhanced-measurement-activation-banner-dismissed-item",l="_r.explorerCard..selmet",c="_r.explorerCard..seldim",d="_r..dataFilters",g="_r..nav",u="key-metrics-connect-ga4-cta-widget",m="analytics-4"},23955:(e,t,i)=>{"use strict";i.d(t,{A:()=>AdBlockerWarning});var o,a=i(62688),s=i.n(a),n=i(50539),r=i(29785),l=i(88273),c=i(4452),d=i.n(c),g=i(82871),u=i(13606),m=i(38432),p=i(63696);function h(){return h=Object.assign?Object.assign.bind():function(e){for(var t=1;tp.createElement("svg",h({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 13 14"},e),o||(o=p.createElement("path",{stroke:"currentColor",strokeWidth:1.5,d:"M4.5 1.5H3a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h7a2 2 0 0 0 2-2V9M7 1.5h5v5M5 8.5 11.5 2"})));var y=i(25797),A=i(62540);function AdBlockerWarningMessage({className:e,getHelpLink:t="",warningMessage:i=null}){return i?(0,A.jsx)(y.A,{className:d()("googlesitekit-notice--small",e),type:y.A.TYPES.WARNING,description:(0,u.A)((0,g.sprintf)(/* translators: 1: The warning message. 2: "Get help" text. */ /* translators: 1: The warning message. 2: "Get help" text. */ (0,g.__)("%1$s. %2$s","google-site-kit"),i,(0,g.__)("Get help","google-site-kit")),{Link:(0,A.jsx)(m.A,{href:t,trailingIcon:(0,A.jsx)(I,{width:15,height:15}),external:!0,hideExternalIndicator:!0}),Strong:(0,A.jsx)("strong",{})}),hideIcon:!0}):null}function AdBlockerWarning({moduleSlug:e,className:t}){const i=(0,n.useSelect)(t=>t(l.i).getModuleStoreName(e)),o=(0,n.useSelect)(e=>e(i)?.getAdBlockerWarningMessage()),a=(0,n.useSelect)(t=>t(r.O4).getDocumentationLinkURL(`${e}-ad-blocker-detected`));return(0,A.jsx)(AdBlockerWarningMessage,{className:t,getHelpLink:a,warningMessage:o})}AdBlockerWarningMessage.propTypes={className:s().string,getHelpLink:s().string,warningMessage:s().string},AdBlockerWarning.propTypes={className:s().string,moduleSlug:s().string.isRequired}},24355:(e,t,i)=>{"use strict";i.d(t,{SO:()=>l,xJ:()=>r});var o=i(55620),a=i(99123);function s(){return[i.g.innerWidth,i.g.innerHeight]}function n({fps:e=60,leading:t=!1,initialWidth:i=0,initialHeight:n=0}={}){const[r,l]=(0,o._)("undefined"==typeof document?[i,n]:s,e,t);function c(){return l(s)}return(0,a.A)(window,"resize",c),(0,a.A)(window,"orientationchange",c),r}function r(e={}){return n(e)[1]}function l(e={}){return n(e)[0]}},24560:(e,t,i)=>{"use strict";i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var o,a=i(63696);function s(){return s=Object.assign?Object.assign.bind():function(e){for(var t=1;ta.createElement("svg",s({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 16 12"},e),o||(o=a.createElement("g",{fill:"currentColor",fillRule:"evenodd"},a.createElement("path",{d:"M0 6.414 1.415 5l5.292 5.292-1.414 1.415z"}),a.createElement("path",{d:"m14.146.146 1.415 1.414L5.414 11.707 4 10.292z"}))))},25064:(e,t,i)=>{"use strict";i.d(t,{A:()=>MetricTileHeader});var o=i(62688),a=i.n(o),s=i(82267),n=i(55989),r=i(33052),l=i(62540);function MetricTileHeader({title:e,infoTooltip:t,loading:i}){return(0,l.jsxs)("div",{className:"googlesitekit-km-widget-tile__title-container",children:[(0,l.jsx)(r.A,{as:"h3",size:"small",type:"label",className:"googlesitekit-km-widget-tile__title",children:e}),i?(0,l.jsx)(n.A,{children:(0,l.jsx)(s.A,{title:t})}):(0,l.jsx)(s.A,{title:t})]})}MetricTileHeader.propTypes={title:a().string,infoTooltip:a().oneOfType([a().string,a().element]),loading:a().bool}},25427:(e,t,i)=>{"use strict";i.d(t,{G4:()=>c,Ig:()=>s,Q3:()=>l,a2:()=>n,wA:()=>r});var o=i(17243),a=i(73730);function s(e){function t(e){return"string"==typeof e&&/^[a-zA-Z0-9_]+$/.test(e)}if("string"==typeof e){return e.split(",").every(t)}return(0,a.cX)(e,e=>{const i=e.hasOwnProperty("name")&&t(e.name);if(!e.hasOwnProperty("expression"))return i;const o="string"==typeof e.expression;return i&&o},t)}function n(e){return(0,a.cX)(e,e=>e.hasOwnProperty("name")&&"string"==typeof e.name)}function r(e){const t=["string"];return Object.keys(e).every(i=>{if(t.includes(typeof e[i]))return!0;if(Array.isArray(e[i]))return e[i].every(e=>t.includes(typeof e));if((0,o.isPlainObject)(e[i])){const t=Object.keys(e[i]);return!!t.includes("filterType")&&!("emptyFilter"!==e[i].filterType&&!t.includes("value"))}return!1})}function l(e){const t=["string"],i=["numericFilter","betweenFilter"];return Object.values(e).every(e=>{if(t.includes(typeof e))return!0;if(Array.isArray(e))return e.every(e=>t.includes(typeof e));if(!(0,o.isPlainObject)(e))return!1;const{filterType:a,value:s,fromValue:n,toValue:r}=e;if(a&&!i.includes(a))return!1;const l=Object.keys(e);return a&&"numericFilter"!==a?"betweenFilter"===a&&(l.includes("fromValue")&&l.includes("toValue")&&[n,r].every(e=>!(0,o.isPlainObject)(e)||"int64Value"in e)):l.includes("operation")&&l.includes("value")&&(!(0,o.isPlainObject)(s)||"int64Value"in s)})}function c(e){return!!Array.isArray(e)&&e.every(e=>!!(0,o.isPlainObject)(e)&&((!e.hasOwnProperty("desc")||"boolean"==typeof e.desc)&&(e.metric?!e.dimension&&"string"==typeof e.metric?.metricName:!!e.dimension&&"string"==typeof e.dimension?.dimensionName)))}},25797:(e,t,i)=>{"use strict";i.d(t,{A:()=>M});var o,a=i(62688),s=i.n(a),n=i(4452),r=i.n(n),l=i(63696),c=i(19793);function d(){return d=Object.assign?Object.assign.bind():function(e){for(var t=1;tl.createElement("svg",d({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24"},e),o||(o=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 g=i(42343),u=i(76984),m=i(62540);const p={[u.Q.NEW]:g.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=p[e]||warning_notice;return(0,m.jsx)(t,{width:24,height:24})}function Title({className:e,children:t}){return(0,m.jsx)("p",{className:r()("googlesitekit-notice__title",e),children:t})}function Description({className:e,children:t}){return(0,m.jsx)("p",{className:r()("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),I=i(83366);function CTAButton({label:e,disabled:t,inProgress:i,onClick:o,href:a,external:s=!1,hideExternalIndicator:n=!1}){let l;return s&&!n&&(l=(0,m.jsx)(I.A,{width:14,height:14})),(0,m.jsx)(h.SpinnerButton,{className:r()("googlesitekit-notice__cta",{"googlesitekit-notice__cta--spinner__running":i}),disabled:t,isSaving:i,onClick:o,href:a,target:s?"_blank":void 0,trailingIcon:l,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 y=i(82871);function DismissButton({label:e=(0,y.__)("Got it","google-site-kit"),onClick:t,disabled:i,href:o,external:a=!1}){return(0,m.jsx)(h.Button,{onClick:t,disabled:i,href:o,target:a?"_blank":void 0,tertiary:!0,children:e})}DismissButton.propTypes={label:s().string,onClick:s().func.isRequired,disabled:s().bool,href:s().string,external:s().bool};const A=(0,l.forwardRef)(({className:e,title:t,description:i,dismissButton:o,ctaButton:a,type:s=u.Q.INFO,children:n,hideIcon:l},c)=>(0,m.jsx)("div",{className:"googlesitekit-notice-container",ref:c,children:(0,m.jsxs)("div",{className:r()("googlesitekit-notice",`googlesitekit-notice--${s}`,e),role:"status",children:[!l&&(0,m.jsx)("div",{className:"googlesitekit-notice__icon",children:(0,m.jsx)(Icon,{type:s})}),(0,m.jsxs)("div",{className:"googlesitekit-notice__content",children:[t&&(0,m.jsx)(Title,{children:t}),i&&(0,m.jsx)(Description,{children:i})]}),(o?.label||o?.onClick||a?.label&&(a?.onClick||a?.href)||n)&&(0,m.jsxs)("div",{className:"googlesitekit-notice__action",children:[n,(o?.label||o?.onClick)&&(0,m.jsx)(DismissButton,{label:o.label,onClick:o.onClick,disabled:o.disabled,href:o.href,external:o.external}),a?.label&&(a?.onClick||a?.href)&&(0,m.jsx)(CTAButton,{label:a.label,onClick:a.onClick,inProgress:a.inProgress,disabled:a.disabled,href:a.href,external:a.external,hideExternalIndicator:a.hideExternalIndicator})]})]})}));A.TYPES=u.Q,A.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 M=A},25850:(e,t,i)=>{"use strict";i.d(t,{A:()=>EnhancedMeasurementSwitch});var o=i(4452),a=i.n(o),s=i(62688),n=i.n(s),r=i(15844),l=i(63696),c=i(13606),d=i(82871),g=i(50539),u=i(49383),m=i(11999),p=i(80),h=i(55103),I=i(13047),y=i(62659),A=i(63972),M=i(68832),N=i(62540);function EnhancedMeasurementSwitch({className:e,onClick:t,disabled:i=!1,loading:o=!1,formName:s=p.TQ,isEnhancedMeasurementAlreadyEnabled:n=!1,showTick:f=!1}){const k=(0,M.A)(s,p.aj),S=(0,y.A)(),{setValues:T}=(0,g.useDispatch)(m.s),v=(0,l.useCallback)(()=>{T(s,{[p.aj]:!k}),(0,I.sx)(`${S}_analytics`,k?"deactivate_enhanced_measurement":"activate_enhanced_measurement"),t?.()},[s,k,t,T,S]);return(0,r.A)(()=>{T(p.TQ,{[p.Lf]:!0})}),(0,N.jsxs)("div",{className:a()("googlesitekit-analytics-enable-enhanced-measurement",e,{"googlesitekit-analytics-enable-enhanced-measurement--loading":o}),children:[o&&(0,N.jsx)(u.ProgressBar,{className:"googlesitekit-analytics-enable-enhanced-measurement__progress--settings-edit",small:!0}),!o&&n&&(0,N.jsxs)("div",{className:"googlesitekit-analytics-enable-enhanced-measurement__already-enabled-label",children:[f&&(0,N.jsx)("div",{className:"googlesitekit-analytics-enable-enhanced-measurement__already-enabled-tick",children:(0,N.jsx)(A.A,{})}),(0,d.__)("Enhanced measurement is enabled for this web data stream","google-site-kit")]}),!o&&!n&&(0,N.jsx)(u.Switch,{label:(0,d.__)("Enable enhanced measurement","google-site-kit"),checked:k,disabled:i,onClick:v,hideLabel:!1}),(0,N.jsx)("p",{className:"googlesitekit-module-settings-group__helper-text",children:(0,c.A)((0,d.__)("This allows you to measure interactions with your content (e.g. file downloads, form completions, video views). Learn more","google-site-kit"),{a:(0,N.jsx)(h.A,{path:"/analytics/answer/9216061",external:!0})})})]})}EnhancedMeasurementSwitch.propTypes={onClick:n().func,disabled:n().bool,loading:n().bool,isEnhancedMeasurementAlreadyEnabled:n().bool,showTick:n().bool}},27885:(e,t,i)=>{"use strict";var o=i(50539),a=i.n(o),s=i(13620),n=i.n(s),r=i(88176),l=i.n(r),c=i(46935),d=i.n(c),g=i(82871),u=i(99162),m=i(63696),p=i(13606),h=i(55103),I=i(70301),y=i(29785),A=i(85097),M=i(62659),N=i(13047),f=i(35952),k=i(17243);function S(e,t){if(void 0===e)return;const{rows:i,totals:o}=e||{};return!i?.length||(!o?.cells?.length||0===+o.cells[t]?.value)}var T=i(5704),v=i(4452),j=i.n(v);function _({year:e=0,month:t=1,day:i=0}={}){return new Date(e,t-1,i)}var b=i(68728),x=i(9577),C=i(21620);function D(e){const t=new URL(e),{domain:i}=(0,C.qg)(t.hostname);return i}var E=i(89065),w=i(25797),Z=i(62540);function AdBlockingRecoverySetupCTANotice(){const e=(0,A.W)(),t=(0,M.A)(),i=(0,o.useSelect)(e=>e(f.wl).getAdBlockingRecoverySetupStatus()),a=(0,o.useSelect)(e=>e(f.wl).getAccountStatus()),s=(0,o.useSelect)(e=>e(f.wl).getSiteStatus()),n=(0,o.useSelect)(e=>e(f.wl).hasExistingAdBlockingRecoveryTag()),r=(0,o.useSelect)(e=>e(y.O4).getAdminURL("googlesitekit-ad-blocking-recovery")),l=(0,o.useSelect)(e=>e(I.M).isNavigatingTo(r)),{navigateTo:c}=(0,o.useDispatch)(I.M),d=void 0===n||n||""!==i||a!==b.pJ||s!==b.TF;return(0,m.useEffect)(()=>{e&&!d&&(0,N.sx)(`${t}_adsense-abr-cta-widget`,"view_notification")},[e,d,t]),d?null:(0,Z.jsx)(w.A,{type:w.A.TYPES.INFO,title:(0,g.__)("Ad blocking recovery","google-site-kit"),description:(0,p.A)((0,g.__)("Start recovering revenue lost from ad blockers by deploying an ad blocking recovery message through Site Kit. Learn more","google-site-kit"),{a:(0,Z.jsx)(h.A,{path:"/adsense/answer/11576589",onClick:function(){(0,N.sx)(`${t}_adsense-abr-cta-widget`,"click_learn_more_link")},external:!0})}),ctaButton:{label:(0,g.__)("Set up now","google-site-kit"),onClick:async function(){return await(0,N.sx)(`${t}_adsense-abr-cta-widget`,"confirm_notification"),c(r)},isSaving:l,disabled:l},children:(0,Z.jsx)(E.A,{triggerID:"view_abr_setup_cta",ttl:N.tt})})}var R=i(15844),L=i(49383),G=i(38432),z=i(83880),O=i(11999),P=i(68832);function AdBlockingRecoveryToggle(){const e=(0,M.A)(),t=(0,o.useSelect)(e=>e(f.wl).getUseAdBlockingRecoverySnippet()),i=(0,o.useSelect)(e=>e(f.wl).getUseAdBlockingRecoveryErrorSnippet()),a=(0,o.useSelect)(e=>e(f.wl).getAdBlockingRecoverySetupStatus()),s=(0,o.useSelect)(e=>e(f.wl).getExistingAdBlockingRecoveryTag()),n=(0,o.useSelect)(e=>e(f.wl).getAccountID()),r=(0,o.useSelect)(e=>e(f.wl).getServiceURL({path:`/${n}/privacymessaging/ad_blocking`})),l=(0,o.useSelect)(e=>e(y.O4).getDocumentationLinkURL("ad-blocking-recovery")),c=(0,P.A)(f.RR,"adBlockingRecoveryToggle"),d=(0,P.A)(f.RR,"adBlockingRecoveryErrorToggle"),{setValues:u}=(0,o.useDispatch)(O.s),{setUseAdBlockingRecoverySnippet:m,setUseAdBlockingRecoveryErrorSnippet:h}=(0,o.useDispatch)(f.wl);let I;return(0,R.A)(()=>{const e={adBlockingRecoveryToggle:t,adBlockingRecoveryErrorToggle:i};u(f.RR,e)}),s&&s===n?I=(0,g.__)("You’ve already enabled an ad blocking recovery message on your site. We recommend using Site Kit to manage this to get the most out of AdSense.","google-site-kit"):s&&(I=(0,g.sprintf)(/* translators: %s: account ID */ /* translators: %s: account ID */ (0,g.__)("Site Kit detected Ad Blocking Recovery code for a different account %s on your site. For a better ad blocking recovery experience, you should remove Ad Blocking Recovery code that’s not linked to this AdSense account.","google-site-kit"),(0,T.v)(s))),a?(0,Z.jsxs)("fieldset",{className:"googlesitekit-settings-module__ad-blocking-recovery-toggles",children:[(0,Z.jsx)("legend",{className:"googlesitekit-setup-module__text",children:(0,g.__)("Ad blocking recovery","google-site-kit")}),(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-items",children:[(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(L.Switch,{label:(0,g.__)("Enable ad blocking recovery message","google-site-kit"),checked:c,onClick:function(){const t=!c;u(f.RR,{adBlockingRecoveryToggle:t}),m(t),(0,N.sx)(`${e}_adsense-abr`,t?"enable_tag":"disable_tag","abr_tag")},hideLabel:!1}),(0,Z.jsx)(z.A,{children:(0,p.A)((0,g.__)("Identify site visitors that have an ad blocker browser extension installed. These site visitors will see the ad blocking recovery message created in AdSense. Configure your message","google-site-kit"),{a:(0,Z.jsx)(G.A,{href:r,external:!0})})})]}),(c||t)&&(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(L.Switch,{label:(0,g.__)("Place error protection code","google-site-kit"),checked:d,onClick:function(){const t=!d;u(f.RR,{adBlockingRecoveryErrorToggle:t}),h(t),(0,N.sx)(`${e}_adsense-abr`,t?"enable_tag":"disable_tag","error_protection_tag")},hideLabel:!1}),(0,Z.jsx)(z.A,{children:(0,p.A)((0,g.__)("If a site visitor’s ad blocker browser extension blocks the message you create in AdSense, a default, non-customizable ad blocking recovery message will display instead. Learn more","google-site-kit"),{a:(0,Z.jsx)(G.A,{href:l,external:!0})})})]})]}),s&&(0,Z.jsx)(w.A,{type:w.A.TYPES.INFO,description:I})]}):null}var B=i(58240),U=i(10626);function SettingsForm(){const e=(0,o.useSelect)(e=>e(y.O4).isWebStoriesActive()),t=(0,o.useSelect)(e=>e(f.wl).getClientID()),i=(0,o.useSelect)(e=>e(f.wl).getExistingTag()),a=(0,o.useSelect)(e=>e(f.wl).hasFinishedResolution("getExistingTag"));(0,o.useSelect)(e=>e(f.wl).getExistingAdBlockingRecoveryTag());const s=(0,o.useSelect)(e=>e(f.wl).hasFinishedResolution("getExistingAdBlockingRecoveryTag"));if(!a||!s)return(0,Z.jsx)(L.ProgressBar,{});let n,r;i&&i===t?(n=(0,g.__)("You’ve already got an AdSense code on your site for this account, we recommend you use Site Kit to place code to get the most out of AdSense","google-site-kit"),r=n):i?(n=(0,g.sprintf)(/* translators: %s: account ID */ /* translators: %s: account ID */ (0,g.__)("Site Kit detected AdSense code for a different account %s on your site. For a better ads experience, you should remove AdSense code that’s not linked to this AdSense account.","google-site-kit"),(0,T.c)(i)),r=(0,g.__)("Please note that AdSense will not show ads on your website unless you’ve already placed the code","google-site-kit")):r=(0,g.__)("Please note that AdSense will not show ads on your website unless you’ve already placed the code","google-site-kit");return(0,Z.jsxs)("div",{className:"googlesitekit-adsense-settings-fields",children:[(0,Z.jsx)(B.kg,{}),(0,Z.jsx)(B.TZ,{checkedMessage:n,uncheckedMessage:r}),e&&(0,Z.jsxs)(m.Fragment,{children:[(0,Z.jsx)(U.A,{}),(0,Z.jsx)(z.A,{children:(0,p.A)((0,g.__)("This ad unit will be used for your Web Stories. ","google-site-kit"),{LearnMoreLink:(0,Z.jsx)(G.A,{href:"https://support.google.com/adsense/answer/10175505#create-an-ad-unit-for-web-stories","aria-label":(0,g.__)("Learn more about Ad Sense Web Stories.","google-site-kit"),external:!0,children:(0,g.__)("Learn more","google-site-kit")})})})]}),(0,Z.jsx)(B.Ve,{}),(0,Z.jsx)(AdBlockingRecoverySetupCTANotice,{}),(0,Z.jsx)(AdBlockingRecoveryToggle,{})]})}function SettingsEdit(){let e;return e=(0,o.useSelect)(e=>e(f.wl).isDoingSubmitChanges())?(0,Z.jsx)(L.ProgressBar,{}):(0,Z.jsx)(SettingsForm,{}),(0,Z.jsx)("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense",children:e})}var W=i(88273),H=i(58718),V=i(42340);function SettingsSetupIncomplete(){const e=(0,o.useSelect)(e=>e(f.wl).getAccountStatus()),t=(0,b.DZ)(e),i=(0,o.useSelect)(e=>e(f.wl).getAdminReauthURL()),a=(0,o.useSelect)(e=>e(W.i)?.getCheckRequirementsError(H.Py));let s,n;return t?( /* translators: %s: link with next step */ s=(0,g.__)("Site Kit has placed AdSense code on your site: %s","google-site-kit"),n=(0,g.__)("check module page","google-site-kit")):( /* translators: %s: link with next step */ s=(0,g.__)("Setup incomplete: %s","google-site-kit"),n=(0,g.__)("continue module setup","google-site-kit")),(0,Z.jsxs)(m.Fragment,{children:[(0,Z.jsx)("div",{className:"googlesitekit-settings-module__fields-group googlesitekit-settings-module__fields-group--no-border",children:(0,Z.jsx)(V.A,{slug:"adsense"})}),(0,Z.jsx)("div",{className:"googlesitekit-settings-module__fields-group-title",children:(0,p.A)((0,g.sprintf)(s,`${n}`),{a:(0,Z.jsx)(G.A,{className:"googlesitekit-settings-module__edit-button",href:i,disabled:!!a})})})]})}var Y=i(50464),F=i(45454);var Q=i(55989),J=i(33052);function SettingsView(){const e=(0,o.useSelect)(e=>e(f.wl).getAccountID()),t=(0,o.useSelect)(e=>e(f.wl).getServiceAccountManageSitesURL()),i=(0,o.useSelect)(e=>e(y.O4).isWebStoriesActive()),a=(0,o.useSelect)(e=>e(f.wl).getWebStoriesAdUnit()),s=(0,o.useSelect)(e=>e(f.wl).getAccountStatus()),n=(0,o.useSelect)(e=>e(f.wl).getUseAdBlockingRecoverySnippet()),r=(0,o.useSelect)(e=>e(f.wl).getUseAdBlockingRecoveryErrorSnippet()),l=(0,o.useSelect)(e=>e(f.wl).getSiteStatus()),c=(0,o.useSelect)(e=>e(f.wl).getUseSnippet()),d=(0,o.useSelect)(e=>e(f.wl).getAdBlockingRecoverySetupStatus()),u=(0,o.useSelect)(e=>e(f.wl).getExistingTag()),h=(0,o.useSelect)(e=>e(f.wl).getClientID()),I=(0,o.useSelect)(e=>e(f.wl).getAutoAdsDisabled()||[]),A=(0,o.useSelect)(t=>t(f.wl).getServiceURL({path:`/${e}/privacymessaging/ad_blocking`})),M=function(e){let t=(0,g.__)("Your site isn’t ready to show ads yet","google-site-kit");switch(e){case b.ZT:t=(0,g.__)("Your account has been approved","google-site-kit");break;case b.pJ:t=(0,g.__)("Your site is ready for ads","google-site-kit");break;case b.X_:case b.iP:t=(0,g.__)("We’re getting your site ready for ads. This usually takes less than a day, but it can sometimes take a bit longer","google-site-kit");break;case b.ze:case b.f8:case b.gV:case b.bF:case b.Yb:t=(0,g.__)("You need to fix some issues before your account is approved. Go to AdSense to find out how to fix it","google-site-kit")}return t}(s),N=function(e){let t="";switch(e){case b.k:case b.dL:t=(0,g.__)("You need to fix some things before your site is ready.","google-site-kit");break;case b.oC:t=(0,g.__)("Your site is getting ready.","google-site-kit");break;case b.TF:t=(0,g.__)("Your site is ready for ads.","google-site-kit");break;case b.um:t=(0,g.__)("Your site is ready, with auto-ads disabled.","google-site-kit")}return t}(l),k=(0,p.A)((0,g.__)("View site in AdSense","google-site-kit"),{VisuallyHidden:(0,Z.jsx)(Q.A,{})}),S=function(e,t,i){let o=(0,g.__)("The AdSense code has not been placed on your site","google-site-kit");return e?o=(0,g.__)("The AdSense code has been placed on your site","google-site-kit"):t&&t===i&&(o=(0,g.__)("The AdSense code has been placed by another plugin or theme","google-site-kit")),o}(c,u,h),T=function(e){let t=(0,g.__)("Ads are currently displayed for all visitors","google-site-kit");return e.includes(F.nk)&&e.includes(F.ru)?t=(0,g.__)("All logged-in users and users who can write posts","google-site-kit"):e.includes(F.nk)?t=F.BN[F.nk]:e.includes(F.ru)&&(t=F.BN[F.ru]),t}(I),v=(0,o.useSelect)(e=>void 0===e(f.wl).getSettings()||void 0===e(f.wl).hasExistingAdBlockingRecoveryTag());return(0,Z.jsxs)("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense",children:[(0,Z.jsx)(B.kg,{}),(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-items",children:[(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(J.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,g.__)("Publisher ID","google-site-kit")}),(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,Z.jsx)(Y.A,{value:e})})]}),(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(J.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,g.__)("Site Status","google-site-kit")}),(0,Z.jsxs)("p",{className:"googlesitekit-settings-module__meta-item-data",children:[N+" ",(0,Z.jsx)(G.A,{href:t,className:"googlesitekit-settings-module__cta-button",disabled:void 0===t,hideExternalIndicator:void 0===t,external:!0,children:k})]})]})]}),(0,Z.jsx)("div",{className:"googlesitekit-settings-module__meta-items",children:(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(J.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,g.__)("Account Status","google-site-kit")}),(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:M})]})}),(0,Z.jsx)("div",{className:"googlesitekit-settings-module__meta-items",children:(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(J.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,g.__)("AdSense Code","google-site-kit")}),(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:S})]})}),(0,Z.jsx)("div",{className:"googlesitekit-settings-module__meta-items",children:(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(J.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,g.__)("Excluded from ads","google-site-kit")}),(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:T})]})}),i&&(0,Z.jsx)("div",{className:"googlesitekit-settings-module__meta-items",children:(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(J.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,g.__)("Web Stories Ad Unit","google-site-kit")}),(0,Z.jsxs)("p",{className:"googlesitekit-settings-module__meta-item-data",children:[!a&&(0,Z.jsx)("span",{children:(0,g.__)("None","google-site-kit")}),a&&(0,Z.jsx)(Y.A,{value:a})]})]})}),d?.length>0&&(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-items",children:[v&&(0,Z.jsx)(L.ProgressBar,{verticalSpacing:86,small:!0}),!v&&(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(J.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,g.__)("Ad blocking recovery","google-site-kit")}),!n&&(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,g.__)("Ad blocking recovery message is not placed","google-site-kit")}),n&&(0,Z.jsxs)(m.Fragment,{children:[(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:r?(0,g.__)("Ad blocking recovery message enabled with error protection code","google-site-kit"):(0,g.__)("Ad blocking recovery message enabled without error protection code","google-site-kit")}),(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,p.A)((0,g.__)("Identify site visitors that have an ad blocker browser extension installed. These site visitors will see the ad blocking recovery message created in AdSense. Configure your message","google-site-kit"),{a:(0,Z.jsx)(G.A,{href:A,external:!0})})})]})]})]}),!d?.length&&(0,Z.jsxs)(m.Fragment,{children:[v&&(0,Z.jsx)(L.ProgressBar,{verticalSpacing:131,small:!0}),!v&&(0,Z.jsx)(AdBlockingRecoverySetupCTANotice,{})]})]})}var X,q,K,$,ee=i(93431),te=i(97345),ie=i(84730),oe=i(8732),ae=i(89766);function se(){return se=Object.assign?Object.assign.bind():function(e){for(var t=1;tm.createElement("svg",se({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 52 52"},e),X||(X=m.createElement("circle",{cx:26,cy:26,r:26,fill:"#fff"})),q||(q=m.createElement("path",{fill:"#547EC0",d:"M30.514 38.167a4.63 4.63 0 0 0 3.991-2.27l4.85-8.013a4.62 4.62 0 0 0-1.629-6.332 4.636 4.636 0 0 0-6.344 1.625l-4.85 8.013a4.62 4.62 0 0 0 1.63 6.331c.739.437 1.55.646 2.352.646"})),K||(K=m.createElement("path",{fill:"#F9B918",d:"M15.909 38.171a4.6 4.6 0 0 1-2.353-.644 4.62 4.62 0 0 1-1.629-6.332l9.259-15.925a4.64 4.64 0 0 1 6.344-1.626 4.617 4.617 0 0 1 1.628 6.332L19.9 35.9a4.63 4.63 0 0 1-3.991 2.271"})),$||($=m.createElement("path",{fill:"#31A751",d:"M15.887 38.171a4.6 4.6 0 0 0 4.604-4.596 4.6 4.6 0 0 0-4.604-4.595 4.6 4.6 0 0 0-4.605 4.595 4.6 4.6 0 0 0 4.605 4.596"})));function DashboardMainEffectComponent(){return function(){const e=(0,M.A)(),t=(0,o.useSelect)(e=>e(W.i).isModuleConnected(H.Py)),i=(0,o.useSelect)(e=>e(f.wl).getAccountID()),[a,s]=(0,m.useState)([]),{registerNotification:n}=(0,o.useDispatch)(oe.D),r=(0,o.useSelect)(e=>e(f.wl).getNotifications());(0,m.useEffect)(()=>{t&&i&&r?.forEach(t=>{if(a.includes(t.id))return;const i={...t};i.title||(i.title=(0,g.__)("Notice about your AdSense account","google-site-kit")),!i.content?.length&&i.description?.length&&(i.content=i.description,delete i.description),void 0===i.dismissible&&void 0!==i.isDismissible&&(i.dismissible=i.isDismissible,delete i.isDismissible);const o={category:`${e}_adsense-alerts-banner-notification`,label:t.id};n(t.id,{Component:({Notification:e})=>(0,Z.jsx)(e,{gaTrackingEventArgs:o,children:(0,Z.jsx)(ae.A,{...i,titleIcon:(0,Z.jsx)(ne,{}),gaTrackingEventArgs:o})}),priority:t.priority,areaSlug:ie.bI.HEADER,isDismissible:!0}),s(e=>[...e,t.id])})},[e,i,t,r,n,a])}(),null}var re=i(32091),le=i.n(re),ce=i(46763),de=i(8084);const ge="COMPLETE_ACCOUNT_SETUP",ue="COMPLETE_SITE_SETUP",me="RECEIVE_ORIGINAL_USE_SNIPPET",pe={originalUseSnippet:void 0},he={*completeAccountSetup(){return yield{payload:{},type:ge}},*completeSiteSetup(){return yield{payload:{},type:ue}},receiveOriginalUseSnippet:e=>(le()(e,"originalUseSnippet is required."),{payload:{originalUseSnippet:e},type:me})},Ie={[ge]:(0,o.createRegistryControl)(e=>async()=>{if(await e.dispatch(f.wl).setAccountSetupComplete(!0),!e.select(f.wl).canSubmitChanges())return await e.dispatch(f.wl).setAccountSetupComplete(!1),!1;const{error:t}=await e.dispatch(f.wl).submitChanges();return!t||(await e.dispatch(f.wl).setAccountSetupComplete(!1),!1)}),[ue]:(0,o.createRegistryControl)(e=>async()=>{if(await e.dispatch(f.wl).setSiteSetupComplete(!0),!e.select(f.wl).canSubmitChanges())return await e.dispatch(f.wl).setSiteSetupComplete(!1),!1;const{error:t}=await e.dispatch(f.wl).submitChanges();return!t||(await e.dispatch(f.wl).setSiteSetupComplete(!1),!1)})},ye=(0,o.createReducer)((e,t)=>{switch(t.type){case me:{const{originalUseSnippet:i}=t.payload;e.originalUseSnippet=i;break}case"RECEIVE_GET_SETTINGS":{const{response:i}=t.payload,{useSnippet:o}=i;void 0===e.originalUseSnippet&&(e.originalUseSnippet=o);break}}}),Ae={*getOriginalUseSnippet(){const e=yield o.commonActions.getRegistry();void 0===e.select(f.wl).getOriginalUseSnippet()&&e.select(f.wl).getSettings()}},Me={isDoingSaveUseSnippet:e=>Object.values(e.isFetchingSaveUseSnippet).some(Boolean),getOriginalUseSnippet:e=>e.originalUseSnippet};const Ne=(0,o.combineStores)({initialState:pe,actions:he,controls:Ie,reducer:ye,resolvers:Ae,selectors:Me}),fe=(Ne.initialState,Ne.actions,Ne.controls,Ne.reducer,Ne.resolvers,Ne.selectors,Ne),ke=n().createModuleStore(H.Py,{ownedSettingsSlugs:["accountID","clientID"],storeName:f.wl,settingSlugs:["accountID","clientID","useSnippet","accountStatus","siteStatus","accountSetupComplete","siteSetupComplete","ownerID","webStoriesAdUnit","autoAdsDisabled","setupCompletedTimestamp","useAdBlockingRecoverySnippet","useAdBlockingRecoveryErrorSnippet","adBlockingRecoverySetupStatus"],validateCanSubmitChanges:function(e){const t=(0,de.WI)(e),{getAccountID:i,getClientID:o,getAccountStatus:a,haveSettingsChanged:s,isDoingSubmitChanges:n}=t(f.wl);le()(!n(),ce.mV),le()(s(),ce.Wq),le()(a(),"require an account status to be present");const r=i();le()(""===r||(0,x.H)(r),"require account ID to be either empty (if impossible to determine) or valid");const l=o();le()(""===l||(0,x.X)(l),"require client ID to be either empty (if impossible to determine) or valid")},validateIsSetupBlocked:e=>{if(e(te.oR).isAdBlockerActive())throw new Error("Ad blocker detected")}});var Se=i(54419),Te=i(35812),ve=i(73866);const je="RESET_ACCOUNTS",_e=(0,Te.U)({baseName:"getAccounts",controlCallback:()=>(0,Se.get)("modules",H.Py,"accounts",void 0,{useCache:!1}),reducerCallback:(0,o.createReducer)((e,t)=>{e.accounts=t})}),be={accounts:void 0},xe={*resetAccounts(){const{dispatch:e}=yield o.commonActions.getRegistry();return yield{payload:{},type:je},yield ve.o1.clearErrors("getAccounts"),e(f.wl).invalidateResolutionForStoreSelector("getAccounts")}},Ce=(0,o.createReducer)((e,t)=>{switch(t.type){case je:{const{accountID:t,clientID:i,accountStatus:o,siteStatus:a,accountSetupComplete:s,siteSetupComplete:n}=e.savedSettings||{};e.accounts=be.accounts,e.settings={...e.settings||{},accountID:t,clientID:i,accountStatus:o,siteStatus:a,accountSetupComplete:s,siteSetupComplete:n};break}}}),De={*getAccounts(){(yield o.commonActions.getRegistry()).select(f.wl).getAccounts()||(yield _e.actions.fetchGetAccounts())}},Ee={getAccounts(e){const{accounts:t}=e;return t}},we=(0,o.combineStores)(_e,{initialState:be,actions:xe,reducer:Ce,resolvers:De,selectors:Ee}),Ze=(we.initialState,we.actions,we.controls,we.reducer,we.resolvers,we.selectors,we),Re=(0,Te.U)({baseName:"getAdUnits",controlCallback:({accountID:e,clientID:t})=>(0,Se.get)("modules",H.Py,"adunits",{accountID:e,clientID:t},{useCache:!1}),reducerCallback:(0,o.createReducer)((e,t,{accountID:i,clientID:o})=>{e.adunits=e.adunits||{},e.adunits[`${i}::${o}`]=t}),argsToParams:(e,t)=>({accountID:e,clientID:t}),validateParams:({accountID:e,clientID:t}={})=>{le()(e,"accountID is required."),le()(t,"clientID is required.")}}),Le=(0,o.createReducer)((e,t)=>{t.type}),Ge={*getAdUnits(e,t){if(void 0===e||void 0===t)return;(yield o.commonActions.getRegistry()).select(f.wl).getAdUnits(e,t)||(yield Re.actions.fetchGetAdUnits(e,t))}},ze={getAdUnits(e,t,i){if(void 0!==t&&void 0!==i)return e.adunits[`${t}::${i}`]}},Oe=(0,o.combineStores)(Re,{initialState:{adunits:{}},actions:{},reducer:Le,resolvers:Ge,selectors:ze}),Pe=(Oe.initialState,Oe.actions,Oe.controls,Oe.reducer,Oe.resolvers,Oe.selectors,Oe),Be="RESET_CLIENTS",Ue=(0,Te.U)({baseName:"getClients",controlCallback:({accountID:e})=>(0,Se.get)("modules",H.Py,"clients",{accountID:e},{useCache:!1}),reducerCallback:(0,o.createReducer)((e,t,{accountID:i})=>{Array.isArray(t)&&(e.clients=e.clients||{},e.clients[i]=t)}),argsToParams:e=>({accountID:e}),validateParams:({accountID:e}={})=>{le()(e,"accountID is required.")}}),We={*resetClients(){const{dispatch:e}=yield o.commonActions.getRegistry();return yield{payload:{},type:Be},yield ve.o1.clearErrors("getClients"),e(f.wl).invalidateResolutionForStoreSelector("getClients")}},He=(0,o.createReducer)((e,t)=>{switch(t.type){case Be:{const{clientID:t,accountStatus:i,siteStatus:o,accountSetupComplete:a,siteSetupComplete:s}=e.savedSettings||{};e.clients=Qe.clients,e.settings={...e.settings||{},clientID:t,accountStatus:i,siteStatus:o,accountSetupComplete:a,siteSetupComplete:s};break}}}),Ve={*getClients(e){if(void 0===e||!(0,x.H)(e))return;(yield o.commonActions.getRegistry()).select(f.wl).getClients(e)||(yield Ue.actions.fetchGetClients(e))}},Ye={getClients(e,t){if(void 0===t)return;const{clients:i}=e;return i[t]},getAFCClient:(0,o.createRegistrySelector)(e=>(t,i)=>{if(void 0===i)return;const o=e(f.wl).getClients(i);if(void 0===o)return;const a=o.filter(e=>"AFC"===e.productCode);return a.length?a[0]:null})},Fe=(0,o.combineStores)(Ue,{initialState:{clients:{}},actions:We,reducer:He,resolvers:Ve,selectors:Ye}),Qe=Fe.initialState,Je=(Fe.actions,Fe.controls,Fe.reducer,Fe.resolvers,Fe.selectors,Fe);var Xe=i(73730);const qe=["ACTIVE_VIEW_MEASURABILITY","ACTIVE_VIEW_TIME","ACTIVE_VIEW_VIEWABILITY","AD_REQUESTS_COVERAGE","AD_REQUESTS_CTR","AD_REQUESTS_RPM","AD_REQUESTS_SPAM_RATIO","AD_REQUESTS","ADS_PER_IMPRESSION","CLICKS_SPAM_RATIO","CLICKS","COST_PER_CLICK","ESTIMATED_EARNINGS","IMPRESSIONS_CTR","IMPRESSIONS_RPM","IMPRESSIONS_SPAM_RATIO","IMPRESSIONS","INDIVIDUAL_AD_IMPRESSIONS_CTR","INDIVIDUAL_AD_IMPRESSIONS_RPM","INDIVIDUAL_AD_IMPRESSIONS_SPAM_RATIO","INDIVIDUAL_AD_IMPRESSIONS","MATCHED_AD_REQUESTS_CTR","MATCHED_AD_REQUESTS_RPM","MATCHED_AD_REQUESTS_SPAM_RATIO","MATCHED_AD_REQUESTS","METRIC_UNSPECIFIED","PAGE_VIEWS_CTR","PAGE_VIEWS_RPM","PAGE_VIEWS_SPAM_RATIO","PAGE_VIEWS","TOTAL_EARNINGS","TOTAL_IMPRESSIONS","WEBSEARCH_RESULT_PAGES"],Ke=["ACCOUNT_NAME","AD_CLIENT_ID","AD_FORMAT_CODE","AD_FORMAT_NAME","AD_PLACEMENT_CODE","AD_PLACEMENT_NAME","AD_UNIT_ID","AD_UNIT_NAME","AD_UNIT_SIZE_CODE","AD_UNIT_SIZE_NAME","BID_TYPE_CODE","BID_TYPE_NAME","BUYER_NETWORK_ID","BUYER_NETWORK_NAME","CONTENT_PLATFORM_CODE","CONTENT_PLATFORM_NAME","COUNTRY_CODE","COUNTRY_NAME","CREATIVE_SIZE_CODE","CREATIVE_SIZE_NAME","CUSTOM_CHANNEL_ID","CUSTOM_CHANNEL_NAME","CUSTOM_SEARCH_STYLE_ID","CUSTOM_SEARCH_STYLE_NAME","DATE","DIMENSION_UNSPECIFIED","DOMAIN_CODE","DOMAIN_NAME","DOMAIN_REGISTRANT","MONTH","OWNED_SITE_DOMAIN_NAME","OWNED_SITE_ID","PLATFORM_TYPE_CODE","PLATFORM_TYPE_NAME","PRODUCT_CODE","PRODUCT_NAME","REQUESTED_AD_TYPE_CODE","REQUESTED_AD_TYPE_NAME","SERVED_AD_TYPE_CODE","SERVED_AD_TYPE_NAME","TARGETING_TYPE_CODE","TARGETING_TYPE_NAME","URL_CHANNEL_ID","URL_CHANNEL_NAME","WEBSEARCH_QUERY_STRING","WEEK"];const $e=(0,Te.U)({baseName:"getReport",controlCallback:({options:e})=>(0,Se.get)("modules",H.Py,"report",e),reducerCallback:(0,o.createReducer)((e,t,{options:i})=>{e.reports=e.reports||{},e.reports[(0,N.Zm)(i)]=t}),argsToParams:e=>({options:e}),validateParams:({options:e}={})=>{le()((0,k.isPlainObject)(e),"options must be an object."),le()((0,Xe.O5)(e),"Either date range or start/end dates must be provided for AdSense report.");const{orderby:t,metrics:i,dimensions:o}=e;le()((0,Xe.cq)(i),"Metrics for an AdSense report must be either a string or an array of strings."),function(e){const t=(0,k.castArray)(e);le()(t.length,"at least one metric is required.");const i=t.filter(e=>!qe.includes(e));le()(0===i.length,`invalid AdSense metrics requested: ${i.toString()}`)}(i),o&&(le()((0,Xe.cq)(o),"Dimensions for an AdSense report must be either a string or an array of strings."),function(e){const t=(0,k.castArray)(e);le()(t.length,"at least one dimension is required.");const i=t.filter(e=>!Ke.includes(e));le()(0===i.length,`invalid AdSense dimensions requested: ${i.toString()}`)}(o)),t&&le()((0,Xe.G4)(t),'Orders for an AdSense report must be either an object or an array of objects where each object should have "fieldName" and "sortOrder" properties.')}}),et={*getReport(e={}){(yield o.commonActions.getRegistry()).select(f.wl).getReport(e)||(yield $e.actions.fetchGetReport(e))}},tt={getReport(e,t={}){const{reports:i}=e;return i[(0,N.Zm)(t)]}},it=(0,o.combineStores)($e,{initialState:{reports:{}},resolvers:et,selectors:tt}),ot=(it.initialState,it.actions,it.controls,it.reducer,it.resolvers,it.selectors,it);const at=(0,i(75498).d)({storeName:f.wl,tagMatchers:[/google_ad_client: ?["|'](.*?)["|']/,/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/,/<(?:script|amp-auto-ads)[^>]*src="[^"]*\?client=(ca-pub-[^"]+)"[^>]*>/],isValidTag:x.X}),st={selectors:{getAdBlockerWarningMessage:(0,o.createRegistrySelector)(e=>()=>{const t=e(te.oR).isAdBlockerActive();if(void 0===t)return;if(!t)return null;return e(W.i).isModuleConnected(H.Py)?(0,g.__)("To get the latest AdSense data you will need to disable your Ad blocker","google-site-kit"):(0,g.__)("To set up AdSense you will need to disable your Ad blocker","google-site-kit")})}};var nt=i(51568);const rt={selectors:{getServiceURL:(0,o.createRegistrySelector)(e=>(t,{path:i,query:o}={})=>{let a="https://www.google.com/adsense/new/u/0";if(i){a=`${a}${`/${i.replace(/^\//,"")}`}`}o&&(a=(0,nt.F)(a,o));const s=e(te.oR).getAccountChooserURL(a);if(void 0!==s)return s}),getServiceCreateAccountURL:(0,o.createRegistrySelector)(e=>()=>{const t=e(y.O4).getReferenceSiteURL(),i={source:"site-kit",utm_source:"site-kit",utm_medium:"wordpress_signup"};return void 0!==t&&(i.url=D(t)),(0,nt.F)("https://www.google.com/adsense/signup",i)}),getServiceAccountURL:(0,o.createRegistrySelector)(e=>()=>{const t=e(f.wl).getAccountID();if(void 0===t)return;return e(f.wl).getServiceURL({accountID:t,query:{source:"site-kit"}})}),getServiceReportURL:(0,o.createRegistrySelector)(e=>(t,i)=>{const o=e(f.wl).getAccountID();if(void 0===o)return;const a={...i},s=e(y.O4).getReferenceSiteURL(),n=s&&D(s);n&&(a.dd=`1YsiteY1Y${n}Y${n}`);const r=`${o}/reporting`;return e(f.wl).getServiceURL({path:r,query:a})}),getServiceAccountManageSiteURL:(0,o.createRegistrySelector)(e=>()=>{const t=e(f.wl).getAccountID(),i=e(y.O4).getReferenceSiteURL();if(void 0===t||void 0===i)return;const o=`${t}/sites/my-sites`,a={source:"site-kit",url:D(i)||i};return e(f.wl).getServiceURL({path:o,query:a})}),getServiceAccountManageSitesURL:(0,o.createRegistrySelector)(e=>()=>{const t=e(f.wl).getAccountID();if(void 0===t)return;const i=`${t}/sites/my-sites`;return e(f.wl).getServiceURL({path:i,query:{source:"site-kit"}})}),getServiceAccountSiteAdsPreviewURL:(0,o.createRegistrySelector)(e=>()=>{const t=e(f.wl).getAccountID(),i=e(y.O4).getReferenceSiteURL();if(void 0===t||void 0===i)return;const o=`${t}/myads/sites/preview`,a={source:"site-kit",url:D(i)||i};return e(f.wl).getServiceURL({path:o,query:a})}),getDetailsLinkURL:(0,o.createRegistrySelector)(e=>()=>e(f.wl).getServiceAccountManageSitesURL())}};const lt="RESET_SITES",ct=(0,Te.U)({baseName:"getSites",controlCallback:({accountID:e})=>(0,Se.get)("modules",H.Py,"sites",{accountID:e},{useCache:!1}),reducerCallback:(0,o.createReducer)((e,t,{accountID:i})=>{Array.isArray(t)&&(e.sites=e.sites||{},e.sites[i]=t)}),argsToParams:e=>({accountID:e}),validateParams:({accountID:e}={})=>{le()(e,"accountID is required.")}}),dt={*resetSites(){const{dispatch:e}=yield o.commonActions.getRegistry();return yield{payload:{},type:lt},yield ve.o1.clearErrors("getSites"),e(f.wl).invalidateResolutionForStoreSelector("getSites")}},gt=(0,o.createReducer)((e,t)=>{switch(t.type){case lt:{const{siteID:t,accountStatus:i,siteStatus:o,accountSetupComplete:a,siteSetupComplete:s}=e.savedSettings||{};e.sites=ht.sites,e.settings={...e.settings||{},siteID:t,accountStatus:i,siteStatus:o,accountSetupComplete:a,siteSetupComplete:s};break}}}),ut={*getSites(e){if(void 0===e||!(0,x.H)(e))return;(yield o.commonActions.getRegistry()).select(f.wl).getSites(e)||(yield ct.actions.fetchGetSites(e))}},mt={getSites(e,t){if(void 0===t)return;const{sites:i}=e;return i[t]},getSite:(0,o.createRegistrySelector)(e=>(t,i,o)=>function(e,t){if(void 0===e||void 0===t||!Array.isArray(e))return;const i=e.filter(({state:e})=>!!e),o=i.find(e=>e.domain===t.toLowerCase());return o||(i.find(e=>new RegExp(`\\.${(0,k.escapeRegExp)(e.domain)}$`,"i").test(t))||null)}(e(f.wl).getSites(i),o)),getCurrentSite:(0,o.createRegistrySelector)(e=>(t,i)=>{const o=e(y.O4).getReferenceSiteURL(),a=new URL(o);return e(f.wl).getSite(i,a.hostname)})},pt=(0,o.combineStores)(ct,{initialState:{sites:{}},actions:dt,reducer:gt,resolvers:ut,selectors:mt}),ht=pt.initialState,It=(pt.actions,pt.controls,pt.reducer,pt.resolvers,pt.selectors,pt);var yt=i(56768);const At=[/