33 lines
176 KiB
JavaScript
33 lines
176 KiB
JavaScript
|
|
"use strict";(globalThis.__googlesitekit_webpackJsonp=globalThis.__googlesitekit_webpackJsonp||[]).push([[290,994,998],{3170:(e,t,i)=>{i.d(t,{A:()=>__WEBPACK_DEFAULT_EXPORT__});var n,o=i(63696);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)({}).hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},r.apply(null,arguments)}const __WEBPACK_DEFAULT_EXPORT__=e=>o.createElement("svg",r({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 22 19"},e),n||(n=o.createElement("path",{fill:"currentColor",d:"M0 19h22L11 0zm12-3h-2v-2h2zm0-4h-2V8h2z"})))},5664:(e,t,i)=>{i.d(t,{$:()=>o});var n=i(63696);function o(e,t=0){(0,n.useEffect)(()=>{let n,o=!1;function r(){n=i.g.setTimeout(()=>{o=!0},t)}function s(){i.g.clearTimeout(n),o&&(o=!1,e())}return i.g.addEventListener("focus",s),i.g.addEventListener("blur",r),()=>{i.g.removeEventListener("focus",s),i.g.removeEventListener("blur",r),i.g.clearTimeout(n)}},[t,e])}},5855:(e,t,i)=>{i.d(t,{A:()=>u});var n=i(4452),o=i.n(n),r=i(62688),s=i.n(r),a=i(63696),l=i(62540);const c=(0,a.forwardRef)(({label:e,className:t,hasLeftSpacing:i=!1,...n},r)=>(0,l.jsx)("span",{ref:r,...n,className:o()("googlesitekit-badge",t,{"googlesitekit-badge--has-left-spacing":i}),children:e}));c.displayName="Badge",c.propTypes={label:s().string.isRequired,hasLeftSpacing:s().bool};const u=c},6625:(e,t,i)=>{i.d(t,{A:()=>DefaultSettingsStatus});var n=i(4452),o=i.n(n),r=i(63696),s=i(82871),a=i(49057),l=i(70301),c=i(88273),u=i(8513),g=i(90559),d=i(83880),p=i(24560),m=i(3170),h=i(97015);function DefaultSettingsStatus({slug:e}){const t=(0,a.WM)(t=>t(c.i).getModule(e)),i=(0,a.WM)(t=>{const i=t(c.i).getModuleStoreName(e);return t(i)?.getAdminReauthURL?.()}),n=(0,a.WM)(t=>t(c.i)?.getCheckRequirementsError(e)),I=(0,a.WM)(e=>i&&e(l.M).isNavigatingTo(i)),{navigateTo:y}=(0,a.wA)(l.M),f=(0,r.useCallback)(e=>{e.stopPropagation(),y(i)},[y,i]);if(!t)return null;const{name:N,connected:M}=t;return h.createElement("div",{className:o()("googlesitekit-settings-module__status",{"googlesitekit-settings-module__status--connected":M,"googlesitekit-settings-module__status--not-connected":!M})},M?h.createElement(d.A,{size:u.Yw},(0,s.__)("Connected","google-site-kit")):h.createElement(g.$n,{onClick:f,disabled:!!n||I,inverse:!0},(0,s.sprintf)(/* translators: %s: module name. */ /* translators: %s: module name. */
|
|||
|
|
(0,s.__)("Complete setup for %s","google-site-kit"),N)),h.createElement("span",{className:o()("googlesitekit-settings-module__status-icon",{"googlesitekit-settings-module__status-icon--connected":M,"googlesitekit-settings-module__status-icon--not-connected":!M})},M?h.createElement(p.A,{width:10,height:8}):h.createElement(m.A,{width:19,height:17})))}},7972:(e,t,i)=>{i.d(t,{F:()=>o,n:()=>n});const n="core/ui",o="activeContextID"},8084:(e,t,i)=>{i.d(t,{$C:()=>T,RF:()=>S,WI:()=>v,_5:()=>b,jU:()=>M,o3:()=>N,x0:()=>k});var n=i(32091),o=i.n(n),r=i(50532),s=i.n(r),a=i(17243),l=i(78913);const c="GET_REGISTRY",u="AWAIT";function g(...e){const t=e.reduce((e,t)=>({...e,...t}),{}),i=j(e.reduce((e,t)=>[...e,...Object.keys(t)],[]));return o()(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 d=g,p=g;function m(...e){const t=[...e];let i;return"function"!=typeof t[0]&&(i=t.shift()),(e=i,n={})=>t.reduce((e,t)=>t(e,n),e)}const h=g,I=g,y=g;function f(e){return e}function N(...e){const t=y(...e.map(e=>e.initialState||{}));return{initialState:t,controls:p(...e.map(e=>e.controls||{})),actions:d(...e.map(e=>e.actions||{})),reducer:m(t,...e.map(e=>e.reducer||f)),resolvers:h(...e.map(e=>e.resolvers||{})),selectors:I(...e.map(e=>e.selectors||{}))}}const M={getRegistry:()=>({payload:{},type:c}),*await(e){return{payload:{value:e},type:u}}},b={[c]:(0,l.b)(e=>()=>e),[u]:({payload:e})=>e.value};function j(e){const t=[],i={};for(let n=0;n<e.length;n++){const o=e[n];i[o]=i[o]>=1?i[o]+1:1,i[o]>1&&t.push(o)}return t}const k={actions:M,controls:b,reducer:f};function v(e){return t=>A(e(t))}const A=s()(e=>(0,a.mapValues)(e,(e,t)=>(...i)=>{const n=e(...i);return o()(void 0!==n,`${t}(...) is not resolved`),n}));function S(e,{negate:t=!1}={}){return{safeSelector:(0,l.N)(i=>(n,...o)=>{const r=!t,s=!!t;try{return e(i,n,...o),r}catch{return s}}),dangerousSelector:(0,l.N)(t=>(i,...n)=>{e(t,i,...n)})}}function T(e,t){return o()("function"==typeof e,"a validator function is required."),o()("function"==typeof t,"an action creator function is required."),o()("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)=>{i.d(t,{Kk:()=>r,SZ:()=>n,Yw:()=>s,oJ:()=>a,tT:()=>o});const n="body",o=[n,"display","headline","label","title"],r="small",s="medium",a=[r,s,"large"]},8732:(e,t,i)=>{i.d(t,{$:()=>r,D:()=>o});var n=i(20697);const o="core/notifications",r=[n.uR,n.jU,n.f7,n.Ax,n.Is]},10740:(e,t,i)=>{i.d(t,{$z:()=>o.$,CR:()=>a.C,Cf:()=>l.DialogContent,Es:()=>l.DialogFooter,Nv:()=>n.N,P3:()=>s.P,Si:()=>r.S,fI:()=>u.fI,fh:()=>u.fh,lG:()=>c.a,xA:()=>u.xA});var n=i(91046),o=i(3412),r=i(30454),s=i(26569),a=i(56655),l=i(12786),c=i.n(l),u=i(84984)},11193:(e,t,i)=>{i.d(t,{D:()=>r});var n=i(32091),o=i.n(n);function r(e,{dateRangeLength:t}){o()(Array.isArray(e),"report must be an array to partition."),o()(Number.isInteger(t)&&t>0,"dateRangeLength must be a positive integer.");const i=-1*t;return{currentRange:e.slice(i),compareRange:e.slice(2*i,i)}}},11763:(e,t,i)=>{i.d(t,{A:()=>SpinnerButton,k:()=>g});var n=i(62688),o=i.n(n),r=i(4452),s=i.n(r),a=i(17243),l=i(85135),c=i(99578),u=i(62540);const g={BEFORE:"before",AFTER:"after"};function SpinnerButton(e){const{className:t,onClick:i=()=>{},isSaving:n=!1,spinnerPosition:o=g.AFTER,...r}=e,d=(0,a.pickBy)(r,e=>void 0!==e);return(0,u.jsx)(l.A,{className:s()(t,"googlesitekit-button-icon--spinner",{"googlesitekit-button-icon--spinner__running":n,"googlesitekit-button-icon--spinner__before":o===g.BEFORE,"googlesitekit-button-icon--spinner__after":o===g.AFTER}),icon:n&&o===g.BEFORE?(0,u.jsx)(c.A,{size:14}):void 0,trailingIcon:n&&o===g.AFTER?(0,u.jsx)(c.A,{size:14}):void 0,onClick:i,...d})}SpinnerButton.propTypes={className:o().string,onClick:o().func,isSaving:o().bool,spinnerPosition:o().oneOf(Object.values(g))}},11999:(e,t,i)=>{i.d(t,{s:()=>n});const n="core/forms"},13047:(
|
|||
|
|
(0,c.__)("%1$s (%2$s)","google-site-kit"),t,e)},e))})}PublicationSelect.propTypes={isDisabled:k().bool,hasModuleAccess:k().bool,className:k().string,onChange:k().func};const q=(0,v.createContext)({}),{Consumer:K,Provider:ee}=q,te=q;function ChipMultiSelect({children:e,onToggleChip:t=()=>{}}){return(0,Z.jsx)(ee,{value:{onToggleChip:t},children:(0,Z.jsx)("div",{className:"googlesitekit-chip-multi-select",children:e})})}ChipMultiSelect.propTypes={children:k().node.isRequired,onToggleChip:k().func};var ie=i(17243),ne=i(80452);function ChipCheckmark(){return(0,Z.jsx)("div",{className:"mdc-chip__checkmark",children:(0,Z.jsx)(ne.A,{className:"mdc-chip__checkmark-svg"})})}function ChipMultiSelectItem({children:e,id:t,selected:i,...n}){const{onToggleChip:o}=(0,v.useContext)(te);return(0,Z.jsx)(A.Chip,{className:"googlesitekit-chip-multi-select__item",CheckMark:ChipCheckmark,onClick:()=>{o(t,!i)},id:t,label:e,selected:i,...n})}function PostTypesSelect(e){const{isDisabled:t,hasModuleAccess:i,onChange:o=()=>{}}=e,r=(0,n.useSelect)(e=>e(u.O4).getPostTypes()),s=(0,n.useSelect)(e=>e(g).getPostTypes()),{setPostTypes:a}=(0,n.useDispatch)(g),l=(0,v.useCallback)(e=>{const t=s.includes(e)?s.filter(t=>t!==e):[...s,e];a(t),o(t)},[o,s,a]);return(0,Z.jsx)(ChipMultiSelect,{onToggleChip:l,children:r.map(({slug:e,label:n})=>(0,Z.jsx)(ChipMultiSelectItem,{id:e,selected:s.includes(e),disabled:t||!i,children:n},e))})}function oe(e,t){if(!Array.isArray(e)||0===e.length)return"";if(!Array.isArray(t)||0===t.length)return e.join(", ");const i=t.filter(t=>e.includes(t.slug));return i.length===t.length?(0,c.__)("All post types","google-site-kit"):i.map(e=>e.label).join(", ")}function re(e){return e&&Array.isArray(e)?e.reduce((e,{name:t})=>t?[...e,t]:e,[]):[]}function se(e){if(!e)return"";return Object.keys(e).find(t=>!!e[t])||""}function ae(e){if(!e)return"";const t=e.indexOf(":");return-1===t?e:e.substring(t+1)}function ProductIDSelect(e){const{isDisabled:t,hasModuleAccess:i,showHelperText:o=!0,className:r,onChange:s=()=>{}}=e,a=(0,n.useSelect)(e=>e(g).getProductID()),l=(0,n.useSelect)(e=>e(g).getCurrentProductIDs()),{setProductID:u}=(0,n.useDispatch)(g),d=(0,v.useCallback)((e,t)=>{const i=t.dataset.value;u(i),s(i)},[u,s]);return!1===i?(0,Z.jsx)(A.Select,{className:r,label:(0,c.__)("Default Product ID","google-site-kit"),value:a,enhanced:!0,outlined:!0,disabled:!0,children:(0,Z.jsx)(A.Option,{value:a,children:a})}):(0,Z.jsxs)(A.Select,{className:r,label:(0,c.__)("Default Product ID","google-site-kit"),value:a,onEnhancedChange:d,disabled:t,helperText:o?(0,Y.A)((0,c.__)("Product IDs offer a way to link content to payment plans. <a>Learn more</a>","google-site-kit"),{a:(0,Z.jsx)(S.A,{"aria-label":(0,c.__)("Learn more about product IDs","google-site-kit"),href:"https://support.google.com/news/publisher-center/answer/12345540",external:!0,hideExternalIndicator:!0})}):void 0,enhanced:!0,outlined:!0,children:[(0,Z.jsx)(A.Option,{value:"openaccess",children:(0,c.__)("Open access","google-site-kit")},"openaccess"),(l||[]).map(e=>(0,Z.jsx)(A.Option,{value:e,children:ae(e)},e))]})}function SnippetModeSelect(e){const{isDisabled:t,hasModuleAccess:i,className:o,onChange:r=()=>{}}=e,s=(0,n.useSelect)(e=>e(g).getSnippetMode()),a=(0,n.useSelect)(e=>e(u.O4).getDocumentationLinkURL("rrm-content-settings")),{setSnippetMode:l}=(0,n.useDispatch)(g),d=(0,v.useCallback)((e,t)=>{const i=t.dataset.value;l(i),r(i)},[l,r]);return!1===i?(0,Z.jsx)(A.Select,{className:o,label:(0,c.__)("Display CTAs","google-site-kit"),value:s,enhanced:!0,outlined:!0,disabled:!0,children:(0,Z.jsx)(A.Option,{value:s,children:x.z9[s]})}):(0,Z.jsx)(A.Select,{className:o,label:(0,c.__)("Display CTAs","google-site-kit"),value:s,onEnhancedChange:d,disabled:t,helperText:(0,Y.A)((0,c.__)("Use the new settings in the block editor to customize where your CTAs appear. <a>Learn more</a>","google-site-kit"),{a:(0,Z.jsx)(S.A,{"aria-label":(0,c.__)("Learn more about Reader Revenue Manager settings in the block editor","google-site-kit"),href:a,external:!0,hideExternalIndicator:!0})}),enhanced:!0,outlined:!0,children:
|
|||
|
|
(0,c.__)("The previously selected publication with ID %s was not found. Please select a new publication.","google-site-kit"),t),skipRetryMessage:!0}),e&&s&&r&&(0,Z.jsx)(Me.A,{message:(0,c.sprintf)(/* translators: 1: Product ID. */ /* translators: 1: Product ID. */
|
|||
|
|
(0,c.__)("The previously selected product ID %s was not found. Please select a new product ID.","google-site-kit"),ae(r)),skipRetryMessage:!0}),(0,Z.jsx)("div",{className:"googlesitekit-setup-module__inputs",children:(0,Z.jsx)(PublicationSelect,{hasModuleAccess:e})}),e&&s&&(0,Z.jsx)(PublicationOnboardingStateNotice,{}),e&&s&&(0,Z.jsx)(z,{}),!e&&(0,Z.jsx)(R.A,{className:"googlesitekit-moduleaccess-warning-notice",type:R.A.TYPES.WARNING,description:(0,Y.A)((0,c.sprintf)(/* translators: %s: module owner's name */ /* translators: %s: module owner's name */
|
|||
|
|
(0,c.__)("%s configured Reader Revenue Manager and you don’t have access to its configured publication. Contact them to share access or change the configured publication.","google-site-kit"),a),{strong:(0,Z.jsx)("strong",{})})}),l&&i?.length>0&&(0,Z.jsx)(ProductIDSettings,{hasModuleAccess:e})]}),(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__fields-group",children:[(0,Z.jsx)(W.A,{as:"h4",size:"small",type:"title",className:"googlesitekit-settings-module__fields-group-title",children:(0,c.__)("CTA Placement","google-site-kit")}),(0,Z.jsx)("div",{className:"googlesitekit-rrm-settings-edit__snippet-mode",children:(0,Z.jsx)(SnippetModeSelect,{hasModuleAccess:e})}),"post_types"===o&&(0,Z.jsxs)("div",{className:"googlesitekit-rrm-settings-edit__post-types",children:[(0,Z.jsx)(W.A,{as:"h5",size:"small",type:"label",children:(0,c.__)("Select the content types where you want your CTAs to appear:","google-site-kit")}),(0,Z.jsx)(PostTypesSelect,{hasModuleAccess:e})]})]})]})}function SettingsEdit(){const e=(0,G.A)(),t=(0,n.useSelect)(e=>e(g).isDoingSubmitChanges()),i=(0,n.useSelect)(e=>{const{hasModuleOwnershipOrAccess:t,getErrorForAction:i}=e(Ne.i),n=t(x.K$);if(n)return!0;const o=i("checkModuleAccess",[x.K$]);return void 0!==n||o?!1!==n&&"module_not_connected"===o?.code:void 0}),o=(0,n.useSelect)(e=>e(g).haveSettingsChanged()),r=(0,n.useSelect)(e=>e(u.O4).getPostTypes()),s=(0,n.useSelect)(e=>e(g).getSettings()),{snippetMode:a,postTypes:l}=s||{},[c,d]=(0,v.useState)(s);return(0,v.useEffect)(()=>{!c&&s&&d(s)},[c,s]),(0,fe.A)(()=>{o||(a!==c.snippetMode&&(0,P.sx)(`${e}_rrm-settings`,"change_snippet_mode",x.z9[a]),oe(l)!==oe(c.postTypes)&&(0,P.sx)(`${e}_rrm-settings`,"change_post_types",oe(l,r)))}),t||void 0===i?(0,Z.jsx)(A.ProgressBar,{}):(0,Z.jsx)("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--reader-revenue-manager googlesitekit-rrm-settings-edit",children:(0,Z.jsx)(SettingsForm,{hasModuleAccess:i})})}var be=i(5855),je=i(6625),ke=i(97015);const ve=({slug:e})=>{const t=(0,n.useSelect)(e=>e(Ne.i).isModuleConnected(x.K$)),i=(0,n.useSelect)(e=>{const t=e(g).getContentPolicyState();return t&&t!==p.CONTENT_POLICY_STATE_OK});return t&&i?ke.createElement(be.A,{label:(0,c.__)("Action needed","google-site-kit"),className:"googlesitekit-badge--warning"}):ke.createElement(je.A,{slug:e})};var Ae=i(50464);function SettingsView(){const e=(0,n.useSelect)(e=>e(g).getPublicationID()),t=(0,n.useSelect)(e=>{const t=e(g).getProductID();return"openaccess"===t?(0,c.__)("Open access","google-site-kit"):ae(t)}),i=(0,n.useSelect)(e=>e(g).getSnippetMode()),o=(0,n.useSelect)(e=>{const t=e(u.O4).getPostTypes();return oe(e(g).getPostTypes(),t)}),r=(0,n.useSelect)(e=>{const{hasModuleOwnershipOrAccess:t,getErrorForAction:i}=e(Ne.i),n=t(x.K$);if(n)return!0;const o=i("checkModuleAccess",[x.K$]);return void 0!==n||o?!1!==n&&"module_not_connected"===o?.code:void 0});return(0,Z.jsxs)("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--reader-revenue-manager",children:[(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)(W.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,c.__)("Publication","google-site-kit")}),(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,Z.jsx)(Ae.A,{value:e})})]}),(0,Z.jsxs)("div",{className:"googlesitekit-settings-module__meta-item",children:[(0,Z.jsx)(W.A,{as:"h5",size:"medium",type:"label",className:"googlesitekit-settings-module__meta-item-type",children:(0,c.__)("Default Product ID","google-site-kit")}),(0,Z.jsx)("p",{className:"googlesitekit-settings-module__meta-item-data",children:(0,Z.jsx)(Ae.A,{value:t})})]})]}),r&&(0,Z.jsx)(PublicationOnboardingStateNotice,{}),r&&(0,Z.jsx)(z,{}),(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)(W.A,{as:"h5",siz
|
|||
|
|
(0,n.__)("Your Google account does not have sufficient permissions to access %s data, so you won’t be able to see stats from it on the Site Kit dashboard.","google-site-kit"),s)),a&&a.login&&(c=(0,n.sprintf)(/* translators: %s: owner name */ /* translators: %s: owner name */
|
|||
|
|
(0,n.__)('This service was originally connected by the administrator "%s" — you can contact them for more information.',"google-site-kit"),a.login)),c||(c=(0,n.__)("This service was originally connected by an administrator — you can contact them for more information.","google-site-kit")),`${l} ${c}`}},32600:(e,t,i)=>{i.d(t,{A:()=>NoticeNotification});var n=i(25797),o=i(68761),r=i(50539),s=i(8732),a=i(10740),l=i(62688),c=i.n(l),u=i(62540);function NoticeNotification({notificationID:e,children:t,dismissButton:i,ctaButton:l,gaTrackingEventArgs:c,...g}){const d=(0,o.A)(e,c?.category),{dismissNotification:p}=(0,r.useDispatch)(s.D);return(0,u.jsx)(a.xA,{children:(0,u.jsx)(a.fI,{children:(0,u.jsx)(a.fh,{size:12,alignMiddle:!0,children:(0,u.jsx)(n.A,{dismissButton:{...i,onClick:async function(t){await(i?.onClick?.(t)),d.dismiss(c?.label,c?.value),p(e,{...i?.dismissOptions||{}})}},ctaButton:{...l,onClick:async function(t){d.confirm(c?.label,c?.value),await(l?.onClick?.(t)),l?.dismissOnClick&&p(e,{...l?.dismissOptions})}},...g,children:t})})})})}NoticeNotification.propTypes={notificationID:c().string.isRequired,children:c().node,dismissButton:c().oneOfType([c().bool,c().object]),ctaButton:c().object,gaTrackingEventArgs:c().object}},32803:(e,t,i)=>{i.d(t,{Y:()=>n});const n="search-console"},32885:(e,t,i)=>{i.d(t,{A:()=>Checkbox});var n=i(4452),o=i.n(n),r=i(62688),s=i.n(r),a=i(63696),l=i(62457),c=i(62540);function Checkbox(e){const{onChange:t,id:i,name:n,value:r,checked:s,disabled:u,children:g,tabIndex:d,onKeyDown:p,loading:m,alignLeft:h,description:I,badge:y}=e,f=y?(0,c.jsxs)("div",{className:"mdc-checkbox__label-wrapper",children:[(0,c.jsx)("label",{htmlFor:i,children:g}),y]}):(0,c.jsx)("label",{htmlFor:i,children:g});return(0,c.jsxs)("div",{className:"mdc-form-field",children:[(0,c.jsx)("div",{className:o()("mdc-checkbox",{"mdc-checkbox--disabled":u,"mdc-checkbox--align-left":h}),children:m?(0,c.jsx)(l.A,{style:{margin:"0"},isSaving:!0}):(0,c.jsxs)(a.Fragment,{children:[(0,c.jsx)("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:i,name:n,value:r,checked:s,disabled:u,onChange:t,tabIndex:d,onKeyDown:p}),(0,c.jsxs)("div",{className:"mdc-checkbox__background",children:[(0,c.jsx)("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 12 9",children:(0,c.jsx)("path",{className:"mdc-checkbox__checkmark-path",d:"M2.08301 5.28834L3.55703 7.29507C4.24647 8.23368 5.5034 8.23368 6.19285 7.29507L10.083 1.99902",fill:"none",stroke:"none"})}),(0,c.jsx)("div",{className:"mdc-checkbox__mixedmark"})]})]})}),!I&&f,I&&(0,c.jsxs)("div",{className:"mdc-checkbox__content",children:[f,(0,c.jsx)("div",{className:"mdc-checkbox__description",children:I})]})]})}Checkbox.propTypes={onChange:s().func.isRequired,onKeyDown:s().func,id:s().string.isRequired,name:s().string.isRequired,value:s().string.isRequired,checked:s().bool,disabled:s().bool,children:s().node.isRequired,tabIndex:s().oneOfType([s().number,s().string]),loading:s().bool,alignLeft:s().bool,description:s().node,badge:s().node},Checkbox.defaultProps={checked:!1,disabled:!1,tabIndex:void 0,onKeyDown:null,loading:!1,alignLeft:!1,description:""}},33052:(e,t,i)=>{i.d(t,{A:()=>Typography});var n=i(62688),o=i.n(n),r=i(4452),s=i.n(r),a=i(8513),l=i(62540);function Typography({className:e,type:t,size:i,as:n="span",children:o,...r}){return(0,l.jsx)(n,{className:s()("googlesitekit-typography",e,{[`googlesitekit-typography--${t}`]:t&&a.tT.includes(t),[`googlesitekit-typography--${i}`]:i&&a.oJ.includes(i)}),...r,children:o})}Typography.propTypes={className:o().string,type:o().oneOf(a.tT),size:o().oneOf(a.oJ),as:o().oneOfType([o().string,o().elementType])}},33903:(e,t,i)=>{i.d(t,{A:()=>OverlayNotification});var n=i(62688),o=i.n(n),r=i(50539),s=i(8732),a=i(68761),l=i(5230),c=i(4452),u=i.n(c),g=i(97513),d=i(63696),p=i(33052),m=i(62540);function Title({children:e}){return(0,m.jsx)(p.A,{as:"h3",size:"medium",type:"title",className:"googlesitekit-overlay-card__title",children:e})}function Description({children:e}){return(0,m.jsx)("p",{className:"googlesitekit-overlay-card__description",child
|
|||
|
|
(0,s._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?p(o,{...l,unit:"second"}):"",n?p(n,{...l,unit:"minute"}):"",i?p(i,{...l,unit:"hour"}):"").trim()},formatDecimal(){const t=(0,s.sprintf)(
|
|||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
|||
|
|
// translators: %s: number of seconds with "s" as the abbreviated unit.
|
|||
|
|
(0,s.__)("%ds","google-site-kit"),o);if(0===e)return t;const r=(0,s.sprintf)(
|
|||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
|||
|
|
// translators: %s: number of minutes with "m" as the abbreviated unit.
|
|||
|
|
(0,s.__)("%dm","google-site-kit"),n),a=(0,s.sprintf)(
|
|||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
|||
|
|
// translators: %s: number of hours with "h" as the abbreviated unit.
|
|||
|
|
(0,s.__)("%dh","google-site-kit"),i);return(0,s.sprintf)(/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */ /* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
|||
|
|
(0,s._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?t:"",n?r:"",i?a:"").trim()}}}(e,t);try{return i()}catch{return n()}}function l(e){e=parseInt(e,10),Number.isNaN(e)&&(e=0);return{hours:Math.floor(e/60/60),minutes:Math.floor(e/60%60),seconds:Math.floor(e%60)}}function c(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e}function u(e){let t={};return"%"===e?t={style:"percent",maximumFractionDigits:2}:"s"===e?t={style:"duration",unitDisplay:"narrow"}:e&&"string"==typeof e?t={style:"currency",currency:e}:(0,n.isPlainObject)(e)&&(t={...e}),t}function g(e,t={}){e=(0,n.isFinite)(e)?e:Number(e),(0,n.isFinite)(e)||(console.warn("Invalid number",e,typeof e),e=0);const i=u(t),{style:o="metric"}=i;return"metric"===o?function(e){const t={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?(0,s.sprintf)(
|
|||
|
|
// translators: %s: an abbreviated number in millions.
|
|||
|
|
// translators: %s: an abbreviated number in millions.
|
|||
|
|
(0,s.__)("%sM","google-site-kit"),p(c(e),e%10==0?{}:t)):1e4<=e?(0,s.sprintf)(
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
(0,s.__)("%sK","google-site-kit"),p(c(e))):1e3<=e?(0,s.sprintf)(
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
// translators: %s: an abbreviated number in thousands.
|
|||
|
|
(0,s.__)("%sK","google-site-kit"),p(c(e),e%10==0?{}:t)):p(e,{signDisplay:"never",maximumFractionDigits:1})}(e):"duration"===o?a(e,i):"durationISO"===o?function(e){let{hours:t,minutes:i,seconds:n}=l(e);return n=("0"+n).slice(-2),i=("0"+i).slice(-2),t=("0"+t).slice(-2),"00"===t?`${i}:${n}`:`${t}:${i}:${n}`}(e):p(e,i)}const d=r()(console.warn);function p(e,t={}){const{locale:i=h(),...n}=t;try{return new Intl.NumberFormat(i,n).format(e)}catch(t){d(`Site Kit numberFormat error: Intl.NumberFormat( ${JSON.stringify(i)}, ${JSON.stringify(n)} ).format( ${typeof e} )`,t.message)}const o={currencyDisplay:"narrow",currencySign:"accounting",style:"unit"},r=["signDisplay","compactDisplay"],s={};for(const[e,t]of Object.entries(n))o[e]&&t===o[e]||r.includes(e)||(s[e]=t);try{return new Intl.NumberFormat(i,s).format(e)}catch{return new Intl.NumberFormat(i).format(e)}}function m(e,t={}){const{locale:i=h(),style:n="long",type:o="conjunction"}=t;if(Intl.ListFormat){return new Intl.ListFormat(i,{style:n,type:o}).format(e)}
|
|||
|
|
/* translators: used between list items, there is a space after the comma. */const r=(0,s.__)(", ","google-site-kit");return e.join(r)}function h(e=i.g){const t=(0,n.get)(e,["_googlesitekitLegacyData","locale"]);if(t){const e=t.match(/^(\w{2})?(_)?(\w{2})/);if(e&&e[0])return e[0].replace(/_/g,"-")}return e.navigator.language}},49993:(e,t,i)=>{i.d(t,{Gq:()=>g,IL:()=>h,LD:()=>p,SO:()=>d,a2:()=>o,xD:()=>m});var n=i(13047);const o="googlesitekit_",r=`${o}1.175.0_${i.g._googlesitekitBaseData.storagePrefix}_`,s=["sessionStorage","localStorage"];let a,l=[...s];async function c(e){const t=i.g[e];if(!t)return!1;try{const e="__storage_test__";return t.setItem(e,e),t.removeItem(e),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==t.length}}async function u(){if(void 0!==a)return a;for(const e of l)a||await c(e)&&(a=i.g[e]);return void 0===a&&(a=null),a}async function g(e){const t=await u();if(t){const i=t.getItem(`${r}${e}`);if(i){const e=JSON.parse(i),{timestamp:t,ttl:n,value:o,isError:r}=e;if(t&&(!n||Math.round(Date.now()/1e3)-t<n))return{cacheHit:!0,value:o,isError:r}}}return{cacheHit:!1,value:void 0}}async function d(e,t,{ttl:o=n.Jg,timestamp:s=Math.round(Date.now()/1e3),isError:a=!1}={}){const l=await u();if(l)try{return l.setItem(`${r}${e}`,JSON.stringify({timestamp:s,ttl:o,value:t,isError:a})),!0}catch(e){return i.g.console.warn("Encountered an unexpected storage error:",e),!1}return!1}async function p(e){const t=await u();if(t)try{const i=e.startsWith(o)?e:`${r}${e}`;return t.removeItem(i),!0}catch(e){return i.g.console.warn("Encountered an unexpected storage error:",e),!1}return!1}async function m(){const e=await u();if(e)try{const t=[];for(let i=0;i<e.length;i++){const n=e.key(i);0===n.indexOf(o)&&t.push(n)}return t}catch(e){return i.g.console.warn("Encountered an unexpected storage error:",e),[]}return[]}async function h(){if(await u()){const e=await m();for(const t of e)await p(t);return!0}return!1}},50304:(e,t,i)=>{i.d(t,{A:()=>IconWrapper});var n=i(62688),o=i.n(n),r=i(62540);function IconWrapper({children:e,marginLeft:t,marginRight:i}){return(0,r.jsx)("span",{className:"googlesitekit-icon-wrapper",style:{marginLeft:t,marginRight:i},children:e})}IconWrapper.propTypes={children:o().node.isRequired,marginLeft:o().number,marginRight:o().number}},50464:(e,t,i)=>{i.d(t,{A:()=>s,G:()=>r});var n=i(62688),o=i.n(n);const r=" ";function DisplaySetting({value:e}){return e||r}DisplaySetting.propTypes={value:o().oneOfType([o().string,o().bool,o().number])};const s=DisplaySetting},50477:(e,t,i)=>{i.d(t,{C:()=>r,p:()=>o});var n=i(55465);function o(e,t={}){return{__html:n.O.sanitize(e,t)}}function r(e){const t="object"==typeof e?e.toString():e;return t?.replace?.(/\/+$/,"")}},50539:e=>{e.exports=googlesitekit.data},51193:(e,t,i)=>{i.d(t,{Du:()=>p,GH:()=>l,Gp:()=>c,IS:()=>f,Jg:()=>g,N_:()=>M,O5:()=>N,Ql:()=>m,Qr:()=>h,XH:()=>y,r0:()=>u,sq:()=>I,tt:()=>d});var n=i(32091),o=i.n(n),r=i(17243),s=i(82871);const a="Date param must construct to a valid date instance or be a valid date instance itself.",l="Invalid dateString parameter, it must be a string.",c='Invalid date range, it must be a string with the format "last-x-days".',u=60,g=60*u,d=24*g,p=7*d;function m(){function e(e){return(0,s.sprintf)(/* translators: %s: number of days */ /* translators: %s: number of days */
|
|||
|
|
(0,s._n)("Last %s day","Last %s days",e,"google-site-kit"),e)}return{"last-7-days":{slug:"last-7-days",label:e(7),days:7},"last-14-days":{slug:"last-14-days",label:e(14),days:14},"last-28-days":{slug:"last-28-days",label:e(28),days:28},"last-90-days":{slug:"last-90-days",label:e(90),days:90}}}function h(e=""){if(!(0,r.isString)(e))return!1;if(3!==e.split("-").length)return!1;const t=new Date(e);return(0,r.isDate)(t)&&!isNaN(t)}function I(e){o()((0,r.isDate)(e)&&!isNaN(e),a);const t=`${e.getMonth()+1}`,i=`${e.getDate()}`;return[e.getFullYear(),t.length<2?`0${t}`:t,i.length<2?`0${i}`:i].join("-")}function y(e){o()(h(e),l);const[t,i,n]=e.split("-");return new Date(t,i-1,n)}function f(e,t){return I(M(e,t*d))}function N(e){const t=e.split("-");return 3===t.length&&"last"===t[0]&&!Number.isNaN(t[1])&&!Number.isNaN(parseFloat(t[1]))&&"days"===t[2]}function M(e,t){o()(h(e)||(0,r.isDate)(e)&&!isNaN(e),l);const i=h(e)?Date.parse(e):e.getTime();return new Date(i-1e3*t)}},52274:(e,t,i)=>{i.d(t,{i:()=>s});var n=i(63696),o=i(50539),r=i(7972);function s(e){const{setValue:t}=(0,o.useDispatch)(r.n);return(0,n.useCallback)(()=>{t("admin-screen-tooltip",{isTooltipVisible:!0,...e})},[t,e])}},52696:(e,t,i)=>{i.d(t,{WM:()=>n.WM,wA:()=>n.wA,ws:()=>n.ws});var n=i(49057);void 0===i.g.googlesitekit&&(i.g.googlesitekit={}),i.g.googlesitekit.data=n.Ay},52721:(e,t,i)=>{i.d(t,{w:()=>a});var n=i(35470),o=i(63696),r=i(85097);function s(){}function a(e,t){const i=(0,r.W)({sticky:!0}),a=(0,o.useRef)(),l=(0,o.useCallback)(e,t),c=(0,n.A)(i?l:s);return i&&(a.current=c),a.current}},52735:(e,t,i)=>{i.d(t,{A:()=>n});const n=(0,i(63696).createContext)(!1)},54419:e=>{e.exports=googlesitekit.api},54519:(e,t,i)=>{function n(e,t){for(const[i,n]of Object.entries(t))e.registerNotification(i,n)}i.d(t,{U:()=>n})},55103:(e,t,i)=>{i.d(t,{A:()=>SupportLink});var n=i(62688),o=i.n(n),r=i(50539),s=i(29785),a=i(38432),l=i(62540);function SupportLink(e){const{path:t,query:i,hash:n,...o}=e,c=(0,r.useSelect)(e=>e(s.O4).getGoogleSupportURL({path:t,query:i,hash:n}));return(0,l.jsx)(a.A,{...o,href:c})}SupportLink.propTypes={path:o().string.isRequired,query:o().object,hash:o().string}},55465:(e,t,i)=>{i.d(t,{O:()=>o});var n=i(31234);const o=i.n(n)()(i.g)},60515:(e,t,i)=>{i.d(t,{A:()=>p});var n=i(62688),o=i.n(n),r=i(4452),s=i.n(r),a=i(63696),l=i(82871),c=i(49383),u=i(5855),g=i(38432),d=i(62540);function NewBadge({tooltipTitle:e,learnMoreLink:t,forceOpen:i,hasLeftSpacing:n,hasNoSpacing:o,onLearnMoreClick:r=()=>{}}){const p=(0,d.jsx)(u.A,{className:s()("googlesitekit-new-badge",{"googlesitekit-new-badge--has-no-spacing":o}),label:(0,l.__)("New","google-site-kit"),hasLeftSpacing:n});return e?(0,d.jsx)(c.Tooltip,{tooltipClassName:"googlesitekit-new-badge__tooltip",title:(0,d.jsxs)(a.Fragment,{children:[e,(0,d.jsx)("br",{}),(0,d.jsx)(g.A,{href:t,onClick:r,external:!0,hideExternalIndicator:!0,children:(0,l.__)("Learn more","google-site-kit")})]}),placement:"top",enterTouchDelay:0,leaveTouchDelay:5e3,open:i,interactive:!0,children:p}):p}NewBadge.propTypes={tooltipTitle:o().string,learnMoreLink:o().string,forceOpen:o().bool,onLearnMoreClick:o().func,hasLeftSpacing:o().bool,hasNoSpacing:o().bool};const p=NewBadge},61983:(e,t,i)=>{i.d(t,{A:()=>DismissButton});var n=i(62688),o=i.n(n),r=i(82871),s=i(49383),a=i(62540);function DismissButton({className:e,label:t=(0,r.__)("Maybe later","google-site-kit"),onClick:i,disabled:n,tertiary:o=!0}){return i?(0,a.jsx)(s.Button,{className:e,onClick:i,disabled:n,tertiary:o,children:t}):null}DismissButton.propTypes={className:o().string,label:o().string,onClick:o().func,disabled:o().bool,tertiary:o().bool,dismissOptions:o().shape({expiresInSeconds:o().number,skipHidingFromQueue:o().bool})}},62051:(e,t,i)=>{i.d(t,{A:()=>LearnMoreLink});var n=i(62688),o=i.n(n),r=i(38432),s=i(68761),a=i(62540);function LearnMoreLink({id:e,label:t,url:i,ariaLabel:n,gaTrackingEventArgs:o,external:l=!0,...c}){const u=(0,s.A)(e);return(0,a.jsx)(r.A,{onClick:function(e){e.persist(),u.clickLearnMore(o?.label,o?.value)},href:i,"aria-label":n,external:l,...c,children:t})}LearnMoreLink.p
|
|||
|
|
(0,s.__)("%s (Please try again.)","google-site-kit"),M)),p||(M=(0,s.sprintf)(/* translators: $%s: Error message */ /* translators: $%s: Error message */
|
|||
|
|
(0,s.__)("Error: %s","google-site-kit"),M));const b=t?.data?.reconnectURL;b&&(0,a.m)(b)&&(M=(0,s.sprintf)(/* translators: 1: Original error message 2: Reconnect URL */ /* translators: 1: Original error message 2: Reconnect URL */
|
|||
|
|
(0,s.__)('%1$s To fix this, <a href="%2$s">redo the plugin setup</a>.',"google-site-kit"),M,b));return(0,d.jsx)(u.A,{className:e,type:u.A.TYPES.ERROR,description:(0,d.jsx)("span",{dangerouslySetInnerHTML:(0,g.p9)(M,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href"]})}),ctaButton:N?{label:(0,s.__)("Retry","google-site-kit"),onClick:f}:void 0,hideIcon:h})}ErrorNotice.propTypes={className:o().string,error:o().shape({message:o().string}),hasButton:o().bool,storeName:o().string,message:o().string,noPrefix:o().bool,skipRetryMessage:o().bool,hideIcon:o().bool}},73866:(e,t,i)=>{i.d(t,{g4:()=>h,o1:()=>m});var n=i(78913),o=i(32091),r=i.n(o),s=i(10523),a=i.n(s),l=i(13047),c=i(50539);const u="RECEIVE_ERROR",g="CLEAR_ERROR",d="CLEAR_ERRORS";function p(e,t){if(t&&Array.isArray(t)){const i=t.map(e=>"object"==typeof e?(0,l.Zm)(e):e);return`${e}::${a()(JSON.stringify(i))}`}return e}const m={receiveError:(e,t,i=[])=>(r()(e,"error is required."),r()(t,"baseName is required."),r()(i&&Array.isArray(i),"args must be an array."),{type:u,payload:{error:e,baseName:t,args:i}}),clearError:(e,t=[])=>(r()(e,"baseName is required."),r()(t&&Array.isArray(t),"args must be an array."),{type:g,payload:{baseName:e,args:t}}),clearErrors:e=>({type:d,payload:{baseName:e}})};function h(e){r()(e,"storeName must be defined.");const t=(0,c.createReducer)((e,{type:t,payload:i})=>{switch(t){case u:{const{baseName:t,args:n,error:o}=i,r=p(t,n);e.errors=e.errors||{},e.errorArgs=e.errorArgs||{},e.errors[r]=o,e.errorArgs[r]=n;break}case g:{const{baseName:t,args:n}=i,o=p(t,n);e.errors=e.errors||{},e.errorArgs=e.errorArgs||{},delete e.errors[o],delete e.errorArgs[o];break}case d:{const{baseName:t}=i;if(t){e.errors=e.errors||{},e.errorArgs=e.errorArgs||{};for(const i in e.errors)(i===t||i.startsWith(`${t}::`))&&(delete e.errors[i],delete e.errorArgs[i])}else e.errors={},e.errorArgs={};break}}}),i={getErrorForSelector:(e,t,n=[])=>(r()(t,"selectorName is required."),i.getError(e,t,n)),getErrorForAction:(e,t,n=[])=>(r()(t,"actionName is required."),i.getError(e,t,n)),getError(e,t,i){const{errors:n}=e;return r()(t,"baseName is required."),n[p(t,i)]},getErrors(e){const t=new Set(Object.values(e.errors));return Array.from(t)},getMetaDataForError(e,t){const i=Object.keys(e.errors).find(i=>e.errors[i]===t);if(i){return{baseName:i.substring(0,i.indexOf("::")),args:e.errorArgs[i]}}return null},getSelectorDataForError:(0,n.N)(t=>function(i,n){const o=t(e).getMetaDataForError(n);if(o){const{baseName:i,args:n}=o;if(!!t(e)[i])return{storeName:e,name:i,args:n}}return null}),hasErrors:e=>i.getErrors(e).length>0};return{initialState:{errors:{},errorArgs:{}},actions:m,controls:{},reducer:t,resolvers:{},selectors:i}}},74426:(e,t,i)=>{function n(e){return e.charAt(0).toUpperCase()+e.slice(1)}function o(e){return e.replace(/([a-z0-9]{1})([A-Z]{1})/g,"$1_$2").toUpperCase()}function r(e){return e.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join("")}i.d(t,{Uf:()=>r,m2:()=>n,sP:()=>o})},75649:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(82871),o=i(63696);function r({isDismissalFinal:e}={}){const[t]=(0,o.useState)(!0===e?(0,n.__)("Don’t show again","google-site-kit"):(0,n.__)("Maybe later","google-site-kit"));return t}},76984:(e,t,i)=>{i.d(t,{Q:()=>n});const n={NEW:"new",SUCCESS:"success",WARNING:"warning",INFO:"info",INFO_ALT:"info-alt",INFO_ALT_2:"info-alt-2",ERROR:"error"}},78014:(e,t,i)=>{i.d(t,{A:()=>StoreErrorNotices});var n=i(62688),o=i.n(n),r=i(50539),s=i(73198),a=i(88273),l=i(13137),c=i(31012),u=i(62540);function StoreErrorNotices({hasButton:e=!1,moduleSlug:t,storeName:i}){const n=(0,r.useSelect)(e=>e(i).getErrors()),o=(0,r.useSelect)(e=>e(a.i).getModule(t)),g=[];return n.filter(e=>!(!e?.message||g.includes(e.message))&&(g.push(e.message),!0)).map((t,n)=>{let{message:r}=t;return(0,l.SG)(t)&&(r=(0,c.c)(r,o)),(0,u.jsx)(s.A,{error:t,hasButton:e,storeName:i,message:r},n)})}StoreErrorNotices.propTypes={hasButton:o().bool,storeName:o().string.isRequired,moduleSlug:o().string}},79961:(e,t,i)=>{i.d(t,{A:()=>r});var n=i(63696),o=i(84895);const r=(0,n.createContext)(o.t)},80452:(e,t,i)=>{i.d(t,{A:()=>_
|