Site Kit by Google - Version 1.7.1

Version Description

Download this release

Release Info

Developer flixos90
Plugin Icon 128x128 Site Kit by Google
Version 1.7.1
Comparing to
See all releases

Code changes from version 1.7.0 to 1.7.1

Files changed (34) hide show
  1. dist/assets/js/ads.js +1 -1
  2. dist/assets/js/chunk-googlesitekit-adminbar-0e532f3d6c0b4943f6fd.js +29 -0
  3. dist/assets/js/chunk-googlesitekit-adminbar-6a3138e50217e279fc5b.js +0 -29
  4. dist/assets/js/chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard~chunk-googlesitekit-setup-wizard-proxy-2422cbe0801b8fe596c6.js +1 -0
  5. dist/assets/js/chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard~chunk-googlesitekit-setup-wizard-proxy-521957e350e8b8963c17.js +0 -1
  6. dist/assets/js/chunk-googlesitekit-setup-wizard-71f185e0b62512548cd9.js +0 -7
  7. dist/assets/js/chunk-googlesitekit-setup-wizard-942ae0fa5502c4f41282.js +7 -0
  8. dist/assets/js/chunk-googlesitekit-setup-wizard-proxy-4b07df8eeb258191269b.js +5 -0
  9. dist/assets/js/chunk-googlesitekit-setup-wizard-proxy-6ab90125e13406ab19e1.js +0 -5
  10. dist/assets/js/chunk-googlesitekit-setup-wrapper-3d470b26536110aecd6c.js +0 -1
  11. dist/assets/js/chunk-googlesitekit-setup-wrapper-62b5b16776b62af68252.js +1 -0
  12. dist/assets/js/googlesitekit-activation.js +9 -9
  13. dist/assets/js/googlesitekit-admin.js +1 -1
  14. dist/assets/js/googlesitekit-adminbar-loader.js +2 -2
  15. dist/assets/js/googlesitekit-api.js +5 -5
  16. dist/assets/js/googlesitekit-dashboard-details.js +23 -23
  17. dist/assets/js/googlesitekit-dashboard-splash.js +8 -8
  18. dist/assets/js/googlesitekit-dashboard.js +25 -25
  19. dist/assets/js/googlesitekit-data.js +1 -1
  20. dist/assets/js/googlesitekit-datastore-site.js +1 -1
  21. dist/assets/js/googlesitekit-module.js +24 -24
  22. dist/assets/js/googlesitekit-modules.js +1 -1
  23. dist/assets/js/googlesitekit-settings.js +32 -32
  24. dist/assets/js/googlesitekit-vendor.js +1 -1
  25. dist/assets/js/googlesitekit-wp-dashboard.js +22 -22
  26. dist/assets/js/vendors~chunk-googlesitekit-adminbar-711f81202b21622c492a.js +1 -0
  27. dist/assets/js/vendors~chunk-googlesitekit-adminbar-a7f81ecf39a2695b860a.js +0 -1
  28. dist/assets/js/vendors~chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard-proxy-ab1432a35d53db6a9ee4.js +0 -1
  29. dist/assets/js/vendors~chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard-proxy-afa5462390409683f6d7.js +1 -0
  30. google-site-kit.php +2 -2
  31. includes/Modules/Analytics.php +23 -1
  32. includes/Modules/Tag_Manager.php +23 -6
  33. includes/Plugin.php +9 -0
  34. readme.txt +1 -1
dist/assets/js/ads.js CHANGED
@@ -1 +1 @@
1
- !function(e){function r(r){for(var t,u,i=r[0],a=r[1],p=r[2],l=0,f=[];l<i.length;l++)u=i[l],Object.prototype.hasOwnProperty.call(n,u)&&n[u]&&f.push(n[u][0]),n[u]=0;for(t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);for(c&&c(r);f.length;)f.shift()();return o.push.apply(o,p||[]),_()}function _(){for(var e,r=0;r<o.length;r++){for(var _=o[r],t=!0,u=1;u<_.length;u++){var i=_[u];0!==n[i]&&(t=!1)}t&&(o.splice(r--,1),e=__webpack_require__(__webpack_require__.s=_[0]))}return e}var t={},n={3:0},o=[];function __webpack_require__(r){if(t[r])return t[r].exports;var _=t[r]={i:r,l:!1,exports:{}};return e[r].call(_.exports,_,_.exports,__webpack_require__),_.l=!0,_.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,r,_){__webpack_require__.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:_})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,r){if(1&r&&(e=__webpack_require__(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var _=Object.create(null);if(__webpack_require__.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var t in e)__webpack_require__.d(_,t,function(r){return e[r]}.bind(null,t));return _},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,"a",r),r},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.p="";var u=window.webpackJsonp=window.webpackJsonp||[],i=u.push.bind(u);u.push=r,u=u.slice();for(var a=0;a<u.length;a++)r(u[a]);var c=i;o.push([360,0]),_()}({360:function(e,r,_){(function(e){void 0===e.googlesitekit&&(e.googlesitekit={}),e.googlesitekit.canAdsRun=!0,document.addEventListener("DOMContentLoaded",(function(){e.googlesitekit.canAdsRun=!0}))}).call(this,_(16))}});
1
+ !function(e){function r(r){for(var t,u,i=r[0],a=r[1],p=r[2],l=0,f=[];l<i.length;l++)u=i[l],Object.prototype.hasOwnProperty.call(n,u)&&n[u]&&f.push(n[u][0]),n[u]=0;for(t in a)Object.prototype.hasOwnProperty.call(a,t)&&(e[t]=a[t]);for(c&&c(r);f.length;)f.shift()();return o.push.apply(o,p||[]),_()}function _(){for(var e,r=0;r<o.length;r++){for(var _=o[r],t=!0,u=1;u<_.length;u++){var i=_[u];0!==n[i]&&(t=!1)}t&&(o.splice(r--,1),e=__webpack_require__(__webpack_require__.s=_[0]))}return e}var t={},n={3:0},o=[];function __webpack_require__(r){if(t[r])return t[r].exports;var _=t[r]={i:r,l:!1,exports:{}};return e[r].call(_.exports,_,_.exports,__webpack_require__),_.l=!0,_.exports}__webpack_require__.m=e,__webpack_require__.c=t,__webpack_require__.d=function(e,r,_){__webpack_require__.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:_})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,r){if(1&r&&(e=__webpack_require__(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var _=Object.create(null);if(__webpack_require__.r(_),Object.defineProperty(_,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var t in e)__webpack_require__.d(_,t,function(r){return e[r]}.bind(null,t));return _},__webpack_require__.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(r,"a",r),r},__webpack_require__.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},__webpack_require__.p="";var u=window.webpackJsonp=window.webpackJsonp||[],i=u.push.bind(u);u.push=r,u=u.slice();for(var a=0;a<u.length;a++)r(u[a]);var c=i;o.push([404,0]),_()}({404:function(e,r,_){(function(e){void 0===e.googlesitekit&&(e.googlesitekit={}),e.googlesitekit.canAdsRun=!0,document.addEventListener("DOMContentLoaded",(function(){e.googlesitekit.canAdsRun=!0}))}).call(this,_(16))}});
dist/assets/js/chunk-googlesitekit-adminbar-0e532f3d6c0b4943f6fd.js ADDED
@@ -0,0 +1,29 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[4],[,function(e,t,a){"use strict";(function(e){a.d(t,"d",(function(){return r})),a.d(t,"a",(function(){return c})),a.d(t,"e",(function(){return d})),a.d(t,"f",(function(){return u})),a.d(t,"g",(function(){return g})),a.d(t,"h",(function(){return m})),a.d(t,"b",(function(){return b})),a.d(t,"i",(function(){return f})),a.d(t,"j",(function(){return k})),a.d(t,"k",(function(){return O})),a.d(t,"c",(function(){return D})),a.d(t,"l",(function(){return C})),a.d(t,"m",(function(){return N})),a.d(t,"n",(function(){return P})),a.d(t,"o",(function(){return L})),a.d(t,"p",(function(){return I})),a.d(t,"q",(function(){return M})),a.d(t,"r",(function(){return W}));var n=a(102);void 0===e.googlesitekit&&(e.googlesitekit={});var i=e.googlesitekit._element||n,o=i.__experimentalCreateInterpolateElement,s=i.Children,r=i.cloneElement,c=i.Component,l=i.concatChildren,d=i.createContext,u=i.createElement,g=i.createPortal,m=i.createRef,p=i.findDOMNode,h=i.forwardRef,b=i.Fragment,_=i.isEmptyElement,f=i.isValidElement,k=i.lazy,y=i.memo,v=i.Platform,S=i.RawHTML,O=i.render,E=i.renderToString,j=i.StrictMode,D=i.Suspense,w=i.switchChildrenNodeName,A=i.unmountComponentAtNode,C=i.useCallback,N=i.useContext,x=i.useDebugValue,P=i.useEffect,T=i.useImperativeHandle,L=i.useLayoutEffect,I=i.useMemo,M=i.useReducer,W=i.useRef,R=i.useState;void 0===e.googlesitekit._element&&(e.googlesitekit._element={__experimentalCreateInterpolateElement:o,Children:s,cloneElement:r,Component:c,concatChildren:l,createContext:d,createElement:u,createPortal:g,createRef:m,findDOMNode:p,forwardRef:h,Fragment:b,isEmptyElement:_,isValidElement:f,lazy:k,memo:y,Platform:v,RawHTML:S,render:O,renderToString:E,StrictMode:j,Suspense:D,switchChildrenNodeName:w,unmountComponentAtNode:A,useCallback:C,useContext:N,useDebugValue:x,useEffect:P,useImperativeHandle:T,useLayoutEffect:L,useMemo:I,useReducer:M,useRef:W,useState:R})}).call(this,a(16))},function(e,t,a){"use strict";(function(e){a.d(t,"v",(function(){return I})),a.d(t,"t",(function(){return M})),a.d(t,"q",(function(){return R})),a.d(t,"u",(function(){return U})),a.d(t,"i",(function(){return q})),a.d(t,"b",(function(){return z})),a.d(t,"e",(function(){return G})),a.d(t,"l",(function(){return H})),a.d(t,"n",(function(){return F})),a.d(t,"f",(function(){return B})),a.d(t,"o",(function(){return K})),a.d(t,"B",(function(){return Y})),a.d(t,"C",(function(){return V})),a.d(t,"j",(function(){return J})),a.d(t,"a",(function(){return Q})),a.d(t,"z",(function(){return $})),a.d(t,"x",(function(){return ee})),a.d(t,"d",(function(){return te})),a.d(t,"g",(function(){return ae})),a.d(t,"h",(function(){return ne})),a.d(t,"s",(function(){return ie})),a.d(t,"k",(function(){return oe}));var n=a(10),i=a.n(n),o=a(64),s=a.n(o),r=a(20),c=a.n(r),l=a(114),d=a.n(l),u=a(34),g=a.n(u),m=(a(1),a(13)),p=a(11),h=a.n(p),b=a(43),_=a(12),f=a(0),k=a(42),y=a(192),v=a(23),S=a(91),O=a(92),E=a(93),j=a(33),D=a(45);a.d(t,"A",(function(){return D.c}));var w=a(62);a.d(t,"w",(function(){return w.a}));var A=a(88);a.d(t,"y",(function(){return A.a}));var C=a(72);a.d(t,"c",(function(){return C.b})),a.d(t,"m",(function(){return C.c}));var N=a(89);a.d(t,"p",(function(){return N.a}));var x=a(90);function P(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function T(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?P(a,!0).forEach((function(t){c()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):P(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}a.d(t,"r",(function(){return x.a}));var L=function(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=Object(m.isFinite)(e)?e:Number(e),Object(m.isFinite)(e)||(console.warn("Invalid number",e,g()(e)),e=0),t)return M(e,{style:"currency",currency:t});var a={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?Object(f.sprintf)(// translators: %s: an abbreviated number in millions.
2
+ Object(f.__)("%sM","google-site-kit"),M(L(e),e%10==0?{}:a)):1e4<=e?Object(f.sprintf)(// translators: %s: an abbreviated number in thousands.
3
+ Object(f.__)("%sK","google-site-kit"),M(L(e))):1e3<=e?Object(f.sprintf)(// translators: %s: an abbreviated number in thousands.
4
+ Object(f.__)("%sK","google-site-kit"),M(L(e),e%10==0?{}:a)):e.toString()},M=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.locale,n=void 0===a?W():a,i=d()(t,["locale"]);return new Intl.NumberFormat(n,i).format(e)},W=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,a=Object(m.get)(t,["googlesitekit","locale","","lang"]);if(a){var n=a.match(/^(\w{2})?(_)?(\w{2})/);if(n&&n[0])return n[0].replace(/_/g,"-")}return t.navigator.language},R=function(e){switch(e){case"minute":return 60;case"hour":return 3600;case"day":return 86400;case"week":return 604800;case"month":return 2592e3;case"year":return 31536e3}},U=function(e){if(e=parseInt(e,10),isNaN(e)||0===e)return"0.0s";var t={};return t.hours=Math.floor(e/60/60),t.minutes=Math.floor(e/60%60),t.seconds=Math.floor(e%60),((t.hours?t.hours+"h ":"")+(t.minutes?t.minutes+"m ":"")+(t.seconds?t.seconds+"s ":"")).trim()},q=function(e,t){var a=1e3*R("day"),n=e.getTime(),i=t.getTime();return Math.round(Math.abs(n-i)/a)},z=function(e,t){if("0"===e||0===e||isNaN(e))return"";var a=((t-e)/e*100).toFixed(1);return isNaN(a)||"Infinity"===a?"":a},G=function(e,t){return Object(m.map)(e,(function(e,a){return[e[0],e[t]||(0===a?"":0)]}))},H=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.googlesitekit,a=t.modules;return a?Object.keys(a).reduce((function(e,t){return"object"!==g()(a[t])?e:void 0===a[t].slug||void 0===a[t].name||a[t].slug!==t?e:T({},e,c()({},t,a[t]))}),{}):{}},F=function(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.googlesitekit,i=n.admin,o=i.connectURL,s=i.adminRoot,r=n.setup.needReauthenticate,c=H(n)[t].screenID,l="pagespeed-insights"===t?{notification:"authentication_success",reAuth:void 0}:{},d=Object(k.a)(s,T({page:t&&a&&c?c:"googlesitekit-dashboard",slug:t,reAuth:a},l));if(!r)return d;var u=encodeURIComponent(Object(y.a)(d));return d=s+"?"+u,Object(k.a)(o,{redirect:d,status:a})},B=function(e,t){return function(a){return function InnerComponent(n){return h.a.createElement(e,s()({},n,t,{OriginalComponent:a}))}}},K=function(t,a){var n=e.googlesitekit.admin.adminRoot;return t||(t="googlesitekit-dashboard"),a=T({page:t},a),Object(k.a)(n,a)},Y=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},V=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}#x2F;)},J=function(t){var a,n,o,s,r;return i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return a=e.googlesitekit.admin,n=a.homeURL,o=a.ampMode,s={tagverify:1,timestamp:Date.now()},c.next=4,i.a.awrap(X(Object(k.a)(n,s),t));case 4:if((r=c.sent)||"secondary"!==o){c.next=9;break}return c.next=8,i.a.awrap(Object(b.default)({path:"/wp/v2/posts?per_page=1"}).then((function(e){return e.slice(0,1).map((function(e){return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,i.a.awrap(X(Object(k.a)(e.link,T({},s,{amp:1})),t));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}))})).pop()})));case 8:r=c.sent;case 9:return c.abrupt("return",Promise.resolve(r||null));case 10:case"end":return c.stop()}}))},X=function(e,t){var a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(fetch(e,{credentials:"omit"}).then((function(e){return e.text()})));case 3:return a=n.sent,n.abrupt("return",Z(a,t)||null);case 7:return n.prev=7,n.t0=n.catch(0),n.abrupt("return",null);case 10:case"end":return n.stop()}}),null,null,[[0,7]])},Z=function(e,t){var a=({adsense:O.a,analytics:E.a,tagmanager:j.d,setup:S.a}[t]||[]).find((function(t){return t.test(e)}));return!!a&&a.exec(e)[1]},Q=function(e,t,a){return e.setModuleActive(t,a).then((function(e){var a=H();return a[t]&&(a[t].active=e.active),Object(D.c)("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},$=function(t,a,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.googlesitekit,s=H(o)[t],r=s.settings,c=s.setupComplete,l=i||document.getElementById("confirm-changes-".concat(t));if(c&&l){var d=!!Object.keys(a).find((function(e){var t=a[e];return!Object(m.isEqual)(n[e],r[t])}));return i||(l.disabled=!d),d}},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(_.b)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",B(e,t),1)},te=function(e){if(!e)return"";var t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)})).replace(/(\\)/g,"");return Object(m.unescape)(t)};function ae(){var e=Object(_.c)("googlesitekit.dateRange","last-28-days").match(/last-(\d+)-days/);if(e&&e[1])return Object(f.sprintf)(Object(f._n)("%s day","%s days",parseInt(e[1],10),"google-site-kit"),e[1]);throw new Error("Unrecognized date range slug used in `googlesitekit.dateRange`.")}function ne(){return Object(_.c)("googlesitekit.dateRange","last-28-days")}function ie(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(e.googlesitekit){var s=h.a.createElement(v.a,{id:t,width:n,height:i,className:o});return a?s=h.a.createElement(v.a,{id:"".concat(t,"-disabled"),width:n,height:i,className:o}):"pagespeed-insights"===t&&(s=h.a.createElement("img",{src:e.googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:n,alt:"",className:o})),s}}function oe(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e._googlesitekitBaseData,n=a.blogPrefix;return a.isNetworkMode?t:n+t}}).call(this,a(16))},,,,,,,function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return b})),a.d(t,"b",(function(){return _}));var n=a(20),i=a.n(n),o=a(34),s=a.n(o),r=a(13),c=a(43),l=a(42),d=a(12),u=a(2),g=a(70),m=a(101);function p(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function h(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?p(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):p(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var b="core",_="modules",f=function(){e.googlesitekit.admin=e.googlesitekit.admin||{},"string"==typeof e.googlesitekit.admin.datacache&&(e.googlesitekit.admin.datacache=JSON.parse(e.googlesitekit.admin.datacache)),"object"!==s()(e.googlesitekit.admin.datacache)&&(e.googlesitekit.admin.datacache={})},k=function(e,t){var a=h({data:{}},e);return a.data=h({dateRange:t},a.data),a},y={maxRequests:10,combinedGetFromCache:function(e){var t=this;return new Promise((function(a,n){try{var i=[],o=Object(u.h)();Object(r.each)(e,(function(e){var a=k(e,o);a.key=t.getCacheKey(a.type,a.identifier,a.datapoint,a.data);var n=t.getCache(a.key,a.maxAge);void 0!==n&&(i[a.key]=n,t.resolve(a,n))})),a(i)}catch(e){n()}}))},combinedGet:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],i=25,o=Object(u.h)();Object(r.each)(e,(function(e){var a=k(e,o);a.key=t.getCacheKey(a.type,a.identifier,a.datapoint,a.data);var s=t.getCache(a.key,a.maxAge);void 0!==s?(setTimeout((function(){t.resolve(a,s)}),i),i+=25):n.push(a)})),n=Object(r.sortBy)(n,"priority");var s=[],g=[],m={},p=!!n.find((function(e){return e.priority<10}));Object(r.each)(n,(function(e,t){!a&&10<=e.priority&&p?g.push(e):m[e.key]?m[e.key].push(t):(m[e.key]=[t],s.push(e))}));var h=10,b=s.slice(0,h),_=s.slice(h);if(_=_.concat(g),0!==b.length||0!==_.length){0<_.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(_,!0)}),50):this.maxRequests=10;var f=null!==Object(u.m)("datacache");return Object(c.default)({path:Object(l.a)("/google-site-kit/v1/data/",{datacache:f||void 0}),data:{request:b},method:"POST"}).then((function(e){Object(r.each)(e,(function(e,a){m[a]?(t.handleWPError(e),Object(r.each)(m[a],(function(a){var i=n[a];t.setCache(i.key,e),t.resolve(i,e)})),0===_.length&&Object(d.d)("googlesitekit.dataLoaded","api")):console.error("data_error","unknown response key "+a)}))})).catch((function(e){console.warn("Error caught during combinedGet",e)}))}Object(d.d)("googlesitekit.dataLoaded","cache")},handleWPError:function(e){var t=["code","data","message"],a=Object(r.intersection)(t,Object.keys(e));if(Object(r.isEqual)(t,a)){console.warn("WP Error in data response",e);var n=e.data;if(n&&n.reason){var i=0;["authError","insufficientPermissions"].includes(n.reason)&&(Object(d.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(u.f)(g.a),1),i++),"forbidden"===n.reason&&(Object(d.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(u.f)(m.a),1),i++),i&&Object(d.b)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(d.g)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+i}))}}},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(t,a){if(void 0!==a&&(!a||"object"!==s()(a)||!a.error&&!a.errors)){f(),e.googlesitekit.admin.datacache[t]=Object(r.cloneDeep)(a);var n={value:a,date:Date.now()/1e3};Object(u.p)().setItem("googlesitekit_"+t,JSON.stringify(n))}},getCache:function(t,a){if(!e.googlesitekit.admin.nojscache){if(f(),void 0!==e.googlesitekit.admin.datacache[t])return e.googlesitekit.admin.datacache[t];var n=JSON.parse(Object(u.p)().getItem("googlesitekit_"+t));return n&&"object"===s()(n)&&n.date&&(!a||Date.now()/1e3-n.date<a)?(e.googlesitekit.admin.datacache[t]=Object(r.cloneDeep)(n.value),Object(r.cloneDeep)(e.googlesitekit.admin.datacache[t])):void 0}},deleteCache:function(t){f(),delete e.googlesitekit.admin.datacache[t],Object(u.p)().removeItem("googlesitekit_"+t)},invalidateCacheGroup:function(t,a,n){var i=this.getCacheKey(t,a,n);f(),Object.keys(e.googlesitekit.admin.datacache).forEach((function(t){0!==t.indexOf(i+"::")&&t!==i||delete e.googlesitekit.admin.datacache[t]})),Object.keys(Object(u.p)()).forEach((function(e){0!==e.indexOf("googlesitekit_".concat(i,"::"))&&e!=="googlesitekit_".concat(i)||Object(u.p)().removeItem(e)}))},collectModuleData:function(e,t){var a=Object(d.c)("googlesitekit.module"+e+"DataRequest",[],t);0!==a.length&&this.combinedGet(a)},get:function(e,t,a){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.getCacheKey(e,t,a,i);if(!o){var r=this.getCache(s,3600);if(void 0!==r)return new Promise((function(e){e(r)}))}return Object(c.default)({path:Object(l.a)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(a),i)}).then((function(e){return o||n.setCache(s,e),Promise.resolve(e)})).catch((function(e){return n.handleWPError(e),Promise.reject(e)}))},set:function(e,t,a,n){var i={};return i.data=n,Object(c.default)({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(a),data:i,method:"POST"}).then((function(n){return y.invalidateCacheGroup(e,t,a),new Promise((function(e){e(n)}))}))},getCacheKey:function(e,t,a){for(var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=[],o=[e,t,a],r=0,c=o;r<c.length;r++){var l=c[r];if(!l||!l.length)break;i.push(l)}return 3===i.length&&n&&"object"===s()(n)&&Object.keys(n).length&&i.push(Object(u.y)(n)),i.join("::")},setModuleActive:function(e,t){return this.set(b,"modules","activation",{slug:e,active:t})}};Object(d.e)("googlesitekit.moduleLoaded","googlesitekit.collectModuleData")||Object(d.a)("googlesitekit.moduleLoaded","googlesitekit.collectModuleData",y.collectModuleData.bind(y)),t.c=y}).call(this,a(16))},,,function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"f",(function(){return r})),a.d(t,"g",(function(){return c})),a.d(t,"e",(function(){return l})),a.d(t,"d",(function(){return m})),a.d(t,"c",(function(){return p}));var n=a(96);void 0===e.googlesitekit&&(e.googlesitekit={});var i=e.googlesitekit._hooks||n,o=i.addAction,s=i.addFilter,r=i.removeAction,c=i.removeFilter,l=i.hasAction,d=i.hasFilter,u=i.removeAllActions,g=i.removeAllFilters,m=i.doAction,p=i.applyFilters,h=i.currentAction,b=i.currentFilter,_=i.doingAction,f=i.doingFilter,k=i.didAction,y=i.didFilter,v=i.actions,S=i.filters;void 0===e.googlesitekit._hooks&&(e.googlesitekit._hooks={addAction:o,addFilter:s,removeAction:r,removeFilter:c,hasAction:l,hasFilter:d,removeAllActions:u,removeAllFilters:g,doAction:m,applyFilters:p,currentAction:h,currentFilter:b,doingAction:_,doingFilter:f,didAction:k,didFilter:y,actions:v,filters:S})}).call(this,a(16))},,,,,function(e,t,a){"use strict";a.d(t,"e",(function(){return s})),a.d(t,"c",(function(){return c})),a.d(t,"d",(function(){return l})),a.d(t,"b",(function(){return d})),a.d(t,"f",(function(){return u})),a.d(t,"h",(function(){return g})),a.d(t,"a",(function(){return m})),a.d(t,"j",(function(){return p})),a.d(t,"i",(function(){return h})),a.d(t,"l",(function(){return b})),a.d(t,"k",(function(){return _})),a.d(t,"g",(function(){return f}));var n=a(13),i=a(0),o=a(2),s=function(e){if(!e||!e.length)return null;var t=e[0].data,a=t.rows,i=t.totals[0].values[0],o=[["Source","Percent"]];return Object(n.each)(a,(function(e){var t=e.metrics[0].values[0]/i;if(1>100*t)return!1;var a=e.dimensions[0].replace(/\(none\)/gi,"direct");o.push([a,t])})),o};function r(e,t){var a=[];return Object(n.each)(e,(function(e){if(e.metrics){var n=e.metrics[0].values,i=e.dimensions[0],o=i.slice(0,4)+"-"+i.slice(4,6)+"-"+i.slice(6,8),s=new Date(o);a.push([s,n[t]])}})),a}var c=function(e,t,a){if(!e||!e.length)return null;var o=e[0].data.rows;if(!o)return!1;var s=o.length;if(2*a>s){for(var c=new Date,l=0;a>l;l++){var d=(c.getMonth()+1).toString(),u=c.getDate().toString(),g=c.getFullYear().toString()+(2>d.length?"0":"")+d+(2>u.length?"0":"")+u;if(l>s){var m={dimensions:[g],metrics:[{values:[0,0,0,0,0]}]};o.unshift(m)}c.setDate(c.getDate()-1)}o.push([0,0])}var p=[Object(i.__)("Users","google-site-kit"),Object(i.__)("Sessions","google-site-kit"),Object(i.__)("Bounce Rate","google-site-kit"),Object(i.__)("Session Duration","google-site-kit")],h=[[{type:"date",label:Object(i.__)("Day","google-site-kit")},{type:"number",label:p[t]},{type:"number",label:Object(i.__)("Previous month","google-site-kit")}]],b=o.slice(o.length-a,o.length),_=o.slice(0,o.length-a),f=r(b,t),k=r(_,t);return Object(n.each)(f,(function(e,t){e[0]&&e[1]&&k[t]&&h.push([e[0],e[1],k[t][1]])})),h},l=function(e){if(!e||!e.length)return null;var t=e[0].data.rows,a=[[{type:"date",label:"Day"},{type:"number",label:"Users"},{type:"number",label:"Sessions"},{type:"number",label:"Goals Completed"}]];return Object(n.each)(t,(function(e){var t=e.metrics[0].values,n=e.dimensions[0],i=n.slice(0,4)+"-"+n.slice(4,6)+"-"+n.slice(6,8),o=new Date(i);a.push([o,t[0],t[1],t[4]])})),a},d=function(e){if(!e||!e.length)return!1;var t=e[0].data.totals,a=t[0].values,n=t[1].values,i=a[0],s=a[1],r=a[2],c=a[3],l=a[4],d=a[5];return{totalUsers:i,totalSessions:s,averageBounceRate:r,averageSessionDuration:c,totalUsersChange:Object(o.b)(n[0],a[0]),totalSessionsChange:Object(o.b)(n[1],a[1]),averageBounceRateChange:Object(o.b)(n[2],a[2]),averageSessionDurationChange:Object(o.b)(n[3],a[3]),goalCompletions:l,goalCompletionsChange:Object(o.b)(n[4],a[4]),totalPageViews:d,totalPageViewsChange:Object(o.b)(n[5],a[5])}},u=function(e){return!(!e.error||!e.error.status)&&function(e,t){var a="";switch(e){case"INVALID_ARGUMENT":a=Object(i.__)("Analytics module needs to be configured.","google-site-kit");break;case"UNAUTHENTICATED":a=Object(i.__)("You need to be authenticated to get this data.","google-site-kit");break;case"PERMISSION_DENIED":a=Object(i.__)("Your account does not have sufficient permission to access this data, please consult to your web administrator.","google-site-kit");break;case"RESOURCE_EXHAUSTED":a=Object(i.__)("Your account exceeded the maximum quota. Please try again later.","google-site-kit");break;case"INTERNAL":a=Object(i.__)("Unexpected internal server error occurred.","google-site-kit");break;case"BACKEND_ERROR":a=Object(i.__)("Analytics server returned unknown error. Please try again later.","google-site-kit");break;case"UNAVAILABLE":a=Object(i.__)("The service was unable to process the request. Please try again later.","google-site-kit");break;default:a=t}return a}(e.error.status,e.error.message)},g=function(e){if(!e||!e.length)return!0;if(e&&e[0]&&e[0].data&&e[0].data.totals&&e[0].data.totals[0]){var t=e[0].data.totals[0].values,a=!0;return Object(n.each)(t,(function(e){0!==parseInt(e)&&(a=!1)})),a}return!1},m={dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:[{expression:"ga:adsenseRevenue",alias:"Earnings"},{expression:"ga:adsenseECPM",alias:"Page RPM"},{expression:"ga:adsensePageImpressions",alias:"Impressions"}],orderby:[{fieldName:"ga:adsenseRevenue",sortOrder:"DESCENDING"}],limit:10},p={compareDateRanges:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"}],limit:180},h={multiDateRange:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"},{expression:"ga:pageviews",alias:"Pageviews"}],limit:10},b={metrics:[{expression:"ga:users",alias:"Total Users"}]},_={dimensions:"ga:medium",metrics:[{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:users",alias:"Users"},{expression:"ga:newUsers",alias:"New Users"}],orderby:[{fieldName:"ga:sessions",sortOrder:"DESCENDING"}],limit:10},f=function(){var e=[{expression:"ga:pageviews",alias:"Pageviews"},{expression:"ga:uniquePageviews",alias:"Unique Pageviews"},{expression:"ga:bounceRate",alias:"Bounce rate"}];return Object(o.l)().analytics.settings.adsenseLinked&&e.push({expression:"ga:adsenseRevenue",alias:"AdSense Revenue"},{expression:"ga:adsenseECPM",alias:"AdSense ECPM"}),{dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:e,orderby:[{fieldName:"ga:pageviews",sortOrder:"DESCENDING"}],limit:10}}},function(e,t,a){"use strict";(function(e){var n=a(64),i=a.n(n),o=a(4),s=a.n(o),r=a(5),c=a.n(r),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(8),p=a.n(m),h=a(1),b=a(13),_=a(12),f=a(0),k=a(2),y=a(46),v=a(39),S=a(78);t.a=function(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{inGrid:!1,fullWidth:!1,createGrid:!1},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1},l=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(e){if(e&&e.error)return e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(f.__)("Unidentified error","google-site-kit");if(e&&e.errors&&e.errors[0]&&e.errors[0].message)return e.errors[0].message;if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"RateLimitExceeded"===t[0].reason)return Object(f.__)("Too many requests have been sent within a given time span. Please reload this page again in a few seconds","google-site-kit")}if(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1};return function(u){function NewComponent(e){var t;s()(this,NewComponent),(t=d()(this,g()(NewComponent).call(this,e))).state={data:!1,zeroData:!1,error:!1},Object(_.a)("googlesitekit.moduleDataReset","googlesitekit.moduleDataResetHandler",(function(){t.setState({data:!1})}));var n=function(e,a){var n=t.props,i=n.handleDataError,o=n.handleDataSuccess,s=a.datapoint,c=a.identifier,d=a.toState,u=l(e);u?(t.setState({error:u,module:c}),i&&i(u)):r(e,s,a)?(i&&i(u),t.setState({zeroData:!0})):o&&o(),t.setState({requestDataToState:d,data:e,datapoint:s,module:c})};return Object(b.each)(a,(function(e){Array.isArray(e.context)?Object(b.each)(e.context,(function(t){Object(_.b)("googlesitekit.module".concat(t,"DataRequest"),"googlesitekit.data".concat(t),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})):Object(_.b)("googlesitekit.module".concat(e.context,"DataRequest"),"googlesitekit.data".concat(e.context),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})),t}return p()(NewComponent,u),c()(NewComponent,[{key:"render",value:function(){var a=this.state,s=a.data,r=a.datapoint,c=a.module,l=a.zeroData,d=a.error,u=a.requestDataToState;if(!s)return n;var g=Object(k.l)(),m=c?g[c].name:Object(f.__)("Site Kit","google-site-kit");return c&&g[c].active&&!g[c].setupComplete?Object(S.a)(c,o.inGrid,o.fullWidth,o.createGrid):d?"string"!=typeof d?d:Object(v.a)(m,d,o.inGrid,o.fullWidth,o.createGrid):l?Object(y.a)(m,o.inGrid,o.fullWidth,o.createGrid):e.createElement(t,i()({data:s,datapoint:r,requestDataToState:u},this.props))}}]),NewComponent}(h.a)}}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=function(t){function Link(){return i()(this,Link),c()(this,d()(Link).apply(this,arguments))}return g()(Link,t),s()(Link,[{key:"render",value:function(){var t=this.props,a=t.dangerouslySetInnerHTML,n=t.onClick,i=t.href,o=t.children,s=t.className,r=t.arrow,c=t.external,l=t.inverse,d=t.back,u=t.small,g=t.inherit,m=t.caps,p=t.danger,h=t.disabled,b=t.id,f=i&&!h,k=f?"a":"button";return e.createElement(k,{className:_()("googlesitekit-cta-link",s,{"googlesitekit-cta-link--arrow":r,"googlesitekit-cta-link--external":c,"googlesitekit-cta-link--inverse":l,"googlesitekit-cta-link--back":d,"googlesitekit-cta-link--small":u,"googlesitekit-cta-link--inherit":g,"googlesitekit-cta-link--caps":m,"googlesitekit-cta-link--danger":p,"googlesitekit-cta-link--disabled":h}),onClick:n,id:b,href:f?i:void 0,target:f&&c?"_blank":void 0,rel:c?"noopener noreferrer":void 0,disabled:h,dangerouslySetInnerHTML:a},o)}}]),Link}(m.a);f.propTypes={dangerouslySetInnerHTML:h.a.shape({__html:h.a.string}),onClick:h.a.func,href:h.a.string,children:h.a.oneOfType([h.a.string.isRequired,h.a.array.isRequired]),className:h.a.string,arrow:h.a.bool,external:h.a.bool,inverse:h.a.bool,back:h.a.bool,small:h.a.bool,inherit:h.a.bool,caps:h.a.bool,danger:h.a.bool,disabled:h.a.bool},f.defaultProps={dangerouslySetInnerHTML:void 0,onClick:null,href:"",className:"",arrow:!1,external:!1,inverse:!1,back:!1,small:!1,inherit:!1,caps:!1,danger:!1,disabled:!1},t.a=f}).call(this,a(11))},,,function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(1),i=function(e){return function(t){return function FilteredComponent(a){return Object(n.f)(n.b,{},"",Object(n.f)(t,a),e)}}}},function(e,t,a){"use strict";(function(e,n){a(1);var i=a(3),o=a.n(i),s=a(14),r=a.n(s),c=function SvgIcon(t){var a=t.id,i=t.className,o=t.height,s=t.width,c="".concat(e.googlesitekit.admin.assetsRoot,"svg/svg.svg");return n.createElement("svg",{className:r()("svg",i),height:o,width:s},n.createElement("use",{xlinkHref:"".concat(c,"#").concat(a)}))};c.propTypes={id:o.a.string.isRequired,className:o.a.string,height:o.a.string,width:o.a.string},c.defaultProps={className:"",height:20,width:20},t.a=c}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=function(t){function PreviewBlock(){return i()(this,PreviewBlock),c()(this,d()(PreviewBlock).apply(this,arguments))}return g()(PreviewBlock,t),s()(PreviewBlock,[{key:"render",value:function(){var t=this.props,a=t.width,n=t.height,i=t.shape,o=t.padding;return e.createElement("div",{className:_()("googlesitekit-preview-block",{"googlesitekit-preview-block--padding":o}),style:{width:a,height:n}},e.createElement("div",{className:_()("googlesitekit-preview-block__wrapper",{"googlesitekit-preview-block__wrapper--circle":"circular"===i})}))}}]),PreviewBlock}(m.a);f.propTypes={width:h.a.string,height:h.a.string,shape:h.a.string,padding:h.a.bool},f.defaultProps={width:"100px",height:"100px",shape:"square",padding:!1},t.a=f}).call(this,a(11))},function(e,t,a){"use strict";var n=a(75),i=a.n(n);a.d(t,"l",(function(){return i.a})),a.d(t,"a",(function(){return n.HelperText})),a.d(t,"b",(function(){return n.Input}));var o=a(110);a.d(t,"h",(function(){return o.a}));var s=a(209);a.d(t,"e",(function(){return s.a}));var r=a(208);a.d(t,"g",(function(){return r.a}));var c=a(97),l=a.n(c);a.d(t,"k",(function(){return l.a})),a.d(t,"j",(function(){return c.Option}));var d=a(207);a.d(t,"i",(function(){return d.a}));var u=a(206);a.d(t,"d",(function(){return u.a}));var g=a(205);a.d(t,"c",(function(){return g.a}));var m=a(204);a.d(t,"f",(function(){return m.a}))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(15),g=a.n(u),m=a(8),p=a.n(m),h=a(1),b=a(3),_=a.n(b),f=a(14),k=a.n(f),y=a(100),v=a(2),S=a(49),O=function(t){function DataBlock(e){var t;return i()(this,DataBlock),(t=c()(this,d()(DataBlock).call(this,e))).handleClick=t.handleClick.bind(g()(t)),t.handleKeyPress=t.handleKeyPress.bind(g()(t)),t}return p()(DataBlock,t),s()(DataBlock,[{key:"handleClick",value:function(){var e=this.props,t=e.stat;(0,e.handleStatSelection)(t)}},{key:"handleKeyPress",value:function(e){e.preventDefault();var t=this.props,a=t.stat,n=t.handleStatSelection;"Enter"!==e.key&&" "!==e.key||n(a)}},{key:"render",value:function(){var t=this.props,a=t.className,n=t.title,i=t.datapoint,o=t.datapointUnit,s=t.change,r=t.changeDataUnit,c=t.context,l=t.period,d=t.selected,u=t.handleStatSelection,g=t.source,m=t.sparkline,p=t.invertChangeColor,b="button"===c?"button":"",_=m;return _&&p&&(_=Object(h.d)(m,{invertChangeColor:p})),e.createElement("div",{className:k()("googlesitekit-data-block",a,"googlesitekit-data-block--".concat(c),{"googlesitekit-data-block--selected":d}),tabIndex:"button"===c?"0":"-1",role:u&&b,onClick:u&&this.handleClick,onKeyPress:u&&this.handleKeyPress,"aria-label":u&&n,"aria-pressed":u&&d},e.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},e.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},n),e.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(i).concat(o))),_&&e.createElement("div",{className:"googlesitekit-data-block__sparkline"},_),e.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},e.createElement("div",{className:"googlesitekit-data-block__change"},""===s&&e.createElement(h.b,null," "),s&&e.createElement(h.b,null,e.createElement("span",{className:"googlesitekit-data-block__arrow"},e.createElement(y.a,{direction:0<parseFloat(s)?"up":"down",invertColor:p})),e.createElement("span",{className:"googlesitekit-data-block__value"},"".concat(Object(v.t)(Math.abs(s))).concat(r," ").concat(l)))),g&&e.createElement(S.a,{className:"googlesitekit-data-block__source",name:g.name,href:g.link})))}}]),DataBlock}(h.a);O.propTypes={stat:_.a.number,onClick:_.a.func,className:_.a.string,title:_.a.string,datapoint:_.a.oneOfType([_.a.string,_.a.number]),datapointUnit:_.a.string,change:_.a.oneOfType([_.a.string,_.a.number]),changeDataUnit:_.a.string,context:_.a.string,period:_.a.string,selected:_.a.bool,handleStatSelection:_.a.func,invertChangeColor:_.a.bool},O.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,invertChangeColor:!1},t.a=O}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){a.d(t,"b",(function(){return E})),a.d(t,"a",(function(){return j}));var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(15),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(3),f=a.n(_),k=a(14),y=a.n(k),v=a(13),S=a(49),O=a(19),E=function(t,a,n){var i=[],o=n.links,s=n.source,r=n.showURLs;n.cap&&(t=t.slice(0,n.cap)),Object(v.each)(t,(function(t,a){var n=[],s=o&&o[a];Object(v.each)(t,(function(a,i){"string"==typeof a&&(a=a.replace(/\(none\)/gi,"direct")),n.push(e.createElement("td",{key:"cell-"+i,className:"googlesitekit-table__body-item"},t[0]===a&&s?e.createElement("div",{className:"googlesitekit-table__body-item-content"},e.createElement(O.a,{className:"googlesitekit-table__body-item-link",href:s,external:!0,inherit:!0},a),r&&""!==Object(v.trim)(s,"/")&&e.createElement(O.a,{className:"googlesitekit-table__body-item-url",href:s,inherit:!0,external:!0},Object(v.trim)(s,"/"))):e.createElement("div",{className:"googlesitekit-table__body-item-content"},a)))})),i.push(e.createElement("tr",{key:"tr-"+a,className:"googlesitekit-table__body-row"},n))}));var c=t&&t[0]&&t[0].length?t[0].length:1;return e.createElement("div",{className:y()("googlesitekit-table",{"googlesitekit-table--with-list":!n||!n.disableListMode})},e.createElement("table",{className:y()("googlesitekit-table__wrapper","googlesitekit-table__wrapper--".concat(c,"-col"))},e.createElement("thead",{className:"googlesitekit-table__head"},e.createElement("tr",{key:"gksc_data_row_header-wrap",style:n&&n.hideHeader?{display:"none"}:{},className:"googlesitekit-table__head-row"},a.map((function(t,a){return e.createElement("th",{key:"gksc_data_row_header-".concat(a),className:y()("googlesitekit-table__head-item",{"googlesitekit-table__head-item--primary":t.primary}),"data-tooltip":t.tooltip},t.title)})))),e.createElement("tbody",{className:"googlesitekit-table__body"},i)),s&&e.createElement(S.a,{className:"googlesitekit-table__source",name:s.name,href:s.link}))},j=function(t){function TableOverflowContainer(){var e;return o()(this,TableOverflowContainer),(e=l()(this,u()(TableOverflowContainer).call(this))).state={isScrolling:!1},e.scrollRef=Object(b.h)(),e.updateFadeOnScroll=e.updateFadeOnScroll.bind(m()(e)),e}return h()(TableOverflowContainer,t),r()(TableOverflowContainer,[{key:"componentDidMount",value:function(){var e=this;e.updateFadeOnScroll(),this.resize=Object(v.debounce)((function(){e.updateFadeOnScroll()}),100),n.addEventListener("resize",this.resize)}},{key:"componentWillUnmount",value:function(){n.removeEventListener("resize",this.resize)}},{key:"updateFadeOnScroll",value:function(){var e=this.scrollRef.current,t=e.scrollLeft,a=e.scrollWidth-e.offsetWidth,n=t<a-16&&0<a-16;this.setState({isScrolling:n})}},{key:"render",value:function(){var t=this.props.children,a=this.state.isScrolling;return e.createElement("div",{onScroll:Object(v.debounce)(this.updateFadeOnScroll,100),className:y()("googlesitekit-table-overflow",{"googlesitekit-table-overflow--gradient":a})},e.createElement("div",{ref:this.scrollRef,className:"googlesitekit-table-overflow__container"},t))}}]),TableOverflowContainer}(b.a);j.propTypes={children:f.a.element}}).call(this,a(11),a(16))},,function(e,t,a){"use strict";(function(e){var n=a(20),i=a.n(n),o=a(10),s=a.n(o),r=a(4),c=a.n(r),l=a(5),d=a.n(l),u=a(6),g=a.n(u),m=a(7),p=a.n(m),h=a(15),b=a.n(h),_=a(8),f=a.n(_),k=a(1),y=a(3),v=a.n(y),S=a(14),O=a.n(S),E=a(13),j=a(23),D=a(62),w=a(9),A=a(26),C=a(30),N=a(95),x=a(73),P=a(19),T=function(t){function Notification(e){var t;return c()(this,Notification),(t=g()(this,p()(Notification).call(this,e))).state={isClosed:!1},t.cardRef=Object(k.h)(),t.handleDismiss=t.handleDismiss.bind(b()(t)),t.handleCTAClick=t.handleCTAClick.bind(b()(t)),0<t.props.dismissExpires&&t.expireDismiss(),t.props.showOnce&&w.c.setCache("notification::displayed::".concat(t.props.id),new Date),t}return f()(Notification,t),d()(Notification,[{key:"handleDismiss",value:function(e){var t;return s.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(e.persist(),e.preventDefault(),!(t=this.props.onDismiss)){a.next=6;break}return a.next=6,s.a.awrap(t(e));case 6:this.dismiss();case 7:case"end":return a.stop()}}),null,this)}},{key:"dismiss",value:function(){var e=this,t=this.cardRef.current;this.setState({isClosed:!0}),setTimeout((function(){w.c.setCache("notification::dismissed::".concat(e.props.id),new Date),t.style.display="none";var a=new Event("notificationDismissed");document.dispatchEvent(a)}),350)}},{key:"handleCTAClick",value:function(e){var t,a,n;return s.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.persist(),t=this.props,a=t.isDismissable,!(n=t.onCTAClick)){i.next=5;break}return i.next=5,s.a.awrap(n(e));case 5:a&&this.dismiss();case 6:case"end":return i.stop()}}),null,this)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,a=e.dismissExpires,n=w.c.getCache("notification::dismissed::".concat(t));if(n){var i=new Date(n);i.setSeconds(i.getSeconds()+parseInt(a,10)),i<new Date&&w.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var t,a=this.state.isClosed,n=this.props,o=n.children,s=n.id,r=n.title,c=n.description,l=n.blockData,d=n.winImage,u=n.smallImage,g=n.format,m=n.learnMoreURL,p=n.learnMoreDescription,h=n.learnMoreLabel,b=n.ctaLink,_=n.ctaLabel,f=n.ctaTarget,y=n.type,v=n.dismiss,S=n.isDismissable,T=n.logo,L=n.module,I=n.moduleName,M=n.pageIndex;if(w.c.getCache("notification::dismissed::".concat(s)))return null;var W,R=a?"is-closed":"is-open",U="large"===g&&"win-stats-increase"===y,q="mdc-layout-grid__cell--span-12";"large"===g?(q="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-8-desktop ",U&&(q="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-8-desktop ")):"small"===g&&(q="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),W="win-warning"===y?e.createElement(N.a,null):"win-error"===y?e.createElement(x.a,null):"";var z=e.createElement(k.b,null,l&&e.createElement("div",{className:"mdc-layout-grid__inner"},Object(E.map)(l,(function(t,a){return e.createElement("div",{key:a,className:O()("mdc-layout-grid__cell",{"mdc-layout-grid__cell--span-5-desktop":U,"mdc-layout-grid__cell--span-4-desktop":!U})},e.createElement("div",{className:"googlesitekit-publisher-win__stats"},e.createElement(A.a,t)))})))),G=e.createElement(k.b,null,r&&e.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},r),c&&e.createElement("div",{className:"googlesitekit-publisher-win__desc"},e.createElement("p",null,Object(k.i)(c)?c:e.createElement("span",{dangerouslySetInnerHTML:Object(D.a)(c,{ALLOWED_TAGS:["strong","em","br","a"],ALLOWED_ATTR:["href"]})}),h&&e.createElement(k.b,null," ",e.createElement(P.a,{href:m,external:!0,inherit:!0},h),p),M&&e.createElement("span",{className:"googlesitekit-publisher-win__detect"},M))),o),H=L?e.createElement(j.a,{id:L,height:"19",width:"19"}):e.createElement(j.a,{id:"logo-g",height:"34",width:"32"});return e.createElement("section",{ref:this.cardRef,className:O()("googlesitekit-publisher-win",(t={},i()(t,"googlesitekit-publisher-win--".concat(g),g),i()(t,"googlesitekit-publisher-win--".concat(y),y),i()(t,"googlesitekit-publisher-win--".concat(R),R),t))},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},T&&e.createElement("div",{className:O()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",{"mdc-layout-grid__cell--order-2-phone":U,"mdc-layout-grid__cell--order-1-tablet":U})},e.createElement("div",{className:"googlesitekit-publisher-win__logo"},H),I&&e.createElement("div",{className:"googlesitekit-publisher-win__module-name"},I)),u&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:u})),e.createElement("div",{className:O()("mdc-layout-grid__cell",q)},U?e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},G),e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--align-bottom"},z)):e.createElement(k.b,null,G,z),b&&e.createElement(C.a,{href:b,target:f,onClick:this.handleCTAClick},_),S&&v&&e.createElement(P.a,{onClick:this.handleDismiss},v)),d&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--order-1-phone mdc-layout-grid__cell--order-2-tablet mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement("div",{className:"googlesitekit-publisher-win__image-large"},e.createElement("img",{alt:"",src:d}))),("win-error"===y||"win-warning"===y)&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("div",{className:"googlesitekit-publisher-win__icons"},W)))))}}]),Notification}(k.a);T.propTypes={id:v.a.string.isRequired,title:v.a.string.isRequired,description:v.a.node,learnMoreURL:v.a.string,learnMoreDescription:v.a.string,learnMoreLabel:v.a.string,blockData:v.a.array,winImage:v.a.string,smallImage:v.a.string,format:v.a.string,ctaLink:v.a.string,ctaLabel:v.a.string,type:v.a.string,dismiss:v.a.string,isDismissable:v.a.bool,logo:v.a.bool,module:v.a.string,moduleName:v.a.string,pageIndex:v.a.string,dismissExpires:v.a.number,showOnce:v.a.bool,onCTAClick:v.a.func,onDismiss:v.a.func},T.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1},t.a=T}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=a(25),k=function(t){function Button(e){var t;return i()(this,Button),(t=c()(this,d()(Button).call(this,e))).buttonRef=Object(m.h)(),t}return g()(Button,t),s()(Button,[{key:"componentDidMount",value:function(){new f.h(this.buttonRef.current)}},{key:"render",value:function(){var t=this.props,a=t.onClick,n=t.children,i=t.href,o=t.text,s=t.className,r=t.danger,c=t.disabled,l=t.target,d=t.id,u=t.icon,g=t.trailingIcon,m=t.ariaHaspopup,p=t.ariaExpanded,h=t.ariaControls,b=i&&!c?"a":"button";return e.createElement(b,{className:_()("mdc-button",s,{"mdc-button--raised":!o,"mdc-button--danger":r}),onClick:a,href:c?void 0:i,ref:this.buttonRef,disabled:!!c,target:l||"_self",id:d,"aria-haspopup":m,"aria-expanded":p,"aria-controls":h},u&&u,e.createElement("span",{className:"mdc-button__label"},n),g&&g)}}]),Button}(m.a);k.propTypes={onClick:h.a.func,children:h.a.string.isRequired,href:h.a.string,text:h.a.bool,className:h.a.string,danger:h.a.bool,disabled:h.a.bool,icon:h.a.element,trailingIcon:h.a.element,ariaHaspopup:h.a.string,ariaExpanded:h.a.bool,ariaControls:h.a.string},k.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=k}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=function(t){function ProgressBar(){return i()(this,ProgressBar),c()(this,d()(ProgressBar).apply(this,arguments))}return g()(ProgressBar,t),s()(ProgressBar,[{key:"render",value:function(){var t=this.props,a=t.className,n=t.small,i=t.compress,o=t.height,s=o?Math.round(o/2):null;return e.createElement("div",{role:"progressbar",style:{marginTop:s,marginBottom:s},className:_()("mdc-linear-progress","mdc-linear-progress--indeterminate",a,{"mdc-linear-progress--small":n,"mdc-linear-progress--compress":i})},e.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),e.createElement("div",{className:"mdc-linear-progress__buffer"}),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),ProgressBar}(m.a);f.propTypes={className:h.a.string,small:h.a.bool,compress:h.a.bool},f.defaultProps={className:"",small:!1,compress:!1},t.a=f}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=a(19),k=function(t){function CTA(){return i()(this,CTA),c()(this,d()(CTA).apply(this,arguments))}return g()(CTA,t),s()(CTA,[{key:"render",value:function(){var t=this.props,a=t.title,n=t.description,i=t.ctaLink,o=t.ctaLabel,s=t.error,r=t.onClick;return e.createElement("div",{className:_()("googlesitekit-cta",{"googlesitekit-cta--error":s})},a&&e.createElement("h3",{className:"googlesitekit-cta__title"},a),n&&e.createElement("p",{className:"googlesitekit-cta__description"},n),o&&e.createElement(f.a,{href:i,onClick:r,inverse:!s,caps:!0,arrow:!0},o))}}]),CTA}(m.a);k.propTypes={title:h.a.string.isRequired,description:h.a.string,ctaLink:h.a.string,ctaLabel:h.a.string,error:h.a.bool,onClick:h.a.func},k.defaultProps={title:"",description:"",ctaLink:"",ctaLabel:"",error:!1,onClick:function(){}},t.a=k}).call(this,a(11))},function(e,t,a){"use strict";function n(e){return{byContext:function(t){return e.filter((function(e){return e.usageContext.includes(t)}))}}}function i(e){return(parseInt(e)||0)>0}function o(e){return!!e&&e.toString().match(/^GTM-[A-Z0-9]+#x2F;)}a.d(t,"a",(function(){return n})),a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return o})),a.d(t,"d",(function(){return s}));var s=[/<script[^>]*>[^>]+?www.googletagmanager.com\/gtm[^>]+?['|"](GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtm\.js\?id=(GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/ns.html\?id=(GTM-[0-9A-Z]+)['|"]/,/<amp-analytics [^>]*config=['|"]https:\/\/www.googletagmanager.com\/amp.json\?id=(GTM-[0-9A-Z]+)['|"]/]},,function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=a(24),k=function(t){function PreviewTable(){return i()(this,PreviewTable),c()(this,d()(PreviewTable).apply(this,arguments))}return g()(PreviewTable,t),s()(PreviewTable,[{key:"render",value:function(){for(var t=this.props,a=t.rows,n=t.rowHeight,i=t.padding,o=[],s=0;a>s;s++)o.push(e.createElement("div",{className:"googlesitekit-preview-table__row",key:"table-row-"+s},e.createElement(f.a,{width:"100%",height:n+"px"})));return e.createElement("div",{className:_()("googlesitekit-preview-table",{"googlesitekit-preview-table--padding":i})},o)}}]),PreviewTable}(m.a);k.propTypes={rows:h.a.number,rowHeight:h.a.number,padding:h.a.bool},k.defaultProps={rows:11,rowHeight:35,padding:!1},t.a=k}).call(this,a(11))},function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return r}));var n=a(13),i=a(2);function o(e){var t=[[{type:"string",label:"Day"},{type:"number",label:"Clicks"},{type:"number",label:"Impressions"},{type:"number",label:"CTR"},{type:"number",label:"Position"}]],a=0,o=0,s=0,r=0,c=e.length;Object(n.each)(e,(function(e){var n=new Date(e.keys[0]);t.push([n.getMonth()+1+"/"+n.getUTCDate(),e.clicks,e.impressions,e.ctr,e.position]),a+=e.clicks,o+=e.impressions,s+=e.ctr,r+=e.position}));var l=a,d=o;a=Object(i.v)(a),o=Object(i.v)(o);var u=(s/c*100).toFixed(1),g=s/c,m=(r/c).toFixed(1);return{dataMap:t,totalClicks:a,totalClicksRaw:l,totalImpressions:o,totalImpressionsRaw:d,averageCTR:u,averageCTRRaw:g,averagePosition:m}}var s=function(e){var t=Math.floor(e.length/2),a=o(e.slice(t)),n=o(e.slice(0,t));return{dataMap:a.dataMap,totalClicks:a.totalClicks,totalImpressions:a.totalImpressions,averageCTR:a.averageCTR,averagePosition:a.averagePosition,totalClicksChange:Object(i.b)(n.totalClicksRaw,a.totalClicksRaw),totalImpressionsChange:Object(i.b)(n.totalImpressionsRaw,a.totalImpressionsRaw),averageCTRChange:Object(i.b)(n.averageCTRRaw,a.averageCTRRaw),averagePositionChange:Object(i.b)(n.averagePosition,a.averagePosition)}},r=function(e){if(!e.length)return!0;var t=s(e),a=t.totalClicks,n=t.totalImpressions,i=t.averageCTR,o=t.averagePosition;return 0===parseInt(a)&&0===parseInt(n)&&0===parseInt(i)&&0===parseInt(o)}},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=function(t){function DashboardModuleHeader(){return i()(this,DashboardModuleHeader),c()(this,d()(DashboardModuleHeader).apply(this,arguments))}return g()(DashboardModuleHeader,t),s()(DashboardModuleHeader,[{key:"render",value:function(){var t=this.props,a=t.title,n=t.description;return e.createElement("header",{className:"googlesitekit-dashboard-module-header"},e.createElement("div",{className:"mdc-layout-grid__inner"},a&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-module-header__title "},a),n&&e.createElement("p",{className:"googlesitekit-dashboard-module-header__description"},n))))}}]),DashboardModuleHeader}(m.a);b.propTypes={title:h.a.string,description:h.a.string},b.defaultProps={title:"",description:""},t.a=b}).call(this,a(11))},function(e,t,a){"use strict";(function(e){a.d(t,"e",(function(){return u})),a.d(t,"d",(function(){return g})),a.d(t,"a",(function(){return m})),a.d(t,"b",(function(){return p})),a.d(t,"c",(function(){return h}));var n=a(10),i=a.n(n),o=a(190),s=a(13),r=a(0),c=a(2),l=a(17),d=a(9);function u(e){var t=[[{type:"date",label:"Day"},{type:"number",label:"RPM"},{type:"number",label:"Earnings"},{type:"number",label:"Impressions"}]];return Object(s.each)(e,(function(e){var a=new Date(e[0]);t.push([a,e[2],e[1],e[3]])})),{dataMap:t}}var g=function(t,a){var n,i,s,l,d,u,g,m,p,h,b,_,f,k=!1,y=!1,v=!1,S=!1,O=!1,E=!1,j=Object(c.l)().adsense,D=j.accountURL,w=j.signupURL,A=Object(c.o)("googlesitekit-module-adsense",{}),C=new URL(e.googlesitekit.admin.siteURL);switch(t){case"account-connected":a?(m=!1,g="alert",p=Object(r.__)("Site Kit will place AdSense code to your site","google-site-kit"),h=Object(r.__)("This means Google will automatically place ads for you in all the best places.","google-site-kit"),i=Object(r.__)("Continue","google-site-kit"),n=A,k=!0,b=Object(r.__)("Let Site Kit place code on your site","google-site-kit"),_=Object(r.__)("If you don’t let Site Kit place the code you may not get the best ads experience. You can set this up later on the Site Kit settings page.","google-site-kit"),f=Object(r.__)("If you’ve already set up ads on your site, it may change how they appear. You can customize this later in AdSense.","google-site-kit")):(m=!1,g=!1,p=Object(r.__)("Looks like you’re already using AdSense","google-site-kit"),h=Object(r.__)("Site Kit will place AdSense code on your site to connect your site to AdSense and help you get the most out of ads. This means Google will automatically place ads for you in all the best places.","google-site-kit"),i=Object(r.__)("Continue","google-site-kit"),n=A,E={eventCategory:"adsense_setup",eventName:"complete_adsense_setup"},b=Object(r.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),_=Object(r.__)("If you’ve already got some AdSense code on your site, we recommend you use Site Kit to place code to get the most out of AdSense.","google-site-kit"));break;case"account-connected-nonmatching":m=!1,g=!1,p=Object(r.__)("Your site has code from another AdSense account","google-site-kit"),h=Object(r.__)("We’ve found some AdSense code on your site, but it’s not linked to this AdSense account.","google-site-kit"),S=!1,i=Object(r.__)("Switch Google account","google-site-kit"),n=Object(c.n)("adsense",!0),y={accountStatus:"account-connected",continueText:Object(r.__)("Continue anyway","google-site-kit"),statusHeadline:Object(r.__)("Site Kit will place AdSense code on your site","google-site-kit"),statusMessage:Object(r.__)("To connect your site to your AdSense account, Site Kit will place AdSense code on your site. For a better ads experience, you should remove AdSense code that’s not linked to this AdSense account.","google-site-kit"),profile:!0,ctaLink:A,ctaLinkText:Object(r.__)("Continue","google-site-kit"),continueAction:!1,switchLabel:Object(r.__)("Let Site Kit place code on your site","google-site-kit"),switchOffMessage:Object(r.__)("You can let Site Kit do this later.","google-site-kit")};break;case"ads-display-pending":var N=Object(o.parse)(C.hostname).domain;p=Object(r.__)("Let’s get your site ready for ads","google-site-kit"),h=Object(r.__)("After you’ve finished setting up your account, we’ll let you know when your site is ready to show ads. This usually takes less than a day, but it can sometimes take a bit longer.","google-site-kit"),i=Object(r.__)("Go to your AdSense account to check on your site’s status or to complete setting up","google-site-kit"),n="https://www.google.com/adsense/new/sites?url=".concat(N||C.hostname,"&source=site-kit");break;case"account-pending-review":p=Object(r.__)("We’re getting your site ready for ads","google-site-kit"),h=Object(r.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),i=Object(r.__)("Go to your AdSense account to check on your site’s status","google-site-kit"),n="https://www.google.com/adsense/new/sites?url=".concat(C.hostname,"&source=site-kit"),v=!0;break;case"account-required-action":O=!0;break;case"disapproved-account":n=D,i=Object(r.__)("Go to AdSense to find out how to fix the issue","google-site-kit"),p=Object(r.__)("Your site isn’t ready to show ads yet","google-site-kit"),h=Object(r.__)("You need to fix some things before we can connect Site Kit to your AdSense account.","google-site-kit");break;case"disapproved-account-afc":m=Object(r.__)("There is an AdSense account, but the AFC account is disapproved","google-site-kit"),g="error",p=Object(r.__)("Create Account","google-site-kit"),h=Object(r.__)("Create an AdMob account, then open AdSense and try to upgrade.","google-site-kit"),i=Object(r.__)("Create an AdMob Account","google-site-kit"),n="https://google.com/admob";break;case"no-account":p=Object(r.__)("Create your AdSense account","google-site-kit"),h=Object(r.__)("Site Kit will place AdSense code on every page across your site. This means Google will automatically place ads for you in all the best places.","google-site-kit"),S=!0,i=Object(r.__)("Create AdSense Account","google-site-kit"),n=w,u=Object(r.__)("Already have an AdSense account?","google-site-kit"),s=Object(r.__)("to connect to it","google-site-kit"),l=Object(r.__)("Switch Google account","google-site-kit"),d=Object(c.n)("adsense",!0),E={eventCategory:"adsense_setup",eventName:"create_adsense_account"};break;case"no-account-tag-found":p=Object(r.__)("Looks like you’re already using AdSense","google-site-kit"),h=Object(r.__)("We’ve found some AdSense code on your site, but it’s not linked to this Google account.","google-site-kit"),S=!1,i=Object(r.__)("Switch Google account","google-site-kit"),n=Object(c.n)("adsense",!0),b=Object(r.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),y={statusHeadline:Object(r.__)("Create a new AdSense account","google-site-kit"),statusMessage:Object(r.__)("Site Kit will place additional AdSense code on every page across your site after you create an account. This means Google will automatically place ads for you in all the best places.","google-site-kit"),notice:Object(r.__)("We recommend you remove the old AdSense code from this site.","google-site-kit"),icon:"warning",continueText:Object(r.__)("Continue anyway","google-site-kit"),ctaLinkText:Object(r.__)("Create AdSense Account","google-site-kit"),ctaLink:w,ctaTarget:"_blank",continueAction:!1};break;case"account-connected-no-data":p=Object(r.__)("We’re getting your site ready for ads","google-site-kit"),h=Object(r.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),v=!0}return{accountTagMatch:k,continueAction:y,ctaLink:n,ctaLinkText:i,footerAppendedText:s,footerCTA:l,footerCTALink:d,footerText:u,icon:g,incomplete:v,issue:m,profile:S,required:O,setupComplete:!1,statusHeadline:p,statusMessage:h,switchLabel:b,switchOffMessage:_,switchOnMessage:f,tracking:E}},m=function(){var t,a,n,o,l,u,g,m,p,h,b,_,f,k,y,v,S,O,E,j,D,w,A,C,N,x,P,T,L,I=arguments;return i.a.async((function(M){for(;;)switch(M.prev=M.next){case 0:return t=I.length>0&&void 0!==I[0]&&I[0],a=I.length>1&&void 0!==I[1]?I[1]:function(){},o=!1,M.prev=3,a(Object(r.__)("Locating accounts…","google-site-kit")),M.next=7,i.a.awrap(d.c.get(d.b,"adsense","accounts").then((function(e){return e})).catch((function(e){return e})));case 7:if(l=M.sent,!(1<(u=!l.data||l.data.status&&200!==l.data.status?l:l.data).length)){M.next=42;break}a(Object(r.__)("Searching for domain…","google-site-kit")),g=!0,m=!1,p=void 0,M.prev=14,h=u[Symbol.iterator]();case 16:if(g=(b=h.next()).done){M.next=28;break}return _=b.value,f=_.id,M.next=21,i.a.awrap(d.c.get(d.b,"adsense","urlchannels",{clientID:f}).then((function(e){return e})).catch((function(e){return e})));case 21:k=M.sent,y=new URL(e.googlesitekit.admin.siteURL),(v=k&&k.length?Object(s.filter)(k,{urlPattern:y.hostname}):[])&&0!==v.length?(O=v[0].id,Object(c.A)("adsense_setup","adsense_account_detected")):(n="account-pending-review",Object(c.A)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"));case 25:g=!0,M.next=16;break;case 28:M.next=34;break;case 30:M.prev=30,M.t0=M.catch(14),m=!0,p=M.t0;case 34:M.prev=34,M.prev=35,g||null==h.return||h.return();case 37:if(M.prev=37,!m){M.next=40;break}throw p;case 40:return M.finish(37);case 41:return M.finish(34);case 42:if(S=u&&u.message&&u.message.error,O=!!(u&&u.length&&u[0])&&u[0].id,u&&O&&!S){M.next=50;break}E=(S||{}).errors,"noAdSenseAccount"!==(j=E[0].reason)&&u&&O||(n="disapprovedAccount"===j?"disapproved-account":t?"no-account-tag-found":"no-account"),M.next=118;break;case 50:return Object(c.l)().adsense.accountURL=Object(r.sprintf)("https://www.google.com/adsense/new/%s/home",O),a(Object(r.__)("Account found, checking account status…","google-site-kit")),M.next=54,i.a.awrap(d.c.get(d.b,"adsense","alerts",{accountID:O}).then((function(e){return e})).catch((function(e){return e})));case 54:if(D=M.sent,w=!D.data||D.data.status&&200!==D.data.status?D:D.data,A=w&&w.message&&w.message.error,!Object(s.find)(D,{type:"GRAYLISTED_PUBLISHER"})){M.next=62;break}n="ads-display-pending",Object(c.A)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=118;break;case 62:return M.next=64,i.a.awrap(d.c.get(d.b,"adsense","clients").then((function(e){return e})).catch((function(e){return e})));case 64:if(C=M.sent,N=!C.data||C.data.status&&200!==C.data.status?C:C.data,x=N&&N.message&&N.message.error,!(P=!(!N||!N.length)&&Object(s.find)(N,{productCode:"AFC"}))){M.next=72;break}return o=P.id,M.next=72,i.a.awrap(d.c.set(d.b,"adsense","client-id",{clientID:o}).then((function(e){return e})).catch((function(e){return e})));case 72:if(!A){M.next=77;break}"accountPendingReview"===w.message.error.errors[0].reason&&(n="ads-display-pending",Object(c.A)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending")),M.next=118;break;case 77:if(a(Object(r.__)("Looking for AdSense client…","google-site-kit")),!x){M.next=83;break}n="account-required-action",Object(c.A)("adsense_setup","adsense_required_action","accountRequiredAction status"),M.next=118;break;case 83:if(!P){M.next=117;break}return o=P.id,a(Object(r.__)("Looking for site domain…","google-site-kit")),M.next=88,i.a.awrap(d.c.get(d.b,"adsense","urlchannels",{clientID:o}).then((function(e){return e})).catch((function(e){return e})));case 88:if(T=M.sent,L=T&&T.length&&Object(s.filter)(T,(function(t){return 0<e.googlesitekit.admin.siteURL.indexOf(t.urlPattern)})),0!==T.length){M.next=95;break}n="ads-display-pending",Object(c.A)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=115;break;case 95:if(L&&0!==L.length){M.next=100;break}n="account-pending-review",Object(c.A)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"),M.next=115;break;case 100:if(!t||o!==t){M.next=105;break}n="account-connected",Object(c.A)("adsense_setup","adsense_account_connected","existing_matching_tag"),M.next=115;break;case 105:if(!t||o===t){M.next=110;break}n="account-connected-nonmatching",Object(c.A)("adsense_setup","adsense_account_connected","existing_non_matching_tag"),M.next=115;break;case 110:return n="account-connected",a(Object(r.__)("Connecting…","google-site-kit")),Object(c.A)("adsense_setup","adsense_account_connected"),M.next=115,i.a.awrap(d.c.set(d.b,"adsense","setup-complete",{clientID:o}).then((function(e){return e})).catch((function(e){return e})));case 115:M.next=118;break;case 117:n="disapproved-account-afc";case 118:return M.next=120,i.a.awrap(d.c.set(d.b,"adsense","account-status",{accountStatus:n}).then((function(e){return e})).catch((function(e){return e})));case 120:return M.abrupt("return",{accountStatus:n,clientID:o});case 123:return M.prev=123,M.t1=M.catch(3),M.abrupt("return",{isLoading:!1,error:M.t1.code,message:M.t1.message});case 126:case"end":return M.stop()}}),null,null,[[3,123],[14,30,34,42],[35,,37,41]])},p=function(){var e,t,a,n;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=Object(c.l)(),t=e.adsense.active,a=e.analytics.active,n=!0,!t||!a){o.next=7;break}return o.next=7,i.a.awrap(d.c.get(d.b,"analytics","report",l.a).then((function(e){e&&(n=!0)})).catch((function(e){400===e.code&&"INVALID_ARGUMENT"===e.message&&(n=!1)})));case 7:return o.abrupt("return",new Promise((function(e){e(n)})));case 8:case"end":return o.stop()}}))},h=function(e,t,a){if(!a.data||!a.data.dateRange||"last-28-days"!==a.data.dateRange)return!1;var n=[];return e.totals&&(n=e.totals),0===(n=n.filter((function(e){return 0<e}))).length}}).call(this,a(16))},function(e,t,a){"use strict";(function(e){a(1);var n=a(0),i=a(2),o=a(32),s=a(67),r=a(136);t.a=function(t,a){var c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=e.createElement(o.a
5
+ /* translators: %s: module name */,{title:Object(n.sprintf)(Object(n.__)("Data error in %s","google-site-kit"),t),description:a,error:!0});return"Invalid Credentials"===a&&Object(i.x)(r.a),Object(s.a)(u,c,l,d)}}).call(this,a(11))},,function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(127),_=a(47),f=function(t){function Sparkline(){return i()(this,Sparkline),c()(this,d()(Sparkline).apply(this,arguments))}return g()(Sparkline,t),s()(Sparkline,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.change,i=t.instanceId,o=t.invertChangeColor,s=t.loadSmall,r=t.loadCompressed,c=t.loadHeight,l=t.loadText;if(!a)return"loading...";var d=o?"red":"green",u=o?"green":"red",g={title:"",backgroundColor:"transparent",curveType:"line",width:"100%",height:"50",enableInteractivity:!1,chartArea:{height:"100%",width:"100%"},legend:{position:"none"},axisFontSize:0,hAxis:{baselineColor:"none",ticks:[]},vAxis:{baselineColor:"none",ticks:[]},axes:[],colors:[0<=(parseFloat(n)||0)?d:u]};return e.createElement("div",{className:"googlesitekit-analytics-sparkline-chart-wrap"},e.createElement(_.a,{data:a,options:g,id:"googlesitekit-sparkline-".concat(i),loadSmall:s,loadCompressed:r,loadHeight:c,loadText:l}))}}]),Sparkline}(m.a);f.propTypes={instanceId:h.a.number.isRequired,invertChangeColor:h.a.bool,loadSmall:h.a.bool,loadCompressed:h.a.bool,loadHeight:h.a.number,loadText:h.a.bool},f.defaultProps={invertChangeColor:!1,loadSmall:!0,loadCompressed:!0,loadHeight:46,loadText:!1},t.a=Object(b.a)(f)}).call(this,a(11))},,function(e,t,a){"use strict";(function(e){var n=a(28),i=a.n(n),o=e._googlesitekitAPIFetchData||{},s=o.nonce,r=o.nonceEndpoint,c=o.preloadedData,l=o.rootURL;i.a.nonceEndpoint=r,i.a.nonceMiddleware=i.a.createNonceMiddleware(s),i.a.rootURLMiddleware=i.a.createRootURLMiddleware(l),i.a.preloadingMiddleware=i.a.createPreloadingMiddleware(c),i.a.use(i.a.nonceMiddleware),i.a.use(i.a.mediaUploadMiddleware),i.a.use(i.a.rootURLMiddleware),i.a.use(i.a.preloadingMiddleware),t.default=i.a}).call(this,a(16))},,,function(e,t,a){"use strict";(function(e){a(1);var n=a(0),i=a(32),o=a(67);t.a=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],c=e.createElement(i.a
6
+ /* translators: %s: Module name */,{title:Object(n.sprintf)(Object(n.__)("%s Gathering Data","google-site-kit"),t)
7
+ /* translators: %s: Module name */,description:Object(n.sprintf)(Object(n.__)("%s data is not yet available, please check back later.","google-site-kit"),t)});return Object(o.a)(c,a,s,r)}}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i,o=a(4),s=a.n(o),r=a(5),c=a.n(r),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(15),p=a.n(m),h=a(8),b=a.n(h),_=a(10),f=a.n(_),k=a(1),y=a(3),v=a.n(y),S=a(0),O=a(13),E=a(31);function j(){var t;return f.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(!i){a.next=2;break}return a.abrupt("return",i);case 2:return e.google&&e.google.charts?i=Promise.resolve():((t=document.createElement("script")).type="text/javascript",i=new Promise((function(a){t.onload=a,e.document.head.appendChild(t),t.src="https://www.gstatic.com/charts/loader.js"}))),a.abrupt("return",i);case 4:case"end":return a.stop()}}))}var D=function(t){function GoogleChart(e){var t;return s()(this,GoogleChart),(t=d()(this,g()(GoogleChart).call(this,e))).state={loading:!0,chart:null},t.onChartsLoad=t.onChartsLoad.bind(p()(t)),t.waitForChart=t.waitForChart.bind(p()(t)),t.getData=t.getData.bind(p()(t)),t.prepareChart=t.prepareChart.bind(p()(t)),t.drawChart=t.drawChart.bind(p()(t)),t.updateChart=t.updateChart.bind(p()(t)),t.chartRef=Object(k.h)(),t.resize=Object(O.debounce)(t.drawChart,100),t}return b()(GoogleChart,t),c()(GoogleChart,[{key:"onChartsLoad",value:function(){this.getData(),this.prepareChart(),this.drawChart(),this.setState({loading:!1})}},{key:"componentDidMount",value:function(){return f.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.a.awrap(j());case 2:e.google.charts.load("current",{packages:["corechart"]}),e.google.charts.setOnLoadCallback(this.onChartsLoad),e.addEventListener("resize",this.resize);case 5:case"end":return t.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props.selectedStats;0!==t.length&&JSON.stringify(t)!==JSON.stringify(e.selectedStats)&&this.updateChart()}},{key:"componentWillUnmount",value:function(){e.removeEventListener("resize",this.resize)}},{key:"waitForChart",value:function(e){setTimeout((function(){e()}),500)}},{key:"getData",value:function(){return e.google&&e.google.visualization&&e.google.visualization.arrayToDataTable(this.props.data)}},{key:"prepareChart",value:function(){var t=this.chartRef.current;if(e.google&&t){var a="pie"===this.props.chartType?new e.google.visualization.PieChart(t):new e.google.visualization.LineChart(t);this.setState({chart:a})}else this.waitForChart(this.prepareChart)}},{key:"drawChart",value:function(){var e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=this.getData();null!==i&&null!==e?(e.draw(i,n),0!==a.length&&this.updateChart()):this.waitForChart(this.drawChart)}},{key:"updateChart",value:function(){var t=this.state.chart,a=this.props,n=a.selectedStats,i=a.options,o=a.singleStat,s=this.getData();if(null!==s&&null!==t){var r=new e.google.visualization.DataView(s);if(!o){var c=[0];c=c.concat(n.map((function(e){return e+1}))),r.setColumns(c)}t.draw(r,i)}else this.waitForChart(this.drawChart)}},{key:"render",value:function(){var e=this.state.loading,t=this.props,a=t.className,i=t.loadSmall,o=t.loadCompressed,s=t.loadHeight,r=t.loadText;return n.createElement("div",{className:"googlesitekit-graph-wrapper"},n.createElement("div",{ref:this.chartRef,className:"googlesitekit-line-chart"},n.createElement("div",{className:"googlesitekit-chart-loading"},e&&n.createElement("div",{className:"googlesitekit-chart-loading__wrapper"},r&&n.createElement("p",null,Object(S.__)("Loading chart...","google-site-kit")),n.createElement(E.a,{className:a,small:i,compress:o,height:s})))))}}]),GoogleChart}(k.a);D.propTypes={selectedStats:v.a.array,options:v.a.object.isRequired,id:v.a.string,singleStat:v.a.bool,className:v.a.string,loadSmall:v.a.bool,loadCompressed:v.a.bool,loadHeight:v.a.number,loadText:v.a.bool},D.defaultProps={selectedStats:[],id:"",singleStat:!0,className:"",loadSmall:!1,loadCompressed:!1,loadHeight:null,loadText:!0},t.a=D}).call(this,a(16),a(11))},,function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=a(0),k=a(19),y=function(t){function SourceLink(){return i()(this,SourceLink),c()(this,d()(SourceLink).apply(this,arguments))}return g()(SourceLink,t),s()(SourceLink,[{key:"render",value:function(){var t=this.props,a=t.name,n=t.href,i=t.className,o=t.external;return e.createElement("div",{className:_()("googlesitekit-source-link",i)},[Object(f.__)("Source:","google-site-kit")," ",e.createElement(k.a,{key:"link",href:n,external:o,inherit:!0},a)])}}]),SourceLink}(m.a);y.propTypes={name:h.a.string,href:h.a.string,className:h.a.string,external:h.a.bool},y.defaultProps={name:"",href:"",className:"",external:!1},t.a=y}).call(this,a(11))},,,,function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(14),h=a.n(p),b=a(3),_=a.n(b),f=a(12),k=a(23),y=a(112),v=function(t){function PageHeader(){return i()(this,PageHeader),c()(this,d()(PageHeader).apply(this,arguments))}return g()(PageHeader,t),s()(PageHeader,[{key:"render",value:function(){var t=this.props,a=t.title,n=t.icon,i=t.iconWidth,o=t.iconHeight,s=t.iconID,r=t.className,c=t.status,l=t.statusText,d=t.fullWidth?"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t":"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t",u=Object(f.c)("googlesitekit.showDateRangeSelector-".concat(s),!1),g=!(""===c&&!u);return e.createElement("header",{className:"googlesitekit-page-header"},e.createElement("div",{className:"mdc-layout-grid__inner"},a&&e.createElement("div",{className:d},n&&e.createElement(k.a,{id:s,height:o,width:i,className:"googlesitekit-page-header__icon"}),e.createElement("h1",{className:h()("googlesitekit-page-header__title",r)},a)),g&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--align-right-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement("div",{className:"googlesitekit-page-header__details"},c&&e.createElement("span",{className:h()("googlesitekit-page-header__status","googlesitekit-page-header__status--".concat(c))},l),u&&e.createElement("span",{className:"googlesitekit-page-header__range"},e.createElement(y.a,null))))))}}]),PageHeader}(m.a);v.propTypes={title:_.a.string,icon:_.a.bool,iconID:_.a.string,iconWidth:_.a.string,iconHeight:_.a.string,className:_.a.string,status:_.a.string,statusText:_.a.string,fullWidth:_.a.bool},v.defaultProps={title:"",icon:!1,iconID:"",iconWidth:"",iconHeight:"",className:"googlesitekit-heading-3",status:"",statusText:"",fullWidth:!1},t.a=v}).call(this,a(11))},,function(e,t,a){"use strict";(function(e){a(1);var n=a(0),i=a(19);t.a=function HelpLink(){var t=Object(n.__)("Need help?","google-site-kit");return e.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},t)}}).call(this,a(11))},,function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(29),h=function(t){function GenericError(){return i()(this,GenericError),c()(this,d()(GenericError).apply(this,arguments))}return g()(GenericError,t),s()(GenericError,[{key:"render",value:function(){return e.createElement(p.a,this.props)}}]),GenericError}(m.a);t.a=h}).call(this,a(11))},function(e,t,a){"use strict";var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(51),p=function(e){function ModuleSettingsWarning(){return i()(this,ModuleSettingsWarning),c()(this,d()(ModuleSettingsWarning).apply(this,arguments))}return g()(ModuleSettingsWarning,e),s()(ModuleSettingsWarning,[{key:"render",value:function(){return null}}]),ModuleSettingsWarning}(a(1).a);t.a=Object(m.a)("googlesitekit.ModuleSettingsWarning")(p)},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=a(127),k=a(25),y=function(t){function Switch(e){var t;return i()(this,Switch),(t=c()(this,d()(Switch).call(this,e))).switchRef=Object(m.h)(),t}return g()(Switch,t),s()(Switch,[{key:"componentDidMount",value:function(){new k.i(this.switchRef.current)}},{key:"render",value:function(){var t=this.props,a=t.id,n=void 0===a?"googlesitekit-switch-".concat(this.props.instanceId):a,i=t.onClick,o=t.label,s=t.checked,r=t.hideLabel;return e.createElement(m.b,null,e.createElement("div",{"aria-checked":s?"true":"false",className:_()("mdc-switch",{"mdc-switch--checked":s}),onClick:i,onKeyPress:function(e){"function"==typeof i&&"Enter"===e.code&&i(e)},role:"switch",ref:this.switchRef,tabIndex:0},e.createElement("div",{className:"mdc-switch__track"}," "),e.createElement("div",{className:"mdc-switch__thumb-underlay"},e.createElement("div",{className:"mdc-switch__thumb"},e.createElement("input",{type:"checkbox",id:n,className:"mdc-switch__native-control",role:"switch",checked:s,onChange:function(){}})))),e.createElement("label",{className:_()({"screen-reader-only":r}),htmlFor:n},o))}}]),Switch}(m.a);y.propTypes={id:h.a.string,onClick:h.a.func,label:h.a.string.isRequired,checked:h.a.bool,hideLabel:h.a.bool,instanceId:h.a.number.isRequired},y.defaultProps={checked:!1,hideLabel:!0},t.a=Object(f.a)(y)}).call(this,a(11))},function(e,t,a){"use strict";(function(e){a.d(t,"d",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return r})),a.d(t,"a",(function(){return c}));a(1);var n=a(0);function i(e){return.9<=e?"fast":.5<=e?"average":"slow"}var o=function(e){var t=i(e);return"fast"===t?Object(n.__)("Fast","google-site-kit"):"average"===t?Object(n.__)("Average","google-site-kit"):Object(n.__)("Slow","google-site-kit")},s=function PageSpeedReportScoreCategoryWrapper(t){var a=t.score,n=t.children,o="googlesitekit-pagespeed-report__score-category-wrapper googlesitekit-pagespeed-report__score-category-wrapper--".concat(i(a)),s="googlesitekit-pagespeed-report__score-icon googlesitekit-pagespeed-report__score-icon--".concat(i(a));return e.createElement("span",{className:o},n," ",e.createElement("span",{className:s}))},r=function PageSpeedReportScoreGauge(t){var a=t.score,o=parseInt(100*a,10),s="\n\t\tgooglesitekit-percentage-circle\n\t\tgooglesitekit-percentage-circle--".concat(i(a),"\n\t\tgooglesitekit-percentage-circle--percent-").concat(o,"\n\t");return e.createElement("div",{className:"googlesitekit-pagespeed-report__score-gauge"},e.createElement("div",{className:s},e.createElement("div",{className:"googlesitekit-percentage-circle__text"},o),e.createElement("div",{className:"googlesitekit-percentage-circle__slice"},e.createElement("div",{className:"googlesitekit-percentage-circle__bar"}),e.createElement("div",{className:"googlesitekit-percentage-circle__fill"}))),e.createElement("span",{className:"googlesitekit-pagespeed-report__score-gauge-label screen-reader-only"},Object(n.__)("Performance","google-site-kit")))},c=function PageSpeedReportScale(){return e.createElement("div",{className:"googlesitekit-pagespeed-report__scale"},e.createElement("span",null,Object(n.__)("Scale:","google-site-kit")),e.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--fast"},Object(n.__)("90-100 (fast)","google-site-kit")),e.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--average"},Object(n.__)("50-89 (average)","google-site-kit")),e.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--slow"},Object(n.__)("0-49 (slow)","google-site-kit")))}}).call(this,a(11))},,function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(94),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{__html:n.a.sanitize(e,t)}}},,,function(e,t,a){"use strict";(function(e,n){var i=a(10),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(3),f=a.n(_),k=a(0),y=a(2),v=a(71),S=a(9),O=a(32),E=a(57),j=function(t){function AnalyticsInactiveCTA(){return r()(this,AnalyticsInactiveCTA),u()(this,m()(AnalyticsInactiveCTA).apply(this,arguments))}return h()(AnalyticsInactiveCTA,t),l()(AnalyticsInactiveCTA,[{key:"render",value:function(){var t=this.props,a=t.title,i=void 0===a?Object(k.__)("Learn more about what visitors do on your site.","google-site-kit"):a,o=t.description,s=void 0===o?Object(k.__)("Connecting with Google Analytics to see unique vistors, goal completions, top pages and more.","google-site-kit"):o,r=t.ctaLabel,c=void 0===r?Object(k.__)("Set up Analytics","google-site-kit"):r;return e.googlesitekit.permissions.canManageOptions?n.createElement(O.a,{title:i,description:s,onClick:AnalyticsInactiveCTA.setupAnalyticsClick,ctaLabel:c}):null}}],[{key:"setupAnalyticsClick",value:function(){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.a.awrap(Object(y.a)(S.c,"analytics",!0));case 3:return t.next=5,o.a.awrap(Object(v.a)());case 5:e.location=Object(y.n)("analytics",!0),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),Object(y.x)(E.a,{id:"analytics-setup-error",title:Object(k.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"});case 11:case"end":return t.stop()}}),null,null,[[0,8]])}}]),AnalyticsInactiveCTA}(b.a);j.propTypes={title:f.a.string,description:f.a.string,ctaLabel:f.a.string},j.defaultProps={},t.a=j}).call(this,a(16),a(11))},,function(e,t,a){"use strict";(function(e){var n=a(1),i=a(21);t.a=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.createElement(n.b,null,a&&o&&s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(i.a,{fill:!0},e.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},t))))),a&&!o&&s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(i.a,{fill:!0},e.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},t))))),a&&o&&!s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},t),a&&!o&&!s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},t),!a&&!o&&s&&e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},t))),!a&&!o&&!s&&t)}}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(10),i=a.n(n),o=a(4),s=a.n(o),r=a(5),c=a.n(r),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(8),p=a.n(m),h=a(1),b=a(3),_=a.n(b),f=a(0),k=a(9),y=a(29),v=function(t){function Alert(e){var t;return s()(this,Alert),(t=d()(this,g()(Alert).call(this,e))).state={isLoading:!0,alerts:[],error:!1,message:""},t}return p()(Alert,t),c()(Alert,[{key:"componentDidMount",value:function(){this.getAlert()}},{key:"getAlert",value:function(){var e,t;return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.props.module,a.next=4,i.a.awrap(k.c.get(k.b,e,"notifications",{},!1));case 4:t=a.sent,this.setState({isLoading:!1,error:!1,alerts:t}),a.next=11;break;case 8:a.prev=8,a.t0=a.catch(0),this.setState({isLoading:!1,error:a.t0.code});case 11:case"end":return a.stop()}}),null,this,[[0,8]])}},{key:"render",value:function(){var t=this.state,a=t.alerts,n=t.error,i=t.isLoading;if(n||i||!a||!a.length)return null;var o=a.map((function(t){return e.createElement(y.a,{id:t.id,key:t.id,title:t.title,description:t.message||t.description,dismiss:Object(f.__)("Dismiss","google-site-kit"),isDismissable:t.isDismissible,format:"small",ctaLink:t.ctaURL,ctaLabel:t.ctaLabel,ctaTarget:t.ctaTarget,type:t.severity})}));return e.createElement(h.b,null,o)}}]),Alert}(h.a);v.propTypes={module:_.a.string.isRequired},t.a=v}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(3),f=a.n(_),k=a(0),y=a(2),v=a(47),S=a(18),O=a(9),E=a(19),j=a(24),D=a(17);function w(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var A=function(t){function DashboardAcquisitionPieChart(){return r()(this,DashboardAcquisitionPieChart),u()(this,m()(DashboardAcquisitionPieChart).apply(this,arguments))}return h()(DashboardAcquisitionPieChart,t),l()(DashboardAcquisitionPieChart,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.source;if(!a||a.error||!a.length)return null;var i=Object(D.e)(a);return e.createElement("div",{className:"googlesitekit-chart googlesitekit-chart--pie"},e.createElement(v.a,{data:i,options:{chartArea:{width:"100%",height:"100%"},backgroundColor:"transparent",height:250,legend:{alignment:"center",textStyle:{color:"#5b5b61",fontSize:12}},slices:{0:{color:"#178EC5"},1:{color:"#54B23B"},2:{color:"#EB5729"},3:{color:"#ECED33"},4:{color:"#34CBE3"},5:{color:"#82E88E"}},title:null,width:"100%"},chartType:"pie",id:"overview-piechart",loadHeight:205}),n&&e.createElement("div",{className:"googlesitekit-chart__source"},[Object(k.__)("Source:","google-site-kit")," ",e.createElement(E.a,{key:"link",href:Object(y.o)("googlesitekit-module-analytics"),inherit:!0},Object(k._x)("Analytics","Service name","google-site-kit"))]))}}]),DashboardAcquisitionPieChart}(b.a);A.defaultProps={source:!1},A.propTypes={source:f.a.bool},t.a=Object(S.a)(A,[{type:O.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?w(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):w(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},D.k,{url:n.googlesitekit.permaLink}),priority:1,maxAge:Object(y.q)("day"),context:["Dashboard","Single"]}],e.createElement(j.a,{width:"282px",height:"282px",shape:"circular"}),{},D.h,D.f)}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e,n){a(1);var i=a(0),o=a(29);t.a=function DashboardAuthAlert(){var t=e.googlesitekit.admin.connectURL;return n.createElement(o.a,{id:"authentication error",title:Object(i.__)("Issue accessing data","google-site-kit"),description:Object(i.__)("You need to reauthenticate your Google account.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0,ctaLink:t,ctaLabel:Object(i.__)("Click here","google-site-kit")})}}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return s}));var n=a(10),i=a.n(n),o=a(9),s=function(){var t,a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(o.c.get(o.a,"user","authentication"));case 3:t=n.sent,a=t.grantedScopes.filter((function(e){return-1!==t.requiredScopes.indexOf(e)})),e.googlesitekit.setup=e.googlesitekit.setup||{},e.googlesitekit.setup.isAuthenticated=t.isAuthenticated,e.googlesitekit.setup.requiredScopes=t.requiredScopes,e.googlesitekit.setup.grantedScopes=t.grantedScopes,e.googlesitekit.setup.needReauthenticate=a.length<t.requiredScopes.length,n.next=14;break;case 12:n.prev=12,n.t0=n.catch(0);case 14:case"end":return n.stop()}}),null,null,[[0,12]])}}).call(this,a(16))},,function(e,t,a){"use strict";(function(e){a(1);t.a=function Error(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#EA4336",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"error-title error-desc"},e.createElement("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z"}))}}).call(this,a(11))},,,,,function(e,t,a){"use strict";(function(e,n){a(1);var i=a(0),o=a(2),s=a(32),r=a(67);t.a=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=arguments.length>2&&void 0!==arguments[2]&&arguments[2],l=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=Object(o.l)()[t].name,u=e.createElement(s.a
8
+ /* translators: %s: Module name */,{title:Object(i.sprintf)(Object(i.__)("%s activation","google-site-kit"),d)
9
+ /* translators: %s: Module name */,description:Object(i.sprintf)(Object(i.__)("%s module needs to be configured","google-site-kit"),d),ctaLabel:Object(i.__)("Complete activation","google-site-kit"),onClick:function(){n.location=Object(o.n)(t,!0)}});return Object(r.a)(u,a,c,l)}}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(2),b=a(23),_=a(30),f=function(t){function AdSenseDashboardOutro(){return i()(this,AdSenseDashboardOutro),c()(this,d()(AdSenseDashboardOutro).apply(this,arguments))}return g()(AdSenseDashboardOutro,t),s()(AdSenseDashboardOutro,[{key:"render",value:function(){var t=Object(h.l)().adsense.accountURL;return e.createElement("section",{className:"googlesitekit-module-outro"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("div",{className:"googlesitekit-module-outro__logo"},e.createElement(b.a,{id:"adsense",height:"36",width:"42"}),e.createElement(b.a,{id:"plus",height:"13",width:"13"}),e.createElement(b.a,{id:"analytics",height:"36",width:"34"})),e.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-module-outro__title "},Object(p.__)("Connect Analytics with AdSense to create a powerful team that shows robust metrics for your site.","google-site-kit")),e.createElement("div",{className:"googlesitekit-module-outro__button"},e.createElement(_.a,{href:t,target:"_blank"},Object(p.__)("Connect Accounts","google-site-kit")))))))}}]),AdSenseDashboardOutro}(m.a);t.a=f}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=a(19),_=a(73),f=a(31),k=function(t){function AdSenseInProcessStatus(){return o()(this,AdSenseInProcessStatus),l()(this,u()(AdSenseInProcessStatus).apply(this,arguments))}return m()(AdSenseInProcessStatus,t),r()(AdSenseInProcessStatus,[{key:"render",value:function(){var t=this.props,a=t.ctaLink,i=t.ctaLinkText,o=t.header,s=t.incomplete,r=t.loadingMessage,c=t.subHeader,l=t.required,d=new URL(e.googlesitekit.admin.siteURL),u="https://www.google.com/adsense/new/sites?url=".concat(d.hostname,"&source=site-kit"),g=[{id:1,
10
+ /* translators: %s: Site URL */
11
+ text:Object(h.sprintf)(Object(h.__)("Added your site %s in ","google-site-kit"),d.hostname),linkText:Object(h.__)("Sites","google-site-kit"),linkURL:u},{id:2,text:Object(h.__)("Enabled ads in","google-site-kit"),linkText:Object(h.__)("Ads","google-site-kit"),linkURL:"https://www.google.com/adsense/new/myads/auto-ads"}];return n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},l&&n.createElement(_.a,null),r&&n.createElement(p.b,null,r,n.createElement(f.a,null)),o&&n.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},o),c&&n.createElement("p",null,c),s&&n.createElement("div",{className:"googlesitekit-setup-module__list-wrapper"},n.createElement("ol",{className:"googlesitekit-setup-module__list"},g.map((function(e){return n.createElement("li",{className:"googlesitekit-setup-module__list-item",key:e.id},e.text," ",n.createElement(b.a,{href:e.linkURL,external:!0,inherit:!0},e.linkText))})))),a&&i&&n.createElement("div",{className:"googlesitekit-setup-module__cta"},n.createElement(b.a,{className:"googlesitekit-setup-module__cta-link",href:a,external:!0},i)))}}]),AdSenseInProcessStatus}(p.a);t.a=k}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(15),g=a.n(u),m=a(8),p=a.n(m),h=a(1),b=a(3),_=a.n(b),f=a(0),k=a(12),y=a(2),v=a(59),S=a(19),O=a(9),E=function(t){function AdSenseSettings(e){var t;i()(this,AdSenseSettings),t=c()(this,d()(AdSenseSettings).call(this,e));var a=Object(y.l)().adsense.settings,n=a.useSnippet,o=void 0===n||n,s=a.accountID,r=a.accountStatus;return t.state={useSnippet:!!o,disabled:!1,accountID:s,accountStatus:r},t.handleUseSnippetSwitch=t.handleUseSnippetSwitch.bind(g()(t)),t.generateAccountStatusLabel=t.generateAccountStatusLabel.bind(g()(t)),t}return p()(AdSenseSettings,t),s()(AdSenseSettings,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(k.b)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed",(function(t,a){return"adsense"!==a.replace("-module","")?t:e.save()})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(k.g)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"save",value:function(){var e=Object(y.l)(),t=this.state.useSnippet;this._isMounted&&this.setState({useSnippet:t});var a={useSnippet:t||!1};return e.adsense.settings&&(e.adsense.settings.useSnippet=t),O.c.set(O.b,"adsense","use-snippet",a).then((function(e){return e})).catch((function(e){return e}))}},{key:"handleUseSnippetSwitch",value:function(){var e=this.props.saveOnChange,t=this.state.useSnippet;t=!t,this._isMounted&&this.setState({useSnippet:t}),Object(y.A)("adsense_setup",t?"adsense_tag_enabled":"adsense_tag_disabled"),e&&O.c.set(O.b,"adsense","use-snippet",{useSnippet:t}).then((function(e){return e})).catch((function(e){return e}))}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(y.z)("adsense",{useSnippet:"useSnippet"},this.state)}}},{key:"generateAccountStatusLabel",value:function(){switch(this.state.accountStatus){case"account-connected":return Object(f.__)("Your account has been approved","google-site-kit");case"account-pending-review":return Object(f.__)("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");case"account-required-action":return Object(f.__)("You need to fix some issues before your account is approved. Go to AdSense to find out how to fix it","google-site-kit");case"account-connected-nonmatching":case"ads-display-pending":case"disapproved-account":case"disapproved-account-afc":case"no-account":case"no-account-tag-found":case"account-connected-no-data":default:return Object(f.__)("Your site isn’t ready to show ads yet","google-site-kit")}}},{key:"render",value:function(){var t=this.state,a=t.useSnippet,n=t.accountID,i=this.props,o=i.isEditing,s=i.switchLabel,r=void 0===s?Object(f.__)("Let Site Kit place code on your site","google-site-kit"):s,c=i.switchOnMessage,l=i.switchOffMessage;return e.createElement(h.b,null,o?e.createElement(h.b,null,e.createElement("div",{className:"googlesitekit-setup-module__switch"},e.createElement(v.a,{id:"enableAutoAds",label:r,onClick:this.handleUseSnippetSwitch,checked:a,hideLabel:!1})," ",e.createElement("span",{className:"googlesitekit-recommended"},Object(f.__)("RECOMMENDED","google-site-kit"))),a&&c&&e.createElement("div",{className:"googlesitekit-settings-notice googlesitekit-settings-notice--suggestion"},e.createElement("div",{className:"googlesitekit-settings-notice__text"},c)),!a&&l&&e.createElement("div",{className:"googlesitekit-settings-notice"},e.createElement("div",{className:"googlesitekit-settings-notice__text"},l))):e.createElement(h.b,null,e.createElement("div",{className:"googlesitekit-settings-module__meta-items"},e.createElement("div",{className:"googlesitekit-settings-module__meta-item"},e.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(f.__)("Publisher ID","google-site-kit")),e.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},n)),e.createElement("div",{className:"googlesitekit-settings-module__meta-item"},e.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(f.__)("Account Status","google-site-kit")),e.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},this.generateAccountStatusLabel())),e.createElement("div",{className:"googlesitekit-settings-module__meta-item"},e.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(f.__)("Site Status","google-site-kit")),e.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},e.createElement(S.a,{href:"https://www.google.com/adsense/new/sites/my-sites",className:"googlesitekit-settings-module__cta-button",inherit:!0,external:!0},Object(f.__)("Check your site status","google-site-kit"))))),e.createElement("div",{className:"googlesitekit-settings-module__meta-items"},e.createElement("div",{className:"googlesitekit-settings-module__meta-item"},e.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(f.__)("AdSense Code","google-site-kit")),e.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a&&Object(f.__)("The AdSense code has been placed on your site","google-site-kit"),!a&&Object(f.__)("The AdSense code has not been placed on your site","google-site-kit"))))))}}]),AdSenseSettings}(h.a);E.propTypes={isEditing:_.a.bool,accountTagMatch:_.a.bool,existingTag:_.a.oneOfType([_.a.bool,_.a.string]),switchLabel:_.a.string,switchOnMessage:_.a.string,switchOffMessage:_.a.string},E.defaultProps={isEditing:!1,accountTagMatch:!1,existingTag:!1,switchOnMessage:"",switchOffMessage:""},t.a=E}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(13),f=a(0),k=a(2),y=a(18),v=a(9),S=a(27),O=a(35),E=a(83),j=a(17);function D(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var w=function(t){function AnalyticsDashboardWidgetTopAcquisitionSources(){return r()(this,AnalyticsDashboardWidgetTopAcquisitionSources),u()(this,m()(AnalyticsDashboardWidgetTopAcquisitionSources).apply(this,arguments))}return h()(AnalyticsDashboardWidgetTopAcquisitionSources,t),l()(AnalyticsDashboardWidgetTopAcquisitionSources,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=Object(k.g)(),n=[{title:Object(f.__)("Medium","google-site-kit"),tooltip:Object(f.__)("Medium refers to where your traffic originated from","google-site-kit")},{title:Object(f.__)("Users","google-site-kit"),tooltip:Object(f.__)("Number of users that originated from that traffic","google-site-kit")},{title:Object(f.__)("New Users","google-site-kit"),
12
+ /* translators: %s: date range */
13
+ tooltip:Object(f.sprintf)(Object(f.__)("Number of new users to visit your page over last %s","google-site-kit"),a)},{title:Object(f.__)("Sessions","google-site-kit"),
14
+ /* translators: %s: date range */
15
+ tooltip:Object(f.sprintf)(Object(f.__)("Number of sessions users had on your website over last %s","google-site-kit"),a)},{title:Object(f.__)("Percentage","google-site-kit"),tooltip:Object(f.__)("Percentage of sessions","google-site-kit")}],i=t[0].data.totals[0].values[0],o=Object(_.map)(t[0].data.rows,(function(t,a){var n=t.metrics[0].values[0]/i*100;return!(1>n)&&[t.dimensions[0],Object(k.t)(t.metrics[0].values[0]),Object(k.t)(t.metrics[0].values[1]),Object(k.t)(t.metrics[0].values[2]),e.createElement(b.b,{key:"minichart-analytics-top-as-"+a},e.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")," ",e.createElement(E.a,{percent:n.toFixed(1),index:a})))]})),s=Object(S.b)(o,n,{hideHeader:!1,chartsEnabled:!1});return e.createElement("div",{className:"googlesitekit-details-widget"},e.createElement(S.a,null,s))}}]),AnalyticsDashboardWidgetTopAcquisitionSources}(b.a);t.a=Object(y.a)(w,[{type:v.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):D(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},j.k,{url:n.googlesitekit.permaLink}),priority:1,maxAge:Object(k.q)("day"),context:["Single","Dashboard"]}],e.createElement(O.a,{rows:4,rowHeight:50}),{},j.h)}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(47),h=a(150),b=function(t){function MiniChart(){return i()(this,MiniChart),c()(this,d()(MiniChart).apply(this,arguments))}return g()(MiniChart,t),s()(MiniChart,[{key:"render",value:function(){var t=this.props,a=t.index,n=t.percent,i={backgroundColor:"transparent",chartArea:{width:"100%",height:"100%"},enableInteractivity:!1,height:28,legend:{position:"none"},slices:{0:{color:h.a[a]},1:{color:"#e6e6e6"}},title:null,tooltip:{trigger:"none"},width:28},o=[["source","percent"],["",+n],["",100-n]];return e.createElement("div",{className:"googlesitekit-mini-chart"},e.createElement(p.a,{data:o,options:i,chartType:"pie",loadSmall:!0,loadCompressed:!0,loadHeight:24,loadText:!1,id:"minichart"+a}))}}]),MiniChart}(m.a);t.a=b}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(13),b=a(0),_=a(2),f=a(18),k=a(9),y=a(27),v=a(35),S=function(t){function SearchConsoleDashboardWidgetKeywordTable(){return o()(this,SearchConsoleDashboardWidgetKeywordTable),l()(this,u()(SearchConsoleDashboardWidgetKeywordTable).apply(this,arguments))}return m()(SearchConsoleDashboardWidgetKeywordTable,t),r()(SearchConsoleDashboardWidgetKeywordTable,[{key:"render",value:function(){var t=this.props.data,a=[{title:Object(b.__)("Keyword","google-site-kit"),tooltip:Object(b.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(b.__)("Clicks","google-site-kit"),tooltip:Object(b.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(b.__)("Impressions","google-site-kit"),tooltip:Object(b.__)("Counted each time your content appears in search results","google-site-kit")}],i=e.googlesitekit.admin.siteURL,o=[],s=Object(h.map)(t,(function(e,t){var a=e.keys[0];return o[t]=Object(b.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",i,a),[a,Object(_.t)(e.clicks),Object(_.t)(e.impressions)]})),r={hideHeader:!1,chartsEnabled:!1,links:o},c=Object(y.b)(s,a,r);return n.createElement(y.a,null,c)}}]),SearchConsoleDashboardWidgetKeywordTable}(p.a);t.a=Object(f.a)(S,[{type:k.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:e.googlesitekit.permaLink,dimensions:"query",limit:10},priority:1,maxAge:Object(_.q)("day"),context:["Single","Dashboard"]}],n.createElement(v.a,{padding:!0}),{createGrid:!0},(function(e){return!e.length}))}).call(this,a(16),a(11))},function(e,t,a){"use strict";var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(51),p=function(e){function DashboardSearchFunnelInner(){return i()(this,DashboardSearchFunnelInner),c()(this,d()(DashboardSearchFunnelInner).apply(this,arguments))}return g()(DashboardSearchFunnelInner,e),s()(DashboardSearchFunnelInner,[{key:"render",value:function(){return null}}]),DashboardSearchFunnelInner}(a(1).a);t.a=Object(m.a)("googlesitekit.DashboardSearchFunnel")(p)},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(3),b=a.n(h),_=a(0),f=a(29),k=function(t){function ErrorHandler(e){var t;return o()(this,ErrorHandler),(t=l()(this,u()(ErrorHandler).call(this,e))).state={error:null,info:null},t}return m()(ErrorHandler,t),r()(ErrorHandler,[{key:"componentDidCatch",value:function(t,a){e.console.error("Caught an error:",t,a),this.setState({error:t,info:a})}},{key:"render",value:function(){var e=this.props.children,t=this.state,a=t.error,i=t.info;return a?n.createElement(f.a,{id:"googlesitekit-error",title:Object(_.__)("Site Kit encountered an error","google-site-kit"),description:n.createElement("code",null,a.message),isDismissable:!1,format:"small",type:"win-error"},n.createElement("pre",null,i.componentStack)):e}}]),ErrorHandler}(p.a);k.defaultProps={},k.propTypes={children:b.a.node.isRequired},t.a=k}).call(this,a(16),a(11))},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=function DisplaySetting(e){return e.value||" "};o.propTypes={value:i.a.oneOfType([i.a.string,i.a.bool,i.a.number])},t.a=o},function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(34),i=a.n(n),o=a(125),s=a.n(o),r=function(e){return s()(JSON.stringify(function e(t){var a={};Object.keys(t).sort().forEach((function(n){var o=t[n];o&&"object"===i()(o)&&!Array.isArray(o)&&(o=e(o)),a[n]=o}));return a}(e)))}},function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return d}));var n,i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=function(t){var a=e[t];if(!a)return!1;try{var n="__storage_test__";return a.setItem(n,n),a.removeItem(n),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==a.length}},l=function(){function NullStorage(){o()(this,NullStorage)}return r()(NullStorage,[{key:"key",value:function(){return null}},{key:"getItem",value:function(){return null}},{key:"setItem",value:function(){}},{key:"removeItem",value:function(){}},{key:"clear",value:function(){}},{key:"length",get:function(){return 0}}]),NullStorage}(),d=function(){return n||(n=c("sessionStorage")?e.sessionStorage:c("localStorage")?e.localStorage:new l),n}}).call(this,a(16))},function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return i}));var n=a(0);function i(){Object(n.setLocaleData)(e.googlesitekit.locale,"google-site-kit")}}).call(this,a(16))},function(e,t,a){"use strict";t.a=[/<meta name="googlesitekit-setup" content="([a-z0-9-]+)"/]},function(e,t,a){"use strict";t.a=[/google_ad_client: ?["|'](.*?)["|']/,/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/]},function(e,t,a){"use strict";t.a=[/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/,/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/,/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/,/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/,/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/]},function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return i}));var n=a(124),i=a.n(n)()(e)}).call(this,a(16))},function(e,t,a){"use strict";(function(e){a(1);t.a=function Warning(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#F9BB2D",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"warning-title warning-desc"},e.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),e.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))}}).call(this,a(11))},,,,function(e,t,a){"use strict";(function(e){a(1);var n=a(0),i=a(23);t.a=function Logo(){return e.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},e.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),e.createElement(i.a,{id:"logo-sitekit",className:"googlesitekit-logo__logo-sitekit",height:"26",width:"99"}),e.createElement("span",{className:"screen-reader-text"},Object(n.__)("Site Kit by Google Logo","google-site-kit")))}}).call(this,a(11))},function(e,t,a){"use strict";(function(e){a(1);var n=a(3),i=a.n(n),o=a(14),s=a.n(o);function ChangeArrow(t){var a=t.direction,n=t.invertColor;return e.createElement("svg",{className:s()("googlesitekit-change-arrow","googlesitekit-change-arrow--".concat(a),{"googlesitekit-change-arrow--inverted-color":n}),width:"9",height:"9",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.625 10L5.625 2.375L9.125 5.875L10 5L5 -1.76555e-07L-2.7055e-07 5L0.875 5.875L4.375 2.375L4.375 10L5.625 10Z",fill:"currentColor"}))}ChangeArrow.propTypes={direction:i.a.string,invertColor:i.a.bool},ChangeArrow.defaultProps={direction:"up",invertColor:!1},t.a=ChangeArrow}).call(this,a(11))},function(e,t,a){"use strict";(function(e){a(1);var n=a(0),i=a(29);t.a=function DashboardPermissionAlert(){return e.createElement(i.a,{id:"permission error",title:Object(n.__)("Permissions issue accessing data","google-site-kit"),description:Object(n.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})}}).call(this,a(11))},,,function(e,t,a){"use strict";(function(e,n){var i=a(115),o=a.n(i),s=a(10),r=a.n(s),c=a(4),l=a.n(c),d=a(5),u=a.n(d),g=a(6),m=a.n(g),p=a(7),h=a.n(p),b=a(15),_=a.n(b),f=a(8),k=a.n(f),y=a(20),v=a.n(y),S=a(1),O=a(3),E=a.n(O),j=a(14),D=a.n(j),w=a(0),A=a(12),C=a(2),N=a(23),x=a(25),P=a(9),T=a(30),L=a(31),I=a(19),M=a(105),W=a(59);function R(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function U(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?R(a,!0).forEach((function(t){v()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):R(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var q=v()({},"loggedinUsers",Object(w.__)("Logged-in users","google-site-kit")),z=function(t){function AnalyticsSetup(e){var t;l()(this,AnalyticsSetup),t=m()(this,h()(AnalyticsSetup).call(this,e));var a=Object(C.l)().analytics.settings,n=a.accountID,i=a.anonymizeIP,o=a.internalWebPropertyID,s=a.profileID,r=a.propertyID,c=a.useSnippet,d=a.trackingDisabled;return t.state={anonymizeIP:i,isLoading:!0,isSaving:!1,propertiesLoading:!1,profilesLoading:!1,useSnippet:c||!1,errorCode:!1,errorMsg:"",errorReason:!1,accounts:[],properties:[],profiles:[],selectedAccount:n,selectedProperty:r,selectedProfile:s,selectedinternalWebProperty:o,existingTag:!1,trackingDisabled:d||[]},t.handleAccountChange=t.handleAccountChange.bind(_()(t)),t.handlePropertyChange=t.handlePropertyChange.bind(_()(t)),t.handleProfileChange=t.handleProfileChange.bind(_()(t)),t.processAccountChange=t.processAccountChange.bind(_()(t)),t.processPropertyChange=t.processPropertyChange.bind(_()(t)),t.handleSubmit=t.handleSubmit.bind(_()(t)),t.handleRadioClick=t.handleRadioClick.bind(_()(t)),t.handleRefetchAccount=t.handleRefetchAccount.bind(_()(t)),t.handleExclusionsChange=t.handleExclusionsChange.bind(_()(t)),t.switchStatus=t.switchStatus.bind(_()(t)),t}return k()(AnalyticsSetup,t),u()(AnalyticsSetup,[{key:"componentDidMount",value:function(){var e,t,a,n,i,o=this;return r.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:if(e=this.props,t=e.isOpen,a=e.onSettingsPage,this._isMounted=!0,!a||t){s.next=4;break}return s.abrupt("return");case 4:return s.next=6,r.a.awrap(Object(C.j)("analytics"));case 6:if(!(n=s.sent)||!n.length){s.next=21;break}return s.prev=8,s.next=11,r.a.awrap(P.c.get(P.b,"analytics","tag-permission",{tag:n}));case 11:return i=s.sent,s.next=14,r.a.awrap(this.getAccounts(i));case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(8),this.setState({isLoading:!1,errorCode:s.t0.code,errorMsg:s.t0.message,errorReason:!(!s.t0.data||!s.t0.data.reason)&&s.t0.data.reason});case 19:s.next=23;break;case 21:return s.next=23,r.a.awrap(this.getAccounts());case 23:Object(A.b)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed",(function(e,t){return"analytics"!==t.replace("-module","")?e:o.props.isEditing?o.handleSubmit():void 0}));case 24:case"end":return s.stop()}}),null,this,[[8,16]])}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(A.g)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={anonymizeIP:"anonymizeIP",selectedAccount:"accountID",selectedProperty:"propertyID",selectedProfile:"profileID",selectedinternalWebProperty:"internalWebPropertyID",useSnippet:"useSnippet",trackingDisabled:"trackingDisabled"};"-1"===this.state.selectedAccount&&(e={}),Object(C.z)("analytics",e,this.state)}}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.dataset.value;n!==a&&("0"!==n?(this.setState({propertiesLoading:!0,profilesLoading:!0,selectedAccount:n}),Object(C.A)("analytics_setup","account_change",n),"-1"!==n&&this.processAccountChange(n)):this.setState({selectedAccount:n,selectedProperty:"-1",selectedProfile:"-1",properties:[{id:"-1",name:Object(w.__)("Select an account","google-site-kit")}],profiles:[{id:"-1",name:Object(w.__)("Select an account","google-site-kit")}]}))}},{key:"handlePropertyChange",value:function(e,t){var a=this.state.selectedProperty,n=t.dataset.value;n!==a&&("0"!==n?(this.setState({profilesLoading:!0,selectedProperty:n}),Object(C.A)("analytics_setup","property_change",n),this.processPropertyChange(n)):this.setState({selectedProperty:n,selectedProfile:n,profiles:[{id:0,name:Object(w.__)("Setup a New Profile","google-site-kit")}]}))}},{key:"handleProfileChange",value:function(e,t){var a=t.dataset.value;this.setState({selectedProfile:a}),Object(C.A)("analytics_setup","profile_change",a)}},{key:"getAccounts",value:function(){var e,t,a,n,i,o,s,c,l,d,u,g,m,p,h,b,_=this,f=arguments;return r.a.async((function(k){for(;;)switch(k.prev=k.next){case 0:return e=f.length>0&&void 0!==f[0]&&f[0],t=this.state,a=t.selectedAccount,n=t.selectedProperty,i=t.selectedProfile,o=t.useSnippet,s=this.props,c=s.isEditing,l=s.onSettingsPage,d=this.state.errorCode,u={},k.prev=5,g=e?{existingAccountID:e.accountID,existingPropertyID:e.propertyID}:{},k.next=9,r.a.awrap(P.c.get(P.b,"analytics","accounts-properties-profiles",g));case 9:0===(m=k.sent).accounts.length?(u=U({},u,{errorCode:"no_account",errorReason:"noAccount"}),P.c.invalidateCacheGroup(P.b,"analytics","accounts-properties-profiles")):a?"0"===a?m.accounts.unshift({id:0,name:Object(w.__)("Select one...","google-site-kit")}):a&&!m.accounts.find((function(e){return e.id===a}))&&(P.c.invalidateCacheGroup(P.b,"analytics","accounts-properties-profiles"),m.accounts.unshift({id:0,name:Object(w.__)("Select one...","google-site-kit")}),c&&(a="0",n="-1",i="-1"),u=U({},u,{errorCode:"insufficient_permissions",errorReason:"insufficientPermissions"})):(p=null,m.matchedProperty&&(p=m.matchedProperty),p?(a=p.accountId,n=p.id,(h=m.profiles.find((function(e){return e.accountId===a})))&&(i=h.id)):m.accounts.unshift({id:0,name:Object(w.__)("Select one...","google-site-kit")})),b={id:"-1",name:Object(w.__)("Select an account","google-site-kit")},this.state.existingTag||m.properties.push({id:0,name:Object(w.__)("Setup a New Property","google-site-kit")}),m.profiles.push({id:0,name:Object(w.__)("Setup a New Profile","google-site-kit")}),l||(o=!e),u=U({},u,{isLoading:!1,accounts:m.accounts,errorCode:d||u.errorCode,selectedAccount:a,selectedProperty:n,selectedProfile:i,properties:[b],profiles:[b],existingTag:!!e&&e.propertyID,useSnippet:o}),a&&"0"!==a&&(u=Object.assign(u,{properties:m.properties,profiles:m.profiles,selectedinternalWebProperty:m.properties[0]?m.properties[0].internalWebPropertyID:0})),k.next=22;break;case 19:k.prev=19,k.t0=k.catch(5),u={isLoading:!1,errorCode:k.t0.code,errorMsg:k.t0.message,errorReason:!(!k.t0.data||!k.t0.data.reason)&&k.t0.data.reason};case 22:return k.abrupt("return",new Promise((function(e){_._isMounted?_.setState(u,e):e()})));case 23:case"end":return k.stop()}}),null,this,[[5,19]])}},{key:"processAccountChange",value:function(e){var t,a,n,i;return r.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,t={accountID:e},o.next=4,r.a.awrap(P.c.get(P.b,"analytics","properties-profiles",t));case 4:a=o.sent,n={id:0,name:Object(w.__)("Setup a New Property","google-site-kit")},a.properties.push(n),i={id:0,name:Object(w.__)("Setup a New Profile","google-site-kit")},a.profiles.push(i),this.setState({propertiesLoading:!1,profilesLoading:!1,properties:a.properties,profiles:a.profiles,selectedAccount:e,selectedProperty:a.properties[0].id,selectedinternalWebProperty:a.properties[0].internalWebPropertyID,selectedProfile:a.profiles[0].id,errorCode:!1}),o.next=15;break;case 12:o.prev=12,o.t0=o.catch(0),this.setState({errorCode:o.t0.code,errorMsg:o.t0.message});case 15:case"end":return o.stop()}}),null,this,[[0,12]])}},{key:"processPropertyChange",value:function(e){var t,a,n;return r.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t=this.state.selectedAccount,i.prev=1,a={accountID:t,propertyID:e},i.next=5,r.a.awrap(P.c.get(P.b,"analytics","profiles",a));case 5:n=i.sent,this.setState({profilesLoading:!1,profiles:n,selectedProperty:e,selectedinternalWebProperty:n[0].internalWebPropertyID,selectedProfile:n[0].id,errorCode:!1}),i.next=12;break;case 9:i.prev=9,i.t0=i.catch(1),this.setState({errorCode:i.t0.code,errorMsg:i.t0.message});case 12:case"end":return i.stop()}}),null,this,[[1,9]])}},{key:"handleSubmit",value:function(e){var t,a,n,i,o,s,c,l,d,u,g,m,p,h,b,_,f;return r.a.async((function(k){for(;;)switch(k.prev=k.next){case 0:if(e&&e.preventDefault(),this.state.selectedAccount&&"-1"!==this.state.selectedAccount){k.next=3;break}return k.abrupt("return");case 3:return t=this.state,a=t.anonymizeIP,n=t.selectedAccount,i=t.selectedProperty,o=t.selectedProfile,s=t.useSnippet,c=t.selectedinternalWebProperty,l=t.accounts,d=t.properties,u=t.profiles,g=t.trackingDisabled,this.setState({isSaving:!0}),m=this.props.finishSetup,p=o||(u[0].id||0===u[0].id?u[0].id.toString():null),h=i||(d[0].id||0===d[0].id?d[0].id.toString():null),b="0"===h?"0":c||(d[0].internalWebPropertyId||0===d[0].internalWebPropertyId?d[0].internalWebPropertyId.toString():null),_={anonymizeIP:a,accountID:n||l[0].id||null,profileID:p,propertyID:h,internalWebPropertyID:b,useSnippet:s||!1,trackingDisabled:g},k.prev=10,k.next=13,r.a.awrap(P.c.set(P.b,"analytics","settings",_));case 13:return f=k.sent,P.c.invalidateCacheGroup(P.b,"analytics","accounts-properties-profiles"),k.next=17,r.a.awrap(this.getAccounts());case 17:Object(C.l)().analytics.settings=f,Object(C.A)("analytics_setup","analytics_configured"),m&&m(),this._isMounted&&this.setState({isSaving:!1,selectedAccount:f.accountID,selectedProfile:f.profileID,selectedProperty:f.propertyID,selectedinternalWebProperty:f.internalWebPropertyID}),k.next=26;break;case 23:k.prev=23,k.t0=k.catch(10),this.setState({isSaving:!1,errorCode:k.t0.code,errorMsg:k.t0.message});case 26:case"end":return k.stop()}}),null,this,[[10,23]])}},{key:"handleRadioClick",value:function(e){var t="1"===e.target.value;this.setState({useSnippet:t}),Object(C.A)("analytics_setup",t?"analytics_tag_enabled":"analytics_tag_disabled")}},{key:"switchStatus",value:function(e){var t=this;return function(){t.setState(v()({},e,!t.state[e]))}}},{key:"handleRefetchAccount",value:function(){this.setState({isLoading:!0,errorCode:!1,errorMsg:"",selectedAccount:"0",selectedProperty:"-1",selectedProfile:"-1",propertiesLoading:!1,profilesLoading:!1},this.getAccounts)}},{key:"handleExclusionsChange",value:function(e){var t=this.state.trackingDisabled,a=e.target,n=a.id,i=a.checked,s=Object.assign.apply(Object,[{}].concat(o()(t.map((function(e){return v()({},e,!0)}))),[v()({},n,i)]));this.setState({trackingDisabled:Object.keys(s).filter((function(e){return s[e]}))})}},{key:"renderAutoInsertSnippetForm",value:function(){var t=this.state,a=t.anonymizeIP,i=t.useSnippet,o=t.isSaving,s=t.existingTag,r=this.props,c=r.isEditing,l=r.onSettingsPage,d=!c,u=e.googlesitekit.admin.ampMode,g=Object(C.l)().analytics.settings.useSnippet;return n.createElement("div",{className:"googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--multiline"},(c||o)&&n.createElement(S.b,null,l&&n.createElement(S.b,null,!g&&!s&&n.createElement(S.b,null,n.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(w.__)("Currently there is no Analytics snippet placed on your site, so no stats are being gathered. Would you like Site Kit to insert the Analytics snippet? You can change this setting later.","google-site-kit"))),g&&n.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(w.__)("Do you want to remove the Analytics snippet inserted by Site Kit?","google-site-kit"))),l&&!s&&!i&&g&&n.createElement("p",null,Object(w.__)("If the code snippet is removed, you will no longer be able to gather Analytics insights about your site.","google-site-kit"))),l&&n.createElement(S.b,null,s&&n.createElement("p",null,Object(w.__)("Placing two tags at the same time is not recommended.","google-site-kit")),n.createElement(M.a,{onClick:this.handleRadioClick,id:"useSnippetTrue",name:"useSnippet",value:"1",checked:i,disabled:d},g?Object(w.__)("Not at this time","google-site-kit"):Object(w.__)("Insert snippet","google-site-kit")),n.createElement(M.a,{onClick:this.handleRadioClick,id:"useSnippetFalse",name:"useSnippet",value:"0",checked:!i,disabled:d},g?Object(w.__)("Remove snippet","google-site-kit"):Object(w.__)("Not at this time","google-site-kit"))),l&&i&&"primary"!==u&&n.createElement("div",{className:"googlesitekit-setup-module__input"},n.createElement(W.a,{id:"anonymizeIP",label:Object(w.__)("Anonymize IP addresses","google-site-kit"),onClick:this.switchStatus("anonymizeIP"),checked:a,hideLabel:!1}),n.createElement("p",null,a?Object(w.__)("IP addresses will be anonymized.","google-site-kit"):Object(w.__)("IP addresses will not be anonymized.","google-site-kit")," ",n.createElement(I.a,{href:"https://support.google.com/analytics/answer/2763052",external:!0,inherit:!0,dangerouslySetInnerHTML:{__html:Object(w.__)('Learn more<span class="screen-reader-text"> about IP anonymization.</span>',"google-site-kit")}}))))}},{key:"accountsDropdown",value:function(){var e=this.state,t=e.accounts,a=e.selectedAccount,i=e.existingTag,o=!this.props.isEditing;return i&&a&&(o=!0),n.createElement(x.k,{className:"googlesitekit-analytics__select-account",enhanced:!0,name:"accounts",value:a||"0",onEnhancedChange:this.handleAccountChange,label:Object(w.__)("Account","google-site-kit"),disabled:o,outlined:!0},t.concat(i?[]:[{id:"-1",name:Object(w.__)("Set up a new account","google-site-kit")}]).map((function(e,t){return n.createElement(x.j,{key:t,value:e.id},e.name)})))}},{key:"renderForm",value:function(){var t=this.state,a=t.anonymizeIP,i=t.isLoading,o=t.propertiesLoading,s=t.profilesLoading,r=t.accounts,c=t.properties,l=t.profiles,d=t.selectedAccount,u=t.selectedProperty,g=t.selectedProfile,m=t.useSnippet,p=t.existingTag,h=t.errorCode,b=t.trackingDisabled,_=this.props,f=_.onSettingsPage,k=_.isEditing,y=parseInt(d)||0,v=!p&&y>0,O=!!/^UA-/.test(u.toString()),E=e.googlesitekit.admin.ampMode,j=Object(C.l)().analytics.setupComplete;if(i)return n.createElement(L.a,null);if("google_analytics_existing_tag_permission"===h)return null;if(!r.length||"-1"===d){if(!k)return Object(w.__)("No account found.","google-site-kit");if(!j||k)return n.createElement(S.b,null,"-1"===d&&n.createElement(S.b,null,n.createElement("p",null,Object(w.__)("To create a new account, click the button below which will open the Google Analytics account creation screen in a new window.","google-site-kit")),n.createElement("p",null,Object(w.__)("Once completed, click the link below to re-fetch your accounts to continue.","google-site-kit"))),n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(T.a,{onClick:AnalyticsSetup.createNewAccount},Object(w.__)("Create an account","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(I.a,{onClick:this.handleRefetchAccount},Object(w.__)("Re-fetch My Account","google-site-kit")))))}if(!k){var D=m?Object(w.__)("Snippet is inserted","google-site-kit"):Object(w.__)("Snippet is not inserted","google-site-kit");return p&&(D=Object(w.__)("Inserted by another plugin or theme","google-site-kit")),n.createElement(S.b,null,n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(w.__)("Account","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},d||r[0].name||!1)),n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(w.__)("Property","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},u||c[0].name||!1)),n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(w.__)("View","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},g||l[0].name||!1))),n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:" googlesitekit-settings-module__meta-item "},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(w.__)("Analytics Code Snippet","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},D))),f&&m&&"primary"!==E&&n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:" googlesitekit-settings-module__meta-item "},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(w.__)("IP Address Anonymization","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a&&Object(w.__)("IP addresses are being anonymized.","google-site-kit"),!a&&Object(w.__)("IP addresses are not being anonymized.","google-site-kit")))),n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:" googlesitekit-settings-module__meta-item "},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(w.__)("Excluded from Analytics","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},!!b.length&&b.map((function(e){return q[e]})).join(Object(w._x)(", ","list separator","google-site-kit")),!b.length&&Object(w.__)("Analytics is currently enabled for all visitors.","google-site-kit")))))}return n.createElement(S.b,null,!f&&0<r.length&&!p&&n.createElement("p",null,Object(w.__)("Please select the account information below. You can change this view later in your settings.","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__inputs"},this.accountsDropdown(),o?n.createElement(L.a,{small:!0}):n.createElement(x.k,{className:"googlesitekit-analytics__select-property",enhanced:!0,name:"properties",value:u||0===u?u.toString():"-1",onEnhancedChange:this.handlePropertyChange,label:Object(w.__)("Property","google-site-kit"),disabled:!v,outlined:!0},c.map((function(e,t){return n.createElement(x.j,{key:t,value:e.id},e.name)}))),s?n.createElement(L.a,{small:!0}):n.createElement(x.k,{className:"googlesitekit-analytics__select-profile",enhanced:!0,name:"profiles",value:g||0===g?g.toString():"-1",onEnhancedChange:this.handleProfileChange,label:Object(w.__)("View","google-site-kit"),disabled:!O,outlined:!0},l.map((function(e,t){return n.createElement(x.j,{key:t,value:e.id},e.name)})))),this.renderAutoInsertSnippetForm(),f&&this.renderExclusionsForm(),!f&&n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(T.a,{disabled:!this.state.selectedAccount,onClick:this.handleSubmit},Object(w.__)("Configure Analytics","google-site-kit"))))}},{key:"renderExclusionsForm",value:function(){var e=this.state.trackingDisabled;return n.createElement("div",null,n.createElement("p",{className:"googlesitekit-setup-module__text"},Object(w.__)("Exclude from Analytics","google-site-kit")),n.createElement("div",{className:"mdc-form-field"},n.createElement(W.a,{id:"loggedinUsers",label:q.loggedinUsers,onClick:this.handleExclusionsChange,checked:e.includes("loggedinUsers"),hideLabel:!1})),n.createElement("p",null,e.includes("loggedinUsers")?Object(w.__)("Logged-in users will be excluded from Analytics tracking.","google-site-kit"):Object(w.__)("Logged-in users will be included in Analytics tracking.","google-site-kit")))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,i=e.errorReason,o=e.accounts,s=this.props.onSettingsPage;if(!t)return null;var r=!0,c=a;switch(!0){case"google_analytics_existing_tag_permission"===t:r=!0;break;case s&&t&&"insufficientPermissions"===i:r=!1,c=Object(w.__)("You currently don't have access to this Google Analytics account. You can either request access from your team, or remove this Google Analytics snippet and connect to a different account.","google-site-kit");break;case!s&&0===o.length:r=!1,c=Object(w.__)('Looks like you don\'t have an Analytics account yet. Once you create it, click on "Re-fetch my account" and Site Kit will locate it.',"google-site-kit")}return c&&0!==c.length?n.createElement("div",{className:D()({"googlesitekit-error-text":r})},n.createElement("p",null,r
16
+ /* translators: %s: Error message */?Object(w.sprintf)(Object(w.__)("Error: %s","google-site-kit"),c):c)):null}},{key:"render",value:function(){var e=this.props.onSettingsPage,t=this.state.existingTag;return e||Object(C.A)("analytics_setup","configure_analytics_screen"),n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--analytics"},!e&&n.createElement(S.b,null,n.createElement("div",{className:"googlesitekit-setup-module__logo"},n.createElement(N.a,{id:"analytics",width:"33",height:"33"})),n.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(w._x)("Analytics","Service name","google-site-kit"))),!!t&&
17
+ /* translators: %s: Analytics tag ID */
18
+ n.createElement("p",null,Object(w.sprintf)(Object(w.__)("An existing analytics tag was found on your site with the ID %s. If later on you decide to replace this tag, Site Kit can place the new tag for you. Make sure you remove the old tag first.","google-site-kit"),t)),this.renderErrorOrNotice(),this.renderForm())}}],[{key:"createNewAccount",value:function(t){t.preventDefault(),Object(C.A)("analytics_setup","new_analytics_account"),e.open("https://analytics.google.com/analytics/web/?#/provision/SignUp","_blank")}}]),AnalyticsSetup}(S.a);z.propTypes={onSettingsPage:E.a.bool,finishSetup:E.a.func,isEditing:E.a.bool},z.defaultProps={onSettingsPage:!0,isEditing:!1},t.a=z}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(14),_=a.n(b),f=a(25),k=function(t){function Radio(e){var t;return i()(this,Radio),(t=c()(this,d()(Radio).call(this,e))).formFieldRef=Object(m.h)(),t.radioRef=Object(m.h)(),t}return g()(Radio,t),s()(Radio,[{key:"componentDidMount",value:function(){new f.e(this.formFieldRef.current).input=new f.g(this.radioRef.current)}},{key:"render",value:function(){var t=this.props,a=t.onClick,n=t.id,i=t.name,o=t.value,s=t.checked,r=t.disabled,c=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:_()("mdc-radio",{"mdc-radio--disabled":r}),ref:this.radioRef},e.createElement("input",{className:"mdc-radio__native-control",onClick:a,type:"radio",id:n,name:i,value:o,checked:s,disabled:r,onChange:function(){}}),e.createElement("div",{className:"mdc-radio__background"},e.createElement("div",{className:"mdc-radio__outer-circle"}),e.createElement("div",{className:"mdc-radio__inner-circle"}))),e.createElement("label",{htmlFor:n},c))}}]),Radio}(m.a);k.propTypes={onClick:h.a.func,id:h.a.string.isRequired,name:h.a.string.isRequired,value:h.a.string.isRequired,checked:h.a.bool,disabled:h.a.bool,children:h.a.string.isRequired},k.defaultProps={onClick:null,checked:!1,disabled:!1},t.a=k}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(10),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(15),h=a.n(p),b=a(8),_=a.n(b),f=a(1),k=a(3),y=a.n(k),v=a(14),S=a.n(v),O=a(0),E=a(12),j=a(2),D=a(23),w=a(30),A=a(19),C=a(9),N=a(25),x=function(t){function OptimizeSetup(e){var t;r()(this,OptimizeSetup),t=u()(this,m()(OptimizeSetup).call(this,e));var a=Object(j.l)(),n=a.optimize.settings,i=n.optimizeID,o=n.ampExperimentJSON,s=(a.analytics||{}).settings,c=a.tagmanager||{},l=c.active,d=c.settings,g=!!s&&s.useSnippet,p=!(!l||!d)&&d.useSnippet;return t.state={optimizeID:i||"",analyticsUseSnippet:g,gtmUseSnippet:p,errorCode:!1,errorMsg:"",ampExperimentJSON:o||"",ampExperimentJSONValidated:!0,OptimizeIDValidated:!0},t.handleOptimizeIDEntry=t.handleOptimizeIDEntry.bind(h()(t)),t.handleSubmit=t.handleSubmit.bind(h()(t)),t.renderInstructionInfo=t.renderInstructionInfo.bind(h()(t)),t.handleAMPOptimizeEntry=t.handleAMPOptimizeEntry.bind(h()(t)),t}return _()(OptimizeSetup,t),l()(OptimizeSetup,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(E.b)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed",(function(t,a){return"optimize"!==a.replace("-module","")?t:e.props.isEditing?e.handleSubmit():void 0})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(E.g)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(j.z)("optimize",{optimizeID:"optimizeID",ampExperimentJSON:"ampExperimentJSON"},this.state)}}},{key:"handleSubmit",value:function(){var e,t,a,n,i,s,r=this;return o.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:if(e=this.state,t=e.optimizeID,a=e.ampExperimentJSON,n=e.OptimizeIDValidated,i=this.props.finishSetup,n&&0!==t.length){c.next=4;break}return c.abrupt("return",!1);case 4:return s={optimizeID:t,ampExperimentJSON:a},c.next=7,o.a.awrap(C.c.set(C.b,"optimize","settings",s).then((function(){i&&i(),Object(j.l)().optimize.settings.optimizeID=t,r._isMounted&&r.setState({isSaving:!1})})).catch((function(e){r._isMounted&&r.setState({errorCode:!0,errorMsg:e.errorMsg})})));case 7:return c.abrupt("return",c.sent);case 8:case"end":return c.stop()}}),null,this)}},{key:"handleOptimizeIDEntry",value:function(e){var t=Object(j.C)(e.target.value);this._isMounted&&this.setState({optimizeID:e.target.value,OptimizeIDValidated:t})}},{key:"handleAMPOptimizeEntry",value:function(e){var t=Object(j.B)(e.target.value);this._isMounted&&this.setState({ampExperimentJSON:e.target.value,ampExperimentJSONValidated:t})}},{key:"renderInfo",value:function(){var t=this.state.optimizeID;return e.createElement(f.b,null,t?e.createElement("div",null,Object(O.__)("Your Optimize Container ID","google-site-kit"),": ",e.createElement("strong",null,t)):e.createElement("div",null,Object(O.__)('Optimize Container ID missing, press "edit" to add',"google-site-kit"),"."))}},{key:"renderInstructionInfo",value:function(){var t=this.state,a=t.analyticsUseSnippet,n=t.gtmUseSnippet,i=t.optimizeID;return!a&&n?e.createElement(f.b,null,e.createElement("p",null,Object(O.__)("You are using auto insert snippet with Tag Manager","google-site-kit")),e.createElement("p",null,e.createElement("a",{href:"https://support.google.com/optimize/answer/6314801"},Object(O.__)("Click here","google-site-kit"))," ",Object(O.__)("for how to implement Optimize tag through your Tag Manager","google-site-kit"))):a?null:e.createElement(f.b,null,e.createElement("p",null,Object(O.__)("You disabled analytics auto insert snippet. If You are using Google Analytics code snippet, add the code below:","google-site-kit")),e.createElement("pre",null,'ga("require", "',i||"GTM-XXXXXXX",'");'),e.createElement("p",null,e.createElement("a",{href:"https://support.google.com/optimize/answer/6262084"},Object(O.__)("Click here","google-site-kit"))," ",Object(O.__)("for how to implement Optimize tag in Google Analytics Code Snippet","google-site-kit")))}},{key:"renderAMPSnippet",value:function(){var t=this.state,a=t.analyticsUseSnippet,i=t.ampExperimentJSON,o=t.ampExperimentJSONValidated,s=n.googlesitekit.admin.ampEnabled;return a&&s?e.createElement(f.b,null,e.createElement("p",null,Object(O.__)("Please input your AMP experiment settings in JSON format below.","google-site-kit")," ",e.createElement(A.a,{href:"https://developers.google.com/optimize/devguides/amp-experiments",external:!0,inherit:!0},Object(O.__)("Learn More.","google-site-kit"))),e.createElement(N.l,{className:S()("mdc-text-field",{"mdc-text-field--error":!o}),name:"amp-experiment",onChange:this.handleAMPOptimizeEntry,textarea:!0},e.createElement(N.b,{inputType:"textarea",value:null===i?"":i})),!o&&e.createElement("p",{className:"googlesitekit-error-text"},Object(O.__)("Error: AMP experiment settings are not in a valid JSON format.","google-site-kit"))):null}},{key:"renderForm",value:function(){var t=this.state,a=t.optimizeID,n=t.errorCode,i=t.errorMsg,o=t.OptimizeIDValidated;return e.createElement(f.b,null,e.createElement("p",null,Object(O.__)("Please copy and paste your Optimize ID to complete your setup.","google-site-kit")," ",e.createElement(A.a,{href:"https://support.google.com/optimize/answer/6211921",external:!0,inherit:!0},Object(O.__)("You can locate this here.","google-site-kit"))),n&&0<i.length&&e.createElement("p",{className:"googlesitekit-error-text"},Object(O.__)("Error:","google-site-kit")," ",i),e.createElement("div",{className:"googlesitekit-setup-module__inputs"},e.createElement(N.l,{className:S()("mdc-text-field",{"mdc-text-field--error":n||!o}),label:Object(O.__)("Optimize Container ID","google-site-kit"),name:"optimizeID",onChange:this.handleOptimizeIDEntry,helperText:e.createElement(N.a,null,Object(O.__)("Format: GTM-XXXXXXX.","google-site-kit")),outlined:!0,required:!0},e.createElement(N.b,{value:a}))),!o&&e.createElement("p",{className:"googlesitekit-error-text"},Object(O.__)("Error: Not a valid Optimize ID.","google-site-kit")),this.renderAMPSnippet(),this.renderInstructionInfo())}},{key:"render",value:function(){var t=this.props,a=t.onSettingsPage,n=t.isEditing;return e.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--optimize"},!a&&e.createElement(f.b,null,e.createElement("div",{className:"googlesitekit-setup-module__logo"},e.createElement(D.a,{id:"optimize",width:"33",height:"33"})),e.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(O._x)("Optimize","Service name","google-site-kit"))),n&&this.renderForm(),!n&&this.renderInfo(),!a&&e.createElement("div",{className:"googlesitekit-setup-module__action"},e.createElement(w.a,{onClick:this.handleSubmit},Object(O.__)("Configure Optimize","google-site-kit"))))}}]),OptimizeSetup}(f.a);x.propTypes={onSettingsPage:y.a.bool,finishSetup:y.a.func,isEditing:y.a.bool},x.defaultProps={onSettingsPage:!0,isEditing:!1},t.a=x}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e,n){a.d(t,"b",(function(){return E})),a.d(t,"a",(function(){return j}));var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(13),b=a(0),_=a(2),f=a(18),k=a(39),y=a(9),v=a(27),S=a(60),O=function(t){function PageSpeedInsightsDashboardWidgetHomepageSpeedColumn(){return o()(this,PageSpeedInsightsDashboardWidgetHomepageSpeedColumn),l()(this,u()(PageSpeedInsightsDashboardWidgetHomepageSpeedColumn).apply(this,arguments))}return m()(PageSpeedInsightsDashboardWidgetHomepageSpeedColumn,t),r()(PageSpeedInsightsDashboardWidgetHomepageSpeedColumn,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.handleDataLoaded;t&&a&&a()}},{key:"render",value:function(){var t=this.props,a=t.data,n=t.title;if(!a||a.error)return null;if(!function(e){return!!Object(h.get)(e,"categories.performance.score")}(a))return Object(k.a)(Object(b._x)("PageSpeed Insights","Service name","google-site-kit"),Object(b.__)("An unknown error occurred while trying to fetch PageSpeed Insights data. Please try again later.","google-site-kit"),!0);var i=a.categories.performance.score,o=Object(S.d)(i),s=a.audits.interactive.displayValue,r=Object(v.b)([[Object(b.__)("Real user speed data","google-site-kit"),e.createElement(S.b,{key:"0",score:i},o)],[Object(b.__)("Time to become fully interactive","google-site-kit"),e.createElement(S.b,{key:"0",score:i},s)]],[],{hideHeader:!0,disableListMode:!0,chartsEnabled:!1,links:[]});return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement("div",{className:"googlesitekit-pagespeed-report__heading-wrapper"},e.createElement("h3",{className:" googlesitekit-subheading-1 "},n),e.createElement(S.c,{score:i})),e.createElement(v.a,null,r))}}]),PageSpeedInsightsDashboardWidgetHomepageSpeedColumn}(p.a),E=Object(f.a)(O,[{type:y.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:n.googlesitekit.permaLink,strategy:"mobile",dateRange:null},priority:10,maxAge:Object(_.q)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0}),j=Object(f.a)(O,[{type:y.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:n.googlesitekit.permaLink,strategy:"desktop",dateRange:null},priority:10,maxAge:Object(_.q)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0})}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(10),r=a.n(s),c=a(4),l=a.n(c),d=a(5),u=a.n(d),g=a(6),m=a.n(g),p=a(7),h=a.n(p),b=a(15),_=a.n(b),f=a(8),k=a.n(f),y=a(1),v=a(3),S=a.n(v),O=a(13),E=a(14),j=a.n(E),D=a(0),w=a(12),A=a(23),C=a(2),N=a(33),x=a(25),P=a(30),T=a(87),L=a(19),I=a(59),M=a(9),W=a(31),R="web",U="amp",q=function(t){function TagmanagerSetup(t){var a;l()(this,TagmanagerSetup),a=m()(this,h()(TagmanagerSetup).call(this,t));var n=e.googlesitekit.admin,i=n.ampEnabled,o=n.ampMode,s=Object(C.l)().tagmanager.settings,r="primary"===o?U:[R,U];return a.state={ampEnabled:i,isLoading:!0,isSecondaryAMP:"secondary"===o,accounts:[],containers:[],containersAMP:[],errorCode:!1,errorMsg:"",existingContainer:"",selectedAccount:s.accountID,selectedContainer:s.containerID,selectedContainerAMP:s.ampContainerID,containersLoading:!1,usageContext:i?r:R,hasExistingTag:!1,useSnippet:s.useSnippet},a.handleSubmit=a.handleSubmit.bind(_()(a)),a.renderAccountDropdownForm=a.renderAccountDropdownForm.bind(_()(a)),a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.refetchAccount=a.refetchAccount.bind(_()(a)),a}return k()(TagmanagerSetup,t),u()(TagmanagerSetup,[{key:"setState",value:function(){this._isMounted&&y.a.prototype.setState.apply(this,arguments)}},{key:"componentDidMount",value:function(){var e,t,a,n=this;return r.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e=this.props,t=e.isOpen,a=e.onSettingsPage,this._isMounted=!0,!a||t){i.next=4;break}return i.abrupt("return");case 4:return i.next=6,r.a.awrap(this.loadAccountsContainers());case 6:Object(w.b)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed",(function(e,t){return"tagmanager"!==t.replace("-module","")?e:n.props.isEditing?n.handleSubmit():void 0})),this.toggleConfirmChangesButton();case 8:case"end":return i.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(w.g)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed")}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={selectedContainer:"containerID",selectedContainerAMP:"ampContainerID",selectedAccount:"accountID",useSnippet:"useSnippet"};this.canSaveSettings()||(e={}),Object(C.z)("tagmanager",e,this.state)}}},{key:"loadAccountsContainers",value:function(){var e,t,a,n,i,o;return r.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,r.a.awrap(Object(C.j)("tagmanager"));case 2:if(!(e=s.sent)){s.next=20;break}return s.prev=4,s.next=7,r.a.awrap(M.c.get(M.b,"tagmanager","tag-permission",{tag:e}));case 7:t=s.sent,a=t.account,n=t.container,i=Object(N.a)([n]).byContext(R),o=Object(N.a)([n]).byContext(U),this.setState({isLoading:!1,existingContainer:e,selectedAccount:a.accountId,selectedContainer:Object(O.get)(i,[0,"publicId"]),selectedContainerAMP:Object(O.get)(o,[0,"publicId"]),accounts:[a],hasExistingTag:!0}),s.next=18;break;case 15:s.prev=15,s.t0=s.catch(4),this.setState({isLoading:!1,errorCode:s.t0.code,errorMsg:s.t0.message,errorReason:!(!s.t0.data||!s.t0.data.reason)&&s.t0.data.reason,existingContainer:e,hasExistingTag:!!e});case 18:s.next=22;break;case 20:return s.next=22,r.a.awrap(this.requestTagManagerAccountsContainers());case 22:case"end":return s.stop()}}),null,this,[[4,15]])}},{key:"requestTagManagerAccounts",value:function(){var e,t;return r.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.selectedAccount,a.next=4,r.a.awrap(M.c.get(M.b,"tagmanager","accounts"));case 4:t=a.sent,this.validateAccounts(t,e),this.setState({isLoading:!1,accounts:t}),a.next=12;break;case 9:a.prev=9,a.t0=a.catch(0),this.setState({isLoading:!1,errorCode:a.t0.code,errorMsg:a.t0.message});case 12:case"end":return a.stop()}}),null,this,[[0,9]])}},{key:"requestTagManagerAccountsContainers",value:function(){var e,t,a,n,i,o,s,c,l,d,u,g,m;return r.a.async((function(p){for(;;)switch(p.prev=p.next){case 0:return p.prev=0,e=this.state,t=e.selectedAccount,a=e.usageContext,n=this.state,i=n.selectedContainer,o=n.selectedContainerAMP,s={accountID:t,usageContext:a},p.next=6,r.a.awrap(M.c.get(M.b,"tagmanager","accounts-containers",s));case 6:c=p.sent,l=c.accounts,d=c.containers,this.validateAccounts(l,t),u=d.map((function(e){return e.publicId})),Object(N.c)(i)&&!u.includes(i)&&(i=""),Object(N.c)(o)&&!u.includes(o)&&(o=""),g=Object(N.a)(d).byContext(R),m=Object(N.a)(d).byContext(U),this.setState({isLoading:!1,accounts:l,containers:g,containersAMP:m,selectedAccount:t||Object(O.get)(d,[0,"accountId"]),selectedContainer:i||Object(O.get)(g,[0,"publicId"]),selectedContainerAMP:o||Object(O.get)(m,[0,"publicId"]),errorCode:!1,errorMsg:""}),p.next=21;break;case 18:p.prev=18,p.t0=p.catch(0),this.setState({isLoading:!1,errorCode:p.t0.code,errorMsg:p.t0.message});case 21:case"end":return p.stop()}}),null,this,[[0,18]])}},{key:"validateAccounts",value:function(e,t){if(!t&&0===e.length)throw{code:"accountEmpty",message:Object(D.__)("We didn’t find an associated Google Tag Manager account, would you like to set it up now? If you’ve just set up an account please re-fetch your account to sync it with Site Kit.","google-site-kit")};if(Object(N.b)(t)&&!e.find((function(e){return e.accountId===t})))throw{code:"insufficientPermissions",message:Object(D.__)("You currently don’t have access to this Google Tag Manager account. You can either request access from your team, or remove this Google Tag Manager snippet and connect to a different account.","google-site-kit")}}},{key:"requestTagManagerContainers",value:function(e){var t,a;return r.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return this.setState({containersLoading:!0}),n.prev=1,t={accountID:e,usageContext:this.state.usageContext},n.next=5,r.a.awrap(M.c.get(M.b,"tagmanager","containers",t));case 5:a=n.sent,this.setState({containersLoading:!1,containers:Object(N.a)(a).byContext(R),containersAMP:Object(N.a)(a).byContext(U),errorCode:!1}),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(1),this.setState({containersLoading:!1,errorCode:n.t0.code,errorMsg:n.t0.message});case 12:case"end":return n.stop()}}),null,this,[[1,9]])}},{key:"handleSubmit",value:function(){var e,t,a,n,i,o,s,c,l,d;return r.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return e=this.state,t=e.hasExistingTag,a=e.selectedAccount,n=e.selectedContainer,i=e.selectedContainerAMP,o=e.usageContext,s=e.useSnippet,c=this.props.finishSetup,u.prev=2,l={accountID:a,containerID:n,ampContainerID:i,usageContext:o,useSnippet:!t&&s},u.next=6,r.a.awrap(M.c.set(M.b,"tagmanager","settings",l));case 6:d=u.sent,c&&c(),Object(C.l)().tagmanager.settings=d,this.setState({isSaving:!1}),u.next=16;break;case 12:throw u.prev=12,u.t0=u.catch(2),this.setState({isLoading:!1,isSaving:!1,errorCode:u.t0.code,errorMsg:u.t0.message}),u.t0;case 16:case"end":return u.stop()}}),null,this,[[2,12]])}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.dataset.value;n!==a&&(this.setState({selectedAccount:n,selectedContainer:"",selectedContainerAMP:""}),Object(N.b)(n)&&this.requestTagManagerContainers(n))}},{key:"refetchAccount",value:function(e){e.preventDefault(),this.setState({isLoading:!0,errorCode:!1,errorMsg:"",selectedAccount:"",selectedContainer:"",selectedContainerAMP:""},this.requestTagManagerAccounts)}},{key:"renderSettingsInfo",value:function(){var e=Object(C.l)().tagmanager.settings,t=this.state,a=t.ampEnabled,i=t.isSecondaryAMP,o=t.hasExistingTag,s=t.isLoading,r=e.accountID,c=e.useSnippet;return s?n.createElement(W.a,null):n.createElement(y.b,null,n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("Account","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},n.createElement(T.a,{value:r}))),(!a||i)&&n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},i&&Object(D.__)("Web Container ID","google-site-kit"),!a&&Object(D.__)("Container ID","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},n.createElement(T.a,{value:e.containerID}))),a&&n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},i&&Object(D.__)("AMP Container ID","google-site-kit"),!i&&Object(D.__)("Container ID","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},n.createElement(T.a,{value:e.ampContainerID})))),n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("Tag Manager Code Snippet","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},c&&Object(D.__)("Snippet is inserted","google-site-kit"),!c&&Object(D.__)("Snippet is not inserted","google-site-kit")),o&&n.createElement("p",null,Object(D.__)("Placing two tags at the same time is not recommended.","google-site-kit")))))}},{key:"renderAccountDropdownForm",value:function(){var e=this,t=this.state,a=t.ampEnabled,i=t.accounts,o=t.selectedAccount,s=t.containers,r=t.containersAMP,c=t.existingContainer,l=t.hasExistingTag,d=t.isLoading,u=t.isSecondaryAMP,g=t.errorCode,m=t.useSnippet,p=this.props.onSettingsPage;if(d)return n.createElement(W.a,null);if("tag_manager_existing_tag_permission"===g)return null;if("accountEmpty"===g)return this.renderCreateAccount();if("account_create"===o)return n.createElement(y.b,null,n.createElement("p",null,Object(D.__)("To create a new account, click the button below which will open the Google Tag Manager account creation screen in a new window.","google-site-kit")),n.createElement("p",null,Object(D.__)("Once completed, click the link below to re-fetch your accounts to continue.","google-site-kit")),this.renderCreateAccount());var h=!a||u,b=a;return n.createElement(y.b,null,l&&n.createElement("p",null,Object(D.sprintf)(// translators: %s: the existing container ID.
19
+ Object(D.__)("An existing tag was found on your site (%s). If you later decide to replace this tag, Site Kit can place the new tag for you. Make sure you remove the old tag first.","google-site-kit"),c)),!l&&!u&&n.createElement("p",null,Object(D.__)("Please select your Tag Manager account and container below, the snippet will be inserted automatically on your site.","google-site-kit")),!l&&u&&n.createElement("p",null,Object(D.__)("Looks like your site is using paired AMP. Please select your Tag Manager account and relevant containers below, the snippets will be inserted automatically on your site.","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__inputs"},n.createElement(x.k,{className:"googlesitekit-tagmanager__select-account",enhanced:!0,name:"accounts",label:Object(D.__)("Account","google-site-kit"),value:o,disabled:l,onEnhancedChange:this.handleAccountChange,outlined:!0},[].concat(i).concat(l?[]:{name:Object(D.__)("Set up a new account","google-site-kit"),accountId:"account_create"}).map((function(e){return n.createElement(x.j,{key:e.accountId,value:e.accountId},e.name)}))),h&&this.renderContainerSelect({selectedStateKey:"selectedContainer",containers:s,label:b?Object(D.__)("Web Container","google-site-kit"):null,type:R}),b&&this.renderContainerSelect({selectedStateKey:"selectedContainerAMP",containers:r,label:h?Object(D.__)("AMP Container","google-site-kit"):null,type:U})),p&&n.createElement(y.b,null,l&&n.createElement("p",null,Object(D.__)("Placing two tags at the same time is not recommended.","google-site-kit")),n.createElement(I.a,{id:"tagmanagerUseSnippet",onClick:function(){return e.setState({useSnippet:!m})},name:"useSnippet",checked:m,label:Object(D.__)("Let Site Kit place code on your site","google-site-kit"),hideLabel:!1}),n.createElement("p",null,m?Object(D.__)("Site Kit will add the code automatically","google-site-kit"):Object(D.__)("Site Kit will not add the code to your site","google-site-kit"))),!p&&n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(P.a,{onClick:this.handleSubmit,disabled:!this.canSaveSettings()},Object(D.__)("Confirm & Continue","google-site-kit"))))}},{key:"renderContainerSelect",value:function(e){var t=this,a=e.label,i=e.selectedStateKey,s=e.containers,r=e.type,c=this.state,l=c.containersLoading,d=c.selectedAccount,u=c.hasExistingTag,g=!!s.length;return l?n.createElement(W.a,{small:!0}):n.createElement(x.k,{className:"\n\t\t\t\t\tgooglesitekit-tagmanager__select-container\n\t\t\t\t\tgooglesitekit-tagmanager__select-container--".concat(r,"\n\t\t\t\t"),label:a||Object(D.__)("Container","google-site-kit"),value:g?this.state[i]:"container_create",onEnhancedChange:function(e,a){return t.setState(o()({},i,a.dataset.value))},disabled:u||!Object(N.b)(d),enhanced:!0,outlined:!0},[].concat(s).concat(u?[]:{name:Object(D.__)("Set up a new container","google-site-kit"),publicId:"container_create"}).map((function(e,t){var a=e.name,i=e.publicId;return n.createElement(x.j,{key:t,value:i},a)})))}},{key:"canSaveSettings",value:function(){var e=this.state,t=e.ampEnabled,a=e.isSecondaryAMP,n=e.errorCode,i=e.isLoading,o=e.selectedAccount,s=e.selectedContainer,r=e.selectedContainerAMP;return!(i||"tag_manager_existing_tag_permission"===n||!Object(N.b)(o))&&(!!(t&&!a||Object(N.c)(s)||"container_create"===s)&&!(t&&!Object(N.c)(r)&&"container_create"!==r))}},{key:"renderCreateAccount",value:function(){return n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(P.a,{onClick:TagmanagerSetup.createNewAccount},Object(D.__)("Create an account","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(L.a,{onClick:this.refetchAccount},Object(D.__)("Re-fetch My Account","google-site-kit"))))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,i=this.props.onSettingsPage;if(0===a.length)return null;var o=!i||"insufficientPermissions"!==t;return n.createElement("div",{className:j()({"googlesitekit-error-text":o})},n.createElement("p",null,o
20
+ /* translators: %s: Error message */?Object(D.sprintf)(Object(D.__)("Error: %s","google-site-kit"),a):a))}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--tag-manager"},!t&&n.createElement(y.b,null,n.createElement("div",{className:"googlesitekit-setup-module__logo"},n.createElement(A.a,{id:"tagmanager",width:"33",height:"33"})),n.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(D._x)("Tag Manager","Service name","google-site-kit"))),this.renderErrorOrNotice(),a&&this.renderAccountDropdownForm(),!a&&this.renderSettingsInfo())}}],[{key:"createNewAccount",value:function(t){t.preventDefault(),e.open("https://tagmanager.google.com/#/admin/accounts/create","_blank")}}]),TagmanagerSetup}(y.a);q.propTypes={onSettingsPage:S.a.bool,finishSetup:S.a.func,isEditing:S.a.bool},q.defaultProps={onSettingsPage:!0,isEditing:!1},t.a=q}).call(this,a(16),a(11))},,,,function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(15),g=a.n(u),m=a(8),p=a.n(m),h=a(1),b=a(0),_=a(12),f=a(25),k=function(t){function DateRangeSelector(e){var t;return i()(this,DateRangeSelector),(t=c()(this,d()(DateRangeSelector).call(this,e))).dateRangeHook="googlesitekit.dateRange",t.dateRangeHandlerHook="googlesitekit.dateRageHandler",t.dateRangeHookAddedHook="googlesitekit.dateRageHookAddedHandler",t.state={context:"Dashboard",dateValue:Object(_.c)(t.dateRangeHook,"last-28-days")},Object(_.a)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector",(function(e){t.setState({context:e}),Object(_.f)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector")})),t.handleSelection=t.handleSelection.bind(g()(t)),t}return p()(DateRangeSelector,t),s()(DateRangeSelector,[{key:"componentDidMount",value:function(){var e=this;Object(_.a)("hookAdded",this.dateRangeHookAddedHook,(function(t){e.dateRangeHook===t&&e.forceUpdate()}))}},{key:"componentWillUnmount",value:function(){Object(_.f)("hookAdded",this.dateRangeHookAddedHook)}},{key:"handleSelection",value:function(e,t){var a=this.state.context,n=t.getAttribute("data-value");return Object(_.g)(this.dateRangeHook,this.dateRangeHandlerHook),Object(_.b)(this.dateRangeHook,this.dateRangeHandlerHook,(function(){return n})),Object(_.d)("googlesitekit.moduleDataReset"),Object(_.d)("googlesitekit.moduleLoaded",a),this.setState({dateValue:Object(_.c)(this.dateRangeHook,"last-28-days")}),!1}},{key:"render",value:function(){var t=this.state.dateValue,a={"last-7-days":Object(b.sprintf)(Object(b._n)("Last %s day","Last %s days",7,"google-site-kit"),7),"last-14-days":Object(b.sprintf)(Object(b._n)("Last %s day","Last %s days",14,"google-site-kit"),14),"last-28-days":Object(b.sprintf)(Object(b._n)("Last %s day","Last %s days",28,"google-site-kit"),28),"last-90-days":Object(b.sprintf)(Object(b._n)("Last %s day","Last %s days",90,"google-site-kit"),90)};return e.createElement(f.k,{enhanced:!0,className:"mdc-select--minimal",name:"time_period",label:"",onEnhancedChange:this.handleSelection,value:t},Object.keys(a).map((function(t){return e.createElement(f.j,{key:t,value:t},a[t])})))}}]),DateRangeSelector}(h.a);t.a=k}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=function(t){function Spinner(){return i()(this,Spinner),c()(this,d()(Spinner).apply(this,arguments))}return g()(Spinner,t),s()(Spinner,[{key:"render",value:function(){var t=this.props.isSaving;return e.createElement("span",{className:"spinner",style:{display:t?"inline-block":"none",float:"none",marginTop:"0",visibility:"visible"}})}}]),Spinner}(a(1).a);t.a=m}).call(this,a(11))},,,,,,,,,,,,,,,,,,,function(e,t,a){"use strict";(function(e){var n=a(10),i=a.n(n),o=a(4),s=a.n(o),r=a(5),c=a.n(r),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(15),p=a.n(m),h=a(8),b=a.n(h),_=a(1),f=a(14),k=a.n(f),y=a(0),v=a(133),S=a(137),O=a(68),E=a(138),j=a(46),D=a(39),w=a(31),A=a(79),C=a(38),N=a(58),x=a(80),P=a(2),T=a(55),L=a(56),I=a(53),M=a(21),W=function(t){function AdSenseDashboardWidget(e){var t;return s()(this,AdSenseDashboardWidget),(t=d()(this,g()(AdSenseDashboardWidget).call(this,e))).state={receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0,zeroData:!1,instructionProps:{}},t.handleDataError=t.handleDataError.bind(p()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(p()(t)),t.handleZeroData=t.handleZeroData.bind(p()(t)),t}return b()(AdSenseDashboardWidget,t),c()(AdSenseDashboardWidget,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(C.b)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleZeroData",value:function(){var e=Object(C.d)("account-connected-no-data");this.setState({zeroData:!0,loading:!1,instructionProps:e})}},{key:"render",value:function(){var t=this,a=Object(P.l)(),n=this.state,i=n.receivingData,o=n.error,s=n.loading,r=n.isAdSenseConnected,c=n.zeroData,l=n.instructionProps,d=a.adsense.homepage,u=s||!i||c?"googlesitekit-nodata":"";return e.createElement(_.b,null,e.createElement(L.a,null),e.createElement("div",{className:u},e.createElement(O.a,{module:"adsense"})),e.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},!o&&a.adsense.setupComplete?e.createElement(I.a,{title:Object(y._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"connected",statusText:Object(y.__)("AdSense is connected","google-site-kit")}):e.createElement(I.a,{title:Object(y._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"not-connected",statusText:Object(y.__)("AdSense is not connected","google-site-kit")}),s&&e.createElement(w.a,null)),c&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(M.a,{fill:!0},e.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e.createElement(x.a,{ctaLink:l.ctaLink,ctaLinkText:l.ctaLinkText,header:l.statusHeadline,subHeader:l.statusMessage,incomplete:l.incomplete,required:l.required})))))),!i&&(o?Object(D.a)(Object(y._x)("AdSense","Service name","google-site-kit"),o,!0,!0,!0):Object(j.a)(Object(y._x)("AdSense","Service name","google-site-kit"),!0,!0,!0)),e.createElement("div",{className:k()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",u)},e.createElement(N.a,{slug:"adsense",context:"module-dashboard"}),e.createElement(M.a,{header:!0,title:Object(y.__)("Estimated earnings","google-site-kit"),headerCtaLabel:Object(y.__)("Advanced Settings","google-site-kit"),headerCtaLink:d},e.createElement(v.a,{handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}))),e.createElement("div",{className:k()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",u)},e.createElement(M.a,{header:!0,title:Object(y.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(y.__)("Advanced Settings","google-site-kit"),headerCtaLink:d},e.createElement(S.a,{handleDataError:function(e){e||t.handleZeroData()}}))),e.createElement("div",{className:k()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",u)},e.createElement(E.a,null)),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},e.createElement(T.a,null))))),!r&&e.createElement(A.a,null))}}]),AdSenseDashboardWidget}(_.a);t.a=W}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(2),b=a(26),_=a(24),f=a(18),k=a(9),y=a(38),v=function(t){function AdSenseEstimateEarningsWidget(e){var t;return i()(this,AdSenseEstimateEarningsWidget),(t=c()(this,d()(AdSenseEstimateEarningsWidget).call(this,e))).state={refetch:!1,today:!1,yesterday:!1,sevenDays:!1,month:!1,twentyEightDays:!1,sameDayLastWeek:!1,prev7Days:!1,monthLastYear:!1,prev28Days:!1,error:!1,message:""},t}return g()(AdSenseEstimateEarningsWidget,t),s()(AdSenseEstimateEarningsWidget,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.today,a=e.yesterday,n=e.sevenDays,i=e.month,o=e.twentyEightDays,s=e.sameDayLastWeek,r=e.prev7Days,c=e.monthLastYear,l=e.prev28Days;if(!(t&&a&&n&&i&&o&&s&&r&&c&&l))return null;var d=t.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),u=!!d&&d.currency,g=t.totals?[{className:"googlesitekit-data-block--today",title:Object(p.__)("Today so far","google-site-kit"),datapoint:Object(h.v)(t.totals[0],u)},{className:"googlesitekit-data-block--yesterday",title:Object(p.__)("Yesterday","google-site-kit"),datapoint:Object(h.v)(a.totals[0],u),change:s.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--7days",title:Object(p.__)("Last 7 days","google-site-kit"),datapoint:Object(h.v)(n.totals[0],u),change:r.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--month",title:Object(p.__)("This month","google-site-kit"),datapoint:Object(h.v)(i.totals[0],u),change:c.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--28days",title:Object(p.__)("Last 28 days","google-site-kit"),datapoint:Object(h.v)(o.totals[0],u),change:l.totals[0],changeDataUnit:"%"}]:[];return AdSenseEstimateEarningsWidget.renderLayout(g)}}],[{key:"renderLayout",value:function(t){return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},t.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement(b.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection}))}))))}},{key:"renderPreviews",value:function(){for(var t=[],a=0;5>a;a++)t.push(e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement(_.a,{width:"100%",height:"104px"})));return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},t))}}]),AdSenseEstimateEarningsWidget}(m.a);t.a=Object(f.a)(v,[{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"yesterday"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.yesterday)return{yesterday:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"same-day-last-week"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sameDayLastWeek)return{sameDayLastWeek:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-7-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sevenDays)return{sevenDays:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-7-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev7Days)return{prev7Days:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.month)return{month:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month-last-year"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.monthLastYear)return{monthLastYear:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:k.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],v.renderPreviews(),{createGrid:!0},y.c)}).call(this,a(11))},,,function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=a(29),_=function(t){function InvalidCredentialsWarning(){return o()(this,InvalidCredentialsWarning),l()(this,u()(InvalidCredentialsWarning).apply(this,arguments))}return m()(InvalidCredentialsWarning,t),r()(InvalidCredentialsWarning,[{key:"render",value:function(){return e.createElement(b.a,{id:"notification-id",title:Object(h.__)("Security Token Error","google-site-kit"),description:Object(h.__)("We’re unable to retrieve your data because your security token is expired or revoked. Please ","google-site-kit"),learnMoreURL:n.googlesitekit.admin.connectURL,learnMoreLabel:Object(h.__)("reauthenticate your account","google-site-kit"),format:"small",type:"win-error"})}}]),InvalidCredentialsWarning}(p.a);t.a=_}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(13),b=a(2),_=a(9),f=a(26),k=a(24),y=a(38),v=a(18),S=function(t){function AdSensePerformanceWidget(e){var t;return i()(this,AdSensePerformanceWidget),(t=c()(this,d()(AdSensePerformanceWidget).call(this,e))).state={twentyEightDays:!1,prev28Days:!1},t}return g()(AdSensePerformanceWidget,t),s()(AdSensePerformanceWidget,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var t=this.state,a=t.twentyEightDays,n=t.prev28Days,i=a.totals?[{className:"googlesitekit-data-block--page-rpm",title:Object(p.__)("Page RPM","google-site-kit"),datapoint:Object(b.v)(a.totals[1]),change:Object(h.isUndefined)(n.totals)?0:n.totals[1],changeDataUnit:"%"},{className:"googlesitekit-data-block--impression",title:Object(p.__)("Impressions","google-site-kit"),datapoint:Object(b.v)(a.totals[2]),change:Object(h.isUndefined)(n.totals)?0:n.totals[2],changeDataUnit:"%"}]:[];return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},i.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement(f.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection}))}))))}}]),AdSensePerformanceWidget}(m.a);t.a=Object(v.a)(S,[{type:_.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(b.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:_.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(b.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],e.createElement(k.a,{width:"100%",height:"250px"}),{},y.c)}).call(this,a(11))},function(e,t,a){"use strict";var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(51),p=function(e){function DashboardAdSenseTopPages(){return i()(this,DashboardAdSenseTopPages),c()(this,d()(DashboardAdSenseTopPages).apply(this,arguments))}return g()(DashboardAdSenseTopPages,e),s()(DashboardAdSenseTopPages,[{key:"render",value:function(){return null}}]),DashboardAdSenseTopPages}(a(1).a);t.a=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTable")(p)},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(37),b=a(140),_=a(141),f=a(58),k=function(t){function DashboardEarnings(){return i()(this,DashboardEarnings),c()(this,d()(DashboardEarnings).apply(this,arguments))}return g()(DashboardEarnings,t),s()(DashboardEarnings,[{key:"render",value:function(){return e.createElement(m.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(h.a,{title:Object(p.__)("Earnings","google-site-kit"),description:Object(p.__)("How much you’re earning from your content through AdSense.","google-site-kit")}),e.createElement(f.a,{slug:"adsense",context:"module-sitekit-dashboard"})),e.createElement(_.a,null),e.createElement(b.a,null))}}]),DashboardEarnings}(m.a);t.a=k}).call(this,a(11))},function(e,t,a){"use strict";var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(51),p=function(e){function DashboardAdSenseTopEarningPagesSmall(){return i()(this,DashboardAdSenseTopEarningPagesSmall),c()(this,d()(DashboardAdSenseTopEarningPagesSmall).apply(this,arguments))}return g()(DashboardAdSenseTopEarningPagesSmall,e),s()(DashboardAdSenseTopEarningPagesSmall,[{key:"render",value:function(){return null}}]),DashboardAdSenseTopEarningPagesSmall}(a(1).a);t.a=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall")(p)},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(38),b=a(21),_=a(18),f=a(9),k=a(24),y=a(2),v=a(26),S=a(41),O=function(t){function AdSenseDashboardMainSummary(e){var t;return i()(this,AdSenseDashboardMainSummary),(t=c()(this,d()(AdSenseDashboardMainSummary).call(this,e))).state={today:!1,period:!1,daily:!1},t}return g()(AdSenseDashboardMainSummary,t),s()(AdSenseDashboardMainSummary,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var t=this.state,a=t.today,n=t.period,i=t.daily;if(!(a&&n&&i&&n.totals))return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(b.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},e.createElement(k.a,{width:"100%",height:"276px",padding:!0})));var o=Object(h.e)(i.rows),s=Object(y.o)("googlesitekit-module-adsense",{}),r=n.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),c=!!r&&r.currency;return e.createElement(m.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(b.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(v.a,{className:"overview-adsense-rpm",title:Object(p.__)("RPM","google-site-kit"),datapoint:Object(y.v)(n.totals[1],c),source:{name:Object(p._x)("AdSense","Service name","google-site-kit"),link:s},sparkline:i&&e.createElement(S.a,{data:Object(y.e)(o.dataMap,2),change:1,loadSmall:!1}),context:"compact"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(v.a,{className:"overview-adsense-earnings",title:Object(p.__)("Total Earnings","google-site-kit"),datapoint:Object(y.v)(n.totals[0],c),source:{name:Object(p._x)("AdSense","Service name","google-site-kit"),link:s},change:a.totals[0],changeDataUnit:"quot;,sparkline:i&&e.createElement(S.a,{data:Object(y.e)(o.dataMap,1),change:1,loadSmall:!1}),context:"compact"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(v.a,{className:"overview-adsense-impressions",title:Object(p.__)("Ad Impressions","google-site-kit"),datapoint:Object(y.v)(n.totals[2]),source:{name:Object(p._x)("AdSense","Service name","google-site-kit"),link:s},sparkline:i&&e.createElement(S.a,{data:Object(y.e)(o.dataMap,3),change:1,loadSmall:!1}),context:"compact"})))))))}}]),AdSenseDashboardMainSummary}(m.a);t.a=Object(_.a)(O,[{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(y.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{},priority:1,maxAge:Object(y.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.period)return{period:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month",dimensions:["DATE"]},priority:1,maxAge:Object(y.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.daily)return{daily:a}}}],e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(b.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},e.createElement(k.a,{width:"100%",height:"276px",padding:!0}))),{inGrid:!0,createGrid:!0},h.c)}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(64),o=a.n(i),s=a(20),r=a.n(s),c=a(10),l=a.n(c),d=a(4),u=a.n(d),g=a(5),m=a.n(g),p=a(6),h=a.n(p),b=a(7),_=a.n(b),f=a(8),k=a.n(f),y=a(1),v=a(3),S=a.n(v),O=a(0),E=a(23),j=a(143),D=a(80),w=a(2),A=a(38);function C(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function N(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?C(a,!0).forEach((function(t){r()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):C(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var x=function(t){function AdSenseModuleStatus(e){var t;return u()(this,AdSenseModuleStatus),(t=h()(this,_()(AdSenseModuleStatus).call(this,e))).state={accountStatus:void 0,loadingMessage:Object(O.__)("Loading…","google-site-kit"),instructionProps:{}},t}return k()(AdSenseModuleStatus,t),m()(AdSenseModuleStatus,[{key:"componentDidMount",value:function(){return l.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,l.a.awrap(this.updateAccountStatus());case 2:case"end":return e.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(e,t){var a=this.state.accountStatus;if(t.accountStatus!==a){var n=Object(A.d)(a);this.setState({instructionProps:n})}}},{key:"continueSetup",value:function(e){var t=this.state.instructionProps;e.existingState=N({},t),this.setState({instructionProps:e})}},{key:"goBack",value:function(){var e=N({},this.state.instructionProps).existingState;e&&(e.existingState=!1,this.setState({instructionProps:e}))}},{key:"updateAccountStatus",value:function(){var e,t,a,n,i,o=this;return l.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,l.a.awrap(Object(w.j)("adsense"));case 2:return e=s.sent,t=function(e){o.setState({loadingMessage:e})},s.next=6,l.a.awrap(Object(A.a)(e,t));case 6:a=s.sent,n=a.accountStatus,i=a.clientID,this.setState({accountStatus:n,clientID:i});case 10:case"end":return s.stop()}}),null,this)}},{key:"render",value:function(){var t=Object(w.l)(),a=this.state,i=a.accountStatus,s=a.clientID,r=a.loadingMessage,c=a.instructionProps,l=!i||!t.adsense.setupComplete||["ads-display-pending","account-pending-review","account-required-action"].includes(i);return e.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},e.createElement("div",{className:"googlesitekit-setup-module__step"},e.createElement("div",{className:"googlesitekit-setup-module__logo"},e.createElement(E.a,{id:"adsense",width:"33",height:"33"})),e.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(O._x)("AdSense","Service name","google-site-kit"))),e.createElement("div",{className:"googlesitekit-setup-module__step"},!n.googlesitekit.canAdsRun&&!t.adsense.setupComplete&&e.createElement("div",{className:"googlesitekit-settings-module-warning"},e.createElement(E.a,{id:"error",height:"20",width:"23"}),Object(O.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit")),l&&"account-connected"!==i&&e.createElement(D.a,{ctaLink:c.ctaLink,ctaLinkText:c.ctaLinkText,header:c.statusHeadline,subHeader:c.statusMessage,incomplete:c.incomplete,required:c.required,loadingMessage:!i&&r}),n.googlesitekit.canAdsRun&&i&&(t.adsense.setupComplete||"account-connected"===i)&&e.createElement(j.a,o()({},c,{accountStatus:i,clientID:s,continueSetup:this.continueSetup,goBack:this.goBack}))))}}]),AdSenseModuleStatus}(y.a);x.propTypes={status:S.a.string,module:S.a.string},t.a=x}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(11),b=a(0),_=a(23),f=a(2),k=a(81),y=a(9),v=a(113),S=a(19),O=a(30),E=function(t){function AdSenseSetupInstructions(e){var t;return o()(this,AdSenseSetupInstructions),(t=l()(this,u()(AdSenseSetupInstructions).call(this,e))).state={isSaving:!1},t}return m()(AdSenseSetupInstructions,t),r()(AdSenseSetupInstructions,[{key:"render",value:function(){var t=this,a=this.props,i=a.error,o=a.message,s=a.issue,r=a.notice,c=a.statusHeadline,l=a.statusMessage,d=a.profile,u=a.ctaLinkText,g=a.ctaLink,m=a.footerText,p=a.footerAppendedText,E=a.footerCTA,j=a.footerCTALink,D=a.continueAction,w=a.continueSetup,A=a.accountStatus,C=a.accountTagMatch,N=a.clientID,x=a.existingTag,P=a.switchLabel,T=a.tracking,L=a.switchOffMessage,I=a.switchOnMessage,M=a.goBack,W=a.existingState,R=this.state.isSaving,U=e.googlesitekit.admin.userData,q=U.email,z=void 0===q?"":q,G=U.picture,H=void 0===G?"":G;return n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},n.createElement("div",{className:"googlesitekit-setup-module__step"},s&&n.createElement("p",{className:"googlesitekit-setup__notice"},n.createElement(_.a,{id:"error",height:"20",width:"23"}),n.createElement("span",{className:"googlesitekit-setup__notice-text"},s)),n.createElement("h2",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},c),n.createElement("p",null,l),d&&n.createElement("p",{className:"googlesitekit-setup-module__user"},H&&n.createElement("img",{className:"googlesitekit-setup-module__user-image",src:H,alt:Object(b.__)("User Avatar","google-site-kit")}),n.createElement("span",{className:"googlesitekit-setup-module__user-email"},z)),"account-connected"===A&&n.createElement(k.a,{isEditing:!0,accountTagMatch:C,existingTag:x,saveOnChange:!0,switchLabel:P,switchOffMessage:L,switchOnMessage:I}),r&&n.createElement("div",{className:"googlesitekit-settings-notice"},n.createElement("div",{className:"googlesitekit-settings-notice__text"},r)),i&&0<o.length&&n.createElement("div",{className:"googlesitekit-error-text"},n.createElement("p",null,Object(b.__)("Error:","google-site-kit")," ",o)),n.createElement("div",{className:"googlesitekit-setup-module__action"},"account-connected"===A&&n.createElement(h.Fragment,null,n.createElement(O.a,{disabled:R,onClick:function(){T&&Object(f.A)(T.eventCategory,T.eventName),t.setState({isSaving:!0});var e=document.getElementById("enableAutoAds"),a=e&&e.checked;y.c.set(y.b,"adsense","setup-complete",{clientID:N,useSnippet:a}).then((function(){document.location=g})).catch((function(){t.setState({isSaving:!1})}))}},u),n.createElement(v.a,{isSaving:R})),"account-connected"!==A&&n.createElement(S.a,{className:"googlesitekit-setup-module__cta-link",external:!0,inherit:!0,href:g},u),D&&n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(S.a,{inherit:!0,onClick:function(){w(D)}},D.continueText)),W&&n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(S.a,{inherit:!0,onClick:function(){M()}},Object(b.__)("Back","google-site-kit")))),m&&n.createElement("p",{className:"googlesitekit-setup-module__footer-text"},m," ",E&&n.createElement(S.a,{href:j,inherit:!0,external:!0},E)," ",p)))}}]),AdSenseSetupInstructions}(p.a);t.a=E}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=a(2),_=a(19),f=function(t){function AdSenseSettingsStatus(){return o()(this,AdSenseSettingsStatus),l()(this,u()(AdSenseSettingsStatus).apply(this,arguments))}return m()(AdSenseSettingsStatus,t),r()(AdSenseSettingsStatus,[{key:"render",value:function(){var t=this.props,a=t.slug,i=t.screenID,o=t.OriginalComponent,s=Object(b.l)().adsense.settings.accountStatus;return s&&"adsense"===a&&("account-pending-review"===s||"ads-display-pending"===s)?e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},Object(h.__)("Site Kit has placed the code on your site, ","google-site-kit"),e.createElement(_.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){var e=i||"googlesitekit-dashboard";n.location=Object(b.o)(e,{reAuth:!0,slug:a})},inherit:!0},Object(h.__)("check module page","google-site-kit"))):e.createElement(o,this.props)}}]),AdSenseSettingsStatus}(p.a);t.a=f}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(14),b=a.n(h),_=a(0),f=a(2),k=a(23),y=function(t){function AdSenseSettingsWarning(){return o()(this,AdSenseSettingsWarning),l()(this,u()(AdSenseSettingsWarning).apply(this,arguments))}return m()(AdSenseSettingsWarning,t),r()(AdSenseSettingsWarning,[{key:"render",value:function(){var t=this.props,a=t.slug,i=t.context,o=t.OriginalComponent;if("adsense"!==a)return e.createElement(o,this.props);var s=Object(f.l)().adsense,r=s.active,c=s.setupComplete,l=Object(_.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit");return r&&c&&(l=Object(_.__)("Ad blocker detected, You need to disable it to get the AdSense latest data.","google-site-kit")),n.googlesitekit.canAdsRun?e.createElement(o,this.props):e.createElement("div",{className:b()("googlesitekit-settings-module-warning","googlesitekit-settings-module-warning--".concat(i))},e.createElement(k.a,{id:"error",height:"20",width:"23"})," ",l)}}]),AdSenseSettingsWarning}(p.a);t.a=y}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){var n=a(10),i=a.n(n),o=a(4),s=a.n(o),r=a(5),c=a.n(r),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(15),p=a.n(m),h=a(8),b=a.n(h),_=a(1),f=a(14),k=a.n(f),y=a(0),v=a(56),S=a(147),O=a(148),E=a(149),j=a(82),D=a(21),w=a(53),A=a(69),C=a(68),N=a(31),x=a(46),P=a(39),T=a(79),L=a(38),I=a(2),M=a(55),W=function(t){function AnalyticsDashboardWidget(e){var t;return s()(this,AnalyticsDashboardWidget),(t=d()(this,g()(AnalyticsDashboardWidget).call(this,e))).state={selectedStats:[0],receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0},t.handleStatSelection=t.handleStatSelection.bind(p()(t)),t.buildSeries=t.buildSeries.bind(p()(t)),t.handleDataError=t.handleDataError.bind(p()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(p()(t)),t}return b()(AnalyticsDashboardWidget,t),c()(AnalyticsDashboardWidget,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(L.b)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleStatSelection",value:function(e){this.setState({selectedStats:[e]})}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,loading:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return{0:{color:t[e],targetAxisIndex:0},1:{color:t[e],targetAxisIndex:0,lineDashStyle:[3,3],lineWidth:1}}}},{key:"render",value:function(){var t=this.state,a=t.selectedStats,n=t.error,i=t.receivingData,o=t.loading,s=t.isAdSenseConnected,r=this.buildSeries(),c=!o&&i?"":"googlesitekit-nodata",l=Object(I.g)();return e.createElement(_.b,null,e.createElement(v.a,null),e.createElement(C.a,{module:"analytics"}),e.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--analytics"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(w.a,{title:Object(y._x)("Analytics","Service name","google-site-kit"),icon:!0,iconWidth:"24",iconHeight:"26",iconID:"analytics",status:"connected",statusText:Object(y.__)("Analytics is connected","google-site-kit")}),o&&e.createElement(N.a,null)),!i&&(n?Object(P.a)(Object(y._x)("Analytics","Service name","google-site-kit"),n,!0,!0,!0):Object(x.a)(Object(y._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)),e.createElement("div",{className:k()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",c)},e.createElement(D.a,{header:!0
21
+ /* translators: %s: date range */,title:Object(y.sprintf)(Object(y.__)("Audience overview for the last %s","google-site-kit"),l),headerCtaLabel:Object(y.__)("See full stats in Analytics","google-site-kit"),headerCtaLink:"http://analytics.google.com"},e.createElement(E.a,{selectedStats:a,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),e.createElement(S.a,{selectedStats:a,series:r,vAxes:null,dateRangeSlug:Object(I.h)()}))),e.createElement("div",{className:k()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",c)},e.createElement(D.a,{header:!0,footer:!0
22
+ /* translators: %s: date range */,title:Object(y.sprintf)(Object(y.__)("Top content over the last %s","google-site-kit"),l),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(y.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(y._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},e.createElement(O.a,null))),e.createElement("div",{className:k()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",c)},e.createElement(D.a,{header:!0,footer:!0
23
+ /* translators: %s: date range */,title:Object(y.sprintf)(Object(y.__)("Top acquisition sources over the last %s","google-site-kit"),l),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(y.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(y._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(A.a,null)),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(j.a,null)))))),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},e.createElement(M.a,null))))),!o&&!s&&e.createElement(T.a,null))}}]),AnalyticsDashboardWidget}(_.a);t.a=W}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(15),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(0),f=a(2),k=a(47),y=a(18),v=a(9),S=a(17),O=a(24),E=function(t){function AnalyticsDashboardWidgetSiteStats(e){var t;return o()(this,AnalyticsDashboardWidgetSiteStats),(t=l()(this,u()(AnalyticsDashboardWidgetSiteStats).call(this,e))).setOptions=t.setOptions.bind(m()(t)),t}return h()(AnalyticsDashboardWidgetSiteStats,t),r()(AnalyticsDashboardWidgetSiteStats,[{key:"setOptions",value:function(){var t=this.props,a=t.series,n=t.vAxes,i={chart:{title:""===e.googlesitekit.pageTitle?"":Object(_.__)("Users Traffic Summary","google-site-kit")},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return i.series=a,i.vAxes=n,i}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,i=e.dateRangeSlug;if(!t||!t.length)return null;var o=i?i.match(/\d+/).map(Number)[0]:28,s=Object(S.c)(t,a,o);if(!s)return null;var r=this.setOptions();return n.createElement("section",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n.createElement(k.a,{selectedStats:a,data:s,options:r}))))}}]),AnalyticsDashboardWidgetSiteStats}(b.a);t.a=Object(y.a)(E,[{type:v.b,identifier:"analytics",datapoint:"report",data:S.j,priority:1,maxAge:Object(f.q)("day"),context:"Single"}],n.createElement(O.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(50),i=a.n(n),o=a(4),s=a.n(o),r=a(5),c=a.n(r),l=a(6),d=a.n(l),u=a(7),g=a.n(u),m=a(8),p=a.n(m),h=a(1),b=a(14),_=a.n(b),f=a(13),k=a(3),y=a.n(k),v=a(0),S=a(2),O=a(18),E=a(9),j=a(27),D=a(35),w=a(17),A=function(t){function AnalyticsDashboardWidgetTopPagesTable(){return s()(this,AnalyticsDashboardWidgetTopPagesTable),d()(this,g()(AnalyticsDashboardWidgetTopPagesTable).apply(this,arguments))}return p()(AnalyticsDashboardWidgetTopPagesTable,t),c()(AnalyticsDashboardWidgetTopPagesTable,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.colspan;if(!a||!a.length)return null;var o=[{title:Object(v.__)("Title","google-site-kit"),tooltip:Object(v.__)("Page Title","google-site-kit"),primary:!0},{title:Object(v.__)("Pageviews","google-site-kit"),tooltip:Object(v.__)("Pageviews","google-site-kit")},{title:Object(v.__)("Unique Pageviews","google-site-kit"),tooltip:Object(v.__)("Unique Pageviews","google-site-kit")},{title:Object(v.__)("Bounce Rate","google-site-kit"),tooltip:Object(v.__)("Bounce Rate","google-site-kit")}],s=[],r=Object(f.map)(a[0].data.rows,(function(t,a){var n=Number(t.metrics[0].values[2]),o=i()(t.dimensions,2),r=o[0],c=o[1];return s[a]=AnalyticsDashboardWidgetTopPagesTable.addDeepLink(c),[r,Object(S.t)(t.metrics[0].values[0]),Object(S.t)(t.metrics[0].values[1]),e.createElement(h.b,{key:"minichart-"+a},e.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")))]})),c={hideHeader:!1,chartsEnabled:!1,links:s},l=Object(j.b)(r,o,c);return e.createElement("div",{className:_()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-".concat(n))},e.createElement(j.a,null,l))}}],[{key:"addDeepLink",value:function(e){var t=Object(S.l)().analytics.settings,a=t.accountID,n=t.internalWebPropertyID,i=t.profileID;return a?"https://analytics.google.com/analytics/web/#/report/content-drilldown/a".concat(a,"w").concat(n,"p").concat(i,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:").concat(encodeURIComponent(e.replace(/\//g,"~2F"))):"https://analytics.google.com/analytics/web/"}}]),AnalyticsDashboardWidgetTopPagesTable}(h.a);A.propTypes={data:y.a.array,colspan:y.a.number},A.defaultProps={data:null,colspan:12},t.a=Object(O.a)(A,[{type:E.b,identifier:"analytics",datapoint:"report",data:Object(w.g)(),priority:1,maxAge:Object(S.q)("day"),context:["Single","Dashboard"]}],e.createElement(D.a,{padding:!0}),{createGrid:!0})}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(13),_=a(0),f=a(2),k=a(26),y=a(18),v=a(9),S=a(17),O=a(24),E=function(t){function AnalyticsDashboardWidgetOverview(e){var t;return i()(this,AnalyticsDashboardWidgetOverview),(t=c()(this,d()(AnalyticsDashboardWidgetOverview).call(this,e))).state={report:!1,directTotalUsers:!1},t}return g()(AnalyticsDashboardWidgetOverview,t),s()(AnalyticsDashboardWidgetOverview,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props.requestDataToState;this.setState(e)}},{key:"render",value:function(){var t=this.props,a=t.selectedStats,n=t.handleStatSelection,i=this.state,o=i.report,s=i.directTotalUsers;if(!o||!o.length||!s)return null;var r=Object(S.b)(o);if(!r)return null;var c=r.totalSessions,l=r.averageBounceRate,d=r.averageSessionDuration,u=r.totalUsersChange,g=r.totalSessionsChange,m=r.averageBounceRateChange,p=r.averageSessionDurationChange,h=[{className:"googlesitekit-data-block--users googlesitekit-data-block--button-1",title:Object(_.__)("Users","google-site-kit"),datapoint:Object(f.v)(s),change:u,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--sessions googlesitekit-data-block--button-2",title:Object(_.__)("Sessions","google-site-kit"),datapoint:Object(f.v)(c),change:g,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--bounce googlesitekit-data-block--button-3",title:Object(_.__)("Bounce Rate","google-site-kit"),datapoint:Number(l).toFixed(2),change:m,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n,datapointUnit:"%",invertChangeColor:!0},{className:"googlesitekit-data-block--duration googlesitekit-data-block--button-4",title:Object(_.__)("Session Duration","google-site-kit"),datapoint:Object(f.u)(d),change:p,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},h.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(k.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection,datapointUnit:t.datapointUnit,invertChangeColor:t.invertChangeColor}))}))))}}]),AnalyticsDashboardWidgetOverview}(m.a);E.propTypes={handleDataError:h.a.func.isRequired},t.a=Object(y.a)(E,[{type:v.b,identifier:"analytics",datapoint:"report",data:S.i,priority:1,maxAge:Object(f.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.report)return{report:a}}},{type:v.b,identifier:"analytics",datapoint:"report",data:S.l,priority:1,maxAge:Object(f.q)("day"),context:["Single"],toState:function(e,t){var a=t.data;if(!e.directTotalUsers)return{directTotalUsers:Object(b.get)(a,"[0].data.totals[0].values[0]")}}}],e.createElement(O.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},S.h,S.f)}).call(this,a(11))},function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));var n=["#178EC5","#54B23B","#EB5729","#ECED33","#34CBE3","#82E88E"]},function(e,t,a){"use strict";(function(e,n){var i=a(34),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(152),f=a(65),k=a(2),y=function(t){function AnalyticsAdminbarWidget(){return r()(this,AnalyticsAdminbarWidget),u()(this,m()(AnalyticsAdminbarWidget).apply(this,arguments))}return h()(AnalyticsAdminbarWidget,t),l()(AnalyticsAdminbarWidget,[{key:"render",value:function(){return"undefined"!==o()(e.googlesitekit.permaLink)&&""===e.googlesitekit.permaLink?null:Object(k.l)().analytics.active?n.createElement(_.a,null):n.createElement(b.b,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},n.createElement(f.a,null)))}}]),AnalyticsAdminbarWidget}(b.a);t.a=y}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(0),f=a(2),k=a(26),y=a(18),v=a(9),S=a(17),O=a(24);function E(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var j=function(t){function AnalyticsAdminbarWidgetOverview(){return r()(this,AnalyticsAdminbarWidgetOverview),u()(this,m()(AnalyticsAdminbarWidgetOverview).apply(this,arguments))}return h()(AnalyticsAdminbarWidgetOverview,t),l()(AnalyticsAdminbarWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||t.error||!t.length)return null;var a=Object(S.b)(t);if(!a)return null;var n=a.totalUsers,i=a.totalSessions,o=a.totalUsersChange,s=a.totalSessionsChange;return e.createElement(b.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(k.a,{className:"overview-total-users",title:Object(_.__)("Total Users","google-site-kit"),datapoint:Object(f.v)(n),change:o,changeDataUnit:"%"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(k.a,{className:"overview-total-sessions",title:Object(_.__)("Total Sessions","google-site-kit"),datapoint:Object(f.v)(i),change:s,changeDataUnit:"%"})))}}]),AnalyticsAdminbarWidgetOverview}(b.a);t.a=Object(y.a)(j,[{type:v.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?E(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):E(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},S.i,{url:n.googlesitekit.permaLink}),priority:1,maxAge:Object(f.q)("day"),context:"Adminbar"}],e.createElement(b.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(O.a,{width:"auto",height:"59px"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(O.a,{width:"auto",height:"59px"}))),{inGrid:!0},S.h,S.f)}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(15),g=a.n(u),m=a(8),p=a.n(m),h=a(1),b=a(14),_=a.n(b),f=a(0),k=a(21),y=a(37),v=a(46),S=a(39),O=a(78),E=a(69),j=a(154),D=a(2),w=function(t){function AnalyticsAllTraffic(e){var t;return i()(this,AnalyticsAllTraffic),(t=c()(this,d()(AnalyticsAllTraffic).call(this,e))).state={receivingData:!0,error:!1},t.handleDataError=t.handleDataError.bind(g()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(g()(t)),t}return p()(AnalyticsAllTraffic,t),s()(AnalyticsAllTraffic,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0})}},{key:"getErrorDataComponent",value:function(){var e=Object(D.l)().analytics,t=e.active,a=e.setupComplete,n=this.state,i=n.error,o=n.receivingData;return t&&!a?Object(O.a)("analytics",!0,!0,!0):o?null:i?Object(S.a)(Object(f._x)("Analytics","Service name","google-site-kit"),i,!0,!0,!0):Object(v.a)(Object(f._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)}},{key:"render",value:function(){var t=this.state,a=t.error,n=t.receivingData,i=a||!n?"googlesitekit-nodata":"";return e.createElement(h.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(y.a,{description:Object(f.__)("How people found your site.","google-site-kit"),title:Object(f.__)("All Traffic","google-site-kit")})),this.getErrorDataComponent(),e.createElement("div",{className:_()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",i)},e.createElement(k.a,{className:"googlesitekit-dashboard-all-traffic"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(E.a,{source:!0,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(j.a,null)))))))}}]),AnalyticsAllTraffic}(h.a);t.a=w}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(13),h=a(0),b=a(2),_=a(18),f=a(9),k=a(27),y=a(83),v=a(35),S=a(17),O=function(t){function AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources(){return i()(this,AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources),c()(this,d()(AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources).apply(this,arguments))}return g()(AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources,t),s()(AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(h.__)("Source","google-site-kit"),primary:!0},{title:Object(h.__)("Percent","google-site-kit")}],n=t[0].data.totals[0].values[0],i=Object(p.map)(t[0].data.rows,(function(t,a){var i=t.metrics[0].values[0]/n*100;return!(1>i)&&[t.dimensions[0],e.createElement(m.b,{key:"minichart-"+a},e.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(i.toFixed(2),"%")," ",e.createElement(y.a,{percent:i.toFixed(1),index:a})))]})),o=Object(k.b)(i,a,{hideHeader:!0,chartsEnabled:!0});return e.createElement("div",{className:"googlesitekit-alltraffic-widget"},e.createElement(k.a,null,o))}}]),AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources}(m.a);t.a=Object(_.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:S.k,priority:1,maxAge:Object(b.q)("day"),context:"Dashboard"}],e.createElement(v.a,{rows:3,rowHeight:50}))}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(13),f=a(0),k=a(2),y=a(17),v=a(26),S=a(18),O=a(9),E=a(41),j=a(32),D=a(24);function w(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function A(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?w(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):w(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var C=function(t){function AnalyticsDashboardWidgetTopLevel(e){var t;return r()(this,AnalyticsDashboardWidgetTopLevel),(t=u()(this,m()(AnalyticsDashboardWidgetTopLevel).call(this,e))).state={accounts:!1,goals:!1,directTotalUsers:!1},t}return h()(AnalyticsDashboardWidgetTopLevel,t),l()(AnalyticsDashboardWidgetTopLevel,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var t=this.state,a=t.overview,i=t.extractedAnalytics,o=t.goals,s=t.directTotalUsers,r=e.googlesitekit.permaLink,c=Object(k.o)("googlesitekit-module-analytics",{}),l="",d="",u="",g="",m="";return a&&(l=a.totalUsersChange,d=a.goalCompletions,u=a.goalCompletionsChange,g=a.averageBounceRate,m=a.averageBounceRateChange),n.createElement(b.b,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},n.createElement(v.a,{className:"overview-total-users",title:Object(f.__)("Unique Visitors from Search","google-site-kit"),datapoint:Object(k.v)(s),change:l,changeDataUnit:"%",source:{name:Object(f._x)("Analytics","Service name","google-site-kit"),link:c},sparkline:i&&n.createElement(E.a,{data:Object(k.e)(i,1),change:l})})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},r&&n.createElement(v.a,{className:"overview-bounce-rate",title:Object(f.__)("Bounce Rate","google-site-kit"),datapoint:Number(g).toFixed(2),datapointUnit:Object(f.__)("%","google-site-kit"),change:m,changeDataUnit:"%",invertChangeColor:!0,source:{name:Object(f._x)("Analytics","Service name","google-site-kit"),link:c},sparkline:i&&n.createElement(E.a,{data:Object(k.e)(i,2),change:m})}),!r&&o&&Object(_.isEmpty)(o.items)&&n.createElement(j.a,{title:Object(f.__)("Use goals to measure success.","google-site-kit"),description:Object(f.__)("Goals measure how well your site or app fulfills your target objectives.","google-site-kit"),ctaLink:"https://support.google.com/analytics/answer/1032415?hl=en#create_or_edit_goals",ctaLabel:Object(f.__)("Create a new goal","google-site-kit")}),!r&&o&&!Object(_.isEmpty)(o.items)&&n.createElement(v.a,{className:"overview-goals-completed",title:Object(f.__)("Goals Completed","google-site-kit"),datapoint:Object(k.v)(d),change:u,changeDataUnit:"%",source:{name:Object(f._x)("Analytics","Service name","google-site-kit"),link:c},sparkline:i&&n.createElement(E.a,{data:Object(k.e)(i,3),change:u})}),!r&&!o&&n.createElement(D.a,{width:"100%",height:"202px"})))}}]),AnalyticsDashboardWidgetTopLevel}(b.a);t.a=Object(S.a)(C,[{type:O.b,identifier:"analytics",datapoint:"report",data:A({},y.i,{url:e.googlesitekit.permaLink}),priority:1,maxAge:Object(k.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.overview)return{overview:Object(y.b)(a)}}},{type:O.b,identifier:"analytics",datapoint:"report",data:A({},y.l,{url:e.googlesitekit.permaLink}),priority:1,maxAge:Object(k.q)("day"),context:["Dashboard"],toState:function(e,t){var a=t.data;if(!e.directTotalUsers)return{directTotalUsers:Object(_.get)(a,"[0].data.totals[0].values[0]")}}},{type:O.b,identifier:"analytics",datapoint:"report",data:A({},y.j,{url:e.googlesitekit.permaLink}),priority:1,maxAge:Object(k.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.extractedAnalytics)return{extractedAnalytics:Object(y.d)(a)}}},{type:O.b,identifier:"analytics",datapoint:"goals",data:{url:e.googlesitekit.permaLink},priority:1,maxAge:Object(k.q)("hour"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.goals)return{goals:a}}}],n.createElement(b.b,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},n.createElement(D.a,{width:"100%",height:"202px"})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},n.createElement(D.a,{width:"100%",height:"202px"}))),{inGrid:!0},(function(e,t){return"report"===t&&Object(y.h)(e)}),y.f)}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(2),b=a(157),_=a(26),f=a(32),k=a(18),y=a(9),v=a(17),S=function(t){function WPAnalyticsDashboardWidgetOverview(){return i()(this,WPAnalyticsDashboardWidgetOverview),c()(this,d()(WPAnalyticsDashboardWidgetOverview).apply(this,arguments))}return g()(WPAnalyticsDashboardWidgetOverview,t),s()(WPAnalyticsDashboardWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=Object(v.b)(t);if(!a)return null;var n=a.totalUsers,i=a.averageSessionDuration,o=a.totalUsersChange,s=a.averageSessionDurationChange;return e.createElement(m.b,null,t.length?e.createElement(m.b,null,e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-users",title:Object(p.__)("Total Unique Visitors","google-site-kit"),datapoint:Object(h.v)(n),change:o,changeDataUnit:"%"}),e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-average-session-duration",title:Object(p.__)("Avg. Time on Page","google-site-kit"),datapoint:Object(h.u)(i),change:s,changeDataUnit:"%"})):e.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},e.createElement(f.a,{title:Object(p.__)("Analytics Gathering Data","google-site-kit"),description:Object(p.__)("Analytics data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),WPAnalyticsDashboardWidgetOverview}(m.a);t.a=Object(k.a)(S,[{type:y.b,identifier:"analytics",datapoint:"report",data:v.i,priority:1,maxAge:Object(h.q)("day"),context:["WPDashboard"]}],e.createElement(b.a,{width:"23%",height:"94px",count:2}),{},v.h,v.f)}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(3),h=a.n(p),b=a(24),_=function(t){function PreviewBlocks(){return i()(this,PreviewBlocks),c()(this,d()(PreviewBlocks).apply(this,arguments))}return g()(PreviewBlocks,t),s()(PreviewBlocks,[{key:"render",value:function(){for(var t=this.props,a=t.width,n=t.height,i=t.shape,o=t.count,s=[],r=0;r++<o;)s.push(e.createElement(b.a,{width:a,height:n,shape:i,key:r}));return s}}]),PreviewBlocks}(m.a);_.propTypes={width:h.a.string,height:h.a.string,shape:h.a.string,count:h.a.number},_.defaultProps={width:"100px",height:"100px",shape:"square",count:1},t.a=_}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(37),b=a(21),_=a(82),f=a(69),k=function(t){function AnalyticsDashboardDetailsWidgetTopAcquisitionSources(){return i()(this,AnalyticsDashboardDetailsWidgetTopAcquisitionSources),c()(this,d()(AnalyticsDashboardDetailsWidgetTopAcquisitionSources).apply(this,arguments))}return g()(AnalyticsDashboardDetailsWidgetTopAcquisitionSources,t),s()(AnalyticsDashboardDetailsWidgetTopAcquisitionSources,[{key:"render",value:function(){return e.createElement(m.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(h.a,{title:Object(p.__)("All Traffic","google-site-kit"),description:Object(p.__)("How people found your page.","google-site-kit")})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(b.a,{className:"googlesitekit-analytics-acquisition-sources",footer:!0,headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(p.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(p._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(f.a,null)),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(_.a,null)))))))}}]),AnalyticsDashboardDetailsWidgetTopAcquisitionSources}(m.a);t.a=k}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(50),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(13),f=a(0),k=a(2),y=a(18),v=a(9),S=a(27),O=a(35),E=a(17),j=function(t){function WPAnalyticsDashboardWidgetTopPagesTable(){return r()(this,WPAnalyticsDashboardWidgetTopPagesTable),u()(this,m()(WPAnalyticsDashboardWidgetTopPagesTable).apply(this,arguments))}return h()(WPAnalyticsDashboardWidgetTopPagesTable,t),l()(WPAnalyticsDashboardWidgetTopPagesTable,[{key:"render",value:function(){var t=this.props.data,a=e.googlesitekit.admin.siteURL;if(Object(E.h)(t))return null;var i=[],s=Object(_.map)(t[0].data.rows,(function(e,t){var n=o()(e.dimensions,2),s=n[0],r=n[1];return i[t]=a+r,[s,Object(k.t)(e.metrics[0].values[0])]})),r=[{title:Object(f.__)("Title","google-site-kit"),tooltip:Object(f.__)("Page Title","google-site-kit"),primary:!0},{title:Object(f.__)("Pageviews","google-site-kit"),tooltip:Object(f.__)("Pageviews","google-site-kit")}],c={chartsEnabled:!0,links:i,cap:5,showURLs:!0},l=Object(S.b)(s,r,c);return n.createElement("div",{className:"googlesitekit-search-console-widget"},n.createElement("h2",{className:"googlesitekit-search-console-widget__title"},Object(f.__)("Top content over the last 28 days","google-site-kit")),n.createElement(S.a,null,l))}}]),WPAnalyticsDashboardWidgetTopPagesTable}(b.a);t.a=Object(y.a)(j,[{type:v.b,identifier:"analytics",datapoint:"report",data:Object(E.g)(),priority:1,maxAge:Object(k.q)("day"),context:"WPDashboard"}],n.createElement(O.a,{rows:6}))}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(13),h=a(0),b=a(2),_=a(18),f=a(9),k=a(27),y=a(21),v=a(35),S=a(17),O=function(t){function AnalyticsAdSenseDashboardWidgetTopPagesTable(){return i()(this,AnalyticsAdSenseDashboardWidgetTopPagesTable),c()(this,d()(AnalyticsAdSenseDashboardWidgetTopPagesTable).apply(this,arguments))}return g()(AnalyticsAdSenseDashboardWidgetTopPagesTable,t),s()(AnalyticsAdSenseDashboardWidgetTopPagesTable,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(h.__)("Page Title","google-site-kit"),tooltip:Object(h.__)("Page Title","google-site-kit"),primary:!0},{title:Object(h.__)("Earnings","google-site-kit"),tooltip:Object(h.__)("Earnings","google-site-kit")},{title:Object(h.__)("Page RPM","google-site-kit"),tooltip:Object(h.__)("Page RPM","google-site-kit")},{title:Object(h.__)("Impressions","google-site-kit"),tooltip:Object(h.__)("Impressions","google-site-kit")}],n=Object(p.map)(t[0].data.rows,(function(e){return[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2),Number(e.metrics[0].values[1]).toFixed(2),Object(b.t)(e.metrics[0].values[2])]})),i=Object(b.l)().analytics.settings,o=i.accountID,s=i.internalWebPropertyID,r=i.profileID,c="https://analytics.google.com/analytics/web/?pli=1#/report/content-pages/a".concat(o,"w").concat(s,"p").concat(r,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:~2F"),l={hideHeader:!1,chartsEnabled:!1,links:Object(p.map)(t[0].data.rows,(function(e){var t=e.dimensions[1].replace(/\//g,"~2F");return c+t}))},d=Object(k.b)(n,a,l);return AnalyticsAdSenseDashboardWidgetTopPagesTable.renderLayout(e.createElement(k.a,null,d))}}],[{key:"renderLayout",value:function(t){var a=Object(b.l)().adsense.accountURL;return e.createElement(y.a,{header:!0,title:Object(h.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(h.__)("Advanced Settings","google-site-kit"),headerCtaLink:a},t)}}]),AnalyticsAdSenseDashboardWidgetTopPagesTable}(m.a);t.a=Object(_.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:S.a,priority:1,maxAge:Object(b.q)("day"),context:"Single"}],O.renderLayout(e.createElement(v.a,{padding:!0})),{inGrid:!0,fullWidth:!0,createGrid:!0},(function(){return!1}),(function(e){return!(!e||!e.error)&&(400===e.error.code&&"INVALID_ARGUMENT"===e.error.status&&Object(b.l)().analytics.active?null:e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(h.__)("Unidentified error","google-site-kit"))}))}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(50),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(13),f=a(0),k=a(2),y=a(17),v=a(18),S=a(9),O=a(27),E=a(35),j=a(21),D=function(t){function AnalyticsDashboardWidgetPopularPagesTable(){return r()(this,AnalyticsDashboardWidgetPopularPagesTable),u()(this,m()(AnalyticsDashboardWidgetPopularPagesTable).apply(this,arguments))}return h()(AnalyticsDashboardWidgetPopularPagesTable,t),l()(AnalyticsDashboardWidgetPopularPagesTable,[{key:"render",value:function(){var t=this.props.data,a=e.googlesitekit.admin.siteURL;if(!t||!t.length)return null;var i=[{title:Object(f.__)("Most popular content","google-site-kit"),primary:!0},{title:Object(f.__)("Views","google-site-kit")}],s=[],r=Object(_.map)(t[0].data.rows,(function(e,t){var n=o()(e.dimensions,2),i=n[0],r=n[1];return s[t]=a+r,[i,Object(k.t)(e.metrics[0].values[0])]})),c={hideHeader:!1,chartsEnabled:!1,links:s,showURLs:!0},l=Object(O.b)(r,i,c);return AnalyticsDashboardWidgetPopularPagesTable.renderLayout(n.createElement(O.a,null,l))}}],[{key:"renderLayout",value:function(e){return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},n.createElement(j.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(f._x)("Analytics","Service name","google-site-kit"),footerCtaLink:Object(k.l)().analytics.homepage,fill:!0},e))}}]),AnalyticsDashboardWidgetPopularPagesTable}(b.a);t.a=Object(v.a)(D,[{type:S.b,identifier:"analytics",datapoint:"report",data:Object(y.g)(),priority:1,maxAge:Object(k.q)("day"),context:["Single","Dashboard"]}],D.renderLayout(n.createElement(E.a,{padding:!0})),{inGrid:!0,createGrid:!0},y.h)}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(13),h=a(0),b=a(2),_=a(18),f=a(9),k=a(27),y=a(35),v=a(21),S=a(32),O=a(17),E=function(t){function AdSenseDashboardWidgetTopPagesTableSmall(){return i()(this,AdSenseDashboardWidgetTopPagesTableSmall),c()(this,d()(AdSenseDashboardWidgetTopPagesTableSmall).apply(this,arguments))}return g()(AdSenseDashboardWidgetTopPagesTableSmall,t),s()(AdSenseDashboardWidgetTopPagesTableSmall,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(h.__)("Top Earning Pages","google-site-kit"),tooltip:Object(h.__)("Top Earning Pages","google-site-kit"),primary:!0},{title:Object(h.__)("Revenue","google-site-kit"),tooltip:Object(h.__)("Revenue","google-site-kit")}],n=[],i=Object(p.map)(t[0].data.rows,(function(e,t){return n[t]=e.dimensions[1],[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2)]})),o={hideHeader:!1,chartsEnabled:!1,cap:5,links:n},s=Object(k.b)(i,a,o);return AdSenseDashboardWidgetTopPagesTableSmall.renderLayout(e.createElement(k.a,null,s))}}],[{key:"renderLayout",value:function(t){return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(v.a,{className:"googlesitekit-top-earnings-pages",footer:!0,footerCtaLabel:Object(h._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"http://analytics.google.com",fill:!0},t))}}]),AdSenseDashboardWidgetTopPagesTableSmall}(m.a);t.a=Object(_.a)(E,[{type:f.b,identifier:"analytics",datapoint:"report",data:O.a,priority:1,maxAge:Object(b.q)("day"),context:"Dashboard"}],E.renderLayout(e.createElement(y.a,{rows:5,padding:!0})),{inGrid:!0,createGrid:!0},(function(){return!1}),(function(t){if(t&&t.error_data){var a=Object.values(t.error_data);if(a[0]&&"badRequest"===a[0].reason)return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(v.a,{className:"googlesitekit-top-earnings-pages",fill:!0},e.createElement(S.a,{title:Object(h.__)("Restricted metric(s)","google-site-kit"),description:Object(h.__)("You need to link Analytics and AdSense to get report for your top earning pages. Learn more: https://support.google.com/adsense/answer/6084409 ","google-site-kit")})))}if(t&&t.errors){var n=Object.values(t.errors);if(n[0]&&n[0][0])return n[0][0]}return!1}))}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=a(21),_=a(37),f=a(164),k=function(t){function DashboardSpeed(){return o()(this,DashboardSpeed),l()(this,u()(DashboardSpeed).apply(this,arguments))}return m()(DashboardSpeed,t),r()(DashboardSpeed,[{key:"render",value:function(){var t=e.googlesitekit.permaLink?Object(h.__)("How fast this page is.","google-site-kit"):Object(h.__)("How fast your home page is.","google-site-kit");return n.createElement(p.b,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(_.a,{title:Object(h.__)("Speed","google-site-kit"),description:t})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(b.a,{className:"googlesitekit-pagespeed-report"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement(f.a,null))))))}}]),DashboardSpeed}(p.a);t.a=k}).call(this,a(16),a(11))},function(e,t,a){"use strict";var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(51),p=function(e){function DashboardSpeedInner(){return i()(this,DashboardSpeedInner),c()(this,d()(DashboardSpeedInner).apply(this,arguments))}return g()(DashboardSpeedInner,e),s()(DashboardSpeedInner,[{key:"render",value:function(){return null}}]),DashboardSpeedInner}(a(1).a);t.a=Object(m.a)("googlesitekit.DashboardSpeed")(p)},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(15),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(0),f=a(107),k=a(60),y=a(49),v=a(31),S=a(39),O=function(t){function PageSpeedInsightsDashboardWidgetHomepageSpeed(e){var t;return o()(this,PageSpeedInsightsDashboardWidgetHomepageSpeed),(t=l()(this,u()(PageSpeedInsightsDashboardWidgetHomepageSpeed).call(this,e))).state={loading:!0,error:!1},t.handleDataLoaded=t.handleDataLoaded.bind(m()(t)),t.handleDataError=t.handleDataError.bind(m()(t)),t}return h()(PageSpeedInsightsDashboardWidgetHomepageSpeed,t),r()(PageSpeedInsightsDashboardWidgetHomepageSpeed,[{key:"handleDataLoaded",value:function(){this.setState({loading:!1})}},{key:"handleDataError",value:function(e){this.setState({error:e})}},{key:"render",value:function(){var t=this.state,a=t.loading,i=t.error,o={name:Object(_._x)("PageSpeed Insights","Service name","google-site-kit"),link:Object(_.sprintf)("https://developers.google.com/speed/pagespeed/insights/?url=%s",e.googlesitekit.permaLink||e.googlesitekit.admin.siteURL)};return i?n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(S.a)(Object(_._x)("PageSpeed Insights","Service name","google-site-kit"),i,!0,!0,!1)):n.createElement(b.b,null,a&&n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement("div",{className:"googlesitekit-pagespeed-report__loading"},n.createElement(v.a,null),n.createElement("p",null,Object(_.__)("PageSpeed Insights is preparing data…","google-site-kit")))),n.createElement(f.b,{handleDataLoaded:this.handleDataLoaded,handleDataError:this.handleDataError,title:Object(_.__)("Mobile","google-site-kit")}),n.createElement(f.a,{title:Object(_.__)("Desktop","google-site-kit")}),!a&&n.createElement(b.b,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},n.createElement(y.a,{name:o.name,href:o.link,external:!0})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right-tablet "},n.createElement(k.a,null))))}}]),PageSpeedInsightsDashboardWidgetHomepageSpeed}(b.a);t.a=O}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(10),o=a.n(i),s=(a(1),a(0)),r=a(2),c=a(32),l=a(9),d=a(57);t.a=function PageSpeedInsightsCTA(){var t=Object(r.l)()["pagespeed-insights"],a=t.active,i=t.setupComplete;if(!e.googlesitekit.permissions.canManageOptions&&!i)return null;return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(c.a,{title:!i&&a?Object(s.__)("Complete PageSpeed Insights activation.","google-site-kit"):Object(s.__)("Activate PageSpeed Insights.","google-site-kit"),description:Object(s.__)("Google PageSpeed Insights gives you metrics about performance, accessibility, SEO and PWA.","google-site-kit"),ctaLink:"#",ctaLabel:!i&&a?Object(s.__)("Complete activation","google-site-kit"):Object(s.__)("Activate PageSpeed Insights","google-site-kit"),onClick:function(){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.a.awrap(Object(r.a)(l.c,"pagespeed-insights",!0));case 3:e.location=Object(r.n)("pagespeed-insights"),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),Object(r.x)(d.a,{id:"pagespeed-insights-setup-error",title:Object(s.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"});case 9:case"end":return t.stop()}}),null,null,[[0,6]])}}))}}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){a.d(t,"a",(function(){return s}));a(1);var i=a(0),o=a(2),s=function(){var t=e.googlesitekit.dashboardPermalink,a=Object(i.sprintf)(
24
+ /* translators: %s is the URL to the Site Kit dashboard. */
25
+ Object(i.__)('To view insights, <a href="%s">visit the dashboard</a>.',"google-site-kit"),t);return n.createElement("p",{dangerouslySetInnerHTML:Object(o.w)(a,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href"]})})}}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=e.googlesitekit.admin.siteURL,_=function(e){function SearchConsoleSettingStatus(){return o()(this,SearchConsoleSettingStatus),l()(this,u()(SearchConsoleSettingStatus).apply(this,arguments))}return m()(SearchConsoleSettingStatus,e),r()(SearchConsoleSettingStatus,[{key:"render",value:function(){return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement("div",{className:"googlesitekit-settings-module__meta-item-type"},Object(h.__)("Connected URL","google-site-kit")),n.createElement("div",{className:"googlesitekit-settings-module__meta-item-data"},b))}}]),SearchConsoleSettingStatus}(p.a);t.a=_}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(15),h=a.n(p),b=a(8),_=a.n(b),f=a(1),k=a(14),y=a.n(k),v=a(0),S=a(56),O=a(170),E=a(84),j=a(171),D=a(53),w=a(21),A=a(68),C=a(31),N=a(46),x=a(39),P=a(2),T=a(55);function L(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var I=function(t){function GoogleSitekitSearchConsoleDashboardWidget(e){var t;return r()(this,GoogleSitekitSearchConsoleDashboardWidget),(t=u()(this,m()(GoogleSitekitSearchConsoleDashboardWidget).call(this,e))).state={selectedStats:[0,1],receivingData:!0,error:!1,loading:!0},t.handleStatSelection=t.handleStatSelection.bind(h()(t)),t.buildSeries=t.buildSeries.bind(h()(t)),t.buildVAxes=t.buildVAxes.bind(h()(t)),t.handleDataError=t.handleDataError.bind(h()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(h()(t)),t}return _()(GoogleSitekitSearchConsoleDashboardWidget,t),l()(GoogleSitekitSearchConsoleDashboardWidget,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleStatSelection",value:function(e){var t=this.state.selectedStats,a=t.slice();t.includes(e)?a=t.filter((function(t){return e!==t})):a.push(e),0!==a.length&&this.setState({selectedStats:a})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return e.map((function(e,a){return{color:t[e],targetAxisIndex:a}}))}},{key:"buildVAxes",value:function(){var e=this.state.selectedStats,t={0:Object(v.__)("Clicks","google-site-kit"),1:Object(v.__)("Impressions","google-site-kit"),2:Object(v.__)("Average CTR","google-site-kit"),3:Object(v.__)("Average Position","google-site-kit")};return e.map((function(e){var a={};return 3===e&&(a.direction=-1),function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?L(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):L(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({title:t[e]},a)}))}},{key:"render",value:function(){var t=this.state,a=t.selectedStats,i=t.receivingData,o=t.error,s=t.loading,r=this.buildSeries(),c=this.buildVAxes(),l=!s&&i?"":"googlesitekit-nodata",d=Object(P.g)(),u=Object(v.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",e.googlesitekit.admin.siteURL);return n.createElement(f.b,null,n.createElement(S.a,null),n.createElement(A.a,{module:"search-console"}),n.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--search-console"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(D.a,{title:Object(v._x)("Search Console","Service name","google-site-kit"),icon:!0,iconWidth:"23",iconHeight:"21",iconID:"search-console",status:"connected",statusText:Object(v.__)("Search Console is connected","google-site-kit")}),s&&n.createElement(C.a,null)),!i&&(o?Object(x.a)(Object(v._x)("Search Console","Service name","google-site-kit"),o,!0,!0,!0):Object(N.a)(Object(v._x)("Search Console","Service name","google-site-kit"),!0,!0,!0)),n.createElement("div",{className:y()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",l)},n.createElement(w.a,{header:!0
26
+ /* translators: %s: date range */,title:Object(v.sprintf)(Object(v.__)("Overview for the last %s","google-site-kit"),d),headerCtaLabel:Object(v.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:u},n.createElement(j.a,{selectedStats:a,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),n.createElement(O.a,{selectedStats:a,series:r,vAxes:c}))),n.createElement("div",{className:y()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",l)},n.createElement(w.a
27
+ /* translators: %s: date range */,{title:Object(v.sprintf)(Object(v.__)("Top search queries over the last %s","google-site-kit"),d),header:!0,footer:!0,headerCtaLabel:Object(v.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:u,footerCtaLabel:Object(v._x)("Search Console","Service name","google-site-kit"),footerCtaLink:u},n.createElement(E.a,null))),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},n.createElement(T.a,null))))))}}]),GoogleSitekitSearchConsoleDashboardWidget}(f.a);t.a=I}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(15),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(0),f=a(2),k=a(18),y=a(9),v=a(47),S=a(24),O=a(36),E=function(t){function SearchConsoleDashboardWidgetSiteStats(e){var t;return o()(this,SearchConsoleDashboardWidgetSiteStats),(t=l()(this,u()(SearchConsoleDashboardWidgetSiteStats).call(this,e))).setOptions=t.setOptions.bind(m()(t)),t}return h()(SearchConsoleDashboardWidgetSiteStats,t),r()(SearchConsoleDashboardWidgetSiteStats,[{key:"setOptions",value:function(){var t=this.props,a=t.selectedStats,n=t.series,i=t.vAxes,o=e.googlesitekit.pageTitle,s=Object(_.__)("Search Traffic Summary","google-site-kit");o&&o.length&&(
28
+ /* translators: %s: page title */
29
+ s=Object(_.sprintf)(Object(_.__)("Search Traffic Summary for %s","google-site-kit"),Object(f.d)(o)));var r={chart:{title:s},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return r.series=n,r.vAxes=i,3<=a.length&&(r.vAxis.textPosition="none",r.vAxis.gridlines.color="#fff",r.vAxis.minorGridlines.color="#fff",r.chartArea.width="98%"),r}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats;if(!t||!t.length)return null;var i=this.setOptions(),o=Object(O.a)(t);return n.createElement("section",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n.createElement(v.a,{selectedStats:a,data:o.dataMap,options:i,singleStat:!1}))))}}]),SearchConsoleDashboardWidgetSiteStats}(b.a);t.a=Object(k.a)(E,[{type:y.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.q)("day"),context:"Single"}],n.createElement(S.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(2),b=a(26),_=a(18),f=a(9),k=a(24),y=a(36),v=a(3),S=a.n(v),O=function(t){function SearchConsoleDashboardWidgetOverview(){return i()(this,SearchConsoleDashboardWidgetOverview),c()(this,d()(SearchConsoleDashboardWidgetOverview).apply(this,arguments))}return g()(SearchConsoleDashboardWidgetOverview,t),s()(SearchConsoleDashboardWidgetOverview,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.selectedStats,i=t.handleStatSelection;if(!a||!a.length)return null;var o=Object(y.a)(a),s=o.totalClicks,r=o.totalImpressions,c=o.averageCTR,l=o.averagePosition,d=o.totalClicksChange,u=o.totalImpressionsChange,g=o.averageCTRChange,h=o.averagePositionChange,_=[{className:"googlesitekit-data-block--clicks googlesitekit-data-block--button-1",title:Object(p.__)("Total Clicks","google-site-kit"),datapoint:s,change:d,changeDataUnit:"%",context:"button",selected:n.includes(0),handleStatSelection:i},{className:"googlesitekit-data-block--impressions googlesitekit-data-block--button-2",title:Object(p.__)("Total Impressions","google-site-kit"),datapoint:r,change:u,changeDataUnit:"%",context:"button",selected:n.includes(1),handleStatSelection:i},{className:"googlesitekit-data-block--ctr googlesitekit-data-block--button-3",title:Object(p.__)("Average CTR","google-site-kit"),datapoint:c+"%",change:g,changeDataUnit:"%",context:"button",selected:n.includes(2),handleStatSelection:i},{className:"googlesitekit-data-block--position googlesitekit-data-block--button-4",title:Object(p.__)("Average Position","google-site-kit"),datapoint:l,change:h,changeDataUnit:"%",context:"button",selected:n.includes(3),handleStatSelection:i}];return e.createElement(m.b,null,e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},_.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(b.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection}))})))))}}]),SearchConsoleDashboardWidgetOverview}(m.a);O.propTypes={handleDataError:S.a.func.isRequired},t.a=Object(_.a)(O,[{type:f.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"]}],e.createElement(k.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},y.b)}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(34),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=a(173),f=function(t){function GoogleSitekitSearchConsoleAdminbarWidget(){return r()(this,GoogleSitekitSearchConsoleAdminbarWidget),u()(this,m()(GoogleSitekitSearchConsoleAdminbarWidget).apply(this,arguments))}return h()(GoogleSitekitSearchConsoleAdminbarWidget,t),l()(GoogleSitekitSearchConsoleAdminbarWidget,[{key:"render",value:function(){return"undefined"!==o()(e.googlesitekit.permaLink)&&""===e.googlesitekit.permaLink?null:n.createElement(_.a,null)}}]),GoogleSitekitSearchConsoleAdminbarWidget}(b.a);t.a=f}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=a(2),_=a(26),f=a(18),k=a(9),y=a(36),v=a(24),S=function(t){function SearchConsoleAdminbarWidgetOverview(){return o()(this,SearchConsoleAdminbarWidgetOverview),l()(this,u()(SearchConsoleAdminbarWidgetOverview).apply(this,arguments))}return m()(SearchConsoleAdminbarWidgetOverview,t),r()(SearchConsoleAdminbarWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||t.error)return null;var a=Object(y.a)(t),n=a.totalClicks,i=a.totalImpressions,o=a.totalClicksChange,s=a.totalImpressionsChange;return e.createElement(p.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(_.a,{className:"overview-total-impressions",title:Object(h.__)("Total Impressions","google-site-kit"),datapoint:i,change:s,changeDataUnit:"%"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(_.a,{className:"overview-total-clicks",title:Object(h.__)("Total Clicks","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})))}}]),SearchConsoleAdminbarWidgetOverview}(p.a);t.a=Object(f.a)(S,[{type:k.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:n.googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(b.q)("day"),context:"Adminbar"}],e.createElement(p.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"auto",height:"59px"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"auto",height:"59px"}))),{inGrid:!0},y.b)}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(175),h=function(t){function WPSearchConsoleDashboardWidget(){return i()(this,WPSearchConsoleDashboardWidget),c()(this,d()(WPSearchConsoleDashboardWidget).apply(this,arguments))}return g()(WPSearchConsoleDashboardWidget,t),s()(WPSearchConsoleDashboardWidget,[{key:"render",value:function(){return e.createElement(m.b,null,e.createElement(p.a,null))}}]),WPSearchConsoleDashboardWidget}(m.a);t.a=h}).call(this,a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(2),b=a(24),_=a(26),f=a(18),k=a(9),y=a(36),v=a(32),S=function(t){function WPSearchConsoleDashboardWidgetOverview(){return i()(this,WPSearchConsoleDashboardWidgetOverview),c()(this,d()(WPSearchConsoleDashboardWidgetOverview).apply(this,arguments))}return g()(WPSearchConsoleDashboardWidgetOverview,t),s()(WPSearchConsoleDashboardWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=Object(y.a)(t),n=a.totalClicks,i=a.totalImpressions,o=a.totalClicksChange,s=a.totalImpressionsChange;return e.createElement(m.b,null,t.length?e.createElement(m.b,null,e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-impressions",title:Object(p.__)("Total Impressions","google-site-kit"),datapoint:i,change:s,changeDataUnit:"%"}),e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-clicks",title:Object(p.__)("Total Clicks","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})):e.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},e.createElement(v.a,{title:Object(p.__)("Search Console Data Empty","google-site-kit"),description:Object(p.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),WPSearchConsoleDashboardWidgetOverview}(m.a);t.a=Object(f.a)(S,[{type:k.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(h.q)("day"),context:["WPDashboard"]}],e.createElement(b.a,{width:"23%",height:"94px",count:2}),{},y.b)}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(14),b=a.n(h),_=a(0),f=a(2),k=a(21),y=a(37),v=a(65),S=a(85),O=function(t){function DashboardSearchFunnel(){return o()(this,DashboardSearchFunnel),l()(this,u()(DashboardSearchFunnel).apply(this,arguments))}return m()(DashboardSearchFunnel,t),r()(DashboardSearchFunnel,[{key:"render",value:function(){var t=Object(f.l)(),a=e.googlesitekit.permissions.canManageOptions,i=t.analytics.active||a?12:6;return n.createElement(p.b,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(y.a,{title:Object(_.__)("Search Funnel","google-site-kit"),description:Object(_.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit")})),n.createElement("div",{className:b()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-".concat(i))},n.createElement(k.a,{className:"googlesitekit-analytics-search-funnel"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement(S.a,null),!t.analytics.active&&n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},n.createElement(v.a,null)))))))}}]),DashboardSearchFunnel}(p.a);t.a=O}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=a(26),_=a(18),f=a(9),k=a(36),y=a(41),v=a(24),S=a(2),O=a(32),E=function(t){function SearchConsoleDashboardWidgetTopLevel(){return o()(this,SearchConsoleDashboardWidgetTopLevel),l()(this,u()(SearchConsoleDashboardWidgetTopLevel).apply(this,arguments))}return m()(SearchConsoleDashboardWidgetTopLevel,t),r()(SearchConsoleDashboardWidgetTopLevel,[{key:"render",value:function(){var t=this.props.data,a=t.error;if(a)return Object(S.A)("plugin_setup","search_console_error",a.message),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(O.a,{title:Object(h.__)("Something went wrong","google-site-kit"),description:a.message,error:!0}));if(!t)return null;if(!t.length)return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(O.a,{title:Object(h.__)("Search Console Data Empty","google-site-kit"),description:Object(h.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""}));var n=Object(S.o)("googlesitekit-module-search-console",{}),i=Object(k.a)(t),o=i.totalClicks,s=i.totalImpressions,r=i.totalClicksChange,c=i.totalImpressionsChange,l=i.dataMap;return e.createElement(p.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(b.a,{className:"overview-total-impressions",title:Object(h.__)("Impressions","google-site-kit"),datapoint:s,change:c,changeDataUnit:"%",source:{name:Object(h._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:e.createElement(y.a,{data:Object(S.e)(l,2),change:c})})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(b.a,{className:"overview-total-clicks",title:Object(h.__)("Clicks","google-site-kit"),datapoint:o,change:r,changeDataUnit:"%",source:{name:Object(h._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:e.createElement(y.a,{data:Object(S.e)(l,1),change:r})})))}}]),SearchConsoleDashboardWidgetTopLevel}(p.a);t.a=Object(_.a)(E,[{type:f.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:n.googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(S.q)("day"),context:["Single","Dashboard"]}],e.createElement(p.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"100%",height:"202px"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"100%",height:"202px"}))),{inGrid:!0},k.b)}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(21),b=a(85),_=a(2),f=a(65),k=a(37),y=function(t){function DashboardDetailsSearchFunnel(){return i()(this,DashboardDetailsSearchFunnel),c()(this,d()(DashboardDetailsSearchFunnel).apply(this,arguments))}return g()(DashboardDetailsSearchFunnel,t),s()(DashboardDetailsSearchFunnel,[{key:"render",value:function(){return e.createElement(m.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(k.a,{description:Object(p.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),title:Object(p.__)("Search Funnel","google-site-kit")})),e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e.createElement(h.a,{className:"googlesitekit-analytics-search-funnel"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement(b.a,null),!Object(_.l)().analytics.active&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(f.a,null)))))))}}]),DashboardDetailsSearchFunnel}(m.a);t.a=y}).call(this,a(11))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(0),b=a(84),_=a(37),f=a(21),k=function(t){function DashboardDetailsWidgetKeywordsTable(){return o()(this,DashboardDetailsWidgetKeywordsTable),l()(this,u()(DashboardDetailsWidgetKeywordsTable).apply(this,arguments))}return m()(DashboardDetailsWidgetKeywordsTable,t),r()(DashboardDetailsWidgetKeywordsTable,[{key:"render",value:function(){return e.createElement(p.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(_.a,{title:Object(h.__)("Top Queries","google-site-kit"),description:Object(h.__)("What people searched for to find your page.","google-site-kit")})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(f.a,{footer:!0,footerCtaLabel:Object(h._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(h.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",n.googlesitekit.admin.siteURL)},e.createElement(b.a,null))))}}]),DashboardDetailsWidgetKeywordsTable}(p.a);t.a=k}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(1),h=a(13),b=a(0),_=a(2),f=a(18),k=a(9),y=a(27),v=a(35),S=a(21),O=a(36),E=function(t){function DashboardWidgetPopularKeywordsTable(){return o()(this,DashboardWidgetPopularKeywordsTable),l()(this,u()(DashboardWidgetPopularKeywordsTable).apply(this,arguments))}return m()(DashboardWidgetPopularKeywordsTable,t),r()(DashboardWidgetPopularKeywordsTable,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(b.__)("Top search queries for your site","google-site-kit"),tooltip:Object(b.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(b.__)("Clicks","google-site-kit"),tooltip:Object(b.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(b.__)("Impressions","google-site-kit"),tooltip:Object(b.__)("Counted each time your content appears in search results","google-site-kit")}],i=e.googlesitekit.admin.siteURL,o=[],s=Object(h.map)(t,(function(e,t){var a=e.keys[0];return o[t]=Object(b.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",i,a),[a,Object(_.t)(e.clicks),Object(_.t)(e.impressions)]})),r={hideHeader:!1,chartsEnabled:!1,links:o},c=Object(y.b)(s,a,r);return DashboardWidgetPopularKeywordsTable.renderLayout(n.createElement(y.a,null,c))}}],[{key:"renderLayout",value:function(t){return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},n.createElement(S.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(b._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(b.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",e.googlesitekit.admin.siteURL),fill:!0},t))}}]),DashboardWidgetPopularKeywordsTable}(p.a);t.a=Object(f.a)(E,[{type:k.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"query",limit:10},priority:1,maxAge:Object(_.q)("day"),context:["Dashboard"]}],E.renderLayout(n.createElement(v.a,{padding:!0})),{inGrid:!0,createGrid:!0},O.b)}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(0),h=a(182),b=a(37),_=function(t){function DashboardPopularity(){return i()(this,DashboardPopularity),c()(this,d()(DashboardPopularity).apply(this,arguments))}return g()(DashboardPopularity,t),s()(DashboardPopularity,[{key:"render",value:function(){return e.createElement(m.b,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(b.a,{title:Object(p.__)("Popularity","google-site-kit"),description:Object(p.__)("Your most popular pages and how people found them from Search.","google-site-kit")})),e.createElement(h.a,null))}}]),DashboardPopularity}(m.a);t.a=_}).call(this,a(11))},function(e,t,a){"use strict";var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(51),p=function(e){function DashboardPopularityInner(){return i()(this,DashboardPopularityInner),c()(this,d()(DashboardPopularityInner).apply(this,arguments))}return g()(DashboardPopularityInner,e),s()(DashboardPopularityInner,[{key:"render",value:function(){return null}}]),DashboardPopularityInner}(a(1).a);t.a=Object(m.a)("googlesitekit.DashboardPopularity")(p)},function(e,t,a){"use strict";(function(e,n){var i=a(10),o=a.n(i),s=a(4),r=a.n(s),c=a(5),l=a.n(c),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(15),h=a.n(p),b=a(8),_=a.n(b),f=a(1),k=a(13),y=a(191),v=a.n(y),S=a(0),O=a(2),E=a(9),j=a(30),D=a(21),w=function(t){function PostSearcher(e){var t;return r()(this,PostSearcher),(t=u()(this,m()(PostSearcher).call(this,e))).state={isSearching:!1,results:[],error:!1,message:""},t.postSearch=t.postSearch.bind(h()(t)),t.onClick=t.onClick.bind(h()(t)),t.onConfirm=t.onConfirm.bind(h()(t)),t}return _()(PostSearcher,t),l()(PostSearcher,[{key:"postSearch",value:function(e,t){var a;return o.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t([Object(S.__)("Loading...","google-site-kit")]),n.prev=1,n.next=4,o.a.awrap(E.c.get(E.a,"search","post-search",{query:encodeURIComponent(e)}));case 4:0<(a=n.sent).length?t(Object(k.map)(a,(function(e){return e.post_title}))):t([Object(S.__)("No results found","google-site-kit")]),this.setState({isSearching:!0,results:a,error:!1,message:""}),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(1),t([Object(S.__)("No results found","google-site-kit")]),this.setState({isSearching:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[1,9]])}},{key:"getURLPathname",value:function(e){try{var t=new URL(e);return Object(k.trim)(t.pathname,"/")}catch(e){return!1}}},{key:"onConfirm",value:function(e){this.setState({selection:e})}},{key:"onClick",value:function(){var e=this.state,t=e.results,a=e.selection,n=Object(k.find)(t,(function(e){return e.post_title===a}));document.location=Object(O.o)("googlesitekit-dashboard",{id:n.id,permaLink:n.permalink,pageTitle:a})}},{key:"render",value:function(){var t=e.googlesitekit.modules,a=t.analytics&&t.analytics.active?"mdc-layout-grid__cell mdc-layout-grid__cell--span-12":"mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop";return n.createElement("div",{className:a},n.createElement(D.a,{title:Object(S.__)("Search for individual page or post information","google-site-kit"),header:!0},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n.createElement("div",{className:"googlesitekit-post-searcher"},n.createElement("label",{className:"googlesitekit-post-searcher__label",htmlFor:"autocomplete"},Object(S.__)("Title or URL","google-site-kit")),n.createElement(v.a,{id:"autocomplete",source:Object(k.debounce)(this.postSearch,200),minLength:2,onConfirm:this.onConfirm,showNoOptionsFound:!1}),n.createElement("div",{className:"googlesitekit-post-searcher__button-wrapper"},n.createElement(j.a,{onClick:this.onClick,className:"googlesitekit-post-searcher__button"},Object(S.__)("View Data","google-site-kit")))))))))}}]),PostSearcher}(f.a);t.a=w}).call(this,a(16),a(11))},,,,,,,,,,function(e,t,a){"use strict";(function(e,t){a(1);var n=a(12),i=a(22),o=a(2),s=a(132),r=a(139),c=a(81),l=a(142),d=a(144),u=a(145),g="adsense";Object(n.b)("googlesitekit.ModuleSettingsWarning","googlesitekit.adsenseSettingsWarning",Object(o.f)(u.a,{})),Object(n.b)("googlesitekit.SetupModuleShowLink","googlesitekit.adsenseSetupModuleShowLink",(function(t,a){return!("adsense"===a&&!e.googlesitekit.canAdsRun)&&t}));var m=Object(o.l)();if(m.adsense.active){var p=Object(i.a)(t.createElement(s.a,null)),h=Object(i.a)(t.createElement(r.a,null));if(m[g].setupComplete)Object(n.b)("googlesitekit.ModuleApp-".concat(g),"googlesitekit.ModuleApp",p),Object(n.b)("googlesitekit.DashboardModule","googlesitekit.DashboardEarningModule",h,50);else{var b=e.googlesitekit.admin,_=b.reAuth,f=b.currentScreen,k=f?f.id:null;_||"site-kit_page_googlesitekit-module-adsense"!==k||(e.location=Object(o.o)("googlesitekit-module-".concat(g),{reAuth:!0,slug:g})),Object(n.b)("googlesitekit.Connected-".concat(g),"googlesitekit.AdSenseModuleConnected",(function(e){var t=m[g].settings;return!(e||void 0===t||"account-pending-review"!==t.accountStatus&&"ads-display-pending"!==t.accountStatus)||e}))}Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat(g),"googlesitekit.AdSenseModuleSettingsDetails",Object(o.f)(c.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.ModuleSetup-".concat(g),"googlesitekit.TagmanagerModuleSetupWizard",Object(o.f)(l.a,{onSettingsPage:!1})),Object(n.b)("googlesitekit.autoRefreshModules","googlesitekit.AdSenseAutoRefresh",(function(e){return e.push({identifier:"adsense",toRefresh:function(){var e="";return m.adsense&&m.adsense["account-status"]&&(e=m.adsense["account-status"].accountStatus),!(e&&-1<e.indexOf("account-connected"))}}),e})),Object(n.b)("googlesitekit.ModulesNotificationsRequest","googlesitekit.adsenseNotifications",(function(e){return e.push({identifier:"adsense"}),e})),Object(n.b)("googlesitekit.ModuleSetupIncomplete","googlesitekit.adsenseSettingStatus",Object(o.f)(d.a,{}))}}).call(this,a(16),a(11))},function(e,t,a){"use strict";(function(e,t){a(1);var n=a(2),i=a(22),o=a(146),s=a(151),r=a(153),c=a(155),l=a(156),d=a(158),u=a(159),g=a(160),m=a(161),p=a(162),h=a(104),b=a(12),_="analytics",f=Object(i.a)(e.createElement(s.a,null));Object(b.b)("googlesitekit.AdminbarModules","googlesitekit.Analytics",f,11);var k=Object(n.l)();if(!k[_].setupComplete){var y=t.googlesitekit.admin,v=y.reAuth,S=y.currentScreen,O=S?S.id:null;v||"site-kit_page_googlesitekit-module-analytics"!==O||(t.location=Object(n.o)("googlesitekit-module-".concat(_),{reAuth:!0,slug:_}))}if(k.analytics.active){var E=Object(i.a)(e.createElement(o.a,null)),j=Object(i.a)(e.createElement(r.a,null)),D=Object(i.a)(e.createElement(l.a,null)),w=Object(i.a)(e.createElement(u.a,null)),A=Object(i.a)(e.createElement(c.a,null)),C=Object(i.a)(e.createElement(d.a,null)),N=Object(i.a)(e.createElement(g.a,null)),x=Object(i.a)(e.createElement(m.a,null)),P=Object(i.a)(e.createElement(p.a,null));Object(b.b)("googlesitekit.DashboardModule","googlesitekit.Analytics",j,9),Object(b.b)("googlesitekit.DashboardSearchFunnel","googlesitekit.Analytics",A,11),Object(b.b)("googlesitekit.DashboardPopularity","googlesitekit.Analytics",x,20),Object(b.b)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall","googlesitekit.Analytics",P,20),Object(b.b)("googlesitekit.DashboardDetailsModule","googlesitekit.Analytics",C,20),Object(b.b)("googlesitekit.WPDashboardHeader","googlesitekit.Analytics",D),Object(b.b)("googlesitekit.WPDashboardModule","googlesitekit.Analytics",w),Object(b.b)("googlesitekit.ModuleApp-"+_,"googlesitekit.Analytics",E),Object(b.b)("googlesitekit.AnalyticsAdSenseTopPagesTable","googlesitekit.Analytics",N,11),Object(b.b)("googlesitekit.ModuleSettingsDetails-".concat(_),"googlesitekit.AnalyticsModuleSettingsDetails",Object(n.f)(h.a,{onSettingsPage:!0})),Object(b.b)("googlesitekit.showDateRangeSelector-".concat(_),"googlesitekit.analyticsShowDateRangeSelector",(function(){return!0})),Object(b.b)("googlesitekit.ModuleSetup-".concat(_),"googlesitekit.AnalyticsModuleSetupWizard",Object(n.f)(h.a,{onSettingsPage:!1}))}}).call(this,a(11),a(16))},function(e,t,a){"use strict";(function(e){a(1);var t=a(12),n=a(22),i=a(163),o=a(165),s=a(166),r=a(167),c=a(2),l="pagespeed-insights",d=Object(c.l)()[l],u=d.active,g=d.setupComplete;if(u&&g){var m=Object(n.a)(e.createElement(i.a,null)),p=Object(n.a)(e.createElement(o.a,null));Object(t.b)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",m,45),Object(t.b)("googlesitekit.DashboardDetailsModule","googlesitekit.PageSpeedInsights",m,45),Object(t.b)("googlesitekit.DashboardSpeed","googlesitekit.PageSpeedInsightsHomepageSpeed",p)}else{var h=Object(n.a)(e.createElement(s.a,null));Object(t.b)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",h,45)}Object(t.b)("googlesitekit.ModuleSettingsDetails-".concat(l),"googlesitekit.PageSpeedInsightsModuleSettingsDetails",Object(n.a)(e.createElement(r.a,null)),10)}).call(this,a(11))},function(e,t,a){"use strict";(function(e){a(1);var t=a(168),n=a(12),i=a(22),o=a(2),s=a(183),r=a(169),c=a(172),l=a(174),d=a(176),u=a(177),g=a(179),m=a(180),p=a(178),h=a(181),b="search-console",_=Object(i.a)(e.createElement(r.a,null)),f=Object(i.a)(e.createElement(c.a,null)),k=Object(i.a)(e.createElement(l.a,null)),y=Object(i.a)(e.createElement(d.a,null)),v=Object(i.a)(e.createElement(u.a,null)),S=Object(i.a)(e.createElement(p.a,null)),O=Object(i.a)(e.createElement(g.a,null)),E=Object(i.a)(e.createElement(m.a,null)),j=Object(i.a)(e.createElement(h.a,null)),D=Object(i.a)(e.createElement(s.a,null));Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat(b),"googlesitekit.SearchConsoleModuleSettingsDetails",Object(o.f)(t.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.DashboardModule","googlesitekit.SearchConsole",y,11),Object(n.b)("googlesitekit.DashboardModule","googlesitekit.DashboardPopularityModule",j,40),Object(n.b)("googlesitekit.DashboardSearchFunnel","googlesitekit.SearchConsoleSearchFunnel",v),Object(n.b)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",S),Object(n.b)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",O,40),Object(n.b)("googlesitekit.DashboardPopularity","googlesitekit.SearchConsoleDashboardPopularity",E),Object(n.b)("googlesitekit.DashboardPopularity","googlesitekit.DashboardPPostSearcherModule",D,30),Object(n.b)("googlesitekit.WPDashboardHeader","googlesitekit.SearchConsole",k,11),Object(n.b)("googlesitekit.ModuleApp-"+b,"googlesitekit.ModuleApp",_),Object(n.b)("googlesitekit.showDateRangeSelector-".concat(b),"googlesitekit.searchConsoleShowDateRangeSelector",(function(){return!0})),Object(n.b)("googlesitekit.AdminbarModules","googlesitekit.SearchConsole",f)}).call(this,a(11))},function(e,t,a){"use strict";a(193),a(194);var n=a(12),i=a(0),o=a(106),s=a(2),r="optimize";Object(s.l)().optimize.active&&(Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat(r),"googlesitekit.OptimizeModuleSettingsDetails",Object(s.f)(o.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.ModuleSetup-".concat(r),"googlesitekit.OptimizeModuleSetupWizard",Object(s.f)(o.a,{onSettingsPage:!1})),Object(n.b)("googlesitekit.SetupWinNotification-".concat(r),"googlesitekit.OptimizeSetupWinNotification",(function(e){return e.description=Object(i.__)("To set up experiments and see the results, go to ","google-site-kit"),e.learnMore.label="Optimize",e.learnMore.url="https://optimize.withgoogle.com/",e})));a(195),a(196);var c=a(108);Object(s.l)().tagmanager.active&&(Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSettingsDetails",Object(s.f)(c.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.ModuleSetup-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSetupWizard",Object(s.f)(c.a,{onSettingsPage:!1})))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){"use strict";a.r(t),function(e,n){a.d(t,"GoogleSitekitAdminbar",(function(){return O})),a.d(t,"init",(function(){return E}));var i=a(4),o=a.n(i),s=a(5),r=a.n(s),c=a(6),l=a.n(c),d=a(7),u=a.n(d),g=a(15),m=a.n(g),p=a(8),h=a.n(p),b=a(1),_=(a(197),a(12)),f=a(0),k=a(2),y=a(19),v=a(418),S=a(86),O=function(t){function GoogleSitekitAdminbar(e){var t;return o()(this,GoogleSitekitAdminbar),(t=l()(this,u()(GoogleSitekitAdminbar).call(this,e))).handleMoreDetailsLink=t.handleMoreDetailsLink.bind(m()(t)),t}return h()(GoogleSitekitAdminbar,t),r()(GoogleSitekitAdminbar,[{key:"handleMoreDetailsLink",value:function(){var t=e.googlesitekit,a=t.permaLink,n=t.postID,i=t.postType,o=t.pageTitle,s=Object(k.o)("googlesitekit-dashboard",{permaLink:a,id:n,postType:i,pageTitle:o});Object(k.A)("admin_bar","post_details_click"),document.location=s}},{key:"render",value:function(){var t=e.googlesitekit,a=t.pageTitle,i=t.permaLink;return n.createElement(S.a,null,n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-3 mdc-layout-grid__cell--align-middle "},n.createElement("div",{className:"googlesitekit-adminbar__subtitle"},Object(f.__)("Stats for","google-site-kit")),n.createElement("div",{className:"googlesitekit-adminbar__title"},a?Object(k.d)(a):i)),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--align-middle "},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement(v.a,null))),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2 mdc-layout-grid__cell--align-middle "},n.createElement(y.a,{className:"googlesitekit-adminbar__link",href:"#",onClick:this.handleMoreDetailsLink},Object(f.__)("More details","google-site-kit"))))),n.createElement(y.a,{className:"googlesitekit-adminbar__link googlesitekit-adminbar__link--mobile",href:"#",onClick:this.handleMoreDetailsLink},Object(f.__)("More details","google-site-kit")))}}]),GoogleSitekitAdminbar}(b.a);function E(){var e=document.getElementById("js-googlesitekit-adminbar-modules");e&&(Object(k.r)(),Object(b.k)(n.createElement(O,null),e),Object(_.d)("googlesitekit.moduleLoaded","Adminbar"))}}.call(this,a(16),a(11))},,,,,,,,,function(e,t,a){"use strict";(function(e){var n=a(4),i=a.n(n),o=a(5),s=a.n(o),r=a(6),c=a.n(r),l=a(7),d=a.n(l),u=a(8),g=a.n(u),m=a(1),p=a(51),h=function(t){function AdminbarModules(){return i()(this,AdminbarModules),c()(this,d()(AdminbarModules).apply(this,arguments))}return g()(AdminbarModules,t),s()(AdminbarModules,[{key:"render",value:function(){return e.createElement(m.b,null)}}]),AdminbarModules}(m.a);t.a=Object(p.a)("googlesitekit.AdminbarModules")(h)}).call(this,a(11))}]]);
dist/assets/js/chunk-googlesitekit-adminbar-6a3138e50217e279fc5b.js DELETED
@@ -1,29 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[4],[,,function(e,t,a){"use strict";(function(e){a.d(t,"v",(function(){return I})),a.d(t,"t",(function(){return W})),a.d(t,"q",(function(){return U})),a.d(t,"u",(function(){return F})),a.d(t,"i",(function(){return q})),a.d(t,"b",(function(){return H})),a.d(t,"e",(function(){return z})),a.d(t,"w",(function(){return G})),a.d(t,"l",(function(){return B})),a.d(t,"n",(function(){return K})),a.d(t,"f",(function(){return Y})),a.d(t,"o",(function(){return V})),a.d(t,"C",(function(){return J})),a.d(t,"D",(function(){return X})),a.d(t,"j",(function(){return Z})),a.d(t,"a",(function(){return ee})),a.d(t,"A",(function(){return te})),a.d(t,"y",(function(){return ae})),a.d(t,"d",(function(){return ne})),a.d(t,"g",(function(){return ie})),a.d(t,"h",(function(){return oe})),a.d(t,"s",(function(){return se})),a.d(t,"k",(function(){return re}));var n=a(64),i=a.n(n),o=a(20),s=a.n(o),r=a(11),l=a.n(r),c=a(73),d=a.n(c),u=a(33),g=a.n(u),m=a(13),p=a(1),h=a.n(p),b=a(41),_=a(12),f=a(0),y=a(42),k=a(187),v=a(24),S=a(79),O=a(96),E=a(97),j=a(34),D=a(45);a.d(t,"B",(function(){return D.c}));var C=a(10),w=a(59);a.d(t,"x",(function(){return w.a}));var A=a(90);a.d(t,"z",(function(){return A.a}));var x=a(75);a.d(t,"c",(function(){return x.b})),a.d(t,"m",(function(){return x.c}));var N=a(91);a.d(t,"p",(function(){return N.a}));var P=a(92);function T(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function L(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?T(a,!0).forEach((function(t){s()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):T(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}a.d(t,"r",(function(){return P.a}));var M=function(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=Object(m.isFinite)(e)?e:Number(e),Object(m.isFinite)(e)||(console.warn("Invalid number",e,g()(e)),e=0),t)return W(e,{style:"currency",currency:t});var a={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?Object(f.sprintf)(// translators: %s: an abbreviated number in millions.
2
- Object(f.__)("%sM","google-site-kit"),W(M(e),e%10==0?{}:a)):1e4<=e?Object(f.sprintf)(// translators: %s: an abbreviated number in thousands.
3
- Object(f.__)("%sK","google-site-kit"),W(M(e))):1e3<=e?Object(f.sprintf)(// translators: %s: an abbreviated number in thousands.
4
- Object(f.__)("%sK","google-site-kit"),W(M(e),e%10==0?{}:a)):e.toString()},W=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a=t.locale,n=void 0===a?R():a,i=d()(t,["locale"]);return new Intl.NumberFormat(n,i).format(e)},R=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,a=Object(m.get)(t,["googlesitekit","locale","","lang"]);if(a){var n=a.match(/^(\w{2})?(_)?(\w{2})/);if(n&&n[0])return n[0].replace(/_/g,"-")}return t.navigator.language},U=function(e){switch(e){case"minute":return 60;case"hour":return 3600;case"day":return 86400;case"week":return 604800;case"month":return 2592e3;case"year":return 31536e3}},F=function(e){if(e=parseInt(e,10),isNaN(e)||0===e)return"0.0s";var t={};return t.hours=Math.floor(e/60/60),t.minutes=Math.floor(e/60%60),t.seconds=Math.floor(e%60),((t.hours?t.hours+"h ":"")+(t.minutes?t.minutes+"m ":"")+(t.seconds?t.seconds+"s ":"")).trim()},q=function(e,t){var a=1e3*U("day"),n=e.getTime(),i=t.getTime();return Math.round(Math.abs(n-i)/a)},H=function(e,t){if("0"===e||0===e||isNaN(e))return"";var a=((t-e)/e*100).toFixed(1);return isNaN(a)||"Infinity"===a?"":a},z=function(e,t){return Object(m.map)(e,(function(e,a){return[e[0],e[t]||(0===a?"":0)]}))},G=function(){var t,a;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,l.a.awrap(C.c.get(C.a,"user","authentication"));case 3:t=n.sent,a=t.grantedScopes.filter((function(e){return-1!==t.requiredScopes.indexOf(e)})),e.googlesitekit.setup=e.googlesitekit.setup||{},e.googlesitekit.setup.isAuthenticated=t.isAuthenticated,e.googlesitekit.setup.requiredScopes=t.requiredScopes,e.googlesitekit.setup.grantedScopes=t.grantedScopes,e.googlesitekit.setup.needReauthenticate=a.length<t.requiredScopes.length,n.next=14;break;case 12:n.prev=12,n.t0=n.catch(0);case 14:case"end":return n.stop()}}),null,null,[[0,12]])},B=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.googlesitekit,a=t.modules;return a?Object.keys(a).reduce((function(e,t){return"object"!==g()(a[t])?e:void 0===a[t].slug||void 0===a[t].name||a[t].slug!==t?e:L({},e,s()({},t,a[t]))}),{}):{}},K=function(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.googlesitekit,i=n.admin,o=i.connectURL,s=i.adminRoot,r=n.setup.needReauthenticate,l=B(n)[t].screenID,c="pagespeed-insights"===t?{notification:"authentication_success",reAuth:void 0}:{},d=Object(y.a)(s,L({page:t&&a&&l?l:"googlesitekit-dashboard",slug:t,reAuth:a},c));if(!r)return d;var u=encodeURIComponent(Object(k.a)(d));return d=s+"?"+u,Object(y.a)(o,{redirect:d,status:a})},Y=function(e,t){return function(a){return function InnerComponent(n){return h.a.createElement(e,i()({},n,t,{OriginalComponent:a}))}}},V=function(t,a){var n=e.googlesitekit.admin.adminRoot;return t||(t="googlesitekit-dashboard"),a=L({page:t},a),Object(y.a)(n,a)},J=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},X=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}#x2F;)},Z=function(t){var a,n,i,o,s;return l.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return a=e.googlesitekit.admin,n=a.homeURL,i=a.ampMode,o={tagverify:1,timestamp:Date.now()},r.next=4,l.a.awrap($(Object(y.a)(n,o),t));case 4:if((s=r.sent)||"secondary"!==i){r.next=9;break}return r.next=8,l.a.awrap(Object(b.default)({path:"/wp/v2/posts?per_page=1"}).then((function(e){return e.slice(0,1).map((function(e){return l.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,l.a.awrap($(Object(y.a)(e.link,L({},o,{amp:1})),t));case 2:return a.abrupt("return",a.sent);case 3:case"end":return a.stop()}}))})).pop()})));case 8:s=r.sent;case 9:return r.abrupt("return",Promise.resolve(s||null));case 10:case"end":return r.stop()}}))},$=function(e,t){var a;return l.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,l.a.awrap(fetch(e,{credentials:"omit"}).then((function(e){return e.text()})));case 3:return a=n.sent,n.abrupt("return",Q(a,t)||null);case 7:return n.prev=7,n.t0=n.catch(0),n.abrupt("return",null);case 10:case"end":return n.stop()}}),null,null,[[0,7]])},Q=function(e,t){var a=({adsense:O.a,analytics:E.a,tagmanager:j.d,setup:S.b}[t]||[]).find((function(t){return t.test(e)}));return!!a&&a.exec(e)[1]},ee=function(e,t,a){return e.setModuleActive(t,a).then((function(e){var a=B();return a[t]&&(a[t].active=e.active),Object(D.c)("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},te=function(t,a,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.googlesitekit,s=B(o)[t],r=s.settings,l=s.setupComplete,c=i||document.getElementById("confirm-changes-".concat(t));if(l&&c){var d=!!Object.keys(a).find((function(e){var t=a[e];return!Object(m.isEqual)(n[e],r[t])}));return i||(c.disabled=!d),d}},ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(_.b)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",Y(e,t),1)},ne=function(e){if(!e)return"";var t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)})).replace(/(\\)/g,"");return Object(m.unescape)(t)};function ie(){var e=Object(_.c)("googlesitekit.dateRange","last-28-days").match(/last-(\d+)-days/);if(e&&e[1])return Object(f.sprintf)(Object(f._n)("%s day","%s days",parseInt(e[1],10),"google-site-kit"),e[1]);throw new Error("Unrecognized date range slug used in `googlesitekit.dateRange`.")}function oe(){return Object(_.c)("googlesitekit.dateRange","last-28-days")}function se(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(e.googlesitekit){var s=h.a.createElement(v.a,{id:t,width:n,height:i,className:o});return a?s=h.a.createElement(v.a,{id:"".concat(t,"-disabled"),width:n,height:i,className:o}):"pagespeed-insights"===t&&(s=h.a.createElement("img",{src:e.googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:n,alt:"",className:o})),s}}function re(t){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e._googlesitekitBaseData,n=a.blogPrefix;return a.isNetworkMode?t:n+t}}).call(this,a(16))},,,,,,,,function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return b})),a.d(t,"b",(function(){return _}));var n=a(20),i=a.n(n),o=a(33),s=a.n(o),r=a(13),l=a(41),c=a(42),d=a(12),u=a(2),g=a(67),m=a(95);function p(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function h(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?p(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):p(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var b="core",_="modules",f=function(){e.googlesitekit.admin=e.googlesitekit.admin||{},"string"==typeof e.googlesitekit.admin.datacache&&(e.googlesitekit.admin.datacache=JSON.parse(e.googlesitekit.admin.datacache)),"object"!==s()(e.googlesitekit.admin.datacache)&&(e.googlesitekit.admin.datacache={})},y=function(e,t){var a=h({data:{}},e);return a.data=h({dateRange:t},a.data),a},k={maxRequests:10,init:function(){Object(d.a)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingData",this.collectModuleData.bind(this))},combinedGetFromCache:function(e){var t=this;return new Promise((function(a,n){try{var i=[],o=Object(u.h)();Object(r.each)(e,(function(e){var a=y(e,o);a.key=t.getCacheKey(a.type,a.identifier,a.datapoint,a.data);var n=t.getCache(a.key,a.maxAge);void 0!==n&&(i[a.key]=n,t.resolve(a,n))})),a(i)}catch(e){n()}}))},combinedGet:function(e){var t=this,a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=[],i=25,o=Object(u.h)();Object(r.each)(e,(function(e){var a=y(e,o);a.key=t.getCacheKey(a.type,a.identifier,a.datapoint,a.data);var s=t.getCache(a.key,a.maxAge);void 0!==s?(setTimeout((function(){t.resolve(a,s)}),i),i+=25):n.push(a)})),n=Object(r.sortBy)(n,"priority");var s=[],g=[],m={},p=!!n.find((function(e){return e.priority<10}));Object(r.each)(n,(function(e,t){!a&&10<=e.priority&&p?g.push(e):m[e.key]?m[e.key].push(t):(m[e.key]=[t],s.push(e))}));var h=10,b=s.slice(0,h),_=s.slice(h);if(_=_.concat(g),0!==b.length||0!==_.length){0<_.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(_,!0)}),50):this.maxRequests=10;var f=null!==Object(u.m)("datacache");return Object(l.default)({path:Object(c.a)("/google-site-kit/v1/data/",{datacache:f||void 0}),data:{request:b},method:"POST"}).then((function(e){Object(r.each)(e,(function(e,a){m[a]?(t.handleWPError(e),Object(r.each)(m[a],(function(a){var i=n[a];t.setCache(i.key,e),t.resolve(i,e)})),0===_.length&&Object(d.d)("googlesitekit.dataLoaded","api")):console.error("data_error","unknown response key "+a)}))})).catch((function(e){console.warn("Error caught during combinedGet",e)}))}Object(d.d)("googlesitekit.dataLoaded","cache")},handleWPError:function(e){var t=["code","data","message"],a=Object(r.intersection)(t,Object.keys(e));if(Object(r.isEqual)(t,a)){console.warn("WP Error in data response",e);var n=e.data;if(n&&n.reason){var i=0;["authError","insufficientPermissions"].includes(n.reason)&&(Object(d.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(u.f)(g.a),1),i++),"forbidden"===n.reason&&(Object(d.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(u.f)(m.a),1),i++),i&&Object(d.b)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(d.f)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+i}))}}},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(t,a){if(void 0!==a&&(!a||"object"!==s()(a)||!a.error&&!a.errors)){f(),e.googlesitekit.admin.datacache[t]=Object(r.cloneDeep)(a);var n={value:a,date:Date.now()/1e3};Object(u.p)().setItem("googlesitekit_"+t,JSON.stringify(n))}},getCache:function(t,a){if(!e.googlesitekit.admin.nojscache){if(f(),void 0!==e.googlesitekit.admin.datacache[t])return e.googlesitekit.admin.datacache[t];var n=JSON.parse(Object(u.p)().getItem("googlesitekit_"+t));return n&&"object"===s()(n)&&n.date&&(!a||Date.now()/1e3-n.date<a)?(e.googlesitekit.admin.datacache[t]=Object(r.cloneDeep)(n.value),Object(r.cloneDeep)(e.googlesitekit.admin.datacache[t])):void 0}},deleteCache:function(t){f(),delete e.googlesitekit.admin.datacache[t],Object(u.p)().removeItem("googlesitekit_"+t)},invalidateCacheGroup:function(t,a,n){var i=this.getCacheKey(t,a,n);f(),Object.keys(e.googlesitekit.admin.datacache).forEach((function(t){0!==t.indexOf(i+"::")&&t!==i||delete e.googlesitekit.admin.datacache[t]})),Object.keys(Object(u.p)()).forEach((function(e){0!==e.indexOf("googlesitekit_".concat(i,"::"))&&e!=="googlesitekit_".concat(i)||Object(u.p)().removeItem(e)}))},collectModuleData:function(e,t){var a=Object(d.c)("googlesitekit.module"+e+"DataRequest",[],t);0!==a.length&&this.combinedGet(a)},get:function(e,t,a){var n=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],s=this.getCacheKey(e,t,a,i);if(!o){var r=this.getCache(s,3600);if(void 0!==r)return new Promise((function(e){e(r)}))}return Object(l.default)({path:Object(c.a)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(a),i)}).then((function(e){return o||n.setCache(s,e),Promise.resolve(e)})).catch((function(e){return n.handleWPError(e),Promise.reject(e)}))},set:function(e,t,a,n){var i={};return i.data=n,Object(l.default)({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(a),data:i,method:"POST"}).then((function(n){return k.invalidateCacheGroup(e,t,a),new Promise((function(e){e(n)}))}))},getCacheKey:function(e,t,a){for(var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=[],o=[e,t,a],r=0,l=o;r<l.length;r++){var c=l[r];if(!c||!c.length)break;i.push(c)}return 3===i.length&&n&&"object"===s()(n)&&Object.keys(n).length&&i.push(Object(u.z)(n)),i.join("::")},setModuleActive:function(e,t){return this.set(b,"modules","activation",{slug:e,active:t})}};k.init(),t.c=k}).call(this,a(16))},,,,,,,function(e,t,a){"use strict";a.d(t,"e",(function(){return s})),a.d(t,"c",(function(){return l})),a.d(t,"d",(function(){return c})),a.d(t,"b",(function(){return d})),a.d(t,"f",(function(){return u})),a.d(t,"h",(function(){return g})),a.d(t,"a",(function(){return m})),a.d(t,"j",(function(){return p})),a.d(t,"i",(function(){return h})),a.d(t,"l",(function(){return b})),a.d(t,"k",(function(){return _})),a.d(t,"g",(function(){return f}));var n=a(13),i=a(0),o=a(2),s=function(e){if(!e||!e.length)return null;var t=e[0].data,a=t.rows,i=t.totals[0].values[0],o=[["Source","Percent"]];return Object(n.each)(a,(function(e){var t=e.metrics[0].values[0]/i;if(1>100*t)return!1;var a=e.dimensions[0].replace(/\(none\)/gi,"direct");o.push([a,t])})),o};function r(e,t){var a=[];return Object(n.each)(e,(function(e){if(e.metrics){var n=e.metrics[0].values,i=e.dimensions[0],o=i.slice(0,4)+"-"+i.slice(4,6)+"-"+i.slice(6,8),s=new Date(o);a.push([s,n[t]])}})),a}var l=function(e,t,a){if(!e||!e.length)return null;var o=e[0].data.rows;if(!o)return!1;var s=o.length;if(2*a>s){for(var l=new Date,c=0;a>c;c++){var d=(l.getMonth()+1).toString(),u=l.getDate().toString(),g=l.getFullYear().toString()+(2>d.length?"0":"")+d+(2>u.length?"0":"")+u;if(c>s){var m={dimensions:[g],metrics:[{values:[0,0,0,0,0]}]};o.unshift(m)}l.setDate(l.getDate()-1)}o.push([0,0])}var p=[Object(i.__)("Users","google-site-kit"),Object(i.__)("Sessions","google-site-kit"),Object(i.__)("Bounce Rate","google-site-kit"),Object(i.__)("Session Duration","google-site-kit")],h=[[{type:"date",label:Object(i.__)("Day","google-site-kit")},{type:"number",label:p[t]},{type:"number",label:Object(i.__)("Previous month","google-site-kit")}]],b=o.slice(o.length-a,o.length),_=o.slice(0,o.length-a),f=r(b,t),y=r(_,t);return Object(n.each)(f,(function(e,t){e[0]&&e[1]&&y[t]&&h.push([e[0],e[1],y[t][1]])})),h},c=function(e){if(!e||!e.length)return null;var t=e[0].data.rows,a=[[{type:"date",label:"Day"},{type:"number",label:"Users"},{type:"number",label:"Sessions"},{type:"number",label:"Goals Completed"}]];return Object(n.each)(t,(function(e){var t=e.metrics[0].values,n=e.dimensions[0],i=n.slice(0,4)+"-"+n.slice(4,6)+"-"+n.slice(6,8),o=new Date(i);a.push([o,t[0],t[1],t[4]])})),a},d=function(e){if(!e||!e.length)return!1;var t=e[0].data.totals,a=t[0].values,n=t[1].values,i=a[0],s=a[1],r=a[2],l=a[3],c=a[4],d=a[5];return{totalUsers:i,totalSessions:s,averageBounceRate:r,averageSessionDuration:l,totalUsersChange:Object(o.b)(n[0],a[0]),totalSessionsChange:Object(o.b)(n[1],a[1]),averageBounceRateChange:Object(o.b)(n[2],a[2]),averageSessionDurationChange:Object(o.b)(n[3],a[3]),goalCompletions:c,goalCompletionsChange:Object(o.b)(n[4],a[4]),totalPageViews:d,totalPageViewsChange:Object(o.b)(n[5],a[5])}},u=function(e){return!(!e.error||!e.error.status)&&function(e,t){var a="";switch(e){case"INVALID_ARGUMENT":a=Object(i.__)("Analytics module needs to be configured.","google-site-kit");break;case"UNAUTHENTICATED":a=Object(i.__)("You need to be authenticated to get this data.","google-site-kit");break;case"PERMISSION_DENIED":a=Object(i.__)("Your account does not have sufficient permission to access this data, please consult to your web administrator.","google-site-kit");break;case"RESOURCE_EXHAUSTED":a=Object(i.__)("Your account exceeded the maximum quota. Please try again later.","google-site-kit");break;case"INTERNAL":a=Object(i.__)("Unexpected internal server error occurred.","google-site-kit");break;case"BACKEND_ERROR":a=Object(i.__)("Analytics server returned unknown error. Please try again later.","google-site-kit");break;case"UNAVAILABLE":a=Object(i.__)("The service was unable to process the request. Please try again later.","google-site-kit");break;default:a=t}return a}(e.error.status,e.error.message)},g=function(e){if(!e||!e.length)return!0;if(e&&e[0]&&e[0].data&&e[0].data.totals&&e[0].data.totals[0]){var t=e[0].data.totals[0].values,a=!0;return Object(n.each)(t,(function(e){0!==parseInt(e)&&(a=!1)})),a}return!1},m={dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:[{expression:"ga:adsenseRevenue",alias:"Earnings"},{expression:"ga:adsenseECPM",alias:"Page RPM"},{expression:"ga:adsensePageImpressions",alias:"Impressions"}],orderby:[{fieldName:"ga:adsenseRevenue",sortOrder:"DESCENDING"}],limit:10},p={compareDateRanges:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"}],limit:180},h={multiDateRange:1,dimensions:"ga:date",metrics:[{expression:"ga:users",alias:"Users"},{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:bounceRate",alias:"Bounce Rate"},{expression:"ga:avgSessionDuration",alias:"Average Session Duration"},{expression:"ga:goalCompletionsAll",alias:"Goal Completions"},{expression:"ga:pageviews",alias:"Pageviews"}],limit:10},b={metrics:[{expression:"ga:users",alias:"Total Users"}]},_={dimensions:"ga:medium",metrics:[{expression:"ga:sessions",alias:"Sessions"},{expression:"ga:users",alias:"Users"},{expression:"ga:newUsers",alias:"New Users"}],orderby:[{fieldName:"ga:sessions",sortOrder:"DESCENDING"}],limit:10},f=function(){var e=[{expression:"ga:pageviews",alias:"Pageviews"},{expression:"ga:uniquePageviews",alias:"Unique Pageviews"},{expression:"ga:bounceRate",alias:"Bounce rate"}];return Object(o.l)().analytics.settings.adsenseLinked&&e.push({expression:"ga:adsenseRevenue",alias:"AdSense Revenue"},{expression:"ga:adsenseECPM",alias:"AdSense ECPM"}),{dimensions:["ga:pageTitle","ga:pagePath"].join(","),metrics:e,orderby:[{fieldName:"ga:pageviews",sortOrder:"DESCENDING"}],limit:10}}},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=function(t){function Link(){return i()(this,Link),l()(this,d()(Link).apply(this,arguments))}return g()(Link,t),s()(Link,[{key:"render",value:function(){var t=this.props,a=t.dangerouslySetInnerHTML,n=t.onClick,i=t.href,o=t.children,s=t.className,r=t.arrow,l=t.external,c=t.inverse,d=t.back,u=t.small,g=t.inherit,m=t.caps,p=t.danger,h=t.disabled,_=t.id,f=i&&!h,y=f?"a":"button";return e.createElement(y,{className:b()("googlesitekit-cta-link",s,{"googlesitekit-cta-link--arrow":r,"googlesitekit-cta-link--external":l,"googlesitekit-cta-link--inverse":c,"googlesitekit-cta-link--back":d,"googlesitekit-cta-link--small":u,"googlesitekit-cta-link--inherit":g,"googlesitekit-cta-link--caps":m,"googlesitekit-cta-link--danger":p,"googlesitekit-cta-link--disabled":h}),onClick:n,id:_,href:f?i:void 0,target:f&&l?"_blank":void 0,rel:l?"noopener noreferrer":void 0,disabled:h,dangerouslySetInnerHTML:a},o)}}]),Link}(_.Component);f.propTypes={dangerouslySetInnerHTML:p.a.shape({__html:p.a.string}),onClick:p.a.func,href:p.a.string,children:p.a.oneOfType([p.a.string.isRequired,p.a.array.isRequired]),className:p.a.string,arrow:p.a.bool,external:p.a.bool,inverse:p.a.bool,back:p.a.bool,small:p.a.bool,inherit:p.a.bool,caps:p.a.bool,danger:p.a.bool,disabled:p.a.bool},f.defaultProps={dangerouslySetInnerHTML:void 0,onClick:null,href:"",className:"",arrow:!1,external:!1,inverse:!1,back:!1,small:!1,inherit:!1,caps:!1,danger:!1,disabled:!1},t.a=f}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(64),i=a.n(n),o=a(5),s=a.n(o),r=a(6),l=a.n(r),c=a(7),d=a.n(c),u=a(8),g=a.n(u),m=a(9),p=a.n(m),h=a(13),b=a(12),_=a(1),f=a(0),y=a(2),k=a(46),v=a(39),S=a(81);t.a=function(t,a){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{inGrid:!1,fullWidth:!1,createGrid:!1},r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1},c=arguments.length>5&&void 0!==arguments[5]?arguments[5]:function(e){if(e&&e.error)return e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(f.__)("Unidentified error","google-site-kit");if(e&&e.errors&&e.errors[0]&&e.errors[0].message)return e.errors[0].message;if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"RateLimitExceeded"===t[0].reason)return Object(f.__)("Too many requests have been sent within a given time span. Please reload this page again in a few seconds","google-site-kit")}if(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1};return function(u){function NewComponent(e){var t;s()(this,NewComponent),(t=d()(this,g()(NewComponent).call(this,e))).state={data:!1,zeroData:!1,error:!1},Object(b.a)("googlesitekit.moduleDataReset","googlesitekit.moduleDataResetHandler",(function(){t.setState({data:!1})}));var n=function(e,a){var n=t.props,i=n.handleDataError,o=n.handleDataSuccess,s=a.datapoint,l=a.identifier,d=a.toState,u=c(e);u?(t.setState({error:u,module:l}),i&&i(u)):r(e,s,a)?(i&&i(u),t.setState({zeroData:!0})):o&&o(),t.setState({requestDataToState:d,data:e,datapoint:s,module:l})};return Object(h.each)(a,(function(e){Array.isArray(e.context)?Object(h.each)(e.context,(function(t){Object(b.b)("googlesitekit.module".concat(t,"DataRequest"),"googlesitekit.data".concat(t),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})):Object(b.b)("googlesitekit.module".concat(e.context,"DataRequest"),"googlesitekit.data".concat(e.context),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})),t}return p()(NewComponent,u),l()(NewComponent,[{key:"render",value:function(){var a=this.state,s=a.data,r=a.datapoint,l=a.module,c=a.zeroData,d=a.error,u=a.requestDataToState;if(!s)return n;var g=Object(y.l)(),m=l?g[l].name:Object(f.__)("Site Kit","google-site-kit");return l&&g[l].active&&!g[l].setupComplete?Object(S.a)(l,o.inGrid,o.fullWidth,o.createGrid):d?"string"!=typeof d?d:Object(v.a)(m,d,o.inGrid,o.fullWidth,o.createGrid):c?Object(k.a)(m,o.inGrid,o.fullWidth,o.createGrid):e.createElement(t,i()({data:s,datapoint:r,requestDataToState:u},this.props))}}]),NewComponent}(_.Component)}}).call(this,a(1))},,,function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(1),i=function(e){return function(t){return function FilteredComponent(a){return Object(n.createElement)(n.Fragment,{},"",Object(n.createElement)(t,a),e)}}}},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=function(t){function PreviewBlock(){return i()(this,PreviewBlock),l()(this,d()(PreviewBlock).apply(this,arguments))}return g()(PreviewBlock,t),s()(PreviewBlock,[{key:"render",value:function(){var t=this.props,a=t.width,n=t.height,i=t.shape,o=t.padding;return e.createElement("div",{className:b()("googlesitekit-preview-block",{"googlesitekit-preview-block--padding":o}),style:{width:a,height:n}},e.createElement("div",{className:b()("googlesitekit-preview-block__wrapper",{"googlesitekit-preview-block__wrapper--circle":"circular"===i})}))}}]),PreviewBlock}(_.Component);f.propTypes={width:p.a.string,height:p.a.string,shape:p.a.string,padding:p.a.bool},f.defaultProps={width:"100px",height:"100px",shape:"square",padding:!1},t.a=f}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(3),o=a.n(i),s=a(14),r=a.n(s),l=function SvgIcon(t){var a=t.id,i=t.className,o=t.height,s=t.width,l="".concat(e.googlesitekit.admin.assetsRoot,"svg/svg.svg");return n.createElement("svg",{className:r()("svg",i),height:o,width:s},n.createElement("use",{xlinkHref:"".concat(l,"#").concat(a)}))};l.propTypes={id:o.a.string.isRequired,className:o.a.string,height:o.a.string,width:o.a.string},l.defaultProps={className:"",height:20,width:20},t.a=l}).call(this,a(16),a(1))},function(e,t,a){"use strict";var n=a(72),i=a.n(n);a.d(t,"l",(function(){return i.a})),a.d(t,"a",(function(){return n.HelperText})),a.d(t,"b",(function(){return n.Input}));var o=a(101);a.d(t,"h",(function(){return o.a}));var s=a(200);a.d(t,"e",(function(){return s.a}));var r=a(199);a.d(t,"g",(function(){return r.a}));var l=a(80),c=a.n(l);a.d(t,"k",(function(){return c.a})),a.d(t,"j",(function(){return l.Option}));var d=a(201);a.d(t,"i",(function(){return d.a}));var u=a(198);a.d(t,"d",(function(){return u.a}));var g=a(197);a.d(t,"c",(function(){return g.a}));var m=a(196);a.d(t,"f",(function(){return m.a}))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(15),g=a.n(u),m=a(9),p=a.n(m),h=a(3),b=a.n(h),_=a(14),f=a.n(_),y=a(1),k=a(94),v=a(2),S=a(48),O=function(t){function DataBlock(e){var t;return i()(this,DataBlock),(t=l()(this,d()(DataBlock).call(this,e))).handleClick=t.handleClick.bind(g()(t)),t.handleKeyPress=t.handleKeyPress.bind(g()(t)),t}return p()(DataBlock,t),s()(DataBlock,[{key:"handleClick",value:function(){var e=this.props,t=e.stat;(0,e.handleStatSelection)(t)}},{key:"handleKeyPress",value:function(e){e.preventDefault();var t=this.props,a=t.stat,n=t.handleStatSelection;"Enter"!==e.key&&" "!==e.key||n(a)}},{key:"render",value:function(){var t=this.props,a=t.className,n=t.title,i=t.datapoint,o=t.datapointUnit,s=t.change,r=t.changeDataUnit,l=t.context,c=t.period,d=t.selected,u=t.handleStatSelection,g=t.source,m=t.sparkline,p=t.invertChangeColor,h="button"===l?"button":"",b=m;return b&&p&&(b=Object(y.cloneElement)(m,{invertChangeColor:p})),e.createElement("div",{className:f()("googlesitekit-data-block",a,"googlesitekit-data-block--".concat(l),{"googlesitekit-data-block--selected":d}),tabIndex:"button"===l?"0":"-1",role:u&&h,onClick:u&&this.handleClick,onKeyPress:u&&this.handleKeyPress,"aria-label":u&&n,"aria-pressed":u&&d},e.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},e.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},n),e.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(i).concat(o))),b&&e.createElement("div",{className:"googlesitekit-data-block__sparkline"},b),e.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},e.createElement("div",{className:"googlesitekit-data-block__change"},""===s&&e.createElement(y.Fragment,null," "),s&&e.createElement(y.Fragment,null,e.createElement("span",{className:"googlesitekit-data-block__arrow"},e.createElement(k.a,{direction:0<parseFloat(s)?"up":"down",invertColor:p})),e.createElement("span",{className:"googlesitekit-data-block__value"},"".concat(Object(v.t)(Math.abs(s))).concat(r," ").concat(c)))),g&&e.createElement(S.a,{className:"googlesitekit-data-block__source",name:g.name,href:g.link})))}}]),DataBlock}(y.Component);O.propTypes={stat:b.a.number,onClick:b.a.func,className:b.a.string,title:b.a.string,datapoint:b.a.oneOfType([b.a.string,b.a.number]),datapointUnit:b.a.string,change:b.a.oneOfType([b.a.string,b.a.number]),changeDataUnit:b.a.string,context:b.a.string,period:b.a.string,selected:b.a.bool,handleStatSelection:b.a.func,invertChangeColor:b.a.bool},O.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,invertChangeColor:!1},t.a=O}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){a.d(t,"b",(function(){return E})),a.d(t,"a",(function(){return j}));var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(15),m=a.n(g),p=a(9),h=a.n(p),b=a(3),_=a.n(b),f=a(14),y=a.n(f),k=a(13),v=a(1),S=a(48),O=a(18),E=function(t,a,n){var i=[],o=n.links,s=n.source,r=n.showURLs;n.cap&&(t=t.slice(0,n.cap)),Object(k.each)(t,(function(t,a){var n=[],s=o&&o[a];Object(k.each)(t,(function(a,i){"string"==typeof a&&(a=a.replace(/\(none\)/gi,"direct")),n.push(e.createElement("td",{key:"cell-"+i,className:"googlesitekit-table__body-item"},t[0]===a&&s?e.createElement("div",{className:"googlesitekit-table__body-item-content"},e.createElement(O.a,{className:"googlesitekit-table__body-item-link",href:s,external:!0,inherit:!0},a),r&&""!==Object(k.trim)(s,"/")&&e.createElement(O.a,{className:"googlesitekit-table__body-item-url",href:s,inherit:!0,external:!0},Object(k.trim)(s,"/"))):e.createElement("div",{className:"googlesitekit-table__body-item-content"},a)))})),i.push(e.createElement("tr",{key:"tr-"+a,className:"googlesitekit-table__body-row"},n))}));var l=t&&t[0]&&t[0].length?t[0].length:1;return e.createElement("div",{className:y()("googlesitekit-table",{"googlesitekit-table--with-list":!n||!n.disableListMode})},e.createElement("table",{className:y()("googlesitekit-table__wrapper","googlesitekit-table__wrapper--".concat(l,"-col"))},e.createElement("thead",{className:"googlesitekit-table__head"},e.createElement("tr",{key:"gksc_data_row_header-wrap",style:n&&n.hideHeader?{display:"none"}:{},className:"googlesitekit-table__head-row"},a.map((function(t,a){return e.createElement("th",{key:"gksc_data_row_header-".concat(a),className:y()("googlesitekit-table__head-item",{"googlesitekit-table__head-item--primary":t.primary}),"data-tooltip":t.tooltip},t.title)})))),e.createElement("tbody",{className:"googlesitekit-table__body"},i)),s&&e.createElement(S.a,{className:"googlesitekit-table__source",name:s.name,href:s.link}))},j=function(t){function TableOverflowContainer(){var e;return o()(this,TableOverflowContainer),(e=c()(this,u()(TableOverflowContainer).call(this))).state={isScrolling:!1},e.scrollRef=Object(v.createRef)(),e.updateFadeOnScroll=e.updateFadeOnScroll.bind(m()(e)),e}return h()(TableOverflowContainer,t),r()(TableOverflowContainer,[{key:"componentDidMount",value:function(){var e=this;e.updateFadeOnScroll(),this.resize=Object(k.debounce)((function(){e.updateFadeOnScroll()}),100),n.addEventListener("resize",this.resize)}},{key:"componentWillUnmount",value:function(){n.removeEventListener("resize",this.resize)}},{key:"updateFadeOnScroll",value:function(){var e=this.scrollRef.current,t=e.scrollLeft,a=e.scrollWidth-e.offsetWidth,n=t<a-16&&0<a-16;this.setState({isScrolling:n})}},{key:"render",value:function(){var t=this.props.children,a=this.state.isScrolling;return e.createElement("div",{onScroll:Object(k.debounce)(this.updateFadeOnScroll,100),className:y()("googlesitekit-table-overflow",{"googlesitekit-table-overflow--gradient":a})},e.createElement("div",{ref:this.scrollRef,className:"googlesitekit-table-overflow__container"},t))}}]),TableOverflowContainer}(v.Component);j.propTypes={children:_.a.element}}).call(this,a(1),a(16))},,function(e,t,a){"use strict";(function(e){var n=a(20),i=a.n(n),o=a(11),s=a.n(o),r=a(5),l=a.n(r),c=a(6),d=a.n(c),u=a(7),g=a.n(u),m=a(8),p=a.n(m),h=a(15),b=a.n(h),_=a(9),f=a.n(_),y=a(3),k=a.n(y),v=a(14),S=a.n(v),O=a(13),E=a(1),j=a(24),D=a(59),C=a(10),w=a(26),A=a(31),x=a(60),N=a(71),P=a(18),T=function(t){function Notification(e){var t;return l()(this,Notification),(t=g()(this,p()(Notification).call(this,e))).state={isClosed:!1},t.cardRef=Object(E.createRef)(),t.handleDismiss=t.handleDismiss.bind(b()(t)),t.handleCTAClick=t.handleCTAClick.bind(b()(t)),0<t.props.dismissExpires&&t.expireDismiss(),t.props.showOnce&&C.c.setCache("notification::displayed::".concat(t.props.id),new Date),t}return f()(Notification,t),d()(Notification,[{key:"handleDismiss",value:function(e){var t;return s.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(e.persist(),e.preventDefault(),!(t=this.props.onDismiss)){a.next=6;break}return a.next=6,s.a.awrap(t(e));case 6:this.dismiss();case 7:case"end":return a.stop()}}),null,this)}},{key:"dismiss",value:function(){var e=this,t=this.cardRef.current;this.setState({isClosed:!0}),setTimeout((function(){C.c.setCache("notification::dismissed::".concat(e.props.id),new Date),t.style.display="none";var a=new Event("notificationDismissed");document.dispatchEvent(a)}),350)}},{key:"handleCTAClick",value:function(e){var t,a,n;return s.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.persist(),t=this.props,a=t.isDismissable,!(n=t.onCTAClick)){i.next=5;break}return i.next=5,s.a.awrap(n(e));case 5:a&&this.dismiss();case 6:case"end":return i.stop()}}),null,this)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,a=e.dismissExpires,n=C.c.getCache("notification::dismissed::".concat(t));if(n){var i=new Date(n);i.setSeconds(i.getSeconds()+parseInt(a,10)),i<new Date&&C.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var t,a=this.state.isClosed,n=this.props,o=n.children,s=n.id,r=n.title,l=n.description,c=n.blockData,d=n.winImage,u=n.smallImage,g=n.format,m=n.learnMoreURL,p=n.learnMoreDescription,h=n.learnMoreLabel,b=n.ctaLink,_=n.ctaLabel,f=n.ctaTarget,y=n.type,k=n.dismiss,v=n.isDismissable,T=n.logo,L=n.module,M=n.moduleName,I=n.pageIndex;if(C.c.getCache("notification::dismissed::".concat(s)))return null;var W,R=a?"is-closed":"is-open",U="large"===g&&"win-stats-increase"===y,F="mdc-layout-grid__cell--span-12";"large"===g?(F="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-8-desktop ",U&&(F="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-8-desktop ")):"small"===g&&(F="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),W="win-warning"===y?e.createElement(x.a,null):"win-error"===y?e.createElement(N.a,null):"";var q=e.createElement(E.Fragment,null,c&&e.createElement("div",{className:"mdc-layout-grid__inner"},Object(O.map)(c,(function(t,a){return e.createElement("div",{key:a,className:S()("mdc-layout-grid__cell",{"mdc-layout-grid__cell--span-5-desktop":U,"mdc-layout-grid__cell--span-4-desktop":!U})},e.createElement("div",{className:"googlesitekit-publisher-win__stats"},e.createElement(w.a,t)))})))),H=e.createElement(E.Fragment,null,r&&e.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},r),l&&e.createElement("div",{className:"googlesitekit-publisher-win__desc"},e.createElement("p",null,Object(E.isValidElement)(l)?l:e.createElement("span",{dangerouslySetInnerHTML:Object(D.a)(l,{ALLOWED_TAGS:["strong","em","br","a"],ALLOWED_ATTR:["href"]})}),h&&e.createElement(E.Fragment,null," ",e.createElement(P.a,{href:m,external:!0,inherit:!0},h),p),I&&e.createElement("span",{className:"googlesitekit-publisher-win__detect"},I))),o),z=L?e.createElement(j.a,{id:L,height:"19",width:"19"}):e.createElement(j.a,{id:"logo-g",height:"34",width:"32"});return e.createElement("section",{ref:this.cardRef,className:S()("googlesitekit-publisher-win",(t={},i()(t,"googlesitekit-publisher-win--".concat(g),g),i()(t,"googlesitekit-publisher-win--".concat(y),y),i()(t,"googlesitekit-publisher-win--".concat(R),R),t))},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},T&&e.createElement("div",{className:S()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",{"mdc-layout-grid__cell--order-2-phone":U,"mdc-layout-grid__cell--order-1-tablet":U})},e.createElement("div",{className:"googlesitekit-publisher-win__logo"},z),M&&e.createElement("div",{className:"googlesitekit-publisher-win__module-name"},M)),u&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:u})),e.createElement("div",{className:S()("mdc-layout-grid__cell",F)},U?e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},H),e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--align-bottom"},q)):e.createElement(E.Fragment,null,H,q),b&&e.createElement(A.a,{href:b,target:f,onClick:this.handleCTAClick},_),v&&k&&e.createElement(P.a,{onClick:this.handleDismiss},k)),d&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--order-1-phone mdc-layout-grid__cell--order-2-tablet mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement("div",{className:"googlesitekit-publisher-win__image-large"},e.createElement("img",{alt:"",src:d}))),("win-error"===y||"win-warning"===y)&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("div",{className:"googlesitekit-publisher-win__icons"},W)))))}}]),Notification}(E.Component);T.propTypes={id:k.a.string.isRequired,title:k.a.string.isRequired,description:k.a.node,learnMoreURL:k.a.string,learnMoreDescription:k.a.string,learnMoreLabel:k.a.string,blockData:k.a.array,winImage:k.a.string,smallImage:k.a.string,format:k.a.string,ctaLink:k.a.string,ctaLabel:k.a.string,type:k.a.string,dismiss:k.a.string,isDismissable:k.a.bool,logo:k.a.bool,module:k.a.string,moduleName:k.a.string,pageIndex:k.a.string,dismissExpires:k.a.number,showOnce:k.a.bool,onCTAClick:k.a.func,onDismiss:k.a.func},T.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1},t.a=T}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=function(t){function ProgressBar(){return i()(this,ProgressBar),l()(this,d()(ProgressBar).apply(this,arguments))}return g()(ProgressBar,t),s()(ProgressBar,[{key:"render",value:function(){var t=this.props,a=t.className,n=t.small,i=t.compress,o=t.height,s=o?Math.round(o/2):null;return e.createElement("div",{role:"progressbar",style:{marginTop:s,marginBottom:s},className:b()("mdc-linear-progress","mdc-linear-progress--indeterminate",a,{"mdc-linear-progress--small":n,"mdc-linear-progress--compress":i})},e.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),e.createElement("div",{className:"mdc-linear-progress__buffer"}),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),ProgressBar}(_.Component);f.propTypes={className:p.a.string,small:p.a.bool,compress:p.a.bool},f.defaultProps={className:"",small:!1,compress:!1},t.a=f}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=a(25),y=function(t){function Button(e){var t;return i()(this,Button),(t=l()(this,d()(Button).call(this,e))).buttonRef=Object(_.createRef)(),t}return g()(Button,t),s()(Button,[{key:"componentDidMount",value:function(){new f.h(this.buttonRef.current)}},{key:"render",value:function(){var t=this.props,a=t.onClick,n=t.children,i=t.href,o=t.text,s=t.className,r=t.danger,l=t.disabled,c=t.target,d=t.id,u=t.icon,g=t.trailingIcon,m=t.ariaHaspopup,p=t.ariaExpanded,h=t.ariaControls,_=i&&!l?"a":"button";return e.createElement(_,{className:b()("mdc-button",s,{"mdc-button--raised":!o,"mdc-button--danger":r}),onClick:a,href:l?void 0:i,ref:this.buttonRef,disabled:!!l,target:c||"_self",id:d,"aria-haspopup":m,"aria-expanded":p,"aria-controls":h},u&&u,e.createElement("span",{className:"mdc-button__label"},n),g&&g)}}]),Button}(_.Component);y.propTypes={onClick:p.a.func,children:p.a.string.isRequired,href:p.a.string,text:p.a.bool,className:p.a.string,danger:p.a.bool,disabled:p.a.bool,icon:p.a.element,trailingIcon:p.a.element,ariaHaspopup:p.a.string,ariaExpanded:p.a.bool,ariaControls:p.a.string},y.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=y}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=a(18),y=function(t){function CTA(){return i()(this,CTA),l()(this,d()(CTA).apply(this,arguments))}return g()(CTA,t),s()(CTA,[{key:"render",value:function(){var t=this.props,a=t.title,n=t.description,i=t.ctaLink,o=t.ctaLabel,s=t.error,r=t.onClick;return e.createElement("div",{className:b()("googlesitekit-cta",{"googlesitekit-cta--error":s})},a&&e.createElement("h3",{className:"googlesitekit-cta__title"},a),n&&e.createElement("p",{className:"googlesitekit-cta__description"},n),o&&e.createElement(f.a,{href:i,onClick:r,inverse:!s,caps:!0,arrow:!0},o))}}]),CTA}(_.Component);y.propTypes={title:p.a.string.isRequired,description:p.a.string,ctaLink:p.a.string,ctaLabel:p.a.string,error:p.a.bool,onClick:p.a.func},y.defaultProps={title:"",description:"",ctaLink:"",ctaLabel:"",error:!1,onClick:function(){}},t.a=y}).call(this,a(1))},,function(e,t,a){"use strict";function n(e){return{byContext:function(t){return e.filter((function(e){return e.usageContext.includes(t)}))}}}function i(e){return(parseInt(e)||0)>0}function o(e){return!!e&&e.toString().match(/^GTM-[A-Z0-9]+#x2F;)}a.d(t,"a",(function(){return n})),a.d(t,"b",(function(){return i})),a.d(t,"c",(function(){return o})),a.d(t,"d",(function(){return s}));var s=[/<script[^>]*>[^>]+?www.googletagmanager.com\/gtm[^>]+?['|"](GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtm\.js\?id=(GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/ns.html\?id=(GTM-[0-9A-Z]+)['|"]/,/<amp-analytics [^>]*config=['|"]https:\/\/www.googletagmanager.com\/amp.json\?id=(GTM-[0-9A-Z]+)['|"]/]},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=a(23),y=function(t){function PreviewTable(){return i()(this,PreviewTable),l()(this,d()(PreviewTable).apply(this,arguments))}return g()(PreviewTable,t),s()(PreviewTable,[{key:"render",value:function(){for(var t=this.props,a=t.rows,n=t.rowHeight,i=t.padding,o=[],s=0;a>s;s++)o.push(e.createElement("div",{className:"googlesitekit-preview-table__row",key:"table-row-"+s},e.createElement(f.a,{width:"100%",height:n+"px"})));return e.createElement("div",{className:b()("googlesitekit-preview-table",{"googlesitekit-preview-table--padding":i})},o)}}]),PreviewTable}(_.Component);y.propTypes={rows:p.a.number,rowHeight:p.a.number,padding:p.a.bool},y.defaultProps={rows:11,rowHeight:35,padding:!1},t.a=y}).call(this,a(1))},function(e,t,a){"use strict";a.d(t,"a",(function(){return s})),a.d(t,"b",(function(){return r}));var n=a(13),i=a(2);function o(e){var t=[[{type:"string",label:"Day"},{type:"number",label:"Clicks"},{type:"number",label:"Impressions"},{type:"number",label:"CTR"},{type:"number",label:"Position"}]],a=0,o=0,s=0,r=0,l=e.length;Object(n.each)(e,(function(e){var n=new Date(e.keys[0]);t.push([n.getMonth()+1+"/"+n.getUTCDate(),e.clicks,e.impressions,e.ctr,e.position]),a+=e.clicks,o+=e.impressions,s+=e.ctr,r+=e.position}));var c=a,d=o;a=Object(i.v)(a),o=Object(i.v)(o);var u=(s/l*100).toFixed(1),g=s/l,m=(r/l).toFixed(1);return{dataMap:t,totalClicks:a,totalClicksRaw:c,totalImpressions:o,totalImpressionsRaw:d,averageCTR:u,averageCTRRaw:g,averagePosition:m}}var s=function(e){var t=Math.floor(e.length/2),a=o(e.slice(t)),n=o(e.slice(0,t));return{dataMap:a.dataMap,totalClicks:a.totalClicks,totalImpressions:a.totalImpressions,averageCTR:a.averageCTR,averagePosition:a.averagePosition,totalClicksChange:Object(i.b)(n.totalClicksRaw,a.totalClicksRaw),totalImpressionsChange:Object(i.b)(n.totalImpressionsRaw,a.totalImpressionsRaw),averageCTRChange:Object(i.b)(n.averageCTRRaw,a.averageCTRRaw),averagePositionChange:Object(i.b)(n.averagePosition,a.averagePosition)}},r=function(e){if(!e.length)return!0;var t=s(e),a=t.totalClicks,n=t.totalImpressions,i=t.averageCTR,o=t.averagePosition;return 0===parseInt(a)&&0===parseInt(n)&&0===parseInt(i)&&0===parseInt(o)}},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(1),b=function(t){function DashboardModuleHeader(){return i()(this,DashboardModuleHeader),l()(this,d()(DashboardModuleHeader).apply(this,arguments))}return g()(DashboardModuleHeader,t),s()(DashboardModuleHeader,[{key:"render",value:function(){var t=this.props,a=t.title,n=t.description;return e.createElement("header",{className:"googlesitekit-dashboard-module-header"},e.createElement("div",{className:"mdc-layout-grid__inner"},a&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-module-header__title "},a),n&&e.createElement("p",{className:"googlesitekit-dashboard-module-header__description"},n))))}}]),DashboardModuleHeader}(h.Component);b.propTypes={title:p.a.string,description:p.a.string},b.defaultProps={title:"",description:""},t.a=b}).call(this,a(1))},function(e,t,a){"use strict";(function(e){a.d(t,"e",(function(){return u})),a.d(t,"d",(function(){return g})),a.d(t,"a",(function(){return m})),a.d(t,"b",(function(){return p})),a.d(t,"c",(function(){return h}));var n=a(11),i=a.n(n),o=a(185),s=a(13),r=a(0),l=a(2),c=a(17),d=a(10);function u(e){var t=[[{type:"date",label:"Day"},{type:"number",label:"RPM"},{type:"number",label:"Earnings"},{type:"number",label:"Impressions"}]];return Object(s.each)(e,(function(e){var a=new Date(e[0]);t.push([a,e[2],e[1],e[3]])})),{dataMap:t}}var g=function(t,a){var n,i,s,c,d,u,g,m,p,h,b,_,f,y=!1,k=!1,v=!1,S=!1,O=!1,E=!1,j=Object(l.l)().adsense,D=j.accountURL,C=j.signupURL,w=Object(l.o)("googlesitekit-module-adsense",{}),A=new URL(e.googlesitekit.admin.siteURL);switch(t){case"account-connected":a?(m=!1,g="alert",p=Object(r.__)("Site Kit will place AdSense code to your site","google-site-kit"),h=Object(r.__)("This means Google will automatically place ads for you in all the best places.","google-site-kit"),i=Object(r.__)("Continue","google-site-kit"),n=w,y=!0,b=Object(r.__)("Let Site Kit place code on your site","google-site-kit"),_=Object(r.__)("If you don’t let Site Kit place the code you may not get the best ads experience. You can set this up later on the Site Kit settings page.","google-site-kit"),f=Object(r.__)("If you’ve already set up ads on your site, it may change how they appear. You can customize this later in AdSense.","google-site-kit")):(m=!1,g=!1,p=Object(r.__)("Looks like you’re already using AdSense","google-site-kit"),h=Object(r.__)("Site Kit will place AdSense code on your site to connect your site to AdSense and help you get the most out of ads. This means Google will automatically place ads for you in all the best places.","google-site-kit"),i=Object(r.__)("Continue","google-site-kit"),n=w,E={eventCategory:"adsense_setup",eventName:"complete_adsense_setup"},b=Object(r.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),_=Object(r.__)("If you’ve already got some AdSense code on your site, we recommend you use Site Kit to place code to get the most out of AdSense.","google-site-kit"));break;case"account-connected-nonmatching":m=!1,g=!1,p=Object(r.__)("Your site has code from another AdSense account","google-site-kit"),h=Object(r.__)("We’ve found some AdSense code on your site, but it’s not linked to this AdSense account.","google-site-kit"),S=!1,i=Object(r.__)("Switch Google account","google-site-kit"),n=Object(l.n)("adsense",!0),k={accountStatus:"account-connected",continueText:Object(r.__)("Continue anyway","google-site-kit"),statusHeadline:Object(r.__)("Site Kit will place AdSense code on your site","google-site-kit"),statusMessage:Object(r.__)("To connect your site to your AdSense account, Site Kit will place AdSense code on your site. For a better ads experience, you should remove AdSense code that’s not linked to this AdSense account.","google-site-kit"),profile:!0,ctaLink:w,ctaLinkText:Object(r.__)("Continue","google-site-kit"),continueAction:!1,switchLabel:Object(r.__)("Let Site Kit place code on your site","google-site-kit"),switchOffMessage:Object(r.__)("You can let Site Kit do this later.","google-site-kit")};break;case"ads-display-pending":var x=Object(o.parse)(A.hostname).domain;p=Object(r.__)("Let’s get your site ready for ads","google-site-kit"),h=Object(r.__)("After you’ve finished setting up your account, we’ll let you know when your site is ready to show ads. This usually takes less than a day, but it can sometimes take a bit longer.","google-site-kit"),i=Object(r.__)("Go to your AdSense account to check on your site’s status or to complete setting up","google-site-kit"),n="https://www.google.com/adsense/new/sites?url=".concat(x||A.hostname,"&source=site-kit");break;case"account-pending-review":p=Object(r.__)("We’re getting your site ready for ads","google-site-kit"),h=Object(r.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),i=Object(r.__)("Go to your AdSense account to check on your site’s status","google-site-kit"),n="https://www.google.com/adsense/new/sites?url=".concat(A.hostname,"&source=site-kit"),v=!0;break;case"account-required-action":O=!0;break;case"disapproved-account":n=D,i=Object(r.__)("Go to AdSense to find out how to fix the issue","google-site-kit"),p=Object(r.__)("Your site isn’t ready to show ads yet","google-site-kit"),h=Object(r.__)("You need to fix some things before we can connect Site Kit to your AdSense account.","google-site-kit");break;case"disapproved-account-afc":m=Object(r.__)("There is an AdSense account, but the AFC account is disapproved","google-site-kit"),g="error",p=Object(r.__)("Create Account","google-site-kit"),h=Object(r.__)("Create an AdMob account, then open AdSense and try to upgrade.","google-site-kit"),i=Object(r.__)("Create an AdMob Account","google-site-kit"),n="https://google.com/admob";break;case"no-account":p=Object(r.__)("Create your AdSense account","google-site-kit"),h=Object(r.__)("Site Kit will place AdSense code on every page across your site. This means Google will automatically place ads for you in all the best places.","google-site-kit"),S=!0,i=Object(r.__)("Create AdSense Account","google-site-kit"),n=C,u=Object(r.__)("Already have an AdSense account?","google-site-kit"),s=Object(r.__)("to connect to it","google-site-kit"),c=Object(r.__)("Switch Google account","google-site-kit"),d=Object(l.n)("adsense",!0),E={eventCategory:"adsense_setup",eventName:"create_adsense_account"};break;case"no-account-tag-found":p=Object(r.__)("Looks like you’re already using AdSense","google-site-kit"),h=Object(r.__)("We’ve found some AdSense code on your site, but it’s not linked to this Google account.","google-site-kit"),S=!1,i=Object(r.__)("Switch Google account","google-site-kit"),n=Object(l.n)("adsense",!0),b=Object(r.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),k={statusHeadline:Object(r.__)("Create a new AdSense account","google-site-kit"),statusMessage:Object(r.__)("Site Kit will place additional AdSense code on every page across your site after you create an account. This means Google will automatically place ads for you in all the best places.","google-site-kit"),notice:Object(r.__)("We recommend you remove the old AdSense code from this site.","google-site-kit"),icon:"warning",continueText:Object(r.__)("Continue anyway","google-site-kit"),ctaLinkText:Object(r.__)("Create AdSense Account","google-site-kit"),ctaLink:C,ctaTarget:"_blank",continueAction:!1};break;case"account-connected-no-data":p=Object(r.__)("We’re getting your site ready for ads","google-site-kit"),h=Object(r.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),v=!0}return{accountTagMatch:y,continueAction:k,ctaLink:n,ctaLinkText:i,footerAppendedText:s,footerCTA:c,footerCTALink:d,footerText:u,icon:g,incomplete:v,issue:m,profile:S,required:O,setupComplete:!1,statusHeadline:p,statusMessage:h,switchLabel:b,switchOffMessage:_,switchOnMessage:f,tracking:E}},m=function(){var t,a,n,o,c,u,g,m,p,h,b,_,f,y,k,v,S,O,E,j,D,C,w,A,x,N,P,T,L,M=arguments;return i.a.async((function(I){for(;;)switch(I.prev=I.next){case 0:return t=M.length>0&&void 0!==M[0]&&M[0],a=M.length>1&&void 0!==M[1]?M[1]:function(){},o=!1,I.prev=3,a(Object(r.__)("Locating accounts…","google-site-kit")),I.next=7,i.a.awrap(d.c.get(d.b,"adsense","accounts").then((function(e){return e})).catch((function(e){return e})));case 7:if(c=I.sent,!(1<(u=!c.data||c.data.status&&200!==c.data.status?c:c.data).length)){I.next=42;break}a(Object(r.__)("Searching for domain…","google-site-kit")),g=!0,m=!1,p=void 0,I.prev=14,h=u[Symbol.iterator]();case 16:if(g=(b=h.next()).done){I.next=28;break}return _=b.value,f=_.id,I.next=21,i.a.awrap(d.c.get(d.b,"adsense","urlchannels",{clientID:f}).then((function(e){return e})).catch((function(e){return e})));case 21:y=I.sent,k=new URL(e.googlesitekit.admin.siteURL),(v=y&&y.length?Object(s.filter)(y,{urlPattern:k.hostname}):[])&&0!==v.length?(O=v[0].id,Object(l.B)("adsense_setup","adsense_account_detected")):(n="account-pending-review",Object(l.B)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"));case 25:g=!0,I.next=16;break;case 28:I.next=34;break;case 30:I.prev=30,I.t0=I.catch(14),m=!0,p=I.t0;case 34:I.prev=34,I.prev=35,g||null==h.return||h.return();case 37:if(I.prev=37,!m){I.next=40;break}throw p;case 40:return I.finish(37);case 41:return I.finish(34);case 42:if(S=u&&u.message&&u.message.error,O=!!(u&&u.length&&u[0])&&u[0].id,u&&O&&!S){I.next=50;break}E=(S||{}).errors,"noAdSenseAccount"!==(j=E[0].reason)&&u&&O||(n="disapprovedAccount"===j?"disapproved-account":t?"no-account-tag-found":"no-account"),I.next=118;break;case 50:return Object(l.l)().adsense.accountURL=Object(r.sprintf)("https://www.google.com/adsense/new/%s/home",O),a(Object(r.__)("Account found, checking account status…","google-site-kit")),I.next=54,i.a.awrap(d.c.get(d.b,"adsense","alerts",{accountID:O}).then((function(e){return e})).catch((function(e){return e})));case 54:if(D=I.sent,C=!D.data||D.data.status&&200!==D.data.status?D:D.data,w=C&&C.message&&C.message.error,!Object(s.find)(D,{type:"GRAYLISTED_PUBLISHER"})){I.next=62;break}n="ads-display-pending",Object(l.B)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),I.next=118;break;case 62:return I.next=64,i.a.awrap(d.c.get(d.b,"adsense","clients").then((function(e){return e})).catch((function(e){return e})));case 64:if(A=I.sent,x=!A.data||A.data.status&&200!==A.data.status?A:A.data,N=x&&x.message&&x.message.error,!(P=!(!x||!x.length)&&Object(s.find)(x,{productCode:"AFC"}))){I.next=72;break}return o=P.id,I.next=72,i.a.awrap(d.c.set(d.b,"adsense","client-id",{clientID:o}).then((function(e){return e})).catch((function(e){return e})));case 72:if(!w){I.next=77;break}"accountPendingReview"===C.message.error.errors[0].reason&&(n="ads-display-pending",Object(l.B)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending")),I.next=118;break;case 77:if(a(Object(r.__)("Looking for AdSense client…","google-site-kit")),!N){I.next=83;break}n="account-required-action",Object(l.B)("adsense_setup","adsense_required_action","accountRequiredAction status"),I.next=118;break;case 83:if(!P){I.next=117;break}return o=P.id,a(Object(r.__)("Looking for site domain…","google-site-kit")),I.next=88,i.a.awrap(d.c.get(d.b,"adsense","urlchannels",{clientID:o}).then((function(e){return e})).catch((function(e){return e})));case 88:if(T=I.sent,L=T&&T.length&&Object(s.filter)(T,(function(t){return 0<e.googlesitekit.admin.siteURL.indexOf(t.urlPattern)})),0!==T.length){I.next=95;break}n="ads-display-pending",Object(l.B)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),I.next=115;break;case 95:if(L&&0!==L.length){I.next=100;break}n="account-pending-review",Object(l.B)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"),I.next=115;break;case 100:if(!t||o!==t){I.next=105;break}n="account-connected",Object(l.B)("adsense_setup","adsense_account_connected","existing_matching_tag"),I.next=115;break;case 105:if(!t||o===t){I.next=110;break}n="account-connected-nonmatching",Object(l.B)("adsense_setup","adsense_account_connected","existing_non_matching_tag"),I.next=115;break;case 110:return n="account-connected",a(Object(r.__)("Connecting…","google-site-kit")),Object(l.B)("adsense_setup","adsense_account_connected"),I.next=115,i.a.awrap(d.c.set(d.b,"adsense","setup-complete",{clientID:o}).then((function(e){return e})).catch((function(e){return e})));case 115:I.next=118;break;case 117:n="disapproved-account-afc";case 118:return I.next=120,i.a.awrap(d.c.set(d.b,"adsense","account-status",{accountStatus:n}).then((function(e){return e})).catch((function(e){return e})));case 120:return I.abrupt("return",{accountStatus:n,clientID:o});case 123:return I.prev=123,I.t1=I.catch(3),I.abrupt("return",{isLoading:!1,error:I.t1.code,message:I.t1.message});case 126:case"end":return I.stop()}}),null,null,[[3,123],[14,30,34,42],[35,,37,41]])},p=function(){var e,t,a,n;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=Object(l.l)(),t=e.adsense.active,a=e.analytics.active,n=!0,!t||!a){o.next=7;break}return o.next=7,i.a.awrap(d.c.get(d.b,"analytics","report",c.a).then((function(e){e&&(n=!0)})).catch((function(e){400===e.code&&"INVALID_ARGUMENT"===e.message&&(n=!1)})));case 7:return o.abrupt("return",new Promise((function(e){e(n)})));case 8:case"end":return o.stop()}}))},h=function(e,t,a){if(!a.data||!a.data.dateRange||"last-28-days"!==a.data.dateRange)return!1;var n=[];return e.totals&&(n=e.totals),0===(n=n.filter((function(e){return 0<e}))).length}}).call(this,a(16))},function(e,t,a){"use strict";(function(e){var n=a(0),i=a(2),o=a(32),s=a(68),r=a(130);t.a=function(t,a){var l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=arguments.length>4&&void 0!==arguments[4]&&arguments[4],u=e.createElement(o.a
5
- /* translators: %s: module name */,{title:Object(n.sprintf)(Object(n.__)("Data error in %s","google-site-kit"),t),description:a,error:!0});return"Invalid Credentials"===a&&Object(i.y)(r.a),Object(s.a)(u,l,c,d)}}).call(this,a(1))},,function(e,t,a){"use strict";(function(e){var n=a(28),i=a.n(n),o=e._googlesitekitAPIFetchData||{},s=o.nonce,r=o.nonceEndpoint,l=o.preloadedData,c=o.rootURL;i.a.nonceEndpoint=r,i.a.nonceMiddleware=i.a.createNonceMiddleware(s),i.a.rootURLMiddleware=i.a.createRootURLMiddleware(c),i.a.preloadingMiddleware=i.a.createPreloadingMiddleware(l),i.a.use(i.a.nonceMiddleware),i.a.use(i.a.mediaUploadMiddleware),i.a.use(i.a.rootURLMiddleware),i.a.use(i.a.preloadingMiddleware),t.default=i.a}).call(this,a(16))},,function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(189),b=a(1),_=a(47),f=function(t){function Sparkline(){return i()(this,Sparkline),l()(this,d()(Sparkline).apply(this,arguments))}return g()(Sparkline,t),s()(Sparkline,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.change,i=t.instanceId,o=t.invertChangeColor,s=t.loadSmall,r=t.loadCompressed,l=t.loadHeight,c=t.loadText;if(!a)return"loading...";var d=o?"red":"green",u=o?"green":"red",g={title:"",backgroundColor:"transparent",curveType:"line",width:"100%",height:"50",enableInteractivity:!1,chartArea:{height:"100%",width:"100%"},legend:{position:"none"},axisFontSize:0,hAxis:{baselineColor:"none",ticks:[]},vAxis:{baselineColor:"none",ticks:[]},axes:[],colors:[0<=(parseFloat(n)||0)?d:u]};return e.createElement("div",{className:"googlesitekit-analytics-sparkline-chart-wrap"},e.createElement(_.a,{data:a,options:g,id:"googlesitekit-sparkline-".concat(i),loadSmall:s,loadCompressed:r,loadHeight:l,loadText:c}))}}]),Sparkline}(b.Component);f.propTypes={instanceId:p.a.number.isRequired,invertChangeColor:p.a.bool,loadSmall:p.a.bool,loadCompressed:p.a.bool,loadHeight:p.a.number,loadText:p.a.bool},f.defaultProps={invertChangeColor:!1,loadSmall:!0,loadCompressed:!0,loadHeight:46,loadText:!1},t.a=Object(h.a)(f)}).call(this,a(1))},,,function(e,t,a){"use strict";(function(e){var n=a(0),i=a(32),o=a(68);t.a=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],s=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=arguments.length>3&&void 0!==arguments[3]&&arguments[3],l=e.createElement(i.a
6
- /* translators: %s: Module name */,{title:Object(n.sprintf)(Object(n.__)("%s Gathering Data","google-site-kit"),t)
7
- /* translators: %s: Module name */,description:Object(n.sprintf)(Object(n.__)("%s data is not yet available, please check back later.","google-site-kit"),t)});return Object(o.a)(l,a,s,r)}}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i,o=a(5),s=a.n(o),r=a(6),l=a.n(r),c=a(7),d=a.n(c),u=a(8),g=a.n(u),m=a(15),p=a.n(m),h=a(9),b=a.n(h),_=a(11),f=a.n(_),y=a(3),k=a.n(y),v=a(0),S=a(1),O=a(13),E=a(30);function j(){var t;return f.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(!i){a.next=2;break}return a.abrupt("return",i);case 2:return e.google&&e.google.charts?i=Promise.resolve():((t=document.createElement("script")).type="text/javascript",i=new Promise((function(a){t.onload=a,e.document.head.appendChild(t),t.src="https://www.gstatic.com/charts/loader.js"}))),a.abrupt("return",i);case 4:case"end":return a.stop()}}))}var D=function(t){function GoogleChart(e){var t;return s()(this,GoogleChart),(t=d()(this,g()(GoogleChart).call(this,e))).state={loading:!0,chart:null},t.onChartsLoad=t.onChartsLoad.bind(p()(t)),t.waitForChart=t.waitForChart.bind(p()(t)),t.getData=t.getData.bind(p()(t)),t.prepareChart=t.prepareChart.bind(p()(t)),t.drawChart=t.drawChart.bind(p()(t)),t.updateChart=t.updateChart.bind(p()(t)),t.chartRef=Object(S.createRef)(),t.resize=Object(O.debounce)(t.drawChart,100),t}return b()(GoogleChart,t),l()(GoogleChart,[{key:"onChartsLoad",value:function(){this.getData(),this.prepareChart(),this.drawChart(),this.setState({loading:!1})}},{key:"componentDidMount",value:function(){return f.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,f.a.awrap(j());case 2:e.google.charts.load("current",{packages:["corechart"]}),e.google.charts.setOnLoadCallback(this.onChartsLoad),e.addEventListener("resize",this.resize);case 5:case"end":return t.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(e){var t=this.props.selectedStats;0!==t.length&&JSON.stringify(t)!==JSON.stringify(e.selectedStats)&&this.updateChart()}},{key:"componentWillUnmount",value:function(){e.removeEventListener("resize",this.resize)}},{key:"waitForChart",value:function(e){setTimeout((function(){e()}),500)}},{key:"getData",value:function(){return e.google&&e.google.visualization&&e.google.visualization.arrayToDataTable(this.props.data)}},{key:"prepareChart",value:function(){var t=this.chartRef.current;if(e.google&&t){var a="pie"===this.props.chartType?new e.google.visualization.PieChart(t):new e.google.visualization.LineChart(t);this.setState({chart:a})}else this.waitForChart(this.prepareChart)}},{key:"drawChart",value:function(){var e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=this.getData();null!==i&&null!==e?(e.draw(i,n),0!==a.length&&this.updateChart()):this.waitForChart(this.drawChart)}},{key:"updateChart",value:function(){var t=this.state.chart,a=this.props,n=a.selectedStats,i=a.options,o=a.singleStat,s=this.getData();if(null!==s&&null!==t){var r=new e.google.visualization.DataView(s);if(!o){var l=[0];l=l.concat(n.map((function(e){return e+1}))),r.setColumns(l)}t.draw(r,i)}else this.waitForChart(this.drawChart)}},{key:"render",value:function(){var e=this.state.loading,t=this.props,a=t.className,i=t.loadSmall,o=t.loadCompressed,s=t.loadHeight,r=t.loadText;return n.createElement("div",{className:"googlesitekit-graph-wrapper"},n.createElement("div",{ref:this.chartRef,className:"googlesitekit-line-chart"},n.createElement("div",{className:"googlesitekit-chart-loading"},e&&n.createElement("div",{className:"googlesitekit-chart-loading__wrapper"},r&&n.createElement("p",null,Object(v.__)("Loading chart...","google-site-kit")),n.createElement(E.a,{className:a,small:i,compress:o,height:s})))))}}]),GoogleChart}(S.Component);D.propTypes={selectedStats:k.a.array,options:k.a.object.isRequired,id:k.a.string,singleStat:k.a.bool,className:k.a.string,loadSmall:k.a.bool,loadCompressed:k.a.bool,loadHeight:k.a.number,loadText:k.a.bool},D.defaultProps={selectedStats:[],id:"",singleStat:!0,className:"",loadSmall:!1,loadCompressed:!1,loadHeight:null,loadText:!0},t.a=D}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=a(0),y=a(18),k=function(t){function SourceLink(){return i()(this,SourceLink),l()(this,d()(SourceLink).apply(this,arguments))}return g()(SourceLink,t),s()(SourceLink,[{key:"render",value:function(){var t=this.props,a=t.name,n=t.href,i=t.className,o=t.external;return e.createElement("div",{className:b()("googlesitekit-source-link",i)},[Object(f.__)("Source:","google-site-kit")," ",e.createElement(y.a,{key:"link",href:n,external:o,inherit:!0},a)])}}]),SourceLink}(_.Component);k.propTypes={name:p.a.string,href:p.a.string,className:p.a.string,external:p.a.bool},k.defaultProps={name:"",href:"",className:"",external:!1},t.a=k}).call(this,a(1))},,,,,function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(14),p=a.n(m),h=a(3),b=a.n(h),_=a(1),f=a(12),y=a(24),k=a(109),v=function(t){function PageHeader(){return i()(this,PageHeader),l()(this,d()(PageHeader).apply(this,arguments))}return g()(PageHeader,t),s()(PageHeader,[{key:"render",value:function(){var t=this.props,a=t.title,n=t.icon,i=t.iconWidth,o=t.iconHeight,s=t.iconID,r=t.className,l=t.status,c=t.statusText,d=t.fullWidth?"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t":"\n\t\t\tmdc-layout-grid__cell\n\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t",u=Object(f.c)("googlesitekit.showDateRangeSelector-".concat(s),!1),g=!(""===l&&!u);return e.createElement("header",{className:"googlesitekit-page-header"},e.createElement("div",{className:"mdc-layout-grid__inner"},a&&e.createElement("div",{className:d},n&&e.createElement(y.a,{id:s,height:o,width:i,className:"googlesitekit-page-header__icon"}),e.createElement("h1",{className:p()("googlesitekit-page-header__title",r)},a)),g&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--align-right-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement("div",{className:"googlesitekit-page-header__details"},l&&e.createElement("span",{className:p()("googlesitekit-page-header__status","googlesitekit-page-header__status--".concat(l))},c),u&&e.createElement("span",{className:"googlesitekit-page-header__range"},e.createElement(k.a,null))))))}}]),PageHeader}(_.Component);v.propTypes={title:b.a.string,icon:b.a.bool,iconID:b.a.string,iconWidth:b.a.string,iconHeight:b.a.string,className:b.a.string,status:b.a.string,statusText:b.a.string,fullWidth:b.a.bool},v.defaultProps={title:"",icon:!1,iconID:"",iconWidth:"",iconHeight:"",className:"googlesitekit-heading-3",status:"",statusText:"",fullWidth:!1},t.a=v}).call(this,a(1))},,function(e,t,a){"use strict";(function(e){var n=a(0),i=a(18);t.a=function HelpLink(){var t=Object(n.__)("Need help?","google-site-kit");return e.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},t)}}).call(this,a(1))},,function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(29),h=function(t){function GenericError(){return i()(this,GenericError),l()(this,d()(GenericError).apply(this,arguments))}return g()(GenericError,t),s()(GenericError,[{key:"render",value:function(){return e.createElement(p.a,this.props)}}]),GenericError}(m.Component);t.a=h}).call(this,a(1))},function(e,t,a){"use strict";var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(51),p=a(1),h=function(e){function ModuleSettingsWarning(){return i()(this,ModuleSettingsWarning),l()(this,d()(ModuleSettingsWarning).apply(this,arguments))}return g()(ModuleSettingsWarning,e),s()(ModuleSettingsWarning,[{key:"render",value:function(){return null}}]),ModuleSettingsWarning}(p.Component);t.a=Object(m.a)("googlesitekit.ModuleSettingsWarning")(h)},function(e,t,a){"use strict";a.d(t,"a",(function(){return i}));var n=a(93),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{__html:n.a.sanitize(e,t)}}},function(e,t,a){"use strict";(function(e){t.a=function Warning(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#F9BB2D",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"warning-title warning-desc"},e.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),e.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))}}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=a(25),y=function(t){function Switch(e){var t;return i()(this,Switch),(t=l()(this,d()(Switch).call(this,e))).switchRef=Object(_.createRef)(),t}return g()(Switch,t),s()(Switch,[{key:"componentDidMount",value:function(){new f.i(this.switchRef.current)}},{key:"render",value:function(){var t=this.props,a=t.id,n=t.onClick,i=t.label,o=t.checked,s=t.hideLabel;return e.createElement(_.Fragment,null,e.createElement("div",{"aria-checked":o?"true":"false",className:b()("mdc-switch",{"mdc-switch--checked":o}),onClick:n,onKeyPress:function(e){"function"==typeof n&&"Enter"===e.code&&n(e)},role:"switch",ref:this.switchRef,tabIndex:0},e.createElement("div",{className:"mdc-switch__track"}," "),e.createElement("div",{className:"mdc-switch__thumb-underlay"},e.createElement("div",{className:"mdc-switch__thumb"},e.createElement("input",{type:"checkbox",id:a,className:"mdc-switch__native-control",role:"switch",checked:o,onChange:function(){}})))),e.createElement("label",{className:b()({"screen-reader-only":s}),htmlFor:a},i))}}]),Switch}(_.Component);y.propTypes={id:p.a.string.isRequired,onClick:p.a.func,label:p.a.string.isRequired,checked:p.a.bool,hideLabel:p.a.bool},y.defaultProps={checked:!1,hideLabel:!0},t.a=y}).call(this,a(1))},function(e,t,a){"use strict";(function(e){a.d(t,"d",(function(){return o})),a.d(t,"b",(function(){return s})),a.d(t,"c",(function(){return r})),a.d(t,"a",(function(){return l}));var n=a(0);function i(e){return.9<=e?"fast":.5<=e?"average":"slow"}var o=function(e){var t=i(e);return"fast"===t?Object(n.__)("Fast","google-site-kit"):"average"===t?Object(n.__)("Average","google-site-kit"):Object(n.__)("Slow","google-site-kit")},s=function PageSpeedReportScoreCategoryWrapper(t){var a=t.score,n=t.children,o="googlesitekit-pagespeed-report__score-category-wrapper googlesitekit-pagespeed-report__score-category-wrapper--".concat(i(a)),s="googlesitekit-pagespeed-report__score-icon googlesitekit-pagespeed-report__score-icon--".concat(i(a));return e.createElement("span",{className:o},n," ",e.createElement("span",{className:s}))},r=function PageSpeedReportScoreGauge(t){var a=t.score,o=parseInt(100*a,10),s="\n\t\tgooglesitekit-percentage-circle\n\t\tgooglesitekit-percentage-circle--".concat(i(a),"\n\t\tgooglesitekit-percentage-circle--percent-").concat(o,"\n\t");return e.createElement("div",{className:"googlesitekit-pagespeed-report__score-gauge"},e.createElement("div",{className:s},e.createElement("div",{className:"googlesitekit-percentage-circle__text"},o),e.createElement("div",{className:"googlesitekit-percentage-circle__slice"},e.createElement("div",{className:"googlesitekit-percentage-circle__bar"}),e.createElement("div",{className:"googlesitekit-percentage-circle__fill"}))),e.createElement("span",{className:"googlesitekit-pagespeed-report__score-gauge-label screen-reader-only"},Object(n.__)("Performance","google-site-kit")))},l=function PageSpeedReportScale(){return e.createElement("div",{className:"googlesitekit-pagespeed-report__scale"},e.createElement("span",null,Object(n.__)("Scale:","google-site-kit")),e.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--fast"},Object(n.__)("90-100 (fast)","google-site-kit")),e.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--average"},Object(n.__)("50-89 (average)","google-site-kit")),e.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--slow"},Object(n.__)("0-49 (slow)","google-site-kit")))}}).call(this,a(1))},,,function(e,t,a){"use strict";(function(e,n){var i=a(11),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(3),_=a.n(b),f=a(1),y=a(0),k=a(2),v=a(10),S=a(32),O=a(57),E=function(t){function AnalyticsInactiveCTA(){return r()(this,AnalyticsInactiveCTA),u()(this,m()(AnalyticsInactiveCTA).apply(this,arguments))}return h()(AnalyticsInactiveCTA,t),c()(AnalyticsInactiveCTA,[{key:"render",value:function(){var t=this.props,a=t.title,i=void 0===a?Object(y.__)("Learn more about what visitors do on your site.","google-site-kit"):a,o=t.description,s=void 0===o?Object(y.__)("Connecting with Google Analytics to see unique vistors, goal completions, top pages and more.","google-site-kit"):o,r=t.ctaLabel,l=void 0===r?Object(y.__)("Set up Analytics","google-site-kit"):r;return e.googlesitekit.permissions.canManageOptions?n.createElement(S.a,{title:i,description:s,onClick:AnalyticsInactiveCTA.setupAnalyticsClick,ctaLabel:l}):null}}],[{key:"setupAnalyticsClick",value:function(){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.a.awrap(Object(k.a)(v.c,"analytics",!0));case 3:return t.next=5,o.a.awrap(Object(k.w)());case 5:e.location=Object(k.n)("analytics",!0),t.next=11;break;case 8:t.prev=8,t.t0=t.catch(0),Object(k.y)(O.a,{id:"analytics-setup-error",title:Object(y.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"});case 11:case"end":return t.stop()}}),null,null,[[0,8]])}}]),AnalyticsInactiveCTA}(f.Component);E.propTypes={title:_.a.string,description:_.a.string,ctaLabel:_.a.string},E.defaultProps={},t.a=E}).call(this,a(16),a(1))},,function(e,t,a){"use strict";(function(e,n){var i=a(0),o=a(29);t.a=function DashboardAuthAlert(){var t=e.googlesitekit.admin.connectURL;return n.createElement(o.a,{id:"authentication error",title:Object(i.__)("Issue accessing data","google-site-kit"),description:Object(i.__)("You need to reauthenticate your Google account.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0,ctaLink:t,ctaLabel:Object(i.__)("Click here","google-site-kit")})}}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(1),i=a(21);t.a=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],o=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return e.createElement(n.Fragment,null,a&&o&&s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(i.a,{fill:!0},e.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},t))))),a&&!o&&s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(i.a,{fill:!0},e.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},t))))),a&&o&&!s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},t),a&&!o&&!s&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},t),!a&&!o&&s&&e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},t))),!a&&!o&&!s&&t)}}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(11),i=a.n(n),o=a(5),s=a.n(o),r=a(6),l=a.n(r),c=a(7),d=a.n(c),u=a(8),g=a.n(u),m=a(9),p=a.n(m),h=a(3),b=a.n(h),_=a(0),f=a(1),y=a(10),k=a(29),v=function(t){function Alert(e){var t;return s()(this,Alert),(t=d()(this,g()(Alert).call(this,e))).state={isLoading:!0,alerts:[],error:!1,message:""},t}return p()(Alert,t),l()(Alert,[{key:"componentDidMount",value:function(){this.getAlert()}},{key:"getAlert",value:function(){var e,t;return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.props.module,a.next=4,i.a.awrap(y.c.get(y.b,e,"notifications",{},!1));case 4:t=a.sent,this.setState({isLoading:!1,error:!1,alerts:t}),a.next=11;break;case 8:a.prev=8,a.t0=a.catch(0),this.setState({isLoading:!1,error:a.t0.code});case 11:case"end":return a.stop()}}),null,this,[[0,8]])}},{key:"render",value:function(){var t=this.state,a=t.alerts,n=t.error,i=t.isLoading;if(n||i||!a||!a.length)return null;var o=a.map((function(t){return e.createElement(k.a,{id:t.id,key:t.id,title:t.title,description:t.message||t.description,dismiss:Object(_.__)("Dismiss","google-site-kit"),isDismissable:t.isDismissible,format:"small",ctaLink:t.ctaURL,ctaLabel:t.ctaLabel,ctaTarget:t.ctaTarget,type:t.severity})}));return e.createElement(f.Fragment,null,o)}}]),Alert}(f.Component);v.propTypes={module:b.a.string.isRequired},t.a=v}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(3),_=a.n(b),f=a(1),y=a(0),k=a(2),v=a(47),S=a(19),O=a(10),E=a(18),j=a(23),D=a(17);function C(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var w=function(t){function DashboardAcquisitionPieChart(){return r()(this,DashboardAcquisitionPieChart),u()(this,m()(DashboardAcquisitionPieChart).apply(this,arguments))}return h()(DashboardAcquisitionPieChart,t),c()(DashboardAcquisitionPieChart,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.source;if(!a||a.error||!a.length)return null;var i=Object(D.e)(a);return e.createElement("div",{className:"googlesitekit-chart googlesitekit-chart--pie"},e.createElement(v.a,{data:i,options:{chartArea:{width:"100%",height:"100%"},backgroundColor:"transparent",height:250,legend:{alignment:"center",textStyle:{color:"#5b5b61",fontSize:12}},slices:{0:{color:"#178EC5"},1:{color:"#54B23B"},2:{color:"#EB5729"},3:{color:"#ECED33"},4:{color:"#34CBE3"},5:{color:"#82E88E"}},title:null,width:"100%"},chartType:"pie",id:"overview-piechart",loadHeight:205}),n&&e.createElement("div",{className:"googlesitekit-chart__source"},[Object(y.__)("Source:","google-site-kit")," ",e.createElement(E.a,{key:"link",href:Object(k.o)("googlesitekit-module-analytics"),inherit:!0},Object(y._x)("Analytics","Service name","google-site-kit"))]))}}]),DashboardAcquisitionPieChart}(f.Component);w.defaultProps={source:!1},w.propTypes={source:_.a.bool},t.a=Object(S.a)(w,[{type:O.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?C(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):C(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},D.k,{url:n.googlesitekit.permaLink}),priority:1,maxAge:Object(k.q)("day"),context:["Dashboard","Single"]}],e.createElement(j.a,{width:"282px",height:"282px",shape:"circular"}),{},D.h,D.f)}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){t.a=function Error(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#EA4336",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"error-title error-desc"},e.createElement("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z"}))}}).call(this,a(1))},,,,,,,,function(e,t,a){"use strict";(function(e,n){a.d(t,"b",(function(){return C})),a.d(t,"a",(function(){return A}));var i=a(73),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(11),_=a.n(b),f=a(1),y=a(0),k=a(3),v=a.n(k),S=a(60),O=a(30),E=a(2),j=a(10),D=a(18),C=[/<meta name="googlesitekit-setup" content="([a-z0-9-]+)"/],w=[function(){var t;return _.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(t=e.location.hostname,!["localhost","127.0.0.1"].includes(t)&&!t.match(/\.(example|invalid|localhost|test)#x2F;)){a.next=3;break}throw"invalid_hostname";case 3:case"end":return a.stop()}}))},function(){var e,t,a;return _.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,_.a.awrap(j.c.set(j.a,"site","setup-tag"));case 2:return e=n.sent,t=e.token,n.next=6,_.a.awrap(Object(E.j)("setup").catch((function(){throw"tag_fetch_failed"})));case 6:if(a=n.sent,t===a){n.next=9;break}throw"setup_token_mismatch";case 9:case"end":return n.stop()}}))}],A=function(t){function CompatibilityChecks(t){var a;r()(this,CompatibilityChecks);var n=e.googlesitekit.setup.isSiteKitConnected;return(a=u()(this,m()(CompatibilityChecks).call(this,t))).state={complete:n,error:null,developerPlugin:{}},a}return h()(CompatibilityChecks,t),c()(CompatibilityChecks,[{key:"componentDidMount",value:function(){var e,t,a,n;return _.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.state.complete){i.next=2;break}return i.abrupt("return");case 2:i.prev=2,e=0,t=w;case 4:if(!(e<t.length)){i.next=11;break}return a=t[e],i.next=8,_.a.awrap(a());case 8:e++,i.next=4;break;case 11:i.next=19;break;case 13:return i.prev=13,i.t0=i.catch(2),i.next=17,_.a.awrap(j.c.get(j.a,"site","developer-plugin"));case 17:n=i.sent,this.setState({error:i.t0,developerPlugin:n});case 19:this.setState({complete:!0});case 20:case"end":return i.stop()}}),null,this,[[2,13]])}},{key:"helperCTA",value:function(){var e=this.state.developerPlugin,t=e.installed,a=e.active,n=e.installURL,i=e.activateURL,o=e.configureURL;return!t&&n?{labelHTML:Object(y.__)('Install<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:n,external:!1}:t&&!a&&i?{labelHTML:Object(y.__)('Activate<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:i,external:!1}:t&&a&&o?{labelHTML:Object(y.__)('Configure<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:o,external:!1}:{labelHTML:Object(y.__)('Learn how<span class="screen-reader-text"> to install and use the helper plugin</span>',"google-site-kit"),href:"https://sitekit.withgoogle.com/documentation/using-site-kit-on-a-staging-environment/",external:!0}}},{key:"renderError",value:function(e){var t=this.state.developerPlugin.installed,a=this.helperCTA(),i=a.labelHTML,o=a.href,s=a.external;switch(e){case"invalid_hostname":case"tag_fetch_failed":return n.createElement(f.Fragment,null,!t&&Object(y.__)("Looks like this may be a staging environment. If so, you’ll need to install a helper plugin and verify your production site in Search Console.","google-site-kit"),t&&Object(y.__)("Looks like this may be a staging environment and you already have the helper plugin. Before you can use Site Kit, please make sure you’ve provided the necessary credentials in the Authentication section and verified your production site in Search Console.","google-site-kit")," ",n.createElement(D.a,{href:o,dangerouslySetInnerHTML:{__html:i},external:s,inherit:!0}));case"setup_token_mismatch":return Object(y.__)("Looks like you may be using a caching plugin which could interfere with setup. Please deactivate any caching plugins before setting up Site Kit. You may reactivate them once setup has been completed.","google-site-kit")}}},{key:"render",value:function(){var e,t,a=this.state,i=a.complete,s=a.error,r=this.props,l=r.children,c=o()(r,["children"]);return s&&(e=n.createElement(f.Fragment,null,n.createElement("div",{className:"googlesitekit-setup-compat mdc-layout-grid mdc-layout-grid--align-left"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement(S.a,null),n.createElement("div",{className:"googlesitekit-heading-4 mdc-layout-grid__cell--span-11"},Object(y.__)("Your site may not be ready for Site Kit","google-site-kit"))),n.createElement("p",null,this.renderError(s))))),i||(t=n.createElement("div",{style:{alignSelf:"center",marginLeft:"1rem"}},n.createElement("small",null,Object(y.__)("Checking Compatibility...","google-site-kit")),n.createElement(O.a,{small:!0,compress:!0}))),l({restProps:c,complete:i,error:s,inProgressFeedback:t,CTAFeedback:e})}}]),CompatibilityChecks}(f.Component);A.propTypes={children:v.a.func.isRequired}}).call(this,a(16),a(1))},,function(e,t,a){"use strict";(function(e,n){var i=a(0),o=a(2),s=a(32),r=a(68);t.a=function(t){var a=arguments.length>1&&void 0!==arguments[1]&&arguments[1],l=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],d=Object(o.l)()[t].name,u=e.createElement(s.a
8
- /* translators: %s: Module name */,{title:Object(i.sprintf)(Object(i.__)("%s activation","google-site-kit"),d)
9
- /* translators: %s: Module name */,description:Object(i.sprintf)(Object(i.__)("%s module needs to be configured","google-site-kit"),d),ctaLabel:Object(i.__)("Complete activation","google-site-kit"),onClick:function(){n.location=Object(o.n)(t,!0)}});return Object(r.a)(u,a,l,c)}}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(0),h=a(2),b=a(24),_=a(31),f=function(t){function AdSenseDashboardOutro(){return i()(this,AdSenseDashboardOutro),l()(this,d()(AdSenseDashboardOutro).apply(this,arguments))}return g()(AdSenseDashboardOutro,t),s()(AdSenseDashboardOutro,[{key:"render",value:function(){var t=Object(h.l)().adsense.accountURL;return e.createElement("section",{className:"googlesitekit-module-outro"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("div",{className:"googlesitekit-module-outro__logo"},e.createElement(b.a,{id:"adsense",height:"36",width:"42"}),e.createElement(b.a,{id:"plus",height:"13",width:"13"}),e.createElement(b.a,{id:"analytics",height:"36",width:"34"})),e.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-module-outro__title "},Object(p.__)("Connect Analytics with AdSense to create a powerful team that shows robust metrics for your site.","google-site-kit")),e.createElement("div",{className:"googlesitekit-module-outro__button"},e.createElement(_.a,{href:t,target:"_blank"},Object(p.__)("Connect Accounts","google-site-kit")))))))}}]),AdSenseDashboardOutro}(m.Component);t.a=f}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(1),h=a(0),b=a(18),_=a(71),f=a(30),y=function(t){function AdSenseInProcessStatus(){return o()(this,AdSenseInProcessStatus),c()(this,u()(AdSenseInProcessStatus).apply(this,arguments))}return m()(AdSenseInProcessStatus,t),r()(AdSenseInProcessStatus,[{key:"render",value:function(){var t=this.props,a=t.ctaLink,i=t.ctaLinkText,o=t.header,s=t.incomplete,r=t.loadingMessage,l=t.subHeader,c=t.required,d=new URL(e.googlesitekit.admin.siteURL),u="https://www.google.com/adsense/new/sites?url=".concat(d.hostname,"&source=site-kit"),g=[{id:1,
10
- /* translators: %s: Site URL */
11
- text:Object(h.sprintf)(Object(h.__)("Added your site %s in ","google-site-kit"),d.hostname),linkText:Object(h.__)("Sites","google-site-kit"),linkURL:u},{id:2,text:Object(h.__)("Enabled ads in","google-site-kit"),linkText:Object(h.__)("Ads","google-site-kit"),linkURL:"https://www.google.com/adsense/new/myads/auto-ads"}];return n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},c&&n.createElement(_.a,null),r&&n.createElement(p.Fragment,null,r,n.createElement(f.a,null)),o&&n.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},o),l&&n.createElement("p",null,l),s&&n.createElement("div",{className:"googlesitekit-setup-module__list-wrapper"},n.createElement("ol",{className:"googlesitekit-setup-module__list"},g.map((function(e){return n.createElement("li",{className:"googlesitekit-setup-module__list-item",key:e.id},e.text," ",n.createElement(b.a,{href:e.linkURL,external:!0,inherit:!0},e.linkText))})))),a&&i&&n.createElement("div",{className:"googlesitekit-setup-module__cta"},n.createElement(b.a,{className:"googlesitekit-setup-module__cta-link",href:a,external:!0},i)))}}]),AdSenseInProcessStatus}(p.Component);t.a=y}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(15),g=a.n(u),m=a(9),p=a.n(m),h=a(3),b=a.n(h),_=a(1),f=a(0),y=a(12),k=a(2),v=a(61),S=a(10),O=function(t){function AdSenseSettings(e){var t;i()(this,AdSenseSettings),t=l()(this,d()(AdSenseSettings).call(this,e));var a=Object(k.l)().adsense.settings.useSnippet,n=void 0===a||a;return t.state={useSnippet:!!n,disabled:!1},t.handleUseSnippetSwitch=t.handleUseSnippetSwitch.bind(g()(t)),t}return p()(AdSenseSettings,t),s()(AdSenseSettings,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(y.b)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed",(function(t,a){return"adsense"!==a.replace("-module","")?t:e.save()})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(y.f)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"save",value:function(){var e=Object(k.l)(),t=this.state.useSnippet;this._isMounted&&this.setState({useSnippet:t});var a={useSnippet:t||!1};return e.adsense.settings&&(e.adsense.settings.useSnippet=t),S.c.set(S.b,"adsense","use-snippet",a).then((function(e){return e})).catch((function(e){return e}))}},{key:"handleUseSnippetSwitch",value:function(){var e=this.props.saveOnChange,t=this.state.useSnippet;t=!t,this._isMounted&&this.setState({useSnippet:t}),Object(k.B)("adsense_setup",t?"adsense_tag_enabled":"adsense_tag_disabled"),e&&S.c.set(S.b,"adsense","use-snippet",{useSnippet:t}).then((function(e){return e})).catch((function(e){return e}))}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(k.A)("adsense",{useSnippet:"useSnippet"},this.state)}}},{key:"render",value:function(){var t=this.state.useSnippet,a=this.props,n=a.isEditing,i=a.switchLabel,o=void 0===i?Object(f.__)("Let Site Kit place code on your site","google-site-kit"):i,s=a.switchOnMessage,r=a.switchOffMessage;return e.createElement(_.Fragment,null,n?e.createElement(_.Fragment,null,e.createElement("div",{className:"googlesitekit-setup-module__switch"},e.createElement(v.a,{id:"enableAutoAds",label:o,onClick:this.handleUseSnippetSwitch,checked:t,hideLabel:!1})," ",e.createElement("span",{className:"googlesitekit-recommended"},Object(f.__)("RECOMMENDED","google-site-kit"))),t&&s&&e.createElement("div",{className:"googlesitekit-settings-notice googlesitekit-settings-notice--suggestion"},e.createElement("div",{className:"googlesitekit-settings-notice__text"},s)),!t&&r&&e.createElement("div",{className:"googlesitekit-settings-notice"},e.createElement("div",{className:"googlesitekit-settings-notice__text"},r))):e.createElement(_.Fragment,null,Object(f.__)("The AdSense code has","google-site-kit")," ",t?Object(f.__)("been placed on your site.","google-site-kit"):Object(f.__)("not been placed on your site.","google-site-kit")))}}]),AdSenseSettings}(_.Component);O.propTypes={isEditing:b.a.bool,accountTagMatch:b.a.bool,existingTag:b.a.oneOfType([b.a.bool,b.a.string]),switchLabel:b.a.string,switchOnMessage:b.a.string,switchOffMessage:b.a.string},O.defaultProps={isEditing:!1,accountTagMatch:!1,existingTag:!1,switchOnMessage:"",switchOffMessage:""},t.a=O}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(13),_=a(0),f=a(1),y=a(2),k=a(19),v=a(10),S=a(27),O=a(35),E=a(86),j=a(17);function D(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var C=function(t){function AnalyticsDashboardWidgetTopAcquisitionSources(){return r()(this,AnalyticsDashboardWidgetTopAcquisitionSources),u()(this,m()(AnalyticsDashboardWidgetTopAcquisitionSources).apply(this,arguments))}return h()(AnalyticsDashboardWidgetTopAcquisitionSources,t),c()(AnalyticsDashboardWidgetTopAcquisitionSources,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=Object(y.g)(),n=[{title:Object(_.__)("Medium","google-site-kit"),tooltip:Object(_.__)("Medium refers to where your traffic originated from","google-site-kit")},{title:Object(_.__)("Users","google-site-kit"),tooltip:Object(_.__)("Number of users that originated from that traffic","google-site-kit")},{title:Object(_.__)("New Users","google-site-kit"),
12
- /* translators: %s: date range */
13
- tooltip:Object(_.sprintf)(Object(_.__)("Number of new users to visit your page over last %s","google-site-kit"),a)},{title:Object(_.__)("Sessions","google-site-kit"),
14
- /* translators: %s: date range */
15
- tooltip:Object(_.sprintf)(Object(_.__)("Number of sessions users had on your website over last %s","google-site-kit"),a)},{title:Object(_.__)("Percentage","google-site-kit"),tooltip:Object(_.__)("Percentage of sessions","google-site-kit")}],i=t[0].data.totals[0].values[0],o=Object(b.map)(t[0].data.rows,(function(t,a){var n=t.metrics[0].values[0]/i*100;return!(1>n)&&[t.dimensions[0],Object(y.t)(t.metrics[0].values[0]),Object(y.t)(t.metrics[0].values[1]),Object(y.t)(t.metrics[0].values[2]),e.createElement(f.Fragment,{key:"minichart-analytics-top-as-"+a},e.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")," ",e.createElement(E.a,{percent:n.toFixed(1),index:a})))]})),s=Object(S.b)(o,n,{hideHeader:!1,chartsEnabled:!1});return e.createElement("div",{className:"googlesitekit-details-widget"},e.createElement(S.a,null,s))}}]),AnalyticsDashboardWidgetTopAcquisitionSources}(f.Component);t.a=Object(k.a)(C,[{type:v.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):D(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},j.k,{url:n.googlesitekit.permaLink}),priority:1,maxAge:Object(y.q)("day"),context:["Single","Dashboard"]}],e.createElement(O.a,{rows:4,rowHeight:50}),{},j.h)}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(47),h=a(144),b=function(t){function MiniChart(){return i()(this,MiniChart),l()(this,d()(MiniChart).apply(this,arguments))}return g()(MiniChart,t),s()(MiniChart,[{key:"render",value:function(){var t=this.props,a=t.index,n=t.percent,i={backgroundColor:"transparent",chartArea:{width:"100%",height:"100%"},enableInteractivity:!1,height:28,legend:{position:"none"},slices:{0:{color:h.a[a]},1:{color:"#e6e6e6"}},title:null,tooltip:{trigger:"none"},width:28},o=[["source","percent"],["",+n],["",100-n]];return e.createElement("div",{className:"googlesitekit-mini-chart"},e.createElement(p.a,{data:o,options:i,chartType:"pie",loadSmall:!0,loadCompressed:!0,loadHeight:24,loadText:!1,id:"minichart"+a}))}}]),MiniChart}(m.Component);t.a=b}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(13),h=a(0),b=a(1),_=a(2),f=a(19),y=a(10),k=a(27),v=a(35),S=function(t){function SearchConsoleDashboardWidgetKeywordTable(){return o()(this,SearchConsoleDashboardWidgetKeywordTable),c()(this,u()(SearchConsoleDashboardWidgetKeywordTable).apply(this,arguments))}return m()(SearchConsoleDashboardWidgetKeywordTable,t),r()(SearchConsoleDashboardWidgetKeywordTable,[{key:"render",value:function(){var t=this.props.data,a=[{title:Object(h.__)("Keyword","google-site-kit"),tooltip:Object(h.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(h.__)("Clicks","google-site-kit"),tooltip:Object(h.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(h.__)("Impressions","google-site-kit"),tooltip:Object(h.__)("Counted each time your content appears in search results","google-site-kit")}],i=e.googlesitekit.admin.siteURL,o=[],s=Object(p.map)(t,(function(e,t){var a=e.keys[0];return o[t]=Object(h.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",i,a),[a,Object(_.t)(e.clicks),Object(_.t)(e.impressions)]})),r={hideHeader:!1,chartsEnabled:!1,links:o},l=Object(k.b)(s,a,r);return n.createElement(k.a,null,l)}}]),SearchConsoleDashboardWidgetKeywordTable}(b.Component);t.a=Object(f.a)(S,[{type:y.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:e.googlesitekit.permaLink,dimensions:"query",limit:10},priority:1,maxAge:Object(_.q)("day"),context:["Single","Dashboard"]}],n.createElement(v.a,{padding:!0}),{createGrid:!0},(function(e){return!e.length}))}).call(this,a(16),a(1))},function(e,t,a){"use strict";var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(51),p=a(1),h=function(e){function DashboardSearchFunnelInner(){return i()(this,DashboardSearchFunnelInner),l()(this,d()(DashboardSearchFunnelInner).apply(this,arguments))}return g()(DashboardSearchFunnelInner,e),s()(DashboardSearchFunnelInner,[{key:"render",value:function(){return null}}]),DashboardSearchFunnelInner}(p.Component);t.a=Object(m.a)("googlesitekit.DashboardSearchFunnel")(h)},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(3),h=a.n(p),b=a(1),_=a(0),f=a(29),y=function(t){function ErrorHandler(e){var t;return o()(this,ErrorHandler),(t=c()(this,u()(ErrorHandler).call(this,e))).state={error:null,info:null},t}return m()(ErrorHandler,t),r()(ErrorHandler,[{key:"componentDidCatch",value:function(t,a){e.console.error("Caught an error:",t,a),this.setState({error:t,info:a})}},{key:"render",value:function(){var e=this.props.children,t=this.state,a=t.error,i=t.info;return a?n.createElement(f.a,{id:"googlesitekit-error",title:Object(_.__)("Site Kit encountered an error","google-site-kit"),description:n.createElement("code",null,a.message),isDismissable:!1,format:"small",type:"win-error"},n.createElement("pre",null,i.componentStack)):e}}]),ErrorHandler}(b.Component);y.defaultProps={},y.propTypes={children:h.a.node.isRequired},t.a=y}).call(this,a(16),a(1))},function(e,t,a){"use strict";a.d(t,"a",(function(){return r}));var n=a(33),i=a.n(n),o=a(121),s=a.n(o),r=function(e){return s()(JSON.stringify(function e(t){var a={};Object.keys(t).sort().forEach((function(n){var o=t[n];o&&"object"===i()(o)&&!Array.isArray(o)&&(o=e(o)),a[n]=o}));return a}(e)))}},function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return d}));var n,i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=function(t){var a=e[t];if(!a)return!1;try{var n="__storage_test__";return a.setItem(n,n),a.removeItem(n),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==a.length}},c=function(){function NullStorage(){o()(this,NullStorage)}return r()(NullStorage,[{key:"key",value:function(){return null}},{key:"getItem",value:function(){return null}},{key:"setItem",value:function(){}},{key:"removeItem",value:function(){}},{key:"clear",value:function(){}},{key:"length",get:function(){return 0}}]),NullStorage}(),d=function(){return n||(n=l("sessionStorage")?e.sessionStorage:l("localStorage")?e.localStorage:new c),n}}).call(this,a(16))},function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return i}));var n=a(0);function i(){Object(n.setLocaleData)(e.googlesitekit.locale,"google-site-kit")}}).call(this,a(16))},function(e,t,a){"use strict";(function(e){a.d(t,"a",(function(){return i}));var n=a(120),i=a.n(n)()(e)}).call(this,a(16))},function(e,t,a){"use strict";(function(e){var n=a(3),i=a.n(n),o=a(14),s=a.n(o);function ChangeArrow(t){var a=t.direction,n=t.invertColor;return e.createElement("svg",{className:s()("googlesitekit-change-arrow","googlesitekit-change-arrow--".concat(a),{"googlesitekit-change-arrow--inverted-color":n}),width:"9",height:"9",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.625 10L5.625 2.375L9.125 5.875L10 5L5 -1.76555e-07L-2.7055e-07 5L0.875 5.875L4.375 2.375L4.375 10L5.625 10Z",fill:"currentColor"}))}ChangeArrow.propTypes={direction:i.a.string,invertColor:i.a.bool},ChangeArrow.defaultProps={direction:"up",invertColor:!1},t.a=ChangeArrow}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(0),i=a(29);t.a=function DashboardPermissionAlert(){return e.createElement(i.a,{id:"permission error",title:Object(n.__)("Permissions issue accessing data","google-site-kit"),description:Object(n.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})}}).call(this,a(1))},function(e,t,a){"use strict";t.a=[/google_ad_client: ?["|'](.*?)["|']/,/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/]},function(e,t,a){"use strict";t.a=[/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/,/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/,/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/,/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/,/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/]},,,function(e,t,a){"use strict";(function(e){var n=a(0),i=a(24);t.a=function Logo(){return e.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},e.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),e.createElement(i.a,{id:"logo-sitekit",className:"googlesitekit-logo__logo-sitekit",height:"26",width:"99"}),e.createElement("span",{className:"screen-reader-text"},Object(n.__)("Site Kit by Google Logo","google-site-kit")))}}).call(this,a(1))},,function(e,t,a){"use strict";(function(e,n){var i=a(111),o=a.n(i),s=a(11),r=a.n(s),l=a(5),c=a.n(l),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(15),_=a.n(b),f=a(9),y=a.n(f),k=a(20),v=a.n(k),S=a(3),O=a.n(S),E=a(14),j=a.n(E),D=a(0),C=a(1),w=a(12),A=a(2),x=a(24),N=a(25),P=a(10),T=a(31),L=a(30),M=a(18),I=a(103),W=a(61);function R(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function U(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?R(a,!0).forEach((function(t){v()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):R(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var F=v()({},"loggedinUsers",Object(D.__)("Logged-in users","google-site-kit")),q=function(t){function AnalyticsSetup(e){var t;c()(this,AnalyticsSetup),t=m()(this,h()(AnalyticsSetup).call(this,e));var a=Object(A.l)().analytics.settings,n=a.accountID,i=a.anonymizeIP,o=a.internalWebPropertyID,s=a.profileID,r=a.propertyID,l=a.useSnippet,d=a.trackingDisabled;return t.state={anonymizeIP:i,isLoading:!0,isSaving:!1,propertiesLoading:!1,profilesLoading:!1,useSnippet:l||!1,errorCode:!1,errorMsg:"",errorReason:!1,accounts:[],properties:[],profiles:[],selectedAccount:n,selectedProperty:r,selectedProfile:s,selectedinternalWebProperty:o,existingTag:!1,trackingDisabled:d||[]},t.handleAccountChange=t.handleAccountChange.bind(_()(t)),t.handlePropertyChange=t.handlePropertyChange.bind(_()(t)),t.handleProfileChange=t.handleProfileChange.bind(_()(t)),t.processAccountChange=t.processAccountChange.bind(_()(t)),t.processPropertyChange=t.processPropertyChange.bind(_()(t)),t.handleSubmit=t.handleSubmit.bind(_()(t)),t.handleRadioClick=t.handleRadioClick.bind(_()(t)),t.handleRefetchAccount=t.handleRefetchAccount.bind(_()(t)),t.handleExclusionsChange=t.handleExclusionsChange.bind(_()(t)),t.switchStatus=t.switchStatus.bind(_()(t)),t}return y()(AnalyticsSetup,t),u()(AnalyticsSetup,[{key:"componentDidMount",value:function(){var e,t,a,n,i,o=this;return r.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:if(e=this.props,t=e.isOpen,a=e.onSettingsPage,this._isMounted=!0,!a||t){s.next=4;break}return s.abrupt("return");case 4:return s.next=6,r.a.awrap(Object(A.j)("analytics"));case 6:if(!(n=s.sent)||!n.length){s.next=21;break}return s.prev=8,s.next=11,r.a.awrap(P.c.get(P.b,"analytics","tag-permission",{tag:n}));case 11:return i=s.sent,s.next=14,r.a.awrap(this.getAccounts(i));case 14:s.next=19;break;case 16:s.prev=16,s.t0=s.catch(8),this.setState({isLoading:!1,errorCode:s.t0.code,errorMsg:s.t0.message,errorReason:!(!s.t0.data||!s.t0.data.reason)&&s.t0.data.reason});case 19:s.next=23;break;case 21:return s.next=23,r.a.awrap(this.getAccounts());case 23:Object(w.b)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed",(function(e,t){return"analytics"!==t.replace("-module","")?e:o.props.isEditing?o.handleSubmit():void 0}));case 24:case"end":return s.stop()}}),null,this,[[8,16]])}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(w.f)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={anonymizeIP:"anonymizeIP",selectedAccount:"accountID",selectedProperty:"propertyID",selectedProfile:"profileID",selectedinternalWebProperty:"internalWebPropertyID",useSnippet:"useSnippet",trackingDisabled:"trackingDisabled"};"-1"===this.state.selectedAccount&&(e={}),Object(A.A)("analytics",e,this.state)}}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.dataset.value;n!==a&&("0"!==n?(this.setState({propertiesLoading:!0,profilesLoading:!0,selectedAccount:n}),Object(A.B)("analytics_setup","account_change",n),"-1"!==n&&this.processAccountChange(n)):this.setState({selectedAccount:n,selectedProperty:"-1",selectedProfile:"-1",properties:[{id:"-1",name:Object(D.__)("Select an account","google-site-kit")}],profiles:[{id:"-1",name:Object(D.__)("Select an account","google-site-kit")}]}))}},{key:"handlePropertyChange",value:function(e,t){var a=this.state.selectedProperty,n=t.dataset.value;n!==a&&("0"!==n?(this.setState({profilesLoading:!0,selectedProperty:n}),Object(A.B)("analytics_setup","property_change",n),this.processPropertyChange(n)):this.setState({selectedProperty:n,selectedProfile:n,profiles:[{id:0,name:Object(D.__)("Setup a New Profile","google-site-kit")}]}))}},{key:"handleProfileChange",value:function(e,t){var a=t.dataset.value;this.setState({selectedProfile:a}),Object(A.B)("analytics_setup","profile_change",a)}},{key:"getAccounts",value:function(){var e,t,a,n,i,o,s,l,c,d,u,g,m,p,h,b,_=this,f=arguments;return r.a.async((function(y){for(;;)switch(y.prev=y.next){case 0:return e=f.length>0&&void 0!==f[0]&&f[0],t=this.state,a=t.selectedAccount,n=t.selectedProperty,i=t.selectedProfile,o=t.useSnippet,s=this.props,l=s.isEditing,c=s.onSettingsPage,d=this.state.errorCode,u={},y.prev=5,g=e?{existingAccountID:e.accountID,existingPropertyID:e.propertyID}:{},y.next=9,r.a.awrap(P.c.get(P.b,"analytics","accounts-properties-profiles",g));case 9:0===(m=y.sent).accounts.length?(u=U({},u,{errorCode:"no_account",errorReason:"noAccount"}),P.c.invalidateCacheGroup(P.b,"analytics","accounts-properties-profiles")):a?"0"===a?m.accounts.unshift({id:0,name:Object(D.__)("Select one...","google-site-kit")}):a&&!m.accounts.find((function(e){return e.id===a}))&&(P.c.invalidateCacheGroup(P.b,"analytics","accounts-properties-profiles"),m.accounts.unshift({id:0,name:Object(D.__)("Select one...","google-site-kit")}),l&&(a="0",n="-1",i="-1"),u=U({},u,{errorCode:"insufficient_permissions",errorReason:"insufficientPermissions"})):(p=null,m.matchedProperty&&(p=m.matchedProperty),p?(a=p.accountId,n=p.id,(h=m.profiles.find((function(e){return e.accountId===a})))&&(i=h.id)):m.accounts.unshift({id:0,name:Object(D.__)("Select one...","google-site-kit")})),b={id:"-1",name:Object(D.__)("Select an account","google-site-kit")},this.state.existingTag||m.properties.push({id:0,name:Object(D.__)("Setup a New Property","google-site-kit")}),m.profiles.push({id:0,name:Object(D.__)("Setup a New Profile","google-site-kit")}),c||(o=!e),u=U({},u,{isLoading:!1,accounts:m.accounts,errorCode:d||u.errorCode,selectedAccount:a,selectedProperty:n,selectedProfile:i,properties:[b],profiles:[b],existingTag:!!e&&e.propertyID,useSnippet:o}),a&&"0"!==a&&(u=Object.assign(u,{properties:m.properties,profiles:m.profiles,selectedinternalWebProperty:m.properties[0]?m.properties[0].internalWebPropertyID:0})),y.next=22;break;case 19:y.prev=19,y.t0=y.catch(5),u={isLoading:!1,errorCode:y.t0.code,errorMsg:y.t0.message,errorReason:!(!y.t0.data||!y.t0.data.reason)&&y.t0.data.reason};case 22:return y.abrupt("return",new Promise((function(e){_._isMounted?_.setState(u,e):e()})));case 23:case"end":return y.stop()}}),null,this,[[5,19]])}},{key:"processAccountChange",value:function(e){var t,a,n,i;return r.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,t={accountID:e},o.next=4,r.a.awrap(P.c.get(P.b,"analytics","properties-profiles",t));case 4:a=o.sent,n={id:0,name:Object(D.__)("Setup a New Property","google-site-kit")},a.properties.push(n),i={id:0,name:Object(D.__)("Setup a New Profile","google-site-kit")},a.profiles.push(i),this.setState({propertiesLoading:!1,profilesLoading:!1,properties:a.properties,profiles:a.profiles,selectedAccount:e,selectedProperty:a.properties[0].id,selectedinternalWebProperty:a.properties[0].internalWebPropertyID,selectedProfile:a.profiles[0].id,errorCode:!1}),o.next=15;break;case 12:o.prev=12,o.t0=o.catch(0),this.setState({errorCode:o.t0.code,errorMsg:o.t0.message});case 15:case"end":return o.stop()}}),null,this,[[0,12]])}},{key:"processPropertyChange",value:function(e){var t,a,n;return r.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t=this.state.selectedAccount,i.prev=1,a={accountID:t,propertyID:e},i.next=5,r.a.awrap(P.c.get(P.b,"analytics","profiles",a));case 5:n=i.sent,this.setState({profilesLoading:!1,profiles:n,selectedProperty:e,selectedinternalWebProperty:n[0].internalWebPropertyID,selectedProfile:n[0].id,errorCode:!1}),i.next=12;break;case 9:i.prev=9,i.t0=i.catch(1),this.setState({errorCode:i.t0.code,errorMsg:i.t0.message});case 12:case"end":return i.stop()}}),null,this,[[1,9]])}},{key:"handleSubmit",value:function(e){var t,a,n,i,o,s,l,c,d,u,g,m,p,h,b,_,f;return r.a.async((function(y){for(;;)switch(y.prev=y.next){case 0:if(e&&e.preventDefault(),this.state.selectedAccount&&"-1"!==this.state.selectedAccount){y.next=3;break}return y.abrupt("return");case 3:return t=this.state,a=t.anonymizeIP,n=t.selectedAccount,i=t.selectedProperty,o=t.selectedProfile,s=t.useSnippet,l=t.selectedinternalWebProperty,c=t.accounts,d=t.properties,u=t.profiles,g=t.trackingDisabled,this.setState({isSaving:!0}),m=this.props.finishSetup,p=o||(u[0].id||0===u[0].id?u[0].id.toString():null),h=i||(d[0].id||0===d[0].id?d[0].id.toString():null),b="0"===h?"0":l||(d[0].internalWebPropertyId||0===d[0].internalWebPropertyId?d[0].internalWebPropertyId.toString():null),_={anonymizeIP:a,accountID:n||c[0].id||null,profileID:p,propertyID:h,internalWebPropertyID:b,useSnippet:s||!1,trackingDisabled:g},y.prev=10,y.next=13,r.a.awrap(P.c.set(P.b,"analytics","settings",_));case 13:return f=y.sent,P.c.invalidateCacheGroup(P.b,"analytics","accounts-properties-profiles"),y.next=17,r.a.awrap(this.getAccounts());case 17:Object(A.l)().analytics.settings=f,Object(A.B)("analytics_setup","analytics_configured"),m&&m(),this._isMounted&&this.setState({isSaving:!1,selectedAccount:f.accountID,selectedProfile:f.profileID,selectedProperty:f.propertyID,selectedinternalWebProperty:f.internalWebPropertyID}),y.next=26;break;case 23:y.prev=23,y.t0=y.catch(10),this.setState({isSaving:!1,errorCode:y.t0.code,errorMsg:y.t0.message});case 26:case"end":return y.stop()}}),null,this,[[10,23]])}},{key:"handleRadioClick",value:function(e){var t="1"===e.target.value;this.setState({useSnippet:t}),Object(A.B)("analytics_setup",t?"analytics_tag_enabled":"analytics_tag_disabled")}},{key:"switchStatus",value:function(e){var t=this;return function(){t.setState(v()({},e,!t.state[e]))}}},{key:"handleRefetchAccount",value:function(){this.setState({isLoading:!0,errorCode:!1,errorMsg:"",selectedAccount:"0",selectedProperty:"-1",selectedProfile:"-1",propertiesLoading:!1,profilesLoading:!1},this.getAccounts)}},{key:"handleExclusionsChange",value:function(e){var t=this.state.trackingDisabled,a=e.target,n=a.id,i=a.checked,s=Object.assign.apply(Object,[{}].concat(o()(t.map((function(e){return v()({},e,!0)}))),[v()({},n,i)]));this.setState({trackingDisabled:Object.keys(s).filter((function(e){return s[e]}))})}},{key:"renderAutoInsertSnippetForm",value:function(){var t=this.state,a=t.anonymizeIP,i=t.useSnippet,o=t.isSaving,s=t.existingTag,r=this.props,l=r.isEditing,c=r.onSettingsPage,d=!l,u=e.googlesitekit.admin.ampMode,g=Object(A.l)().analytics.settings.useSnippet;return n.createElement("div",{className:"googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--multiline"},(l||o)&&n.createElement(C.Fragment,null,c&&n.createElement(C.Fragment,null,!g&&!s&&n.createElement(C.Fragment,null,n.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(D.__)("Currently there is no Analytics snippet placed on your site, so no stats are being gathered. Would you like Site Kit to insert the Analytics snippet? You can change this setting later.","google-site-kit"))),g&&n.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(D.__)("Do you want to remove the Analytics snippet inserted by Site Kit?","google-site-kit"))),c&&!s&&!i&&g&&n.createElement("p",null,Object(D.__)("If the code snippet is removed, you will no longer be able to gather Analytics insights about your site.","google-site-kit"))),c&&n.createElement(C.Fragment,null,s&&n.createElement("p",null,Object(D.__)("Placing two tags at the same time is not recommended.","google-site-kit")),n.createElement(I.a,{onClick:this.handleRadioClick,id:"useSnippetTrue",name:"useSnippet",value:"1",checked:i,disabled:d},g?Object(D.__)("Not at this time","google-site-kit"):Object(D.__)("Insert snippet","google-site-kit")),n.createElement(I.a,{onClick:this.handleRadioClick,id:"useSnippetFalse",name:"useSnippet",value:"0",checked:!i,disabled:d},g?Object(D.__)("Remove snippet","google-site-kit"):Object(D.__)("Not at this time","google-site-kit"))),c&&i&&"primary"!==u&&n.createElement("div",{className:"googlesitekit-setup-module__input"},n.createElement(W.a,{id:"anonymizeIP",label:Object(D.__)("Anonymize IP addresses","google-site-kit"),onClick:this.switchStatus("anonymizeIP"),checked:a,hideLabel:!1}),n.createElement("p",null,a?Object(D.__)("IP addresses will be anonymized.","google-site-kit"):Object(D.__)("IP addresses will not be anonymized.","google-site-kit")," ",n.createElement(M.a,{href:"https://support.google.com/analytics/answer/2763052",external:!0,inherit:!0,dangerouslySetInnerHTML:{__html:Object(D.__)('Learn more<span class="screen-reader-text"> about IP anonymization.</span>',"google-site-kit")}}))))}},{key:"accountsDropdown",value:function(){var e=this.state,t=e.accounts,a=e.selectedAccount,i=e.existingTag,o=!this.props.isEditing;return i&&a&&(o=!0),n.createElement(N.k,{className:"googlesitekit-analytics__select-account",enhanced:!0,name:"accounts",value:a||"0",onEnhancedChange:this.handleAccountChange,label:Object(D.__)("Account","google-site-kit"),disabled:o,outlined:!0},t.concat(i?[]:[{id:"-1",name:Object(D.__)("Set up a new account","google-site-kit")}]).map((function(e,t){return n.createElement(N.j,{key:t,value:e.id},e.name)})))}},{key:"renderForm",value:function(){var t=this.state,a=t.anonymizeIP,i=t.isLoading,o=t.propertiesLoading,s=t.profilesLoading,r=t.accounts,l=t.properties,c=t.profiles,d=t.selectedAccount,u=t.selectedProperty,g=t.selectedProfile,m=t.useSnippet,p=t.existingTag,h=t.errorCode,b=t.trackingDisabled,_=this.props,f=_.onSettingsPage,y=_.isEditing,k=parseInt(d)||0,v=!p&&k>0,S=!!/^UA-/.test(u.toString()),O=e.googlesitekit.admin.ampMode,E=Object(A.l)().analytics.setupComplete;if(i)return n.createElement(L.a,null);if("google_analytics_existing_tag_permission"===h)return null;if(!r.length||"-1"===d){if(!y)return Object(D.__)("No account found.","google-site-kit");if(!E||y)return n.createElement(C.Fragment,null,"-1"===d&&n.createElement(C.Fragment,null,n.createElement("p",null,Object(D.__)("To create a new account, click the button below which will open the Google Analytics account creation screen in a new window.","google-site-kit")),n.createElement("p",null,Object(D.__)("Once completed, click the link below to re-fetch your accounts to continue.","google-site-kit"))),n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(T.a,{onClick:AnalyticsSetup.createNewAccount},Object(D.__)("Create an account","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(M.a,{onClick:this.handleRefetchAccount},Object(D.__)("Re-fetch My Account","google-site-kit")))))}if(!y){var j=m?Object(D.__)("Snippet is inserted","google-site-kit"):Object(D.__)("Snippet is not inserted","google-site-kit");return p&&(j=Object(D.__)("Inserted by another plugin or theme","google-site-kit")),n.createElement(C.Fragment,null,n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("Account","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},d||r[0].name||!1)),n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("Property","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},u||l[0].name||!1)),n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("View","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},g||c[0].name||!1))),n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:" googlesitekit-settings-module__meta-item "},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("Analytics Code Snippet","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},j))),f&&m&&"primary"!==O&&n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:" googlesitekit-settings-module__meta-item "},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("IP Address Anonymization","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a&&Object(D.__)("IP addresses are being anonymized.","google-site-kit"),!a&&Object(D.__)("IP addresses are not being anonymized.","google-site-kit")))),n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:" googlesitekit-settings-module__meta-item "},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(D.__)("Excluded from Analytics","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},!!b.length&&b.map((function(e){return F[e]})).join(Object(D._x)(", ","list separator","google-site-kit")),!b.length&&Object(D.__)("Analytics is currently enabled for all visitors.","google-site-kit")))))}return n.createElement(C.Fragment,null,!f&&0<r.length&&!p&&n.createElement("p",null,Object(D.__)("Please select the account information below. You can change this view later in your settings.","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__inputs"},this.accountsDropdown(),o?n.createElement(L.a,{small:!0}):n.createElement(N.k,{className:"googlesitekit-analytics__select-property",enhanced:!0,name:"properties",value:u||0===u?u.toString():"-1",onEnhancedChange:this.handlePropertyChange,label:Object(D.__)("Property","google-site-kit"),disabled:!v,outlined:!0},l.map((function(e,t){return n.createElement(N.j,{key:t,value:e.id},e.name)}))),s?n.createElement(L.a,{small:!0}):n.createElement(N.k,{className:"googlesitekit-analytics__select-profile",enhanced:!0,name:"profiles",value:g||0===g?g.toString():"-1",onEnhancedChange:this.handleProfileChange,label:Object(D.__)("View","google-site-kit"),disabled:!S,outlined:!0},c.map((function(e,t){return n.createElement(N.j,{key:t,value:e.id},e.name)})))),this.renderAutoInsertSnippetForm(),f&&this.renderExclusionsForm(),!f&&n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(T.a,{disabled:!this.state.selectedAccount,onClick:this.handleSubmit},Object(D.__)("Configure Analytics","google-site-kit"))))}},{key:"renderExclusionsForm",value:function(){var e=this.state.trackingDisabled;return n.createElement("div",null,n.createElement("p",{className:"googlesitekit-setup-module__text"},Object(D.__)("Exclude from Analytics","google-site-kit")),n.createElement("div",{className:"mdc-form-field"},n.createElement(W.a,{id:"loggedinUsers",label:F.loggedinUsers,onClick:this.handleExclusionsChange,checked:e.includes("loggedinUsers"),hideLabel:!1})),n.createElement("p",null,e.includes("loggedinUsers")?Object(D.__)("Logged-in users will be excluded from Analytics tracking.","google-site-kit"):Object(D.__)("Logged-in users will be included in Analytics tracking.","google-site-kit")))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,i=e.errorReason,o=e.accounts,s=this.props.onSettingsPage;if(!t)return null;var r=!0,l=a;switch(!0){case"google_analytics_existing_tag_permission"===t:r=!0;break;case s&&t&&"insufficientPermissions"===i:r=!1,l=Object(D.__)("You currently don't have access to this Google Analytics account. You can either request access from your team, or remove this Google Analytics snippet and connect to a different account.","google-site-kit");break;case!s&&0===o.length:r=!1,l=Object(D.__)('Looks like you don\'t have an Analytics account yet. Once you create it, click on "Re-fetch my account" and Site Kit will locate it.',"google-site-kit")}return l&&0!==l.length?n.createElement("div",{className:j()({"googlesitekit-error-text":r})},n.createElement("p",null,r
16
- /* translators: %s: Error message */?Object(D.sprintf)(Object(D.__)("Error: %s","google-site-kit"),l):l)):null}},{key:"render",value:function(){var e=this.props.onSettingsPage,t=this.state.existingTag;return e||Object(A.B)("analytics_setup","configure_analytics_screen"),n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--analytics"},!e&&n.createElement(C.Fragment,null,n.createElement("div",{className:"googlesitekit-setup-module__logo"},n.createElement(x.a,{id:"analytics",width:"33",height:"33"})),n.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(D._x)("Analytics","Service name","google-site-kit"))),!!t&&
17
- /* translators: %s: Analytics tag ID */
18
- n.createElement("p",null,Object(D.sprintf)(Object(D.__)("An existing analytics tag was found on your site with the ID %s. If later on you decide to replace this tag, Site Kit can place the new tag for you. Make sure you remove the old tag first.","google-site-kit"),t)),this.renderErrorOrNotice(),this.renderForm())}}],[{key:"createNewAccount",value:function(t){t.preventDefault(),Object(A.B)("analytics_setup","new_analytics_account"),e.open("https://analytics.google.com/analytics/web/?#/provision/SignUp","_blank")}}]),AnalyticsSetup}(C.Component);q.propTypes={onSettingsPage:O.a.bool,finishSetup:O.a.func,isEditing:O.a.bool},q.defaultProps={onSettingsPage:!0,isEditing:!1},t.a=q}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=a(25),y=function(t){function Radio(e){var t;return i()(this,Radio),(t=l()(this,d()(Radio).call(this,e))).formFieldRef=Object(_.createRef)(),t.radioRef=Object(_.createRef)(),t}return g()(Radio,t),s()(Radio,[{key:"componentDidMount",value:function(){new f.e(this.formFieldRef.current).input=new f.g(this.radioRef.current)}},{key:"render",value:function(){var t=this.props,a=t.onClick,n=t.id,i=t.name,o=t.value,s=t.checked,r=t.disabled,l=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:b()("mdc-radio",{"mdc-radio--disabled":r}),ref:this.radioRef},e.createElement("input",{className:"mdc-radio__native-control",onClick:a,type:"radio",id:n,name:i,value:o,checked:s,disabled:r,onChange:function(){}}),e.createElement("div",{className:"mdc-radio__background"},e.createElement("div",{className:"mdc-radio__outer-circle"}),e.createElement("div",{className:"mdc-radio__inner-circle"}))),e.createElement("label",{htmlFor:n},l))}}]),Radio}(_.Component);y.propTypes={onClick:p.a.func,id:p.a.string.isRequired,name:p.a.string.isRequired,value:p.a.string.isRequired,checked:p.a.bool,disabled:p.a.bool,children:p.a.string.isRequired},y.defaultProps={onClick:null,checked:!1,disabled:!1},t.a=y}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(11),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(15),h=a.n(p),b=a(9),_=a.n(b),f=a(3),y=a.n(f),k=a(14),v=a.n(k),S=a(0),O=a(1),E=a(12),j=a(2),D=a(24),C=a(31),w=a(18),A=a(10),x=a(25),N=function(t){function OptimizeSetup(e){var t;r()(this,OptimizeSetup),t=u()(this,m()(OptimizeSetup).call(this,e));var a=Object(j.l)(),n=a.optimize.settings,i=n.optimizeID,o=n.ampExperimentJSON,s=(a.analytics||{}).settings,l=a.tagmanager||{},c=l.active,d=l.settings,g=!!s&&s.useSnippet,p=!(!c||!d)&&d.useSnippet;return t.state={optimizeID:i||"",analyticsUseSnippet:g,gtmUseSnippet:p,errorCode:!1,errorMsg:"",ampExperimentJSON:o||"",ampExperimentJSONValidated:!0,OptimizeIDValidated:!0},t.handleOptimizeIDEntry=t.handleOptimizeIDEntry.bind(h()(t)),t.handleSubmit=t.handleSubmit.bind(h()(t)),t.renderInstructionInfo=t.renderInstructionInfo.bind(h()(t)),t.handleAMPOptimizeEntry=t.handleAMPOptimizeEntry.bind(h()(t)),t}return _()(OptimizeSetup,t),c()(OptimizeSetup,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(E.b)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed",(function(t,a){return"optimize"!==a.replace("-module","")?t:e.props.isEditing?e.handleSubmit():void 0})),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(E.f)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(j.A)("optimize",{optimizeID:"optimizeID",ampExperimentJSON:"ampExperimentJSON"},this.state)}}},{key:"handleSubmit",value:function(){var e,t,a,n,i,s,r=this;return o.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:if(e=this.state,t=e.optimizeID,a=e.ampExperimentJSON,n=e.OptimizeIDValidated,i=this.props.finishSetup,n&&0!==t.length){l.next=4;break}return l.abrupt("return",!1);case 4:return s={optimizeID:t,ampExperimentJSON:a},l.next=7,o.a.awrap(A.c.set(A.b,"optimize","settings",s).then((function(){i&&i(),Object(j.l)().optimize.settings.optimizeID=t,r._isMounted&&r.setState({isSaving:!1})})).catch((function(e){r._isMounted&&r.setState({errorCode:!0,errorMsg:e.errorMsg})})));case 7:return l.abrupt("return",l.sent);case 8:case"end":return l.stop()}}),null,this)}},{key:"handleOptimizeIDEntry",value:function(e){var t=Object(j.D)(e.target.value);this._isMounted&&this.setState({optimizeID:e.target.value,OptimizeIDValidated:t})}},{key:"handleAMPOptimizeEntry",value:function(e){var t=Object(j.C)(e.target.value);this._isMounted&&this.setState({ampExperimentJSON:e.target.value,ampExperimentJSONValidated:t})}},{key:"renderInfo",value:function(){var t=this.state.optimizeID;return e.createElement(O.Fragment,null,t?e.createElement("div",null,Object(S.__)("Your Optimize Container ID","google-site-kit"),": ",e.createElement("strong",null,t)):e.createElement("div",null,Object(S.__)('Optimize Container ID missing, press "edit" to add',"google-site-kit"),"."))}},{key:"renderInstructionInfo",value:function(){var t=this.state,a=t.analyticsUseSnippet,n=t.gtmUseSnippet,i=t.optimizeID;return!a&&n?e.createElement(O.Fragment,null,e.createElement("p",null,Object(S.__)("You are using auto insert snippet with Tag Manager","google-site-kit")),e.createElement("p",null,e.createElement("a",{href:"https://support.google.com/optimize/answer/6314801"},Object(S.__)("Click here","google-site-kit"))," ",Object(S.__)("for how to implement Optimize tag through your Tag Manager","google-site-kit"))):a?null:e.createElement(O.Fragment,null,e.createElement("p",null,Object(S.__)("You disabled analytics auto insert snippet. If You are using Google Analytics code snippet, add the code below:","google-site-kit")),e.createElement("pre",null,'ga("require", "',i||"GTM-XXXXXXX",'");'),e.createElement("p",null,e.createElement("a",{href:"https://support.google.com/optimize/answer/6262084"},Object(S.__)("Click here","google-site-kit"))," ",Object(S.__)("for how to implement Optimize tag in Google Analytics Code Snippet","google-site-kit")))}},{key:"renderAMPSnippet",value:function(){var t=this.state,a=t.analyticsUseSnippet,i=t.ampExperimentJSON,o=t.ampExperimentJSONValidated,s=n.googlesitekit.admin.ampEnabled;return a&&s?e.createElement(O.Fragment,null,e.createElement("p",null,Object(S.__)("Please input your AMP experiment settings in JSON format below.","google-site-kit")," ",e.createElement(w.a,{href:"https://developers.google.com/optimize/devguides/amp-experiments",external:!0,inherit:!0},Object(S.__)("Learn More.","google-site-kit"))),e.createElement(x.l,{className:v()("mdc-text-field",{"mdc-text-field--error":!o}),name:"amp-experiment",onChange:this.handleAMPOptimizeEntry,textarea:!0},e.createElement(x.b,{inputType:"textarea",value:null===i?"":i})),!o&&e.createElement("p",{className:"googlesitekit-error-text"},Object(S.__)("Error: AMP experiment settings are not in a valid JSON format.","google-site-kit"))):null}},{key:"renderForm",value:function(){var t=this.state,a=t.optimizeID,n=t.errorCode,i=t.errorMsg,o=t.OptimizeIDValidated;return e.createElement(O.Fragment,null,e.createElement("p",null,Object(S.__)("Please copy and paste your Optimize ID to complete your setup.","google-site-kit")," ",e.createElement(w.a,{href:"https://support.google.com/optimize/answer/6211921",external:!0,inherit:!0},Object(S.__)("You can locate this here.","google-site-kit"))),n&&0<i.length&&e.createElement("p",{className:"googlesitekit-error-text"},Object(S.__)("Error:","google-site-kit")," ",i),e.createElement("div",{className:"googlesitekit-setup-module__inputs"},e.createElement(x.l,{className:v()("mdc-text-field",{"mdc-text-field--error":n||!o}),label:Object(S.__)("Optimize Container ID","google-site-kit"),name:"optimizeID",onChange:this.handleOptimizeIDEntry,helperText:e.createElement(x.a,null,Object(S.__)("Format: GTM-XXXXXXX.","google-site-kit")),outlined:!0,required:!0},e.createElement(x.b,{value:a}))),!o&&e.createElement("p",{className:"googlesitekit-error-text"},Object(S.__)("Error: Not a valid Optimize ID.","google-site-kit")),this.renderAMPSnippet(),this.renderInstructionInfo())}},{key:"render",value:function(){var t=this.props,a=t.onSettingsPage,n=t.isEditing;return e.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--optimize"},!a&&e.createElement(O.Fragment,null,e.createElement("div",{className:"googlesitekit-setup-module__logo"},e.createElement(D.a,{id:"optimize",width:"33",height:"33"})),e.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(S._x)("Optimize","Service name","google-site-kit"))),n&&this.renderForm(),!n&&this.renderInfo(),!a&&e.createElement("div",{className:"googlesitekit-setup-module__action"},e.createElement(C.a,{onClick:this.handleSubmit},Object(S.__)("Configure Optimize","google-site-kit"))))}}]),OptimizeSetup}(O.Component);N.propTypes={onSettingsPage:y.a.bool,finishSetup:y.a.func,isEditing:y.a.bool},N.defaultProps={onSettingsPage:!0,isEditing:!1},t.a=N}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e,n){a.d(t,"b",(function(){return E})),a.d(t,"a",(function(){return j}));var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(13),h=a(1),b=a(0),_=a(2),f=a(19),y=a(39),k=a(10),v=a(27),S=a(62),O=function(t){function PageSpeedInsightsDashboardWidgetHomepageSpeedColumn(){return o()(this,PageSpeedInsightsDashboardWidgetHomepageSpeedColumn),c()(this,u()(PageSpeedInsightsDashboardWidgetHomepageSpeedColumn).apply(this,arguments))}return m()(PageSpeedInsightsDashboardWidgetHomepageSpeedColumn,t),r()(PageSpeedInsightsDashboardWidgetHomepageSpeedColumn,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.handleDataLoaded;t&&a&&a()}},{key:"render",value:function(){var t=this.props,a=t.data,n=t.title;if(!a||a.error)return null;if(!function(e){return!!Object(p.get)(e,"categories.performance.score")}(a))return Object(y.a)(Object(b._x)("PageSpeed Insights","Service name","google-site-kit"),Object(b.__)("An unknown error occurred while trying to fetch PageSpeed Insights data. Please try again later.","google-site-kit"),!0);var i=a.categories.performance.score,o=Object(S.d)(i),s=a.audits.interactive.displayValue,r=Object(v.b)([[Object(b.__)("Real user speed data","google-site-kit"),e.createElement(S.b,{key:"0",score:i},o)],[Object(b.__)("Time to become fully interactive","google-site-kit"),e.createElement(S.b,{key:"0",score:i},s)]],[],{hideHeader:!0,disableListMode:!0,chartsEnabled:!1,links:[]});return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement("div",{className:"googlesitekit-pagespeed-report__heading-wrapper"},e.createElement("h3",{className:" googlesitekit-subheading-1 "},n),e.createElement(S.c,{score:i})),e.createElement(v.a,null,r))}}]),PageSpeedInsightsDashboardWidgetHomepageSpeedColumn}(h.Component),E=Object(f.a)(O,[{type:k.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:n.googlesitekit.permaLink,strategy:"mobile",dateRange:null},priority:10,maxAge:Object(_.q)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0}),j=Object(f.a)(O,[{type:k.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:n.googlesitekit.permaLink,strategy:"desktop",dateRange:null},priority:10,maxAge:Object(_.q)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0})}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(11),r=a.n(s),l=a(5),c=a.n(l),d=a(6),u=a.n(d),g=a(7),m=a.n(g),p=a(8),h=a.n(p),b=a(15),_=a.n(b),f=a(9),y=a.n(f),k=a(3),v=a.n(k),S=a(13),O=a(14),E=a.n(O),j=a(0),D=a(1),C=a(12),w=a(24),A=a(2),x=a(34),N=a(25),P=a(31),T=a(18),L=a(61),M=a(10),I=a(30),W="web",R="amp",U=function(t){function TagmanagerSetup(t){var a;c()(this,TagmanagerSetup),a=m()(this,h()(TagmanagerSetup).call(this,t));var n=e.googlesitekit.admin,i=n.ampEnabled,o=n.ampMode,s=Object(A.l)().tagmanager.settings,r="primary"===o?R:[W,R];return a.state={ampEnabled:i,isLoading:!0,isSecondaryAMP:"secondary"===o,accounts:[],containers:[],containersAMP:[],errorCode:!1,errorMsg:"",existingContainer:"",selectedAccount:s.accountID,selectedContainer:s.containerID,selectedContainerAMP:s.ampContainerID,containersLoading:!1,usageContext:i?r:W,hasExistingTag:!1,useSnippet:s.useSnippet},a.handleSubmit=a.handleSubmit.bind(_()(a)),a.renderAccountDropdownForm=a.renderAccountDropdownForm.bind(_()(a)),a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.refetchAccount=a.refetchAccount.bind(_()(a)),a}return y()(TagmanagerSetup,t),u()(TagmanagerSetup,[{key:"setState",value:function(){this._isMounted&&D.Component.prototype.setState.apply(this,arguments)}},{key:"componentDidMount",value:function(){var e,t,a,n=this;return r.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e=this.props,t=e.isOpen,a=e.onSettingsPage,this._isMounted=!0,!a||t){i.next=4;break}return i.abrupt("return");case 4:return i.next=6,r.a.awrap(this.loadAccountsContainers());case 6:Object(C.b)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed",(function(e,t){return"tagmanager"!==t.replace("-module","")?e:n.props.isEditing?n.handleSubmit():void 0})),this.toggleConfirmChangesButton();case 8:case"end":return i.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(C.f)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed")}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={selectedContainer:"containerID",selectedContainerAMP:"ampContainerID",selectedAccount:"accountID",useSnippet:"useSnippet"};this.canSaveSettings()||(e={}),Object(A.A)("tagmanager",e,this.state)}}},{key:"loadAccountsContainers",value:function(){var e,t,a,n,i,o;return r.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,r.a.awrap(Object(A.j)("tagmanager"));case 2:if(!(e=s.sent)){s.next=20;break}return s.prev=4,s.next=7,r.a.awrap(M.c.get(M.b,"tagmanager","tag-permission",{tag:e}));case 7:t=s.sent,a=t.account,n=t.container,i=Object(x.a)([n]).byContext(W),o=Object(x.a)([n]).byContext(R),this.setState({isLoading:!1,existingContainer:e,selectedAccount:a.accountId,selectedContainer:Object(S.get)(i,[0,"publicId"]),selectedContainerAMP:Object(S.get)(o,[0,"publicId"]),accounts:[a],hasExistingTag:!0}),s.next=18;break;case 15:s.prev=15,s.t0=s.catch(4),this.setState({isLoading:!1,errorCode:s.t0.code,errorMsg:s.t0.message,errorReason:!(!s.t0.data||!s.t0.data.reason)&&s.t0.data.reason,existingContainer:e,hasExistingTag:!!e});case 18:s.next=22;break;case 20:return s.next=22,r.a.awrap(this.requestTagManagerAccountsContainers());case 22:case"end":return s.stop()}}),null,this,[[4,15]])}},{key:"requestTagManagerAccounts",value:function(){var e,t;return r.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.selectedAccount,a.next=4,r.a.awrap(M.c.get(M.b,"tagmanager","accounts"));case 4:t=a.sent,this.validateAccounts(t,e),this.setState({isLoading:!1,accounts:t}),a.next=12;break;case 9:a.prev=9,a.t0=a.catch(0),this.setState({isLoading:!1,errorCode:a.t0.code,errorMsg:a.t0.message});case 12:case"end":return a.stop()}}),null,this,[[0,9]])}},{key:"requestTagManagerAccountsContainers",value:function(){var e,t,a,n,i,o,s,l,c,d,u,g,m;return r.a.async((function(p){for(;;)switch(p.prev=p.next){case 0:return p.prev=0,e=this.state,t=e.selectedAccount,a=e.usageContext,n=this.state,i=n.selectedContainer,o=n.selectedContainerAMP,s={accountID:t,usageContext:a},p.next=6,r.a.awrap(M.c.get(M.b,"tagmanager","accounts-containers",s));case 6:l=p.sent,c=l.accounts,d=l.containers,this.validateAccounts(c,t),u=d.map((function(e){return e.publicId})),Object(x.c)(i)&&!u.includes(i)&&(i=""),Object(x.c)(o)&&!u.includes(o)&&(o=""),g=Object(x.a)(d).byContext(W),m=Object(x.a)(d).byContext(R),this.setState({isLoading:!1,accounts:c,containers:g,containersAMP:m,selectedAccount:t||Object(S.get)(d,[0,"accountId"]),selectedContainer:i||Object(S.get)(g,[0,"publicId"]),selectedContainerAMP:o||Object(S.get)(m,[0,"publicId"]),errorCode:!1,errorMsg:""}),p.next=21;break;case 18:p.prev=18,p.t0=p.catch(0),this.setState({isLoading:!1,errorCode:p.t0.code,errorMsg:p.t0.message});case 21:case"end":return p.stop()}}),null,this,[[0,18]])}},{key:"validateAccounts",value:function(e,t){if(!t&&0===e.length)throw{code:"accountEmpty",message:Object(j.__)("We didn’t find an associated Google Tag Manager account, would you like to set it up now? If you’ve just set up an account please re-fetch your account to sync it with Site Kit.","google-site-kit")};if(Object(x.b)(t)&&!e.find((function(e){return e.accountId===t})))throw{code:"insufficientPermissions",message:Object(j.__)("You currently don’t have access to this Google Tag Manager account. You can either request access from your team, or remove this Google Tag Manager snippet and connect to a different account.","google-site-kit")}}},{key:"requestTagManagerContainers",value:function(e){var t,a;return r.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return this.setState({containersLoading:!0}),n.prev=1,t={accountID:e,usageContext:this.state.usageContext},n.next=5,r.a.awrap(M.c.get(M.b,"tagmanager","containers",t));case 5:a=n.sent,this.setState({containersLoading:!1,containers:Object(x.a)(a).byContext(W),containersAMP:Object(x.a)(a).byContext(R),errorCode:!1}),n.next=12;break;case 9:n.prev=9,n.t0=n.catch(1),this.setState({containersLoading:!1,errorCode:n.t0.code,errorMsg:n.t0.message});case 12:case"end":return n.stop()}}),null,this,[[1,9]])}},{key:"handleSubmit",value:function(){var e,t,a,n,i,o,s,l,c,d;return r.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return e=this.state,t=e.hasExistingTag,a=e.selectedAccount,n=e.selectedContainer,i=e.selectedContainerAMP,o=e.usageContext,s=e.useSnippet,l=this.props.finishSetup,u.prev=2,c={accountID:a,containerID:n,ampContainerID:i,usageContext:o,useSnippet:!t&&s},u.next=6,r.a.awrap(M.c.set(M.b,"tagmanager","settings",c));case 6:d=u.sent,l&&l(),Object(A.l)().tagmanager.settings=d,this.setState({isSaving:!1}),u.next=16;break;case 12:throw u.prev=12,u.t0=u.catch(2),this.setState({isLoading:!1,isSaving:!1,errorCode:u.t0.code,errorMsg:u.t0.message}),u.t0;case 16:case"end":return u.stop()}}),null,this,[[2,12]])}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.dataset.value;n!==a&&(this.setState({selectedAccount:n,selectedContainer:"",selectedContainerAMP:""}),Object(x.b)(n)&&this.requestTagManagerContainers(n))}},{key:"refetchAccount",value:function(e){e.preventDefault(),this.setState({isLoading:!0,errorCode:!1,errorMsg:"",selectedAccount:"",selectedContainer:"",selectedContainerAMP:""},this.requestTagManagerAccounts)}},{key:"renderSettingsInfo",value:function(){var e=Object(A.l)().tagmanager.settings,t=this.state,a=t.ampEnabled,i=t.isSecondaryAMP,o=t.hasExistingTag,s=t.isLoading,r=e.accountID,l=e.useSnippet;return s?n.createElement(I.a,null):n.createElement(D.Fragment,null,n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(j.__)("Account","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},r||!1)),(!a||i)&&n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},i&&Object(j.__)("Web Container ID","google-site-kit"),!a&&Object(j.__)("Container ID","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},e.containerID||!1)),a&&n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},i&&Object(j.__)("AMP Container ID","google-site-kit"),!i&&Object(j.__)("Container ID","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},e.ampContainerID||!1))),n.createElement("div",{className:"googlesitekit-settings-module__meta-items"},n.createElement("div",{className:"googlesitekit-settings-module__meta-item"},n.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(j.__)("Tag Manager Code Snippet","google-site-kit")),n.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},l&&Object(j.__)("Snippet is inserted","google-site-kit"),!l&&Object(j.__)("Snippet is not inserted","google-site-kit")),o&&n.createElement("p",null,Object(j.__)("Placing two tags at the same time is not recommended.","google-site-kit")))))}},{key:"renderAccountDropdownForm",value:function(){var e=this,t=this.state,a=t.ampEnabled,i=t.accounts,o=t.selectedAccount,s=t.containers,r=t.containersAMP,l=t.existingContainer,c=t.hasExistingTag,d=t.isLoading,u=t.isSecondaryAMP,g=t.errorCode,m=t.useSnippet,p=this.props.onSettingsPage;if(d)return n.createElement(I.a,null);if("tag_manager_existing_tag_permission"===g)return null;if("accountEmpty"===g)return this.renderCreateAccount();if("account_create"===o)return n.createElement(D.Fragment,null,n.createElement("p",null,Object(j.__)("To create a new account, click the button below which will open the Google Tag Manager account creation screen in a new window.","google-site-kit")),n.createElement("p",null,Object(j.__)("Once completed, click the link below to re-fetch your accounts to continue.","google-site-kit")),this.renderCreateAccount());var h=!a||u,b=a;return n.createElement(D.Fragment,null,c&&n.createElement("p",null,Object(j.sprintf)(// translators: %s: the existing container ID.
19
- Object(j.__)("An existing tag was found on your site (%s). If you later decide to replace this tag, Site Kit can place the new tag for you. Make sure you remove the old tag first.","google-site-kit"),l)),!c&&!u&&n.createElement("p",null,Object(j.__)("Please select your Tag Manager account and container below, the snippet will be inserted automatically on your site.","google-site-kit")),!c&&u&&n.createElement("p",null,Object(j.__)("Looks like your site is using paired AMP. Please select your Tag Manager account and relevant containers below, the snippets will be inserted automatically on your site.","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__inputs"},n.createElement(N.k,{className:"googlesitekit-tagmanager__select-account",enhanced:!0,name:"accounts",label:Object(j.__)("Account","google-site-kit"),value:o,disabled:c,onEnhancedChange:this.handleAccountChange,outlined:!0},[].concat(i).concat(c?[]:{name:Object(j.__)("Set up a new account","google-site-kit"),accountId:"account_create"}).map((function(e){return n.createElement(N.j,{key:e.accountId,value:e.accountId},e.name)}))),h&&this.renderContainerSelect({selectedStateKey:"selectedContainer",containers:s,label:b?Object(j.__)("Web Container","google-site-kit"):null,type:W}),b&&this.renderContainerSelect({selectedStateKey:"selectedContainerAMP",containers:r,label:h?Object(j.__)("AMP Container","google-site-kit"):null,type:R})),p&&n.createElement(D.Fragment,null,c&&n.createElement("p",null,Object(j.__)("Placing two tags at the same time is not recommended.","google-site-kit")),n.createElement(L.a,{id:"tagmanagerUseSnippet",onClick:function(){return e.setState({useSnippet:!m})},name:"useSnippet",checked:m,label:Object(j.__)("Let Site Kit place code on your site","google-site-kit"),hideLabel:!1}),n.createElement("p",null,m?Object(j.__)("Site Kit will add the code automatically","google-site-kit"):Object(j.__)("Site Kit will not add the code to your site","google-site-kit"))),!p&&n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(P.a,{onClick:this.handleSubmit,disabled:!this.canSaveSettings()},Object(j.__)("Confirm & Continue","google-site-kit"))))}},{key:"renderContainerSelect",value:function(e){var t=this,a=e.label,i=e.selectedStateKey,s=e.containers,r=e.type,l=this.state,c=l.containersLoading,d=l.selectedAccount,u=l.hasExistingTag,g=!!s.length;return c?n.createElement(I.a,{small:!0}):n.createElement(N.k,{className:"\n\t\t\t\t\tgooglesitekit-tagmanager__select-container\n\t\t\t\t\tgooglesitekit-tagmanager__select-container--".concat(r,"\n\t\t\t\t"),label:a||Object(j.__)("Container","google-site-kit"),value:g?this.state[i]:"container_create",onEnhancedChange:function(e,a){return t.setState(o()({},i,a.dataset.value))},disabled:u||!Object(x.b)(d),enhanced:!0,outlined:!0},[].concat(s).concat(u?[]:{name:Object(j.__)("Set up a new container","google-site-kit"),publicId:"container_create"}).map((function(e,t){var a=e.name,i=e.publicId;return n.createElement(N.j,{key:t,value:i},a)})))}},{key:"canSaveSettings",value:function(){var e=this.state,t=e.ampEnabled,a=e.isSecondaryAMP,n=e.errorCode,i=e.isLoading,o=e.selectedAccount,s=e.selectedContainer,r=e.selectedContainerAMP;return!(i||"tag_manager_existing_tag_permission"===n||!Object(x.b)(o))&&(!!(t&&!a||Object(x.c)(s)||"container_create"===s)&&!(t&&!Object(x.c)(r)&&"container_create"!==r))}},{key:"renderCreateAccount",value:function(){return n.createElement("div",{className:"googlesitekit-setup-module__action"},n.createElement(P.a,{onClick:TagmanagerSetup.createNewAccount},Object(j.__)("Create an account","google-site-kit")),n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(T.a,{onClick:this.refetchAccount},Object(j.__)("Re-fetch My Account","google-site-kit"))))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,i=this.props.onSettingsPage;if(0===a.length)return null;var o=!i||"insufficientPermissions"!==t;return n.createElement("div",{className:E()({"googlesitekit-error-text":o})},n.createElement("p",null,o
20
- /* translators: %s: Error message */?Object(j.sprintf)(Object(j.__)("Error: %s","google-site-kit"),a):a))}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--tag-manager"},!t&&n.createElement(D.Fragment,null,n.createElement("div",{className:"googlesitekit-setup-module__logo"},n.createElement(w.a,{id:"tagmanager",width:"33",height:"33"})),n.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(j._x)("Tag Manager","Service name","google-site-kit"))),this.renderErrorOrNotice(),a&&this.renderAccountDropdownForm(),!a&&this.renderSettingsInfo())}}],[{key:"createNewAccount",value:function(t){t.preventDefault(),e.open("https://tagmanager.google.com/#/admin/accounts/create","_blank")}}]),TagmanagerSetup}(D.Component);U.propTypes={onSettingsPage:v.a.bool,finishSetup:v.a.func,isEditing:v.a.bool},U.defaultProps={onSettingsPage:!0,isEditing:!1},t.a=U}).call(this,a(16),a(1))},,,function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(15),g=a.n(u),m=a(9),p=a.n(m),h=a(0),b=a(1),_=a(12),f=a(25),y=function(t){function DateRangeSelector(e){var t;return i()(this,DateRangeSelector),(t=l()(this,d()(DateRangeSelector).call(this,e))).dateRangeHook="googlesitekit.dateRange",t.dateRangeHandlerHook="googlesitekit.dateRageHandler",t.dateRangeHookAddedHook="googlesitekit.dateRageHookAddedHandler",t.state={context:"Dashboard",dateValue:Object(_.c)(t.dateRangeHook,"last-28-days")},Object(_.a)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector",(function(e){t.setState({context:e}),Object(_.e)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector")})),t.handleSelection=t.handleSelection.bind(g()(t)),t}return p()(DateRangeSelector,t),s()(DateRangeSelector,[{key:"componentDidMount",value:function(){var e=this;Object(_.a)("hookAdded",this.dateRangeHookAddedHook,(function(t){e.dateRangeHook===t&&e.forceUpdate()}))}},{key:"componentWillUnmount",value:function(){Object(_.e)("hookAdded",this.dateRangeHookAddedHook)}},{key:"handleSelection",value:function(e,t){var a=this.state.context,n=t.getAttribute("data-value");return Object(_.f)(this.dateRangeHook,this.dateRangeHandlerHook),Object(_.b)(this.dateRangeHook,this.dateRangeHandlerHook,(function(){return n})),Object(_.d)("googlesitekit.moduleDataReset"),Object(_.d)("googlesitekit.moduleLoaded",a),this.setState({dateValue:Object(_.c)(this.dateRangeHook,"last-28-days")}),!1}},{key:"render",value:function(){var t=this.state.dateValue,a={"last-7-days":Object(h.sprintf)(Object(h._n)("Last %s day","Last %s days",7,"google-site-kit"),7),"last-14-days":Object(h.sprintf)(Object(h._n)("Last %s day","Last %s days",14,"google-site-kit"),14),"last-28-days":Object(h.sprintf)(Object(h._n)("Last %s day","Last %s days",28,"google-site-kit"),28),"last-90-days":Object(h.sprintf)(Object(h._n)("Last %s day","Last %s days",90,"google-site-kit"),90)};return e.createElement(f.k,{enhanced:!0,className:"mdc-select--minimal",name:"time_period",label:"",onEnhancedChange:this.handleSelection,value:t},Object.keys(a).map((function(t){return e.createElement(f.j,{key:t,value:t},a[t])})))}}]),DateRangeSelector}(b.Component);t.a=y}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=function(t){function Spinner(){return i()(this,Spinner),l()(this,d()(Spinner).apply(this,arguments))}return g()(Spinner,t),s()(Spinner,[{key:"render",value:function(){var t=this.props.isSaving;return e.createElement("span",{className:"spinner",style:{display:t?"inline-block":"none",float:"none",marginTop:"0",visibility:"visible"}})}}]),Spinner}(m.Component);t.a=p}).call(this,a(1))},,,,,,,,,,,,,,,,function(e,t,a){"use strict";(function(e){var n=a(11),i=a.n(n),o=a(5),s=a.n(o),r=a(6),l=a.n(r),c=a(7),d=a.n(c),u=a(8),g=a.n(u),m=a(15),p=a.n(m),h=a(9),b=a.n(h),_=a(14),f=a.n(_),y=a(1),k=a(0),v=a(127),S=a(131),O=a(69),E=a(132),j=a(46),D=a(39),C=a(30),w=a(82),A=a(38),x=a(58),N=a(83),P=a(2),T=a(55),L=a(56),M=a(53),I=a(21),W=function(t){function AdSenseDashboardWidget(e){var t;return s()(this,AdSenseDashboardWidget),(t=d()(this,g()(AdSenseDashboardWidget).call(this,e))).state={receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0,zeroData:!1,instructionProps:{}},t.handleDataError=t.handleDataError.bind(p()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(p()(t)),t.handleZeroData=t.handleZeroData.bind(p()(t)),t}return b()(AdSenseDashboardWidget,t),l()(AdSenseDashboardWidget,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(A.b)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleZeroData",value:function(){var e=Object(A.d)("account-connected-no-data");this.setState({zeroData:!0,loading:!1,instructionProps:e})}},{key:"render",value:function(){var t=this,a=Object(P.l)(),n=this.state,i=n.receivingData,o=n.error,s=n.loading,r=n.isAdSenseConnected,l=n.zeroData,c=n.instructionProps,d=a.adsense.homepage,u=s||!i||l?"googlesitekit-nodata":"";return e.createElement(y.Fragment,null,e.createElement(L.a,null),e.createElement("div",{className:u},e.createElement(O.a,{module:"adsense"})),e.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},!o&&a.adsense.setupComplete?e.createElement(M.a,{title:Object(k._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"connected",statusText:Object(k.__)("AdSense is connected","google-site-kit")}):e.createElement(M.a,{title:Object(k._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"not-connected",statusText:Object(k.__)("AdSense is not connected","google-site-kit")}),s&&e.createElement(C.a,null)),l&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(I.a,{fill:!0},e.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e.createElement(N.a,{ctaLink:c.ctaLink,ctaLinkText:c.ctaLinkText,header:c.statusHeadline,subHeader:c.statusMessage,incomplete:c.incomplete,required:c.required})))))),!i&&(o?Object(D.a)(Object(k._x)("AdSense","Service name","google-site-kit"),o,!0,!0,!0):Object(j.a)(Object(k._x)("AdSense","Service name","google-site-kit"),!0,!0,!0)),e.createElement("div",{className:f()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",u)},e.createElement(x.a,{slug:"adsense",context:"module-dashboard"}),e.createElement(I.a,{header:!0,title:Object(k.__)("Estimated earnings","google-site-kit"),headerCtaLabel:Object(k.__)("Advanced Settings","google-site-kit"),headerCtaLink:d},e.createElement(v.a,{handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}))),e.createElement("div",{className:f()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",u)},e.createElement(I.a,{header:!0,title:Object(k.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(k.__)("Advanced Settings","google-site-kit"),headerCtaLink:d},e.createElement(S.a,{handleDataError:function(e){e||t.handleZeroData()}}))),e.createElement("div",{className:f()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",u)},e.createElement(E.a,null)),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},e.createElement(T.a,null))))),!r&&e.createElement(w.a,null))}}]),AdSenseDashboardWidget}(y.Component);t.a=W}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(0),p=a(1),h=a(2),b=a(26),_=a(23),f=a(19),y=a(10),k=a(38),v=function(t){function AdSenseEstimateEarningsWidget(e){var t;return i()(this,AdSenseEstimateEarningsWidget),(t=l()(this,d()(AdSenseEstimateEarningsWidget).call(this,e))).state={refetch:!1,today:!1,yesterday:!1,sevenDays:!1,month:!1,twentyEightDays:!1,sameDayLastWeek:!1,prev7Days:!1,monthLastYear:!1,prev28Days:!1,error:!1,message:""},t}return g()(AdSenseEstimateEarningsWidget,t),s()(AdSenseEstimateEarningsWidget,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var e=this.state,t=e.today,a=e.yesterday,n=e.sevenDays,i=e.month,o=e.twentyEightDays,s=e.sameDayLastWeek,r=e.prev7Days,l=e.monthLastYear,c=e.prev28Days;if(!(t&&a&&n&&i&&o&&s&&r&&l&&c))return null;var d=t.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),u=!!d&&d.currency,g=t.totals?[{className:"googlesitekit-data-block--today",title:Object(m.__)("Today so far","google-site-kit"),datapoint:Object(h.v)(t.totals[0],u)},{className:"googlesitekit-data-block--yesterday",title:Object(m.__)("Yesterday","google-site-kit"),datapoint:Object(h.v)(a.totals[0],u),change:s.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--7days",title:Object(m.__)("Last 7 days","google-site-kit"),datapoint:Object(h.v)(n.totals[0],u),change:r.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--month",title:Object(m.__)("This month","google-site-kit"),datapoint:Object(h.v)(i.totals[0],u),change:l.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--28days",title:Object(m.__)("Last 28 days","google-site-kit"),datapoint:Object(h.v)(o.totals[0],u),change:c.totals[0],changeDataUnit:"%"}]:[];return AdSenseEstimateEarningsWidget.renderLayout(g)}}],[{key:"renderLayout",value:function(t){return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},t.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement(b.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection}))}))))}},{key:"renderPreviews",value:function(){for(var t=[],a=0;5>a;a++)t.push(e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement(_.a,{width:"100%",height:"104px"})));return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},t))}}]),AdSenseEstimateEarningsWidget}(p.Component);t.a=Object(f.a)(v,[{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"yesterday"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.yesterday)return{yesterday:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"same-day-last-week"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sameDayLastWeek)return{sameDayLastWeek:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-7-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sevenDays)return{sevenDays:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-7-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev7Days)return{prev7Days:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.month)return{month:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month-last-year"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.monthLastYear)return{monthLastYear:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:y.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],v.renderPreviews(),{createGrid:!0},k.c)}).call(this,a(1))},,,function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(1),h=a(0),b=a(29),_=function(t){function InvalidCredentialsWarning(){return o()(this,InvalidCredentialsWarning),c()(this,u()(InvalidCredentialsWarning).apply(this,arguments))}return m()(InvalidCredentialsWarning,t),r()(InvalidCredentialsWarning,[{key:"render",value:function(){return e.createElement(b.a,{id:"notification-id",title:Object(h.__)("Security Token Error","google-site-kit"),description:Object(h.__)("We’re unable to retrieve your data because your security token is expired or revoked. Please ","google-site-kit"),learnMoreURL:n.googlesitekit.admin.connectURL,learnMoreLabel:Object(h.__)("reauthenticate your account","google-site-kit"),format:"small",type:"win-error"})}}]),InvalidCredentialsWarning}(p.Component);t.a=_}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(0),p=a(1),h=a(13),b=a(2),_=a(10),f=a(26),y=a(23),k=a(38),v=a(19),S=function(t){function AdSensePerformanceWidget(e){var t;return i()(this,AdSensePerformanceWidget),(t=l()(this,d()(AdSensePerformanceWidget).call(this,e))).state={twentyEightDays:!1,prev28Days:!1},t}return g()(AdSensePerformanceWidget,t),s()(AdSensePerformanceWidget,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var t=this.state,a=t.twentyEightDays,n=t.prev28Days,i=a.totals?[{className:"googlesitekit-data-block--page-rpm",title:Object(m.__)("Page RPM","google-site-kit"),datapoint:Object(b.v)(a.totals[1]),change:Object(h.isUndefined)(n.totals)?0:n.totals[1],changeDataUnit:"%"},{className:"googlesitekit-data-block--impression",title:Object(m.__)("Impressions","google-site-kit"),datapoint:Object(b.v)(a.totals[2]),change:Object(h.isUndefined)(n.totals)?0:n.totals[2],changeDataUnit:"%"}]:[];return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},i.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-top mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement(f.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection}))}))))}}]),AdSensePerformanceWidget}(p.Component);t.a=Object(v.a)(S,[{type:_.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(b.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:_.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(b.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],e.createElement(y.a,{width:"100%",height:"250px"}),{},k.c)}).call(this,a(1))},function(e,t,a){"use strict";var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(51),p=a(1),h=function(e){function DashboardAdSenseTopPages(){return i()(this,DashboardAdSenseTopPages),l()(this,d()(DashboardAdSenseTopPages).apply(this,arguments))}return g()(DashboardAdSenseTopPages,e),s()(DashboardAdSenseTopPages,[{key:"render",value:function(){return null}}]),DashboardAdSenseTopPages}(p.Component);t.a=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTable")(h)},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(0),h=a(37),b=a(134),_=a(135),f=a(58),y=function(t){function DashboardEarnings(){return i()(this,DashboardEarnings),l()(this,d()(DashboardEarnings).apply(this,arguments))}return g()(DashboardEarnings,t),s()(DashboardEarnings,[{key:"render",value:function(){return e.createElement(m.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(h.a,{title:Object(p.__)("Earnings","google-site-kit"),description:Object(p.__)("How much you’re earning from your content through AdSense.","google-site-kit")}),e.createElement(f.a,{slug:"adsense",context:"module-sitekit-dashboard"})),e.createElement(_.a,null),e.createElement(b.a,null))}}]),DashboardEarnings}(m.Component);t.a=y}).call(this,a(1))},function(e,t,a){"use strict";var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(51),p=a(1),h=function(e){function DashboardAdSenseTopEarningPagesSmall(){return i()(this,DashboardAdSenseTopEarningPagesSmall),l()(this,d()(DashboardAdSenseTopEarningPagesSmall).apply(this,arguments))}return g()(DashboardAdSenseTopEarningPagesSmall,e),s()(DashboardAdSenseTopEarningPagesSmall,[{key:"render",value:function(){return null}}]),DashboardAdSenseTopEarningPagesSmall}(p.Component);t.a=Object(m.a)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall")(h)},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(0),p=a(1),h=a(38),b=a(21),_=a(19),f=a(10),y=a(23),k=a(2),v=a(26),S=a(43),O=function(t){function AdSenseDashboardMainSummary(e){var t;return i()(this,AdSenseDashboardMainSummary),(t=l()(this,d()(AdSenseDashboardMainSummary).call(this,e))).state={today:!1,period:!1,daily:!1},t}return g()(AdSenseDashboardMainSummary,t),s()(AdSenseDashboardMainSummary,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var t=this.state,a=t.today,n=t.period,i=t.daily;if(!(a&&n&&i&&n.totals))return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(b.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},e.createElement(y.a,{width:"100%",height:"276px",padding:!0})));var o=Object(h.e)(i.rows),s=Object(k.o)("googlesitekit-module-adsense",{}),r=n.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),l=!!r&&r.currency;return e.createElement(p.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(b.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(v.a,{className:"overview-adsense-rpm",title:Object(m.__)("RPM","google-site-kit"),datapoint:Object(k.v)(n.totals[1],l),source:{name:Object(m._x)("AdSense","Service name","google-site-kit"),link:s},sparkline:i&&e.createElement(S.a,{data:Object(k.e)(o.dataMap,2),change:1,loadSmall:!1}),context:"compact"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(v.a,{className:"overview-adsense-earnings",title:Object(m.__)("Total Earnings","google-site-kit"),datapoint:Object(k.v)(n.totals[0],l),source:{name:Object(m._x)("AdSense","Service name","google-site-kit"),link:s},change:a.totals[0],changeDataUnit:"quot;,sparkline:i&&e.createElement(S.a,{data:Object(k.e)(o.dataMap,1),change:1,loadSmall:!1}),context:"compact"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(v.a,{className:"overview-adsense-impressions",title:Object(m.__)("Ad Impressions","google-site-kit"),datapoint:Object(k.v)(n.totals[2]),source:{name:Object(m._x)("AdSense","Service name","google-site-kit"),link:s},sparkline:i&&e.createElement(S.a,{data:Object(k.e)(o.dataMap,3),change:1,loadSmall:!1}),context:"compact"})))))))}}]),AdSenseDashboardMainSummary}(p.Component);t.a=Object(_.a)(O,[{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(k.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{},priority:1,maxAge:Object(k.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.period)return{period:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month",dimensions:["DATE"]},priority:1,maxAge:Object(k.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.daily)return{daily:a}}}],e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(b.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},e.createElement(y.a,{width:"100%",height:"276px",padding:!0}))),{inGrid:!0,createGrid:!0},h.c)}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(64),o=a.n(i),s=a(20),r=a.n(s),l=a(11),c=a.n(l),d=a(5),u=a.n(d),g=a(6),m=a.n(g),p=a(7),h=a.n(p),b=a(8),_=a.n(b),f=a(9),y=a.n(f),k=a(3),v=a.n(k),S=a(1),O=a(0),E=a(24),j=a(137),D=a(83),C=a(2),w=a(38);function A(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function x(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?A(a,!0).forEach((function(t){r()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):A(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var N=function(t){function AdSenseModuleStatus(e){var t;return u()(this,AdSenseModuleStatus),(t=h()(this,_()(AdSenseModuleStatus).call(this,e))).state={accountStatus:void 0,loadingMessage:Object(O.__)("Loading…","google-site-kit"),instructionProps:{}},t}return y()(AdSenseModuleStatus,t),m()(AdSenseModuleStatus,[{key:"componentDidMount",value:function(){return c.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,c.a.awrap(this.updateAccountStatus());case 2:case"end":return e.stop()}}),null,this)}},{key:"componentDidUpdate",value:function(e,t){var a=this.state.accountStatus;if(t.accountStatus!==a){var n=Object(w.d)(a);this.setState({instructionProps:n})}}},{key:"continueSetup",value:function(e){var t=this.state.instructionProps;e.existingState=x({},t),this.setState({instructionProps:e})}},{key:"goBack",value:function(){var e=x({},this.state.instructionProps).existingState;e&&(e.existingState=!1,this.setState({instructionProps:e}))}},{key:"updateAccountStatus",value:function(){var e,t,a,n,i,o=this;return c.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return s.next=2,c.a.awrap(Object(C.j)("adsense"));case 2:return e=s.sent,t=function(e){o.setState({loadingMessage:e})},s.next=6,c.a.awrap(Object(w.a)(e,t));case 6:a=s.sent,n=a.accountStatus,i=a.clientID,this.setState({accountStatus:n,clientID:i});case 10:case"end":return s.stop()}}),null,this)}},{key:"render",value:function(){var t=Object(C.l)(),a=this.state,i=a.accountStatus,s=a.clientID,r=a.loadingMessage,l=a.instructionProps,c=!i||!t.adsense.setupComplete||["ads-display-pending","account-pending-review","account-required-action"].includes(i);return e.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},e.createElement("div",{className:"googlesitekit-setup-module__step"},e.createElement("div",{className:"googlesitekit-setup-module__logo"},e.createElement(E.a,{id:"adsense",width:"33",height:"33"})),e.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(O._x)("AdSense","Service name","google-site-kit"))),e.createElement("div",{className:"googlesitekit-setup-module__step"},!n.googlesitekit.canAdsRun&&!t.adsense.setupComplete&&e.createElement("div",{className:"googlesitekit-settings-module-warning"},e.createElement(E.a,{id:"error",height:"20",width:"23"}),Object(O.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit")),c&&"account-connected"!==i&&e.createElement(D.a,{ctaLink:l.ctaLink,ctaLinkText:l.ctaLinkText,header:l.statusHeadline,subHeader:l.statusMessage,incomplete:l.incomplete,required:l.required,loadingMessage:!i&&r}),n.googlesitekit.canAdsRun&&i&&(t.adsense.setupComplete||"account-connected"===i)&&e.createElement(j.a,o()({},l,{accountStatus:i,clientID:s,continueSetup:this.continueSetup,goBack:this.goBack}))))}}]),AdSenseModuleStatus}(S.Component);N.propTypes={status:v.a.string,module:v.a.string},t.a=N}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(1),h=a(0),b=a(24),_=a(2),f=a(84),y=a(10),k=a(110),v=a(18),S=a(31),O=function(t){function AdSenseSetupInstructions(e){var t;return o()(this,AdSenseSetupInstructions),(t=c()(this,u()(AdSenseSetupInstructions).call(this,e))).state={isSaving:!1},t}return m()(AdSenseSetupInstructions,t),r()(AdSenseSetupInstructions,[{key:"render",value:function(){var t=this,a=this.props,i=a.error,o=a.message,s=a.issue,r=a.notice,l=a.statusHeadline,c=a.statusMessage,d=a.profile,u=a.ctaLinkText,g=a.ctaLink,m=a.footerText,O=a.footerAppendedText,E=a.footerCTA,j=a.footerCTALink,D=a.continueAction,C=a.continueSetup,w=a.accountStatus,A=a.accountTagMatch,x=a.clientID,N=a.existingTag,P=a.switchLabel,T=a.tracking,L=a.switchOffMessage,M=a.switchOnMessage,I=a.goBack,W=a.existingState,R=this.state.isSaving,U=e.googlesitekit.admin.userData,F=U.email,q=void 0===F?"":F,H=U.picture,z=void 0===H?"":H;return n.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},n.createElement("div",{className:"googlesitekit-setup-module__step"},s&&n.createElement("p",{className:"googlesitekit-setup__notice"},n.createElement(b.a,{id:"error",height:"20",width:"23"}),n.createElement("span",{className:"googlesitekit-setup__notice-text"},s)),n.createElement("h2",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},l),n.createElement("p",null,c),d&&n.createElement("p",{className:"googlesitekit-setup-module__user"},z&&n.createElement("img",{className:"googlesitekit-setup-module__user-image",src:z,alt:Object(h.__)("User Avatar","google-site-kit")}),n.createElement("span",{className:"googlesitekit-setup-module__user-email"},q)),"account-connected"===w&&n.createElement(f.a,{isEditing:!0,accountTagMatch:A,existingTag:N,saveOnChange:!0,switchLabel:P,switchOffMessage:L,switchOnMessage:M}),r&&n.createElement("div",{className:"googlesitekit-settings-notice"},n.createElement("div",{className:"googlesitekit-settings-notice__text"},r)),i&&0<o.length&&n.createElement("div",{className:"googlesitekit-error-text"},n.createElement("p",null,Object(h.__)("Error:","google-site-kit")," ",o)),n.createElement("div",{className:"googlesitekit-setup-module__action"},"account-connected"===w&&n.createElement(p.Fragment,null,n.createElement(S.a,{disabled:R,onClick:function(){T&&Object(_.B)(T.eventCategory,T.eventName),t.setState({isSaving:!0});var e=document.getElementById("enableAutoAds"),a=e&&e.checked;y.c.set(y.b,"adsense","setup-complete",{clientID:x,useSnippet:a}).then((function(){document.location=g})).catch((function(){t.setState({isSaving:!1})}))}},u),n.createElement(k.a,{isSaving:R})),"account-connected"!==w&&n.createElement(v.a,{className:"googlesitekit-setup-module__cta-link",external:!0,inherit:!0,href:g},u),D&&n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(v.a,{inherit:!0,onClick:function(){C(D)}},D.continueText)),W&&n.createElement("div",{className:"googlesitekit-setup-module__sub-action"},n.createElement(v.a,{inherit:!0,onClick:function(){I()}},Object(h.__)("Back","google-site-kit")))),m&&n.createElement("p",{className:"googlesitekit-setup-module__footer-text"},m," ",E&&n.createElement(v.a,{href:j,inherit:!0,external:!0},E)," ",O)))}}]),AdSenseSetupInstructions}(p.Component);t.a=O}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(1),h=a(0),b=a(2),_=a(18),f=function(t){function AdSenseSettingsStatus(){return o()(this,AdSenseSettingsStatus),c()(this,u()(AdSenseSettingsStatus).apply(this,arguments))}return m()(AdSenseSettingsStatus,t),r()(AdSenseSettingsStatus,[{key:"render",value:function(){var t=this.props,a=t.slug,i=t.screenID,o=t.OriginalComponent,s=Object(b.l)().adsense.settings.accountStatus;return s&&"adsense"===a&&("account-pending-review"===s||"ads-display-pending"===s)?e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},Object(h.__)("Site Kit has placed the code on your site, ","google-site-kit"),e.createElement(_.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){var e=i||"googlesitekit-dashboard";n.location=Object(b.o)(e,{reAuth:!0,slug:a})},inherit:!0},Object(h.__)("check module page","google-site-kit"))):e.createElement(o,this.props)}}]),AdSenseSettingsStatus}(p.Component);t.a=f}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(14),h=a.n(p),b=a(1),_=a(0),f=a(2),y=a(24),k=function(t){function AdSenseSettingsWarning(){return o()(this,AdSenseSettingsWarning),c()(this,u()(AdSenseSettingsWarning).apply(this,arguments))}return m()(AdSenseSettingsWarning,t),r()(AdSenseSettingsWarning,[{key:"render",value:function(){var t=this.props,a=t.slug,i=t.context,o=t.OriginalComponent;if("adsense"!==a)return e.createElement(o,this.props);var s=Object(f.l)().adsense,r=s.active,l=s.setupComplete,c=Object(_.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit");return r&&l&&(c=Object(_.__)("Ad blocker detected, You need to disable it to get the AdSense latest data.","google-site-kit")),n.googlesitekit.canAdsRun?e.createElement(o,this.props):e.createElement("div",{className:h()("googlesitekit-settings-module-warning","googlesitekit-settings-module-warning--".concat(i))},e.createElement(y.a,{id:"error",height:"20",width:"23"})," ",c)}}]),AdSenseSettingsWarning}(b.Component);t.a=k}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var n=a(11),i=a.n(n),o=a(5),s=a.n(o),r=a(6),l=a.n(r),c=a(7),d=a.n(c),u=a(8),g=a.n(u),m=a(15),p=a.n(m),h=a(9),b=a.n(h),_=a(14),f=a.n(_),y=a(1),k=a(0),v=a(56),S=a(141),O=a(142),E=a(143),j=a(85),D=a(21),C=a(53),w=a(70),A=a(69),x=a(30),N=a(46),P=a(39),T=a(82),L=a(38),M=a(2),I=a(55),W=function(t){function AnalyticsDashboardWidget(e){var t;return s()(this,AnalyticsDashboardWidget),(t=d()(this,g()(AnalyticsDashboardWidget).call(this,e))).state={selectedStats:[0],receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0},t.handleStatSelection=t.handleStatSelection.bind(p()(t)),t.buildSeries=t.buildSeries.bind(p()(t)),t.handleDataError=t.handleDataError.bind(p()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(p()(t)),t}return b()(AnalyticsDashboardWidget,t),l()(AnalyticsDashboardWidget,[{key:"componentDidMount",value:function(){this.isAdSenseConnected()}},{key:"isAdSenseConnected",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(L.b)());case 2:e.sent?this.setState({isAdSenseConnected:!0}):this.setState({isAdSenseConnected:!1});case 4:case"end":return e.stop()}}),null,this)}},{key:"handleStatSelection",value:function(e){this.setState({selectedStats:[e]})}},{key:"handleDataError",value:function(e){this.setState({receivingData:!1,loading:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return{0:{color:t[e],targetAxisIndex:0},1:{color:t[e],targetAxisIndex:0,lineDashStyle:[3,3],lineWidth:1}}}},{key:"render",value:function(){var t=this.state,a=t.selectedStats,n=t.error,i=t.receivingData,o=t.loading,s=t.isAdSenseConnected,r=this.buildSeries(),l=!o&&i?"":"googlesitekit-nodata",c=Object(M.g)();return e.createElement(y.Fragment,null,e.createElement(v.a,null),e.createElement(A.a,{module:"analytics"}),e.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--analytics"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(C.a,{title:Object(k._x)("Analytics","Service name","google-site-kit"),icon:!0,iconWidth:"24",iconHeight:"26",iconID:"analytics",status:"connected",statusText:Object(k.__)("Analytics is connected","google-site-kit")}),o&&e.createElement(x.a,null)),!i&&(n?Object(P.a)(Object(k._x)("Analytics","Service name","google-site-kit"),n,!0,!0,!0):Object(N.a)(Object(k._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)),e.createElement("div",{className:f()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",l)},e.createElement(D.a,{header:!0
21
- /* translators: %s: date range */,title:Object(k.sprintf)(Object(k.__)("Audience overview for the last %s","google-site-kit"),c),headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),headerCtaLink:"http://analytics.google.com"},e.createElement(E.a,{selectedStats:a,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),e.createElement(S.a,{selectedStats:a,series:r,vAxes:null,dateRangeSlug:Object(M.h)()}))),e.createElement("div",{className:f()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",l)},e.createElement(D.a,{header:!0,footer:!0
22
- /* translators: %s: date range */,title:Object(k.sprintf)(Object(k.__)("Top content over the last %s","google-site-kit"),c),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(k._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},e.createElement(O.a,null))),e.createElement("div",{className:f()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",l)},e.createElement(D.a,{header:!0,footer:!0
23
- /* translators: %s: date range */,title:Object(k.sprintf)(Object(k.__)("Top acquisition sources over the last %s","google-site-kit"),c),headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(k._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(w.a,null)),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(j.a,null)))))),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},e.createElement(I.a,null))))),!o&&!s&&e.createElement(T.a,null))}}]),AnalyticsDashboardWidget}(y.Component);t.a=W}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(15),m=a.n(g),p=a(9),h=a.n(p),b=a(0),_=a(1),f=a(2),y=a(47),k=a(19),v=a(10),S=a(17),O=a(23),E=function(t){function AnalyticsDashboardWidgetSiteStats(e){var t;return o()(this,AnalyticsDashboardWidgetSiteStats),(t=c()(this,u()(AnalyticsDashboardWidgetSiteStats).call(this,e))).setOptions=t.setOptions.bind(m()(t)),t}return h()(AnalyticsDashboardWidgetSiteStats,t),r()(AnalyticsDashboardWidgetSiteStats,[{key:"setOptions",value:function(){var t=this.props,a=t.series,n=t.vAxes,i={chart:{title:""===e.googlesitekit.pageTitle?"":Object(b.__)("Users Traffic Summary","google-site-kit")},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return i.series=a,i.vAxes=n,i}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,i=e.dateRangeSlug;if(!t||!t.length)return null;var o=i?i.match(/\d+/).map(Number)[0]:28,s=Object(S.c)(t,a,o);if(!s)return null;var r=this.setOptions();return n.createElement("section",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n.createElement(y.a,{selectedStats:a,data:s,options:r}))))}}]),AnalyticsDashboardWidgetSiteStats}(_.Component);t.a=Object(k.a)(E,[{type:v.b,identifier:"analytics",datapoint:"report",data:S.j,priority:1,maxAge:Object(f.q)("day"),context:"Single"}],n.createElement(O.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(50),i=a.n(n),o=a(5),s=a.n(o),r=a(6),l=a.n(r),c=a(7),d=a.n(c),u=a(8),g=a.n(u),m=a(9),p=a.n(m),h=a(14),b=a.n(h),_=a(13),f=a(3),y=a.n(f),k=a(0),v=a(1),S=a(2),O=a(19),E=a(10),j=a(27),D=a(35),C=a(17),w=function(t){function AnalyticsDashboardWidgetTopPagesTable(){return s()(this,AnalyticsDashboardWidgetTopPagesTable),d()(this,g()(AnalyticsDashboardWidgetTopPagesTable).apply(this,arguments))}return p()(AnalyticsDashboardWidgetTopPagesTable,t),l()(AnalyticsDashboardWidgetTopPagesTable,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.colspan;if(!a||!a.length)return null;var o=[{title:Object(k.__)("Title","google-site-kit"),tooltip:Object(k.__)("Page Title","google-site-kit"),primary:!0},{title:Object(k.__)("Pageviews","google-site-kit"),tooltip:Object(k.__)("Pageviews","google-site-kit")},{title:Object(k.__)("Unique Pageviews","google-site-kit"),tooltip:Object(k.__)("Unique Pageviews","google-site-kit")},{title:Object(k.__)("Bounce Rate","google-site-kit"),tooltip:Object(k.__)("Bounce Rate","google-site-kit")}],s=[],r=Object(_.map)(a[0].data.rows,(function(t,a){var n=Number(t.metrics[0].values[2]),o=i()(t.dimensions,2),r=o[0],l=o[1];return s[a]=AnalyticsDashboardWidgetTopPagesTable.addDeepLink(l),[r,Object(S.t)(t.metrics[0].values[0]),Object(S.t)(t.metrics[0].values[1]),e.createElement(v.Fragment,{key:"minichart-"+a},e.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")))]})),l={hideHeader:!1,chartsEnabled:!1,links:s},c=Object(j.b)(r,o,l);return e.createElement("div",{className:b()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-".concat(n))},e.createElement(j.a,null,c))}}],[{key:"addDeepLink",value:function(e){var t=Object(S.l)().analytics.settings,a=t.accountID,n=t.internalWebPropertyID,i=t.profileID;return a?"https://analytics.google.com/analytics/web/#/report/content-drilldown/a".concat(a,"w").concat(n,"p").concat(i,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:").concat(encodeURIComponent(e.replace(/\//g,"~2F"))):"https://analytics.google.com/analytics/web/"}}]),AnalyticsDashboardWidgetTopPagesTable}(v.Component);w.propTypes={data:y.a.array,colspan:y.a.number},w.defaultProps={data:null,colspan:12},t.a=Object(O.a)(w,[{type:E.b,identifier:"analytics",datapoint:"report",data:Object(C.g)(),priority:1,maxAge:Object(S.q)("day"),context:["Single","Dashboard"]}],e.createElement(D.a,{padding:!0}),{createGrid:!0})}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(13),b=a(0),_=a(1),f=a(2),y=a(26),k=a(19),v=a(10),S=a(17),O=a(23),E=function(t){function AnalyticsDashboardWidgetOverview(e){var t;return i()(this,AnalyticsDashboardWidgetOverview),(t=l()(this,d()(AnalyticsDashboardWidgetOverview).call(this,e))).state={report:!1,directTotalUsers:!1},t}return g()(AnalyticsDashboardWidgetOverview,t),s()(AnalyticsDashboardWidgetOverview,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props.requestDataToState;this.setState(e)}},{key:"render",value:function(){var t=this.props,a=t.selectedStats,n=t.handleStatSelection,i=this.state,o=i.report,s=i.directTotalUsers;if(!o||!o.length||!s)return null;var r=Object(S.b)(o);if(!r)return null;var l=r.totalSessions,c=r.averageBounceRate,d=r.averageSessionDuration,u=r.totalUsersChange,g=r.totalSessionsChange,m=r.averageBounceRateChange,p=r.averageSessionDurationChange,h=[{className:"googlesitekit-data-block--users googlesitekit-data-block--button-1",title:Object(b.__)("Users","google-site-kit"),datapoint:Object(f.v)(s),change:u,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--sessions googlesitekit-data-block--button-2",title:Object(b.__)("Sessions","google-site-kit"),datapoint:Object(f.v)(l),change:g,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--bounce googlesitekit-data-block--button-3",title:Object(b.__)("Bounce Rate","google-site-kit"),datapoint:Number(c).toFixed(2),change:m,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n,datapointUnit:"%",invertChangeColor:!0},{className:"googlesitekit-data-block--duration googlesitekit-data-block--button-4",title:Object(b.__)("Session Duration","google-site-kit"),datapoint:Object(f.u)(d),change:p,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},h.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(y.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection,datapointUnit:t.datapointUnit,invertChangeColor:t.invertChangeColor}))}))))}}]),AnalyticsDashboardWidgetOverview}(_.Component);E.propTypes={handleDataError:p.a.func.isRequired},t.a=Object(k.a)(E,[{type:v.b,identifier:"analytics",datapoint:"report",data:S.i,priority:1,maxAge:Object(f.q)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.report)return{report:a}}},{type:v.b,identifier:"analytics",datapoint:"report",data:S.l,priority:1,maxAge:Object(f.q)("day"),context:["Single"],toState:function(e,t){var a=t.data;if(!e.directTotalUsers)return{directTotalUsers:Object(h.get)(a,"[0].data.totals[0].values[0]")}}}],e.createElement(O.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},S.h,S.f)}).call(this,a(1))},function(e,t,a){"use strict";a.d(t,"a",(function(){return n}));var n=["#178EC5","#54B23B","#EB5729","#ECED33","#34CBE3","#82E88E"]},function(e,t,a){"use strict";(function(e,n){var i=a(33),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(1),_=a(146),f=a(65),y=a(2),k=function(t){function AnalyticsAdminbarWidget(){return r()(this,AnalyticsAdminbarWidget),u()(this,m()(AnalyticsAdminbarWidget).apply(this,arguments))}return h()(AnalyticsAdminbarWidget,t),c()(AnalyticsAdminbarWidget,[{key:"render",value:function(){return"undefined"!==o()(e.googlesitekit.permaLink)&&""===e.googlesitekit.permaLink?null:Object(y.l)().analytics.active?n.createElement(_.a,null):n.createElement(b.Fragment,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},n.createElement(f.a,null)))}}]),AnalyticsAdminbarWidget}(b.Component);t.a=k}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(0),_=a(1),f=a(2),y=a(26),k=a(19),v=a(10),S=a(17),O=a(23);function E(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var j=function(t){function AnalyticsAdminbarWidgetOverview(){return r()(this,AnalyticsAdminbarWidgetOverview),u()(this,m()(AnalyticsAdminbarWidgetOverview).apply(this,arguments))}return h()(AnalyticsAdminbarWidgetOverview,t),c()(AnalyticsAdminbarWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||t.error||!t.length)return null;var a=Object(S.b)(t);if(!a)return null;var n=a.totalUsers,i=a.totalSessions,o=a.totalUsersChange,s=a.totalSessionsChange;return e.createElement(_.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(y.a,{className:"overview-total-users",title:Object(b.__)("Total Users","google-site-kit"),datapoint:Object(f.v)(n),change:o,changeDataUnit:"%"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(y.a,{className:"overview-total-sessions",title:Object(b.__)("Total Sessions","google-site-kit"),datapoint:Object(f.v)(i),change:s,changeDataUnit:"%"})))}}]),AnalyticsAdminbarWidgetOverview}(_.Component);t.a=Object(k.a)(j,[{type:v.b,identifier:"analytics",datapoint:"report",data:function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?E(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):E(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},S.i,{url:n.googlesitekit.permaLink}),priority:1,maxAge:Object(f.q)("day"),context:"Adminbar"}],e.createElement(_.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(O.a,{width:"auto",height:"59px"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(O.a,{width:"auto",height:"59px"}))),{inGrid:!0},S.h,S.f)}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(15),g=a.n(u),m=a(9),p=a.n(m),h=a(14),b=a.n(h),_=a(1),f=a(0),y=a(21),k=a(37),v=a(46),S=a(39),O=a(81),E=a(70),j=a(148),D=a(2),C=function(t){function AnalyticsAllTraffic(e){var t;return i()(this,AnalyticsAllTraffic),(t=l()(this,d()(AnalyticsAllTraffic).call(this,e))).state={receivingData:!0,error:!1},t.handleDataError=t.handleDataError.bind(g()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(g()(t)),t}return p()(AnalyticsAllTraffic,t),s()(AnalyticsAllTraffic,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0})}},{key:"getErrorDataComponent",value:function(){var e=Object(D.l)().analytics,t=e.active,a=e.setupComplete,n=this.state,i=n.error,o=n.receivingData;return t&&!a?Object(O.a)("analytics",!0,!0,!0):o?null:i?Object(S.a)(Object(f._x)("Analytics","Service name","google-site-kit"),i,!0,!0,!0):Object(v.a)(Object(f._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)}},{key:"render",value:function(){var t=this.state,a=t.error,n=t.receivingData,i=a||!n?"googlesitekit-nodata":"";return e.createElement(_.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(k.a,{description:Object(f.__)("How people found your site.","google-site-kit"),title:Object(f.__)("All Traffic","google-site-kit")})),this.getErrorDataComponent(),e.createElement("div",{className:b()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",i)},e.createElement(y.a,{className:"googlesitekit-dashboard-all-traffic"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(E.a,{source:!0,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(j.a,null)))))))}}]),AnalyticsAllTraffic}(_.Component);t.a=C}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(13),p=a(0),h=a(1),b=a(2),_=a(19),f=a(10),y=a(27),k=a(86),v=a(35),S=a(17),O=function(t){function AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources(){return i()(this,AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources),l()(this,d()(AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources).apply(this,arguments))}return g()(AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources,t),s()(AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(p.__)("Source","google-site-kit"),primary:!0},{title:Object(p.__)("Percent","google-site-kit")}],n=t[0].data.totals[0].values[0],i=Object(m.map)(t[0].data.rows,(function(t,a){var i=t.metrics[0].values[0]/n*100;return!(1>i)&&[t.dimensions[0],e.createElement(h.Fragment,{key:"minichart-"+a},e.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(i.toFixed(2),"%")," ",e.createElement(k.a,{percent:i.toFixed(1),index:a})))]})),o=Object(y.b)(i,a,{hideHeader:!0,chartsEnabled:!0});return e.createElement("div",{className:"googlesitekit-alltraffic-widget"},e.createElement(y.a,null,o))}}]),AnalyticsAllTrafficDashboardWidgetTopAcquisitionSources}(h.Component);t.a=Object(_.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:S.k,priority:1,maxAge:Object(b.q)("day"),context:"Dashboard"}],e.createElement(v.a,{rows:3,rowHeight:50}))}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(13),_=a(0),f=a(1),y=a(2),k=a(17),v=a(26),S=a(19),O=a(10),E=a(43),j=a(32),D=a(23);function C(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}function w(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?C(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):C(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var A=function(t){function AnalyticsDashboardWidgetTopLevel(e){var t;return r()(this,AnalyticsDashboardWidgetTopLevel),(t=u()(this,m()(AnalyticsDashboardWidgetTopLevel).call(this,e))).state={accounts:!1,goals:!1,directTotalUsers:!1},t}return h()(AnalyticsDashboardWidgetTopLevel,t),c()(AnalyticsDashboardWidgetTopLevel,[{key:"componentDidUpdate",value:function(){this.processCallbackData()}},{key:"componentDidMount",value:function(){this.processCallbackData()}},{key:"processCallbackData",value:function(){var e=this.props,t=e.data,a=e.requestDataToState;t&&!t.error&&"function"==typeof a&&this.setState(a)}},{key:"render",value:function(){var t=this.state,a=t.overview,i=t.extractedAnalytics,o=t.goals,s=t.directTotalUsers,r=e.googlesitekit.permaLink,l=Object(y.o)("googlesitekit-module-analytics",{}),c="",d="",u="",g="",m="";return a&&(c=a.totalUsersChange,d=a.goalCompletions,u=a.goalCompletionsChange,g=a.averageBounceRate,m=a.averageBounceRateChange),n.createElement(f.Fragment,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},n.createElement(v.a,{className:"overview-total-users",title:Object(_.__)("Unique Visitors from Search","google-site-kit"),datapoint:Object(y.v)(s),change:c,changeDataUnit:"%",source:{name:Object(_._x)("Analytics","Service name","google-site-kit"),link:l},sparkline:i&&n.createElement(E.a,{data:Object(y.e)(i,1),change:c})})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},r&&n.createElement(v.a,{className:"overview-bounce-rate",title:Object(_.__)("Bounce Rate","google-site-kit"),datapoint:Number(g).toFixed(2),datapointUnit:Object(_.__)("%","google-site-kit"),change:m,changeDataUnit:"%",invertChangeColor:!0,source:{name:Object(_._x)("Analytics","Service name","google-site-kit"),link:l},sparkline:i&&n.createElement(E.a,{data:Object(y.e)(i,2),change:m})}),!r&&o&&Object(b.isEmpty)(o.items)&&n.createElement(j.a,{title:Object(_.__)("Use goals to measure success.","google-site-kit"),description:Object(_.__)("Goals measure how well your site or app fulfills your target objectives.","google-site-kit"),ctaLink:"https://support.google.com/analytics/answer/1032415?hl=en#create_or_edit_goals",ctaLabel:Object(_.__)("Create a new goal","google-site-kit")}),!r&&o&&!Object(b.isEmpty)(o.items)&&n.createElement(v.a,{className:"overview-goals-completed",title:Object(_.__)("Goals Completed","google-site-kit"),datapoint:Object(y.v)(d),change:u,changeDataUnit:"%",source:{name:Object(_._x)("Analytics","Service name","google-site-kit"),link:l},sparkline:i&&n.createElement(E.a,{data:Object(y.e)(i,3),change:u})}),!r&&!o&&n.createElement(D.a,{width:"100%",height:"202px"})))}}]),AnalyticsDashboardWidgetTopLevel}(f.Component);t.a=Object(S.a)(A,[{type:O.b,identifier:"analytics",datapoint:"report",data:w({},k.i,{url:e.googlesitekit.permaLink}),priority:1,maxAge:Object(y.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.overview)return{overview:Object(k.b)(a)}}},{type:O.b,identifier:"analytics",datapoint:"report",data:k.l,priority:1,maxAge:Object(y.q)("day"),context:["Dashboard"],toState:function(e,t){var a=t.data;if(!e.directTotalUsers)return{directTotalUsers:Object(b.get)(a,"[0].data.totals[0].values[0]")}}},{type:O.b,identifier:"analytics",datapoint:"report",data:w({},k.j,{url:e.googlesitekit.permaLink}),priority:1,maxAge:Object(y.q)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.extractedAnalytics)return{extractedAnalytics:Object(k.d)(a)}}},{type:O.b,identifier:"analytics",datapoint:"goals",data:{url:e.googlesitekit.permaLink},priority:1,maxAge:Object(y.q)("hour"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.goals)return{goals:a}}}],n.createElement(f.Fragment,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},n.createElement(D.a,{width:"100%",height:"202px"})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},n.createElement(D.a,{width:"100%",height:"202px"}))),{inGrid:!0},(function(e,t){return"report"===t&&Object(k.h)(e)}),k.f)}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(0),p=a(1),h=a(2),b=a(151),_=a(26),f=a(32),y=a(19),k=a(10),v=a(17),S=function(t){function WPAnalyticsDashboardWidgetOverview(){return i()(this,WPAnalyticsDashboardWidgetOverview),l()(this,d()(WPAnalyticsDashboardWidgetOverview).apply(this,arguments))}return g()(WPAnalyticsDashboardWidgetOverview,t),s()(WPAnalyticsDashboardWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=Object(v.b)(t);if(!a)return null;var n=a.totalUsers,i=a.averageSessionDuration,o=a.totalUsersChange,s=a.averageSessionDurationChange;return e.createElement(p.Fragment,null,t.length?e.createElement(p.Fragment,null,e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-users",title:Object(m.__)("Total Unique Visitors","google-site-kit"),datapoint:Object(h.v)(n),change:o,changeDataUnit:"%"}),e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-average-session-duration",title:Object(m.__)("Avg. Time on Page","google-site-kit"),datapoint:Object(h.u)(i),change:s,changeDataUnit:"%"})):e.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},e.createElement(f.a,{title:Object(m.__)("Analytics Gathering Data","google-site-kit"),description:Object(m.__)("Analytics data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),WPAnalyticsDashboardWidgetOverview}(p.Component);t.a=Object(y.a)(S,[{type:k.b,identifier:"analytics",datapoint:"report",data:v.i,priority:1,maxAge:Object(h.q)("day"),context:["WPDashboard"]}],e.createElement(b.a,{width:"23%",height:"94px",count:2}),{},v.h,v.f)}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(3),p=a.n(m),h=a(1),b=a(23),_=function(t){function PreviewBlocks(){return i()(this,PreviewBlocks),l()(this,d()(PreviewBlocks).apply(this,arguments))}return g()(PreviewBlocks,t),s()(PreviewBlocks,[{key:"render",value:function(){for(var t=this.props,a=t.width,n=t.height,i=t.shape,o=t.count,s=[],r=0;r++<o;)s.push(e.createElement(b.a,{width:a,height:n,shape:i,key:r}));return s}}]),PreviewBlocks}(h.Component);_.propTypes={width:p.a.string,height:p.a.string,shape:p.a.string,count:p.a.number},_.defaultProps={width:"100px",height:"100px",shape:"square",count:1},t.a=_}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(0),h=a(37),b=a(21),_=a(85),f=a(70),y=function(t){function AnalyticsDashboardDetailsWidgetTopAcquisitionSources(){return i()(this,AnalyticsDashboardDetailsWidgetTopAcquisitionSources),l()(this,d()(AnalyticsDashboardDetailsWidgetTopAcquisitionSources).apply(this,arguments))}return g()(AnalyticsDashboardDetailsWidgetTopAcquisitionSources,t),s()(AnalyticsDashboardDetailsWidgetTopAcquisitionSources,[{key:"render",value:function(){return e.createElement(m.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(h.a,{title:Object(p.__)("All Traffic","google-site-kit"),description:Object(p.__)("How people found your page.","google-site-kit")})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(b.a,{className:"googlesitekit-analytics-acquisition-sources",footer:!0,headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(p.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(p._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(f.a,null)),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},e.createElement(_.a,null)))))))}}]),AnalyticsDashboardDetailsWidgetTopAcquisitionSources}(m.Component);t.a=y}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(50),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(13),_=a(0),f=a(1),y=a(2),k=a(19),v=a(10),S=a(27),O=a(35),E=a(17),j=function(t){function WPAnalyticsDashboardWidgetTopPagesTable(){return r()(this,WPAnalyticsDashboardWidgetTopPagesTable),u()(this,m()(WPAnalyticsDashboardWidgetTopPagesTable).apply(this,arguments))}return h()(WPAnalyticsDashboardWidgetTopPagesTable,t),c()(WPAnalyticsDashboardWidgetTopPagesTable,[{key:"render",value:function(){var t=this.props.data,a=e.googlesitekit.admin.siteURL;if(Object(E.h)(t))return null;var i=[],s=Object(b.map)(t[0].data.rows,(function(e,t){var n=o()(e.dimensions,2),s=n[0],r=n[1];return i[t]=a+r,[s,Object(y.t)(e.metrics[0].values[0])]})),r=[{title:Object(_.__)("Title","google-site-kit"),tooltip:Object(_.__)("Page Title","google-site-kit"),primary:!0},{title:Object(_.__)("Pageviews","google-site-kit"),tooltip:Object(_.__)("Pageviews","google-site-kit")}],l={chartsEnabled:!0,links:i,cap:5,showURLs:!0},c=Object(S.b)(s,r,l);return n.createElement("div",{className:"googlesitekit-search-console-widget"},n.createElement("h2",{className:"googlesitekit-search-console-widget__title"},Object(_.__)("Top content over the last 28 days","google-site-kit")),n.createElement(S.a,null,c))}}]),WPAnalyticsDashboardWidgetTopPagesTable}(f.Component);t.a=Object(k.a)(j,[{type:v.b,identifier:"analytics",datapoint:"report",data:Object(E.g)(),priority:1,maxAge:Object(y.q)("day"),context:"WPDashboard"}],n.createElement(O.a,{rows:6}))}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(13),p=a(0),h=a(1),b=a(2),_=a(19),f=a(10),y=a(27),k=a(21),v=a(35),S=a(17),O=function(t){function AnalyticsAdSenseDashboardWidgetTopPagesTable(){return i()(this,AnalyticsAdSenseDashboardWidgetTopPagesTable),l()(this,d()(AnalyticsAdSenseDashboardWidgetTopPagesTable).apply(this,arguments))}return g()(AnalyticsAdSenseDashboardWidgetTopPagesTable,t),s()(AnalyticsAdSenseDashboardWidgetTopPagesTable,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(p.__)("Page Title","google-site-kit"),tooltip:Object(p.__)("Page Title","google-site-kit"),primary:!0},{title:Object(p.__)("Earnings","google-site-kit"),tooltip:Object(p.__)("Earnings","google-site-kit")},{title:Object(p.__)("Page RPM","google-site-kit"),tooltip:Object(p.__)("Page RPM","google-site-kit")},{title:Object(p.__)("Impressions","google-site-kit"),tooltip:Object(p.__)("Impressions","google-site-kit")}],n=Object(m.map)(t[0].data.rows,(function(e){return[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2),Number(e.metrics[0].values[1]).toFixed(2),Object(b.t)(e.metrics[0].values[2])]})),i=Object(b.l)().analytics.settings,o=i.accountID,s=i.internalWebPropertyID,r=i.profileID,l="https://analytics.google.com/analytics/web/?pli=1#/report/content-pages/a".concat(o,"w").concat(s,"p").concat(r,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:~2F"),c={hideHeader:!1,chartsEnabled:!1,links:Object(m.map)(t[0].data.rows,(function(e){var t=e.dimensions[1].replace(/\//g,"~2F");return l+t}))},d=Object(y.b)(n,a,c);return AnalyticsAdSenseDashboardWidgetTopPagesTable.renderLayout(e.createElement(y.a,null,d))}}],[{key:"renderLayout",value:function(t){var a=Object(b.l)().adsense.accountURL;return e.createElement(k.a,{header:!0,title:Object(p.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(p.__)("Advanced Settings","google-site-kit"),headerCtaLink:a},t)}}]),AnalyticsAdSenseDashboardWidgetTopPagesTable}(h.Component);t.a=Object(_.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:S.a,priority:1,maxAge:Object(b.q)("day"),context:"Single"}],O.renderLayout(e.createElement(v.a,{padding:!0})),{inGrid:!0,fullWidth:!0,createGrid:!0},(function(){return!1}),(function(e){return!(!e||!e.error)&&(400===e.error.code&&"INVALID_ARGUMENT"===e.error.status&&Object(b.l)().analytics.active?null:e.error.message?e.error.message:e.error.errors&&e.error.errors[0]&&e.error.errors[0].message?e.error.errors[0].message:Object(p.__)("Unidentified error","google-site-kit"))}))}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(50),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(13),_=a(0),f=a(1),y=a(2),k=a(17),v=a(19),S=a(10),O=a(27),E=a(35),j=a(21),D=function(t){function AnalyticsDashboardWidgetPopularPagesTable(){return r()(this,AnalyticsDashboardWidgetPopularPagesTable),u()(this,m()(AnalyticsDashboardWidgetPopularPagesTable).apply(this,arguments))}return h()(AnalyticsDashboardWidgetPopularPagesTable,t),c()(AnalyticsDashboardWidgetPopularPagesTable,[{key:"render",value:function(){var t=this.props.data,a=e.googlesitekit.admin.siteURL;if(!t||!t.length)return null;var i=[{title:Object(_.__)("Most popular content","google-site-kit"),primary:!0},{title:Object(_.__)("Views","google-site-kit")}],s=[],r=Object(b.map)(t[0].data.rows,(function(e,t){var n=o()(e.dimensions,2),i=n[0],r=n[1];return s[t]=a+r,[i,Object(y.t)(e.metrics[0].values[0])]})),l={hideHeader:!1,chartsEnabled:!1,links:s,showURLs:!0},c=Object(O.b)(r,i,l);return AnalyticsDashboardWidgetPopularPagesTable.renderLayout(n.createElement(O.a,null,c))}}],[{key:"renderLayout",value:function(e){return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},n.createElement(j.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(_._x)("Analytics","Service name","google-site-kit"),footerCtaLink:Object(y.l)().analytics.homepage,fill:!0},e))}}]),AnalyticsDashboardWidgetPopularPagesTable}(f.Component);t.a=Object(v.a)(D,[{type:S.b,identifier:"analytics",datapoint:"report",data:Object(k.g)(),priority:1,maxAge:Object(y.q)("day"),context:["Single","Dashboard"]}],D.renderLayout(n.createElement(E.a,{padding:!0})),{inGrid:!0,createGrid:!0},k.h)}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(13),p=a(0),h=a(1),b=a(2),_=a(19),f=a(10),y=a(27),k=a(35),v=a(21),S=a(32),O=a(17),E=function(t){function AdSenseDashboardWidgetTopPagesTableSmall(){return i()(this,AdSenseDashboardWidgetTopPagesTableSmall),l()(this,d()(AdSenseDashboardWidgetTopPagesTableSmall).apply(this,arguments))}return g()(AdSenseDashboardWidgetTopPagesTableSmall,t),s()(AdSenseDashboardWidgetTopPagesTableSmall,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(p.__)("Top Earning Pages","google-site-kit"),tooltip:Object(p.__)("Top Earning Pages","google-site-kit"),primary:!0},{title:Object(p.__)("Revenue","google-site-kit"),tooltip:Object(p.__)("Revenue","google-site-kit")}],n=[],i=Object(m.map)(t[0].data.rows,(function(e,t){return n[t]=e.dimensions[1],[e.dimensions[0],Number(e.metrics[0].values[0]).toFixed(2)]})),o={hideHeader:!1,chartsEnabled:!1,cap:5,links:n},s=Object(y.b)(i,a,o);return AdSenseDashboardWidgetTopPagesTableSmall.renderLayout(e.createElement(y.a,null,s))}}],[{key:"renderLayout",value:function(t){return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(v.a,{className:"googlesitekit-top-earnings-pages",footer:!0,footerCtaLabel:Object(p._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"http://analytics.google.com",fill:!0},t))}}]),AdSenseDashboardWidgetTopPagesTableSmall}(h.Component);t.a=Object(_.a)(E,[{type:f.b,identifier:"analytics",datapoint:"report",data:O.a,priority:1,maxAge:Object(b.q)("day"),context:"Dashboard"}],E.renderLayout(e.createElement(k.a,{rows:5,padding:!0})),{inGrid:!0,createGrid:!0},(function(){return!1}),(function(t){if(t&&t.error_data){var a=Object.values(t.error_data);if(a[0]&&"badRequest"===a[0].reason)return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e.createElement(v.a,{className:"googlesitekit-top-earnings-pages",fill:!0},e.createElement(S.a,{title:Object(p.__)("Restricted metric(s)","google-site-kit"),description:Object(p.__)("You need to link Analytics and AdSense to get report for your top earning pages. Learn more: https://support.google.com/adsense/answer/6084409 ","google-site-kit")})))}if(t&&t.errors){var n=Object.values(t.errors);if(n[0]&&n[0][0])return n[0][0]}return!1}))}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(1),h=a(0),b=a(21),_=a(37),f=a(158),y=function(t){function DashboardSpeed(){return o()(this,DashboardSpeed),c()(this,u()(DashboardSpeed).apply(this,arguments))}return m()(DashboardSpeed,t),r()(DashboardSpeed,[{key:"render",value:function(){var t=e.googlesitekit.permaLink?Object(h.__)("How fast this page is.","google-site-kit"):Object(h.__)("How fast your home page is.","google-site-kit");return n.createElement(p.Fragment,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(_.a,{title:Object(h.__)("Speed","google-site-kit"),description:t})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(b.a,{className:"googlesitekit-pagespeed-report"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement(f.a,null))))))}}]),DashboardSpeed}(p.Component);t.a=y}).call(this,a(16),a(1))},function(e,t,a){"use strict";var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(51),p=a(1),h=function(e){function DashboardSpeedInner(){return i()(this,DashboardSpeedInner),l()(this,d()(DashboardSpeedInner).apply(this,arguments))}return g()(DashboardSpeedInner,e),s()(DashboardSpeedInner,[{key:"render",value:function(){return null}}]),DashboardSpeedInner}(p.Component);t.a=Object(m.a)("googlesitekit.DashboardSpeed")(h)},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(15),m=a.n(g),p=a(9),h=a.n(p),b=a(1),_=a(0),f=a(105),y=a(62),k=a(48),v=a(30),S=a(39),O=function(t){function PageSpeedInsightsDashboardWidgetHomepageSpeed(e){var t;return o()(this,PageSpeedInsightsDashboardWidgetHomepageSpeed),(t=c()(this,u()(PageSpeedInsightsDashboardWidgetHomepageSpeed).call(this,e))).state={loading:!0,error:!1},t.handleDataLoaded=t.handleDataLoaded.bind(m()(t)),t.handleDataError=t.handleDataError.bind(m()(t)),t}return h()(PageSpeedInsightsDashboardWidgetHomepageSpeed,t),r()(PageSpeedInsightsDashboardWidgetHomepageSpeed,[{key:"handleDataLoaded",value:function(){this.setState({loading:!1})}},{key:"handleDataError",value:function(e){this.setState({error:e})}},{key:"render",value:function(){var t=this.state,a=t.loading,i=t.error,o={name:Object(_._x)("PageSpeed Insights","Service name","google-site-kit"),link:Object(_.sprintf)("https://developers.google.com/speed/pagespeed/insights/?url=%s",e.googlesitekit.permaLink||e.googlesitekit.admin.siteURL)};return i?n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(S.a)(Object(_._x)("PageSpeed Insights","Service name","google-site-kit"),i,!0,!0,!1)):n.createElement(b.Fragment,null,a&&n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement("div",{className:"googlesitekit-pagespeed-report__loading"},n.createElement(v.a,null),n.createElement("p",null,Object(_.__)("PageSpeed Insights is preparing data…","google-site-kit")))),n.createElement(f.b,{handleDataLoaded:this.handleDataLoaded,handleDataError:this.handleDataError,title:Object(_.__)("Mobile","google-site-kit")}),n.createElement(f.a,{title:Object(_.__)("Desktop","google-site-kit")}),!a&&n.createElement(b.Fragment,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},n.createElement(k.a,{name:o.name,href:o.link,external:!0})),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right-tablet "},n.createElement(y.a,null))))}}]),PageSpeedInsightsDashboardWidgetHomepageSpeed}(b.Component);t.a=O}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(11),o=a.n(i),s=a(0),r=a(2),l=a(32),c=a(10),d=a(57);t.a=function PageSpeedInsightsCTA(){var t=Object(r.l)()["pagespeed-insights"],a=t.active,i=t.setupComplete;if(!e.googlesitekit.permissions.canManageOptions&&!i)return null;return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(l.a,{title:!i&&a?Object(s.__)("Complete PageSpeed Insights activation.","google-site-kit"):Object(s.__)("Activate PageSpeed Insights.","google-site-kit"),description:Object(s.__)("Google PageSpeed Insights gives you metrics about performance, accessibility, SEO and PWA.","google-site-kit"),ctaLink:"#",ctaLabel:!i&&a?Object(s.__)("Complete activation","google-site-kit"):Object(s.__)("Activate PageSpeed Insights","google-site-kit"),onClick:function(){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.a.awrap(Object(r.a)(c.c,"pagespeed-insights",!0));case 3:e.location=Object(r.n)("pagespeed-insights"),t.next=9;break;case 6:t.prev=6,t.t0=t.catch(0),Object(r.y)(d.a,{id:"pagespeed-insights-setup-error",title:Object(s.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"});case 9:case"end":return t.stop()}}),null,null,[[0,6]])}}))}}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){a.d(t,"a",(function(){return s}));var i=a(0),o=a(2),s=function(){var t=e.googlesitekit.dashboardPermalink,a=Object(i.sprintf)(
24
- /* translators: %s is the URL to the Site Kit dashboard. */
25
- Object(i.__)('To view insights, <a href="%s">visit the dashboard</a>.',"google-site-kit"),t);return n.createElement("p",{dangerouslySetInnerHTML:Object(o.x)(a,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href"]})})}}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(1),h=a(0),b=e.googlesitekit.admin.siteURL,_=function(e){function SearchConsoleSettingStatus(){return o()(this,SearchConsoleSettingStatus),c()(this,u()(SearchConsoleSettingStatus).apply(this,arguments))}return m()(SearchConsoleSettingStatus,e),r()(SearchConsoleSettingStatus,[{key:"render",value:function(){return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement("div",{className:"googlesitekit-settings-module__meta-item-type"},Object(h.__)("Connected URL","google-site-kit")),n.createElement("div",{className:"googlesitekit-settings-module__meta-item-data"},b))}}]),SearchConsoleSettingStatus}(p.Component);t.a=_}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(20),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(15),h=a.n(p),b=a(9),_=a.n(b),f=a(14),y=a.n(f),k=a(1),v=a(0),S=a(56),O=a(164),E=a(87),j=a(165),D=a(53),C=a(21),w=a(69),A=a(30),x=a(46),N=a(39),P=a(2),T=a(55);function L(e,t){var a=Object.keys(e);return Object.getOwnPropertySymbols&&a.push.apply(a,Object.getOwnPropertySymbols(e)),t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a}var M=function(t){function GoogleSitekitSearchConsoleDashboardWidget(e){var t;return r()(this,GoogleSitekitSearchConsoleDashboardWidget),(t=u()(this,m()(GoogleSitekitSearchConsoleDashboardWidget).call(this,e))).state={selectedStats:[0,1],receivingData:!0,error:!1,loading:!0},t.handleStatSelection=t.handleStatSelection.bind(h()(t)),t.buildSeries=t.buildSeries.bind(h()(t)),t.buildVAxes=t.buildVAxes.bind(h()(t)),t.handleDataError=t.handleDataError.bind(h()(t)),t.handleDataSuccess=t.handleDataSuccess.bind(h()(t)),t}return _()(GoogleSitekitSearchConsoleDashboardWidget,t),c()(GoogleSitekitSearchConsoleDashboardWidget,[{key:"handleDataError",value:function(e){this.setState({receivingData:!1,error:e,loading:!1})}},{key:"handleDataSuccess",value:function(){this.setState({receivingData:!0,loading:!1})}},{key:"handleStatSelection",value:function(e){var t=this.state.selectedStats,a=t.slice();t.includes(e)?a=t.filter((function(t){return e!==t})):a.push(e),0!==a.length&&this.setState({selectedStats:a})}},{key:"buildSeries",value:function(){var e=this.state.selectedStats,t={0:"#4285f4",1:"#27bcd4",2:"#1b9688",3:"#673ab7"};return e.map((function(e,a){return{color:t[e],targetAxisIndex:a}}))}},{key:"buildVAxes",value:function(){var e=this.state.selectedStats,t={0:Object(v.__)("Clicks","google-site-kit"),1:Object(v.__)("Impressions","google-site-kit"),2:Object(v.__)("Average CTR","google-site-kit"),3:Object(v.__)("Average Position","google-site-kit")};return e.map((function(e){var a={};return 3===e&&(a.direction=-1),function(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?L(a,!0).forEach((function(t){o()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):L(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({title:t[e]},a)}))}},{key:"render",value:function(){var t=this.state,a=t.selectedStats,i=t.receivingData,o=t.error,s=t.loading,r=this.buildSeries(),l=this.buildVAxes(),c=!s&&i?"":"googlesitekit-nodata",d=Object(P.g)(),u=Object(v.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",e.googlesitekit.admin.siteURL);return n.createElement(k.Fragment,null,n.createElement(S.a,null),n.createElement(w.a,{module:"search-console"}),n.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--search-console"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(D.a,{title:Object(v._x)("Search Console","Service name","google-site-kit"),icon:!0,iconWidth:"23",iconHeight:"21",iconID:"search-console",status:"connected",statusText:Object(v.__)("Search Console is connected","google-site-kit")}),s&&n.createElement(A.a,null)),!i&&(o?Object(N.a)(Object(v._x)("Search Console","Service name","google-site-kit"),o,!0,!0,!0):Object(x.a)(Object(v._x)("Search Console","Service name","google-site-kit"),!0,!0,!0)),n.createElement("div",{className:y()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",c)},n.createElement(C.a,{header:!0
26
- /* translators: %s: date range */,title:Object(v.sprintf)(Object(v.__)("Overview for the last %s","google-site-kit"),d),headerCtaLabel:Object(v.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:u},n.createElement(j.a,{selectedStats:a,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),n.createElement(O.a,{selectedStats:a,series:r,vAxes:l}))),n.createElement("div",{className:y()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",c)},n.createElement(C.a
27
- /* translators: %s: date range */,{title:Object(v.sprintf)(Object(v.__)("Top search queries over the last %s","google-site-kit"),d),header:!0,footer:!0,headerCtaLabel:Object(v.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:u,footerCtaLabel:Object(v._x)("Search Console","Service name","google-site-kit"),footerCtaLink:u},n.createElement(E.a,null))),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},n.createElement(T.a,null))))))}}]),GoogleSitekitSearchConsoleDashboardWidget}(k.Component);t.a=M}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(15),m=a.n(g),p=a(9),h=a.n(p),b=a(0),_=a(1),f=a(2),y=a(19),k=a(10),v=a(47),S=a(23),O=a(36),E=function(t){function SearchConsoleDashboardWidgetSiteStats(e){var t;return o()(this,SearchConsoleDashboardWidgetSiteStats),(t=c()(this,u()(SearchConsoleDashboardWidgetSiteStats).call(this,e))).setOptions=t.setOptions.bind(m()(t)),t}return h()(SearchConsoleDashboardWidgetSiteStats,t),r()(SearchConsoleDashboardWidgetSiteStats,[{key:"setOptions",value:function(){var t=this.props,a=t.selectedStats,n=t.series,i=t.vAxes,o=e.googlesitekit.pageTitle,s=Object(b.__)("Search Traffic Summary","google-site-kit");o&&o.length&&(
28
- /* translators: %s: page title */
29
- s=Object(b.sprintf)(Object(b.__)("Search Traffic Summary for %s","google-site-kit"),Object(f.d)(o)));var r={chart:{title:s},curveType:"line",height:270,width:"100%",chartArea:{height:"80%",width:"87%"},legend:{position:"top",textStyle:{color:"#616161",fontSize:12}},hAxis:{format:"M/d/yy",gridlines:{color:"#fff"},textStyle:{color:"#616161",fontSize:12}},vAxis:{gridlines:{color:"#eee"},minorGridlines:{color:"#eee"},textStyle:{color:"#616161",fontSize:12},titleTextStyle:{color:"#616161",fontSize:12,italic:!1}}};return r.series=n,r.vAxes=i,3<=a.length&&(r.vAxis.textPosition="none",r.vAxis.gridlines.color="#fff",r.vAxis.minorGridlines.color="#fff",r.chartArea.width="98%"),r}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats;if(!t||!t.length)return null;var i=this.setOptions(),o=Object(O.a)(t);return n.createElement("section",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n.createElement(v.a,{selectedStats:a,data:o.dataMap,options:i,singleStat:!1}))))}}]),SearchConsoleDashboardWidgetSiteStats}(_.Component);t.a=Object(y.a)(E,[{type:k.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.q)("day"),context:"Single"}],n.createElement(S.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(0),p=a(1),h=a(2),b=a(26),_=a(19),f=a(10),y=a(23),k=a(36),v=a(3),S=a.n(v),O=function(t){function SearchConsoleDashboardWidgetOverview(){return i()(this,SearchConsoleDashboardWidgetOverview),l()(this,d()(SearchConsoleDashboardWidgetOverview).apply(this,arguments))}return g()(SearchConsoleDashboardWidgetOverview,t),s()(SearchConsoleDashboardWidgetOverview,[{key:"render",value:function(){var t=this.props,a=t.data,n=t.selectedStats,i=t.handleStatSelection;if(!a||!a.length)return null;var o=Object(k.a)(a),s=o.totalClicks,r=o.totalImpressions,l=o.averageCTR,c=o.averagePosition,d=o.totalClicksChange,u=o.totalImpressionsChange,g=o.averageCTRChange,h=o.averagePositionChange,_=[{className:"googlesitekit-data-block--clicks googlesitekit-data-block--button-1",title:Object(m.__)("Total Clicks","google-site-kit"),datapoint:s,change:d,changeDataUnit:"%",context:"button",selected:n.includes(0),handleStatSelection:i},{className:"googlesitekit-data-block--impressions googlesitekit-data-block--button-2",title:Object(m.__)("Total Impressions","google-site-kit"),datapoint:r,change:u,changeDataUnit:"%",context:"button",selected:n.includes(1),handleStatSelection:i},{className:"googlesitekit-data-block--ctr googlesitekit-data-block--button-3",title:Object(m.__)("Average CTR","google-site-kit"),datapoint:l+"%",change:g,changeDataUnit:"%",context:"button",selected:n.includes(2),handleStatSelection:i},{className:"googlesitekit-data-block--position googlesitekit-data-block--button-4",title:Object(m.__)("Average Position","google-site-kit"),datapoint:c,change:h,changeDataUnit:"%",context:"button",selected:n.includes(3),handleStatSelection:i}];return e.createElement(p.Fragment,null,e.createElement("section",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},_.map((function(t,a){return e.createElement("div",{key:a,className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(b.a,{stat:a,className:t.className,title:t.title,datapoint:t.datapoint,change:t.change,changeDataUnit:t.changeDataUnit,context:t.context,selected:t.selected,handleStatSelection:t.handleStatSelection}))})))))}}]),SearchConsoleDashboardWidgetOverview}(p.Component);O.propTypes={handleDataError:S.a.func.isRequired},t.a=Object(_.a)(O,[{type:f.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(h.q)("day"),context:["Single","Dashboard"]}],e.createElement(y.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},k.b)}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(33),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(9),h=a.n(p),b=a(167),_=a(1),f=function(t){function GoogleSitekitSearchConsoleAdminbarWidget(){return r()(this,GoogleSitekitSearchConsoleAdminbarWidget),u()(this,m()(GoogleSitekitSearchConsoleAdminbarWidget).apply(this,arguments))}return h()(GoogleSitekitSearchConsoleAdminbarWidget,t),c()(GoogleSitekitSearchConsoleAdminbarWidget,[{key:"render",value:function(){return"undefined"!==o()(e.googlesitekit.permaLink)&&""===e.googlesitekit.permaLink?null:n.createElement(b.a,null)}}]),GoogleSitekitSearchConsoleAdminbarWidget}(_.Component);t.a=f}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(0),h=a(1),b=a(2),_=a(26),f=a(19),y=a(10),k=a(36),v=a(23),S=function(t){function SearchConsoleAdminbarWidgetOverview(){return o()(this,SearchConsoleAdminbarWidgetOverview),c()(this,u()(SearchConsoleAdminbarWidgetOverview).apply(this,arguments))}return m()(SearchConsoleAdminbarWidgetOverview,t),r()(SearchConsoleAdminbarWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||t.error)return null;var a=Object(k.a)(t),n=a.totalClicks,i=a.totalImpressions,o=a.totalClicksChange,s=a.totalImpressionsChange;return e.createElement(h.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(_.a,{className:"overview-total-impressions",title:Object(p.__)("Total Impressions","google-site-kit"),datapoint:i,change:s,changeDataUnit:"%"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(_.a,{className:"overview-total-clicks",title:Object(p.__)("Total Clicks","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})))}}]),SearchConsoleAdminbarWidgetOverview}(h.Component);t.a=Object(f.a)(S,[{type:y.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:n.googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(b.q)("day"),context:"Adminbar"}],e.createElement(h.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"auto",height:"59px"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"auto",height:"59px"}))),{inGrid:!0},k.b)}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(169),h=function(t){function WPSearchConsoleDashboardWidget(){return i()(this,WPSearchConsoleDashboardWidget),l()(this,d()(WPSearchConsoleDashboardWidget).apply(this,arguments))}return g()(WPSearchConsoleDashboardWidget,t),s()(WPSearchConsoleDashboardWidget,[{key:"render",value:function(){return e.createElement(m.Fragment,null,e.createElement(p.a,null))}}]),WPSearchConsoleDashboardWidget}(m.Component);t.a=h}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(0),p=a(1),h=a(2),b=a(23),_=a(26),f=a(19),y=a(10),k=a(36),v=a(32),S=function(t){function WPSearchConsoleDashboardWidgetOverview(){return i()(this,WPSearchConsoleDashboardWidgetOverview),l()(this,d()(WPSearchConsoleDashboardWidgetOverview).apply(this,arguments))}return g()(WPSearchConsoleDashboardWidgetOverview,t),s()(WPSearchConsoleDashboardWidgetOverview,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=Object(k.a)(t),n=a.totalClicks,i=a.totalImpressions,o=a.totalClicksChange,s=a.totalImpressionsChange;return e.createElement(p.Fragment,null,t.length?e.createElement(p.Fragment,null,e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-impressions",title:Object(m.__)("Total Impressions","google-site-kit"),datapoint:i,change:s,changeDataUnit:"%"}),e.createElement(_.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-clicks",title:Object(m.__)("Total Clicks","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})):e.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},e.createElement(v.a,{title:Object(m.__)("Search Console Data Empty","google-site-kit"),description:Object(m.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),WPSearchConsoleDashboardWidgetOverview}(p.Component);t.a=Object(f.a)(S,[{type:y.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(h.q)("day"),context:["WPDashboard"]}],e.createElement(b.a,{width:"23%",height:"94px",count:2}),{},k.b)}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(14),h=a.n(p),b=a(1),_=a(0),f=a(2),y=a(21),k=a(37),v=a(65),S=a(88),O=function(t){function DashboardSearchFunnel(){return o()(this,DashboardSearchFunnel),c()(this,u()(DashboardSearchFunnel).apply(this,arguments))}return m()(DashboardSearchFunnel,t),r()(DashboardSearchFunnel,[{key:"render",value:function(){var t=Object(f.l)(),a=e.googlesitekit.permissions.canManageOptions,i=t.analytics.active||a?12:6;return n.createElement(b.Fragment,null,n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(k.a,{title:Object(_.__)("Search Funnel","google-site-kit"),description:Object(_.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit")})),n.createElement("div",{className:h()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-".concat(i))},n.createElement(y.a,{className:"googlesitekit-analytics-search-funnel"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement(S.a,null),!t.analytics.active&&n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},n.createElement(v.a,null)))))))}}]),DashboardSearchFunnel}(b.Component);t.a=O}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(0),h=a(1),b=a(26),_=a(19),f=a(10),y=a(36),k=a(43),v=a(23),S=a(2),O=a(32),E=function(t){function SearchConsoleDashboardWidgetTopLevel(){return o()(this,SearchConsoleDashboardWidgetTopLevel),c()(this,u()(SearchConsoleDashboardWidgetTopLevel).apply(this,arguments))}return m()(SearchConsoleDashboardWidgetTopLevel,t),r()(SearchConsoleDashboardWidgetTopLevel,[{key:"render",value:function(){var t=this.props.data,a=t.error;if(a)return Object(S.B)("plugin_setup","search_console_error",a.message),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(O.a,{title:Object(p.__)("Something went wrong","google-site-kit"),description:a.message,error:!0}));if(!t)return null;if(!t.length)return e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(O.a,{title:Object(p.__)("Search Console Data Empty","google-site-kit"),description:Object(p.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""}));var n=Object(S.o)("googlesitekit-module-search-console",{}),i=Object(y.a)(t),o=i.totalClicks,s=i.totalImpressions,r=i.totalClicksChange,l=i.totalImpressionsChange,c=i.dataMap;return e.createElement(h.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(b.a,{className:"overview-total-impressions",title:Object(p.__)("Impressions","google-site-kit"),datapoint:s,change:l,changeDataUnit:"%",source:{name:Object(p._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:e.createElement(k.a,{data:Object(S.e)(c,2),change:l})})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(b.a,{className:"overview-total-clicks",title:Object(p.__)("Clicks","google-site-kit"),datapoint:o,change:r,changeDataUnit:"%",source:{name:Object(p._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:e.createElement(k.a,{data:Object(S.e)(c,1),change:r})})))}}]),SearchConsoleDashboardWidgetTopLevel}(h.Component);t.a=Object(_.a)(E,[{type:f.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:n.googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(S.q)("day"),context:["Single","Dashboard"]}],e.createElement(h.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"100%",height:"202px"})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-bottom mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},e.createElement(v.a,{width:"100%",height:"202px"}))),{inGrid:!0},y.b)}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(0),h=a(21),b=a(88),_=a(2),f=a(65),y=a(37),k=function(t){function DashboardDetailsSearchFunnel(){return i()(this,DashboardDetailsSearchFunnel),l()(this,d()(DashboardDetailsSearchFunnel).apply(this,arguments))}return g()(DashboardDetailsSearchFunnel,t),s()(DashboardDetailsSearchFunnel,[{key:"render",value:function(){return e.createElement(m.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(y.a,{description:Object(p.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),title:Object(p.__)("Search Funnel","google-site-kit")})),e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e.createElement(h.a,{className:"googlesitekit-analytics-search-funnel"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement(b.a,null),!Object(_.l)().analytics.active&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(f.a,null)))))))}}]),DashboardDetailsSearchFunnel}(m.Component);t.a=k}).call(this,a(1))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(1),h=a(0),b=a(87),_=a(37),f=a(21),y=function(t){function DashboardDetailsWidgetKeywordsTable(){return o()(this,DashboardDetailsWidgetKeywordsTable),c()(this,u()(DashboardDetailsWidgetKeywordsTable).apply(this,arguments))}return m()(DashboardDetailsWidgetKeywordsTable,t),r()(DashboardDetailsWidgetKeywordsTable,[{key:"render",value:function(){return e.createElement(p.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(_.a,{title:Object(h.__)("Top Queries","google-site-kit"),description:Object(h.__)("What people searched for to find your page.","google-site-kit")})),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(f.a,{footer:!0,footerCtaLabel:Object(h._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(h.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",n.googlesitekit.admin.siteURL)},e.createElement(b.a,null))))}}]),DashboardDetailsWidgetKeywordsTable}(p.Component);t.a=y}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e,n){var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(9),m=a.n(g),p=a(13),h=a(0),b=a(1),_=a(2),f=a(19),y=a(10),k=a(27),v=a(35),S=a(21),O=a(36),E=function(t){function DashboardWidgetPopularKeywordsTable(){return o()(this,DashboardWidgetPopularKeywordsTable),c()(this,u()(DashboardWidgetPopularKeywordsTable).apply(this,arguments))}return m()(DashboardWidgetPopularKeywordsTable,t),r()(DashboardWidgetPopularKeywordsTable,[{key:"render",value:function(){var t=this.props.data;if(!t||!t.length)return null;var a=[{title:Object(h.__)("Top search queries for your site","google-site-kit"),tooltip:Object(h.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(h.__)("Clicks","google-site-kit"),tooltip:Object(h.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(h.__)("Impressions","google-site-kit"),tooltip:Object(h.__)("Counted each time your content appears in search results","google-site-kit")}],i=e.googlesitekit.admin.siteURL,o=[],s=Object(p.map)(t,(function(e,t){var a=e.keys[0];return o[t]=Object(h.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",i,a),[a,Object(_.t)(e.clicks),Object(_.t)(e.impressions)]})),r={hideHeader:!1,chartsEnabled:!1,links:o},l=Object(k.b)(s,a,r);return DashboardWidgetPopularKeywordsTable.renderLayout(n.createElement(k.a,null,l))}}],[{key:"renderLayout",value:function(t){return n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},n.createElement(S.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(h._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(h.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",e.googlesitekit.admin.siteURL),fill:!0},t))}}]),DashboardWidgetPopularKeywordsTable}(b.Component);t.a=Object(f.a)(E,[{type:y.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"query",limit:10},priority:1,maxAge:Object(_.q)("day"),context:["Dashboard"]}],E.renderLayout(n.createElement(v.a,{padding:!0})),{inGrid:!0,createGrid:!0},O.b)}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(1),p=a(0),h=a(176),b=a(37),_=function(t){function DashboardPopularity(){return i()(this,DashboardPopularity),l()(this,d()(DashboardPopularity).apply(this,arguments))}return g()(DashboardPopularity,t),s()(DashboardPopularity,[{key:"render",value:function(){return e.createElement(m.Fragment,null,e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(b.a,{title:Object(p.__)("Popularity","google-site-kit"),description:Object(p.__)("Your most popular pages and how people found them from Search.","google-site-kit")})),e.createElement(h.a,null))}}]),DashboardPopularity}(m.Component);t.a=_}).call(this,a(1))},function(e,t,a){"use strict";var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(51),p=a(1),h=function(e){function DashboardPopularityInner(){return i()(this,DashboardPopularityInner),l()(this,d()(DashboardPopularityInner).apply(this,arguments))}return g()(DashboardPopularityInner,e),s()(DashboardPopularityInner,[{key:"render",value:function(){return null}}]),DashboardPopularityInner}(p.Component);t.a=Object(m.a)("googlesitekit.DashboardPopularity")(h)},function(e,t,a){"use strict";(function(e,n){var i=a(11),o=a.n(i),s=a(5),r=a.n(s),l=a(6),c=a.n(l),d=a(7),u=a.n(d),g=a(8),m=a.n(g),p=a(15),h=a.n(p),b=a(9),_=a.n(b),f=a(13),y=a(186),k=a.n(y),v=a(1),S=a(0),O=a(2),E=a(10),j=a(31),D=a(21),C=function(t){function PostSearcher(e){var t;return r()(this,PostSearcher),(t=u()(this,m()(PostSearcher).call(this,e))).state={isSearching:!1,results:[],error:!1,message:""},t.postSearch=t.postSearch.bind(h()(t)),t.onClick=t.onClick.bind(h()(t)),t.onConfirm=t.onConfirm.bind(h()(t)),t}return _()(PostSearcher,t),c()(PostSearcher,[{key:"postSearch",value:function(e,t){var a;return o.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t([Object(S.__)("Loading...","google-site-kit")]),n.prev=1,n.next=4,o.a.awrap(E.c.get(E.a,"search","post-search",{query:encodeURIComponent(e)}));case 4:0<(a=n.sent).length?t(Object(f.map)(a,(function(e){return e.post_title}))):t([Object(S.__)("No results found","google-site-kit")]),this.setState({isSearching:!0,results:a,error:!1,message:""}),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(1),t([Object(S.__)("No results found","google-site-kit")]),this.setState({isSearching:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[1,9]])}},{key:"getURLPathname",value:function(e){try{var t=new URL(e);return Object(f.trim)(t.pathname,"/")}catch(e){return!1}}},{key:"onConfirm",value:function(e){this.setState({selection:e})}},{key:"onClick",value:function(){var e=this.state,t=e.results,a=e.selection,n=Object(f.find)(t,(function(e){return e.post_title===a}));document.location=Object(O.o)("googlesitekit-dashboard",{id:n.id,permaLink:n.permalink,pageTitle:a})}},{key:"render",value:function(){var t=e.googlesitekit.modules,a=t.analytics&&t.analytics.active?"mdc-layout-grid__cell mdc-layout-grid__cell--span-12":"mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop";return n.createElement("div",{className:a},n.createElement(D.a,{title:Object(S.__)("Search for individual page or post information","google-site-kit"),header:!0},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n.createElement("div",{className:"googlesitekit-post-searcher"},n.createElement("label",{className:"googlesitekit-post-searcher__label",htmlFor:"autocomplete"},Object(S.__)("Title or URL","google-site-kit")),n.createElement(k.a,{id:"autocomplete",source:Object(f.debounce)(this.postSearch,200),minLength:2,onConfirm:this.onConfirm,showNoOptionsFound:!1}),n.createElement("div",{className:"googlesitekit-post-searcher__button-wrapper"},n.createElement(j.a,{onClick:this.onClick,className:"googlesitekit-post-searcher__button"},Object(S.__)("View Data","google-site-kit")))))))))}}]),PostSearcher}(v.Component);t.a=C}).call(this,a(16),a(1))},,,,,,,,,,,,,,function(e,t,a){"use strict";(function(e,t){var n=a(12),i=a(22),o=a(2),s=a(126),r=a(133),l=a(84),c=a(136),d=a(138),u=a(139),g="adsense";Object(n.b)("googlesitekit.ModuleSettingsWarning","googlesitekit.adsenseSettingsWarning",Object(o.f)(u.a,{})),Object(n.b)("googlesitekit.SetupModuleShowLink","googlesitekit.adsenseSetupModuleShowLink",(function(t,a){return!("adsense"===a&&!e.googlesitekit.canAdsRun)&&t}));var m=Object(o.l)();if(m.adsense.active){var p=Object(i.a)(t.createElement(s.a,null)),h=Object(i.a)(t.createElement(r.a,null));if(m[g].setupComplete)Object(n.b)("googlesitekit.ModuleApp-".concat(g),"googlesitekit.ModuleApp",p),Object(n.b)("googlesitekit.DashboardModule","googlesitekit.DashboardEarningModule",h,50);else{var b=e.googlesitekit.admin,_=b.reAuth,f=b.currentScreen,y=f?f.id:null;_||"site-kit_page_googlesitekit-module-adsense"!==y||(e.location=Object(o.o)("googlesitekit-module-".concat(g),{reAuth:!0,slug:g})),Object(n.b)("googlesitekit.Connected-".concat(g),"googlesitekit.AdSenseModuleConnected",(function(e){var t=m[g].settings;return!(e||void 0===t||"account-pending-review"!==t.accountStatus&&"ads-display-pending"!==t.accountStatus)||e}))}Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat(g),"googlesitekit.AdSenseModuleSettingsDetails",Object(o.f)(l.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.ModuleSetup-".concat(g),"googlesitekit.TagmanagerModuleSetupWizard",Object(o.f)(c.a,{onSettingsPage:!1})),Object(n.b)("googlesitekit.autoRefreshModules","googlesitekit.AdSenseAutoRefresh",(function(e){return e.push({identifier:"adsense",toRefresh:function(){var e="";return m.adsense&&m.adsense["account-status"]&&(e=m.adsense["account-status"].accountStatus),!(e&&-1<e.indexOf("account-connected"))}}),e})),Object(n.b)("googlesitekit.ModulesNotificationsRequest","googlesitekit.adsenseNotifications",(function(e){return e.push({identifier:"adsense"}),e})),Object(n.b)("googlesitekit.ModuleSetupIncomplete","googlesitekit.adsenseSettingStatus",Object(o.f)(d.a,{}))}}).call(this,a(16),a(1))},function(e,t,a){"use strict";(function(e,t){var n=a(2),i=a(22),o=a(140),s=a(145),r=a(147),l=a(149),c=a(150),d=a(152),u=a(153),g=a(154),m=a(155),p=a(156),h=a(102),b=a(12),_="analytics",f=Object(i.a)(e.createElement(s.a,null));Object(b.b)("googlesitekit.AdminbarModules","googlesitekit.Analytics",f,11);var y=Object(n.l)();if(!y[_].setupComplete){var k=t.googlesitekit.admin,v=k.reAuth,S=k.currentScreen,O=S?S.id:null;v||"site-kit_page_googlesitekit-module-analytics"!==O||(t.location=Object(n.o)("googlesitekit-module-".concat(_),{reAuth:!0,slug:_}))}if(y.analytics.active){var E=Object(i.a)(e.createElement(o.a,null)),j=Object(i.a)(e.createElement(r.a,null)),D=Object(i.a)(e.createElement(c.a,null)),C=Object(i.a)(e.createElement(u.a,null)),w=Object(i.a)(e.createElement(l.a,null)),A=Object(i.a)(e.createElement(d.a,null)),x=Object(i.a)(e.createElement(g.a,null)),N=Object(i.a)(e.createElement(m.a,null)),P=Object(i.a)(e.createElement(p.a,null));Object(b.b)("googlesitekit.DashboardModule","googlesitekit.Analytics",j,9),Object(b.b)("googlesitekit.DashboardSearchFunnel","googlesitekit.Analytics",w,11),Object(b.b)("googlesitekit.DashboardPopularity","googlesitekit.Analytics",N,20),Object(b.b)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall","googlesitekit.Analytics",P,20),Object(b.b)("googlesitekit.DashboardDetailsModule","googlesitekit.Analytics",A,20),Object(b.b)("googlesitekit.WPDashboardHeader","googlesitekit.Analytics",D),Object(b.b)("googlesitekit.WPDashboardModule","googlesitekit.Analytics",C),Object(b.b)("googlesitekit.ModuleApp-"+_,"googlesitekit.Analytics",E),Object(b.b)("googlesitekit.AnalyticsAdSenseTopPagesTable","googlesitekit.Analytics",x,11),Object(b.b)("googlesitekit.ModuleSettingsDetails-".concat(_),"googlesitekit.AnalyticsModuleSettingsDetails",Object(n.f)(h.a,{onSettingsPage:!0})),Object(b.b)("googlesitekit.showDateRangeSelector-".concat(_),"googlesitekit.analyticsShowDateRangeSelector",(function(){return!0})),Object(b.b)("googlesitekit.ModuleSetup-".concat(_),"googlesitekit.AnalyticsModuleSetupWizard",Object(n.f)(h.a,{onSettingsPage:!1}))}}).call(this,a(1),a(16))},function(e,t,a){"use strict";(function(e){var t=a(12),n=a(22),i=a(157),o=a(159),s=a(160),r=a(161),l=a(2),c="pagespeed-insights",d=Object(l.l)()[c],u=d.active,g=d.setupComplete;if(u&&g){var m=Object(n.a)(e.createElement(i.a,null)),p=Object(n.a)(e.createElement(o.a,null));Object(t.b)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",m,45),Object(t.b)("googlesitekit.DashboardDetailsModule","googlesitekit.PageSpeedInsights",m,45),Object(t.b)("googlesitekit.DashboardSpeed","googlesitekit.PageSpeedInsightsHomepageSpeed",p)}else{var h=Object(n.a)(e.createElement(s.a,null));Object(t.b)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",h,45)}Object(t.b)("googlesitekit.ModuleSettingsDetails-".concat(c),"googlesitekit.PageSpeedInsightsModuleSettingsDetails",Object(n.a)(e.createElement(r.a,null)),10)}).call(this,a(1))},function(e,t,a){"use strict";(function(e){var t=a(162),n=a(12),i=a(22),o=a(2),s=a(177),r=a(163),l=a(166),c=a(168),d=a(170),u=a(171),g=a(173),m=a(174),p=a(172),h=a(175),b="search-console",_=Object(i.a)(e.createElement(r.a,null)),f=Object(i.a)(e.createElement(l.a,null)),y=Object(i.a)(e.createElement(c.a,null)),k=Object(i.a)(e.createElement(d.a,null)),v=Object(i.a)(e.createElement(u.a,null)),S=Object(i.a)(e.createElement(p.a,null)),O=Object(i.a)(e.createElement(g.a,null)),E=Object(i.a)(e.createElement(m.a,null)),j=Object(i.a)(e.createElement(h.a,null)),D=Object(i.a)(e.createElement(s.a,null));Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat(b),"googlesitekit.SearchConsoleModuleSettingsDetails",Object(o.f)(t.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.DashboardModule","googlesitekit.SearchConsole",k,11),Object(n.b)("googlesitekit.DashboardModule","googlesitekit.DashboardPopularityModule",j,40),Object(n.b)("googlesitekit.DashboardSearchFunnel","googlesitekit.SearchConsoleSearchFunnel",v),Object(n.b)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",S),Object(n.b)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",O,40),Object(n.b)("googlesitekit.DashboardPopularity","googlesitekit.SearchConsoleDashboardPopularity",E),Object(n.b)("googlesitekit.DashboardPopularity","googlesitekit.DashboardPPostSearcherModule",D,30),Object(n.b)("googlesitekit.WPDashboardHeader","googlesitekit.SearchConsole",y,11),Object(n.b)("googlesitekit.ModuleApp-"+b,"googlesitekit.ModuleApp",_),Object(n.b)("googlesitekit.showDateRangeSelector-".concat(b),"googlesitekit.searchConsoleShowDateRangeSelector",(function(){return!0})),Object(n.b)("googlesitekit.AdminbarModules","googlesitekit.SearchConsole",f)}).call(this,a(1))},function(e,t,a){"use strict";a(191),a(192);var n=a(12),i=a(0),o=a(104),s=a(2),r="optimize";Object(s.l)().optimize.active&&(Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat(r),"googlesitekit.OptimizeModuleSettingsDetails",Object(s.f)(o.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.ModuleSetup-".concat(r),"googlesitekit.OptimizeModuleSetupWizard",Object(s.f)(o.a,{onSettingsPage:!1})),Object(n.b)("googlesitekit.SetupWinNotification-".concat(r),"googlesitekit.OptimizeSetupWinNotification",(function(e){return e.description=Object(i.__)("To set up experiments and see the results, go to ","google-site-kit"),e.learnMore.label="Optimize",e.learnMore.url="https://optimize.withgoogle.com/",e})));a(193),a(194);var l=a(106);Object(s.l)().tagmanager.active&&(Object(n.b)("googlesitekit.ModuleSettingsDetails-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSettingsDetails",Object(s.f)(l.a,{onSettingsPage:!0})),Object(n.b)("googlesitekit.ModuleSetup-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSetupWizard",Object(s.f)(l.a,{onSettingsPage:!1})))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){"use strict";a.r(t),function(e,n){a.d(t,"GoogleSitekitAdminbar",(function(){return E})),a.d(t,"init",(function(){return j}));var i=a(5),o=a.n(i),s=a(6),r=a.n(s),l=a(7),c=a.n(l),d=a(8),u=a.n(d),g=a(15),m=a.n(g),p=a(9),h=a.n(p),b=(a(195),a(12)),_=a(1),f=a(118),y=a(0),k=a(2),v=a(18),S=a(373),O=a(89),E=function(t){function GoogleSitekitAdminbar(e){var t;return o()(this,GoogleSitekitAdminbar),(t=c()(this,u()(GoogleSitekitAdminbar).call(this,e))).handleMoreDetailsLink=t.handleMoreDetailsLink.bind(m()(t)),t}return h()(GoogleSitekitAdminbar,t),r()(GoogleSitekitAdminbar,[{key:"handleMoreDetailsLink",value:function(){var t=e.googlesitekit,a=t.permaLink,n=t.postID,i=t.postType,o=t.pageTitle,s=Object(k.o)("googlesitekit-dashboard",{permaLink:a,id:n,postType:i,pageTitle:o});Object(k.B)("admin_bar","post_details_click"),document.location=s}},{key:"render",value:function(){var t=e.googlesitekit,a=t.pageTitle,i=t.permaLink;return n.createElement(O.a,null,n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-3 mdc-layout-grid__cell--align-middle "},n.createElement("div",{className:"googlesitekit-adminbar__subtitle"},Object(y.__)("Stats for","google-site-kit")),n.createElement("div",{className:"googlesitekit-adminbar__title"},a?Object(k.d)(a):i)),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--align-middle "},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement(S.a,null))),n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2 mdc-layout-grid__cell--align-middle "},n.createElement(v.a,{className:"googlesitekit-adminbar__link",href:"#",onClick:this.handleMoreDetailsLink},Object(y.__)("More details","google-site-kit"))))),n.createElement(v.a,{className:"googlesitekit-adminbar__link googlesitekit-adminbar__link--mobile",href:"#",onClick:this.handleMoreDetailsLink},Object(y.__)("More details","google-site-kit")))}}]),GoogleSitekitAdminbar}(_.Component);function j(){var e=document.getElementById("js-googlesitekit-adminbar-modules");e&&(Object(k.r)(),Object(f.render)(n.createElement(E,null),e),Object(b.d)("googlesitekit.moduleLoaded","Adminbar"))}}.call(this,a(16),a(1))},,,,,,,,,function(e,t,a){"use strict";(function(e){var n=a(5),i=a.n(n),o=a(6),s=a.n(o),r=a(7),l=a.n(r),c=a(8),d=a.n(c),u=a(9),g=a.n(u),m=a(51),p=a(1),h=function(t){function AdminbarModules(){return i()(this,AdminbarModules),l()(this,d()(AdminbarModules).apply(this,arguments))}return g()(AdminbarModules,t),s()(AdminbarModules,[{key:"render",value:function(){return e.createElement(p.Fragment,null)}}]),AdminbarModules}(p.Component);t.a=Object(m.a)("googlesitekit.AdminbarModules")(h)}).call(this,a(1))}]]);
dist/assets/js/chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard~chunk-googlesitekit-setup-wizard-proxy-2422cbe0801b8fe596c6.js ADDED
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{111:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),l=n(5),o=n.n(l),r=n(6),c=n.n(r),s=n(7),u=n.n(s),d=n(8),m=n.n(d),g=n(1),h=n(3),p=n.n(h),f=n(189),_=n.n(f),y=n(14),v=n.n(y),k=n(127),b=n(0),E=n(30),L=n(19),N=n(25),C=function(t){function Dialog(){var e;return i()(this,Dialog),(e=c()(this,u()(Dialog).call(this))).state={attributes:[Object(b.__)("Audience overview","google-site-kit"),Object(b.__)("Top pages","google-site-kit"),Object(b.__)("Top acquisition sources","google-site-kit"),Object(b.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.h)(),e}return m()(Dialog,t),o()(Dialog,[{key:"componentDidMount",value:function(){new N.d(this.dialogRef.current)}},{key:"render",value:function(){var t=this.props,n=t.dialogActive,a=t.handleDialog,i=t.title,l=t.provides,o=t.handleConfirm,r=t.subtitle,c=t.confirmButton,s=t.dependentModules,u=t.instanceId,d="googlesitekit-dialog-label-".concat(u),m="googlesitekit-dialog-description-".concat(u),g=!(!l||!l.length);return e.createElement("div",{ref:this.dialogRef,className:v()("mdc-dialog",{"mdc-dialog--open":n}),role:"alertdialog","aria-modal":"true","aria-labelledby":i?d:void 0,"aria-describedby":g?m:void 0,"aria-hidden":n?"false":"true",tabIndex:"-1"},e.createElement("div",{className:"mdc-dialog__scrim"}," "),e.createElement(_.a,{active:n},e.createElement("div",null,e.createElement("div",{className:"mdc-dialog__container"},e.createElement("div",{className:"mdc-dialog__surface"},i&&e.createElement("h2",{id:d,className:"mdc-dialog__title"},i),r&&e.createElement("p",{className:"mdc-dialog__lead"},r),g&&e.createElement("section",{id:m,className:"mdc-dialog__content"},e.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},l.map((function(t){return e.createElement("li",{className:"mdc-list-item",key:t},e.createElement("span",{className:"mdc-list-item__text"},t))})))),s&&e.createElement("p",{className:"mdc-dialog__dependecies"},e.createElement("strong",null,Object(b.__)("Note: ","google-site-kit")),s),e.createElement("footer",{className:"mdc-dialog__actions"},e.createElement(E.a,{onClick:o,danger:!0},c||Object(b.__)("Disconnect","google-site-kit")),e.createElement(L.a,{className:"mdc-dialog__cancel-button",onClick:function(){return a()},inherit:!0},Object(b.__)("Cancel","google-site-kit"))))))))}}]),Dialog}(g.a);C.propTypes={dialogActive:p.a.bool,handleDialog:p.a.func,handleConfirm:p.a.func.isRequired,title:p.a.string,description:p.a.string,confirmButton:p.a.string},C.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=Object(k.a)(C)}).call(this,n(11))},123:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n(4),i=n.n(a),l=n(5),o=n.n(l),r=n(6),c=n.n(r),s=n(7),u=n.n(s),d=n(8),m=n.n(d),g=n(1),h=function(e){function Modal(e){var t;return i()(this,Modal),(t=c()(this,u()(Modal).call(this,e))).el=document.createElement("div"),t.root=document.querySelector(".googlesitekit-plugin")||document.body,t}return m()(Modal,e),o()(Modal,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.g)(this.props.children,this.el)}}]),Modal}(g.a)},129:function(e,t,n){"use strict";(function(e,a){var i=n(10),l=n.n(i),o=n(4),r=n.n(o),c=n(5),s=n.n(c),u=n(6),d=n.n(u),m=n(7),g=n.n(m),h=n(15),p=n.n(h),f=n(8),_=n.n(f),y=n(1),v=n(0),k=n(2),b=n(111),E=n(30),L=n(130),N=n(123),C=function(t){function UserMenu(e){var t;return r()(this,UserMenu),(t=d()(this,g()(UserMenu).call(this,e))).state={dialogActive:!1,menuOpen:!1},t.handleMenu=t.handleMenu.bind(p()(t)),t.handleMenuClose=t.handleMenuClose.bind(p()(t)),t.handleMenuItemSelect=t.handleMenuItemSelect.bind(p()(t)),t.handleDialog=t.handleDialog.bind(p()(t)),t.handleDialogClose=t.handleDialogClose.bind(p()(t)),t.handleUnlinkConfirm=t.handleUnlinkConfirm.bind(p()(t)),t.menuButtonRef=Object(y.h)(),t.menuRef=Object(y.h)(),t}return _()(UserMenu,t),s()(UserMenu,[{key:"componentDidMount",value:function(){e.addEventListener("mouseup",this.handleMenuClose),e.addEventListener("keyup",this.handleMenuClose),e.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){e.removeEventListener("mouseup",this.handleMenuClose),e.removeEventListener("keyup",this.handleMenuClose),e.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(t,n){var a=e.googlesitekit.admin.proxyPermissionsURL;if("keydown"===n.type&&(13===n.keyCode||32===n.keyCode)||"click"===n.type)switch(t){case 0:this.handleDialog();break;case 1:e.location.assign(a);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return l.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(k.c)(),document.location=Object(k.o)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var t=e.googlesitekit.admin,n=t.userData,i=n.email,l=void 0===i?"":i,o=n.picture,r=void 0===o?"":o,c=t.proxyPermissionsURL,s=this.state,u=s.dialogActive,d=s.menuOpen;return a.createElement(y.b,null,a.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},a.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:r?a.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},a.createElement("img",{className:"mdc-button__icon--image",src:r,alt:Object(v.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:d,ariaControls:"user-menu"},l),a.createElement(L.a,{ref:this.menuRef,menuOpen:d,menuItems:[Object(v.__)("Disconnect","google-site-kit")].concat(c?[Object(v.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),a.createElement(N.a,null,a.createElement(b.a,{dialogActive:u,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(v.__)("Disconnect","google-site-kit"),subtitle:Object(v.__)("Disconnecting Site Kit by Google will remove your access to all services. After disconnecting, you will need to re-authorize to restore service.","google-site-kit"),confirmButton:Object(v.__)("Disconnect","google-site-kit"),provides:[]})))}}]),UserMenu}(y.a);t.a=C}).call(this,n(16),n(11))},130:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),l=n(5),o=n.n(l),r=n(6),c=n.n(r),s=n(7),u=n.n(s),d=n(8),m=n.n(d),g=n(1),h=n(3),p=n.n(h),f=n(25),_=function(t){function Menu(e){var t;return i()(this,Menu),(t=c()(this,u()(Menu).call(this,e))).menuRef=Object(g.h)(),t}return m()(Menu,t),o()(Menu,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new f.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var t=this.props,n=t.menuOpen,a=t.menuItems,i=t.onSelected,l=t.id;return e.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},e.createElement("ul",{id:l,className:"mdc-list",role:"menu","aria-hidden":!n,"aria-orientation":"vertical",tabIndex:"-1"},a.map((function(t,n){return e.createElement("li",{key:n,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,n),onKeyDown:i.bind(null,n)},e.createElement("span",{className:"mdc-list-item__text"},t))}))))}}]),Menu}(g.a);_.propTypes={menuOpen:p.a.bool.isRequired,menuItems:p.a.array.isRequired,id:p.a.string.isRequired},t.a=_}).call(this,n(11))},131:function(e,t,n){"use strict";var a=n(4),i=n.n(a),l=n(5),o=n.n(l),r=n(6),c=n.n(r),s=n(7),u=n.n(s),d=n(8),m=n.n(d),g=n(51),h=function(e){function ErrorNotification(){return i()(this,ErrorNotification),c()(this,u()(ErrorNotification).apply(this,arguments))}return m()(ErrorNotification,e),o()(ErrorNotification,[{key:"render",value:function(){return null}}]),ErrorNotification}(n(1).a);t.a=Object(g.a)("googlesitekit.ErrorNotification")(h)},134:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),l=n(5),o=n.n(l),r=n(6),c=n.n(r),s=n(7),u=n.n(s),d=n(8),m=n.n(d),g=n(1),h=n(3),p=n.n(h),f=n(14),_=n.n(f),y=n(19),v=function(t){function LayoutHeader(){return i()(this,LayoutHeader),c()(this,u()(LayoutHeader).apply(this,arguments))}return m()(LayoutHeader,t),o()(LayoutHeader,[{key:"render",value:function(){var t=this.props,n=t.title,a=t.ctaLabel,i=t.ctaLink;return e.createElement("header",{className:"googlesitekit-layout__header"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},n&&e.createElement("div",{className:_()("mdc-layout-grid__cell","mdc-layout-grid__cell--align-middle","mdc-layout-grid__cell--span-4-phone",{"mdc-layout-grid__cell--span-6-desktop":i,"mdc-layout-grid__cell--span-12-desktop":!i,"mdc-layout-grid__cell--span-8-tablet":!i})},e.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},n)),i&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},e.createElement(y.a,{href:i,external:!0,inherit:!0},a)))))}}]),LayoutHeader}(g.a);v.propTypes={title:p.a.string,ctaLabel:p.a.string,ctaLink:p.a.string},v.defaultProps={title:"",ctaLabel:"",ctaLink:""},t.a=v}).call(this,n(11))},135:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),l=n(5),o=n.n(l),r=n(6),c=n.n(r),s=n(7),u=n.n(s),d=n(8),m=n.n(d),g=n(1),h=n(3),p=n.n(h),f=n(49),_=function(t){function LayoutFooter(){return i()(this,LayoutFooter),c()(this,u()(LayoutFooter).apply(this,arguments))}return m()(LayoutFooter,t),o()(LayoutFooter,[{key:"render",value:function(){var t=this.props,n=t.ctaLabel,a=t.ctaLink,i=t.footerContent;return e.createElement("footer",{className:"googlesitekit-layout__footer"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},a&&n&&e.createElement(f.a,{className:"googlesitekit-data-block__source",name:n,href:a,external:!0}),i))))}}]),LayoutFooter}(g.a);_.propTypes={ctaLabel:p.a.string,ctaLink:p.a.string},t.a=_}).call(this,n(11))},21:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),l=n(5),o=n.n(l),r=n(6),c=n.n(r),s=n(7),u=n.n(s),d=n(8),m=n.n(d),g=n(1),h=n(3),p=n.n(h),f=n(14),_=n.n(f),y=n(134),v=n(135),k=function(t){function Layout(){return i()(this,Layout),c()(this,u()(Layout).apply(this,arguments))}return m()(Layout,t),o()(Layout,[{key:"render",value:function(){var t=this.props,n=t.header,a=t.footer,i=t.children,l=t.title,o=t.headerCtaLabel,r=t.headerCtaLink,c=t.footerCtaLabel,s=t.footerCtaLink,u=t.footerContent,d=t.className,m=t.fill,g=t.relative;return e.createElement("div",{className:_()("googlesitekit-layout",d,{"googlesitekit-layout--fill":m,"googlesitekit-layout--relative":g})},n&&e.createElement(y.a,{title:l,ctaLabel:o,ctaLink:r}),i,a&&e.createElement(v.a,{ctaLabel:c,ctaLink:s,footerContent:u}))}}]),Layout}(g.a);k.propTypes={header:p.a.bool,footer:p.a.bool,children:p.a.node.isRequired,title:p.a.string,headerCtaLabel:p.a.string,headerCtaLink:p.a.string,footerCtaLabel:p.a.string,footerCtaLink:p.a.string,footerContent:p.a.node,className:p.a.string,fill:p.a.bool,relative:p.a.bool},k.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1},t.a=k}).call(this,n(11))},56:function(e,t,n){"use strict";(function(e,a){var i=n(4),l=n.n(i),o=n(5),r=n.n(o),c=n(6),s=n.n(c),u=n(7),d=n.n(u),m=n(8),g=n.n(m),h=n(1),p=n(99),f=n(129),_=n(131),y=function(t){function Header(){return l()(this,Header),s()(this,d()(Header).apply(this,arguments))}return g()(Header,t),r()(Header,[{key:"render",value:function(){var t=e.googlesitekit.setup.isAuthenticated;return a.createElement(h.b,null,a.createElement("header",{className:"googlesitekit-header"},a.createElement("section",{className:"mdc-layout-grid"},a.createElement("div",{className:"mdc-layout-grid__inner"},a.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},a.createElement(p.a,null)),a.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},t&&a.createElement(f.a,null))))),a.createElement(_.a,null))}}]),Header}(h.a);t.a=y}).call(this,n(16),n(11))}}]);
dist/assets/js/chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard~chunk-googlesitekit-setup-wizard-proxy-521957e350e8b8963c17.js DELETED
@@ -1 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{108:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),o=n(6),l=n.n(o),r=n(7),c=n.n(r),s=n(8),u=n.n(s),d=n(9),m=n.n(d),g=n(3),h=n.n(g),p=n(184),f=n.n(p),_=n(14),y=n.n(_),v=n(189),k=n(1),b=n(0),E=n(31),C=n(18),L=n(25),N=function(t){function Dialog(){var e;return i()(this,Dialog),(e=c()(this,u()(Dialog).call(this))).state={attributes:[Object(b.__)("Audience overview","google-site-kit"),Object(b.__)("Top pages","google-site-kit"),Object(b.__)("Top acquisition sources","google-site-kit"),Object(b.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(k.createRef)(),e}return m()(Dialog,t),l()(Dialog,[{key:"componentDidMount",value:function(){new L.d(this.dialogRef.current)}},{key:"render",value:function(){var t=this.props,n=t.dialogActive,a=t.handleDialog,i=t.title,o=t.provides,l=t.handleConfirm,r=t.subtitle,c=t.confirmButton,s=t.dependentModules,u=t.instanceId,d="googlesitekit-dialog-label-".concat(u),m="googlesitekit-dialog-description-".concat(u),g=!(!o||!o.length);return e.createElement("div",{ref:this.dialogRef,className:y()("mdc-dialog",{"mdc-dialog--open":n}),role:"alertdialog","aria-modal":"true","aria-labelledby":i?d:void 0,"aria-describedby":g?m:void 0,"aria-hidden":n?"false":"true",tabIndex:"-1"},e.createElement("div",{className:"mdc-dialog__scrim"}," "),e.createElement(f.a,{active:n},e.createElement("div",null,e.createElement("div",{className:"mdc-dialog__container"},e.createElement("div",{className:"mdc-dialog__surface"},i&&e.createElement("h2",{id:d,className:"mdc-dialog__title"},i),r&&e.createElement("p",{className:"mdc-dialog__lead"},r),g&&e.createElement("section",{id:m,className:"mdc-dialog__content"},e.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},o.map((function(t){return e.createElement("li",{className:"mdc-list-item",key:t},e.createElement("span",{className:"mdc-list-item__text"},t))})))),s&&e.createElement("p",{className:"mdc-dialog__dependecies"},e.createElement("strong",null,Object(b.__)("Note: ","google-site-kit")),s),e.createElement("footer",{className:"mdc-dialog__actions"},e.createElement(E.a,{onClick:l,danger:!0},c||Object(b.__)("Disconnect","google-site-kit")),e.createElement(C.a,{className:"mdc-dialog__cancel-button",onClick:function(){return a()},inherit:!0},Object(b.__)("Cancel","google-site-kit"))))))))}}]),Dialog}(k.Component);N.propTypes={dialogActive:h.a.bool,handleDialog:h.a.func,handleConfirm:h.a.func.isRequired,title:h.a.string,description:h.a.string,confirmButton:h.a.string},N.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=Object(v.a)(N)}).call(this,n(1))},119:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(5),i=n.n(a),o=n(6),l=n.n(o),r=n(7),c=n.n(r),s=n(8),u=n.n(s),d=n(9),m=n.n(d),g=n(118),h=n(1),p=function(e){function Modal(e){var t;return i()(this,Modal),(t=c()(this,u()(Modal).call(this,e))).el=document.createElement("div"),t.root=document.querySelector(".googlesitekit-plugin")||document.body,t}return m()(Modal,e),l()(Modal,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(g.createPortal)(this.props.children,this.el)}}]),Modal}(h.Component)},123:function(e,t,n){"use strict";(function(e,a){var i=n(11),o=n.n(i),l=n(5),r=n.n(l),c=n(6),s=n.n(c),u=n(7),d=n.n(u),m=n(8),g=n.n(m),h=n(15),p=n.n(h),f=n(9),_=n.n(f),y=n(1),v=n(0),k=n(2),b=n(108),E=n(31),C=n(124),L=n(119),N=function(t){function UserMenu(e){var t;return r()(this,UserMenu),(t=d()(this,g()(UserMenu).call(this,e))).state={dialogActive:!1,menuOpen:!1},t.handleMenu=t.handleMenu.bind(p()(t)),t.handleMenuClose=t.handleMenuClose.bind(p()(t)),t.handleMenuItemSelect=t.handleMenuItemSelect.bind(p()(t)),t.handleDialog=t.handleDialog.bind(p()(t)),t.handleDialogClose=t.handleDialogClose.bind(p()(t)),t.handleUnlinkConfirm=t.handleUnlinkConfirm.bind(p()(t)),t.menuButtonRef=Object(y.createRef)(),t.menuRef=Object(y.createRef)(),t}return _()(UserMenu,t),s()(UserMenu,[{key:"componentDidMount",value:function(){e.addEventListener("mouseup",this.handleMenuClose),e.addEventListener("keyup",this.handleMenuClose),e.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){e.removeEventListener("mouseup",this.handleMenuClose),e.removeEventListener("keyup",this.handleMenuClose),e.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(t,n){var a=e.googlesitekit.admin.proxyPermissionsURL;if("keydown"===n.type&&(13===n.keyCode||32===n.keyCode)||"click"===n.type)switch(t){case 0:this.handleDialog();break;case 1:e.location.assign(a);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return o.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(k.c)(),document.location=Object(k.o)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var t=e.googlesitekit.admin,n=t.userData,i=n.email,o=void 0===i?"":i,l=n.picture,r=void 0===l?"":l,c=t.proxyPermissionsURL,s=this.state,u=s.dialogActive,d=s.menuOpen;return a.createElement(y.Fragment,null,a.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},a.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:r?a.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},a.createElement("img",{className:"mdc-button__icon--image",src:r,alt:Object(v.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:d,ariaControls:"user-menu"},o),a.createElement(C.a,{ref:this.menuRef,menuOpen:d,menuItems:[Object(v.__)("Disconnect","google-site-kit")].concat(c?[Object(v.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),a.createElement(L.a,null,a.createElement(b.a,{dialogActive:u,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(v.__)("Disconnect","google-site-kit"),subtitle:Object(v.__)("Disconnecting Site Kit by Google will remove your access to all services. After disconnecting, you will need to re-authorize to restore service.","google-site-kit"),confirmButton:Object(v.__)("Disconnect","google-site-kit"),provides:[]})))}}]),UserMenu}(y.Component);t.a=N}).call(this,n(16),n(1))},124:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),o=n(6),l=n.n(o),r=n(7),c=n.n(r),s=n(8),u=n.n(s),d=n(9),m=n.n(d),g=n(3),h=n.n(g),p=n(1),f=n(25),_=function(t){function Menu(e){var t;return i()(this,Menu),(t=c()(this,u()(Menu).call(this,e))).menuRef=Object(p.createRef)(),t}return m()(Menu,t),l()(Menu,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new f.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var t=this.props,n=t.menuOpen,a=t.menuItems,i=t.onSelected,o=t.id;return e.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},e.createElement("ul",{id:o,className:"mdc-list",role:"menu","aria-hidden":!n,"aria-orientation":"vertical",tabIndex:"-1"},a.map((function(t,n){return e.createElement("li",{key:n,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,n),onKeyDown:i.bind(null,n)},e.createElement("span",{className:"mdc-list-item__text"},t))}))))}}]),Menu}(p.Component);_.propTypes={menuOpen:h.a.bool.isRequired,menuItems:h.a.array.isRequired,id:h.a.string.isRequired},t.a=_}).call(this,n(1))},125:function(e,t,n){"use strict";var a=n(5),i=n.n(a),o=n(6),l=n.n(o),r=n(7),c=n.n(r),s=n(8),u=n.n(s),d=n(9),m=n.n(d),g=n(51),h=n(1),p=function(e){function ErrorNotification(){return i()(this,ErrorNotification),c()(this,u()(ErrorNotification).apply(this,arguments))}return m()(ErrorNotification,e),l()(ErrorNotification,[{key:"render",value:function(){return null}}]),ErrorNotification}(h.Component);t.a=Object(g.a)("googlesitekit.ErrorNotification")(p)},128:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),o=n(6),l=n.n(o),r=n(7),c=n.n(r),s=n(8),u=n.n(s),d=n(9),m=n.n(d),g=n(3),h=n.n(g),p=n(14),f=n.n(p),_=n(1),y=n(18),v=function(t){function LayoutHeader(){return i()(this,LayoutHeader),c()(this,u()(LayoutHeader).apply(this,arguments))}return m()(LayoutHeader,t),l()(LayoutHeader,[{key:"render",value:function(){var t=this.props,n=t.title,a=t.ctaLabel,i=t.ctaLink;return e.createElement("header",{className:"googlesitekit-layout__header"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},n&&e.createElement("div",{className:f()("mdc-layout-grid__cell","mdc-layout-grid__cell--align-middle","mdc-layout-grid__cell--span-4-phone",{"mdc-layout-grid__cell--span-6-desktop":i,"mdc-layout-grid__cell--span-12-desktop":!i,"mdc-layout-grid__cell--span-8-tablet":!i})},e.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},n)),i&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},e.createElement(y.a,{href:i,external:!0,inherit:!0},a)))))}}]),LayoutHeader}(_.Component);v.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},v.defaultProps={title:"",ctaLabel:"",ctaLink:""},t.a=v}).call(this,n(1))},129:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),o=n(6),l=n.n(o),r=n(7),c=n.n(r),s=n(8),u=n.n(s),d=n(9),m=n.n(d),g=n(3),h=n.n(g),p=n(1),f=n(48),_=function(t){function LayoutFooter(){return i()(this,LayoutFooter),c()(this,u()(LayoutFooter).apply(this,arguments))}return m()(LayoutFooter,t),l()(LayoutFooter,[{key:"render",value:function(){var t=this.props,n=t.ctaLabel,a=t.ctaLink,i=t.footerContent;return e.createElement("footer",{className:"googlesitekit-layout__footer"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},a&&n&&e.createElement(f.a,{className:"googlesitekit-data-block__source",name:n,href:a,external:!0}),i))))}}]),LayoutFooter}(p.Component);_.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string},t.a=_}).call(this,n(1))},21:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),o=n(6),l=n.n(o),r=n(7),c=n.n(r),s=n(8),u=n.n(s),d=n(9),m=n.n(d),g=n(3),h=n.n(g),p=n(14),f=n.n(p),_=n(1),y=n(128),v=n(129),k=function(t){function Layout(){return i()(this,Layout),c()(this,u()(Layout).apply(this,arguments))}return m()(Layout,t),l()(Layout,[{key:"render",value:function(){var t=this.props,n=t.header,a=t.footer,i=t.children,o=t.title,l=t.headerCtaLabel,r=t.headerCtaLink,c=t.footerCtaLabel,s=t.footerCtaLink,u=t.footerContent,d=t.className,m=t.fill,g=t.relative;return e.createElement("div",{className:f()("googlesitekit-layout",d,{"googlesitekit-layout--fill":m,"googlesitekit-layout--relative":g})},n&&e.createElement(y.a,{title:o,ctaLabel:l,ctaLink:r}),i,a&&e.createElement(v.a,{ctaLabel:c,ctaLink:s,footerContent:u}))}}]),Layout}(_.Component);k.propTypes={header:h.a.bool,footer:h.a.bool,children:h.a.node.isRequired,title:h.a.string,headerCtaLabel:h.a.string,headerCtaLink:h.a.string,footerCtaLabel:h.a.string,footerCtaLink:h.a.string,footerContent:h.a.node,className:h.a.string,fill:h.a.bool,relative:h.a.bool},k.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1},t.a=k}).call(this,n(1))},56:function(e,t,n){"use strict";(function(e,a){var i=n(5),o=n.n(i),l=n(6),r=n.n(l),c=n(7),s=n.n(c),u=n(8),d=n.n(u),m=n(9),g=n.n(m),h=n(1),p=n(100),f=n(123),_=n(125),y=function(t){function Header(){return o()(this,Header),s()(this,d()(Header).apply(this,arguments))}return g()(Header,t),r()(Header,[{key:"render",value:function(){var t=e.googlesitekit.setup.isAuthenticated;return a.createElement(h.Fragment,null,a.createElement("header",{className:"googlesitekit-header"},a.createElement("section",{className:"mdc-layout-grid"},a.createElement("div",{className:"mdc-layout-grid__inner"},a.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},a.createElement(p.a,null)),a.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},t&&a.createElement(f.a,null))))),a.createElement(_.a,null))}}]),Header}(h.Component);t.a=y}).call(this,n(16),n(1))}}]);
dist/assets/js/chunk-googlesitekit-setup-wizard-71f185e0b62512548cd9.js DELETED
@@ -1,7 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{184:function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=n(1),o=n(118),a=n(294),s=function(e){function FocusTrap(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,FocusTrap);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(FocusTrap.__proto__||Object.getPrototypeOf(FocusTrap)).call(this,e));return t.setFocusTrapElement=function(e){t.focusTrapElement=e},"undefined"!=typeof document&&(t.previouslyFocusedElement=document.activeElement),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(FocusTrap,e),i(FocusTrap,[{key:"componentDidMount",value:function(){var e=this.props.focusTrapOptions,t={returnFocusOnDeactivate:!1};for(var n in e)e.hasOwnProperty(n)&&"returnFocusOnDeactivate"!==n&&(t[n]=e[n]);var i=o.findDOMNode(this.focusTrapElement);this.focusTrap=this.props._createFocusTrap(i,t),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()}},{key:"componentDidUpdate",value:function(e){if(e.active&&!this.props.active){var t={returnFocus:this.props.focusTrapOptions.returnFocusOnDeactivate||!1};this.focusTrap.deactivate(t)}else!e.active&&this.props.active&&this.focusTrap.activate();e.paused&&!this.props.paused?this.focusTrap.unpause():!e.paused&&this.props.paused&&this.focusTrap.pause()}},{key:"componentWillUnmount",value:function(){this.focusTrap.deactivate(),!1!==this.props.focusTrapOptions.returnFocusOnDeactivate&&this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus()}},{key:"render",value:function(){var e=this,t=r.Children.only(this.props.children);return r.cloneElement(t,{ref:function(n){e.setFocusTrapElement(n),"function"==typeof t.ref&&t.ref(n)}})}}]),FocusTrap}(r.Component);s.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:a},e.exports=s},189:function(e,t,n){"use strict";function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=n(1),u=n(13);var p=function(e,t){return function(n){var i=e(n),r=n.displayName,o=void 0===r?n.name||"Component":r;return i.displayName="".concat(Object(u.upperFirst)(Object(u.camelCase)(t)),"(").concat(o,")"),i}};t.a=p((function(e){var t=0;return(function(n){function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=a(this,s(o).apply(this,arguments))).instanceId=t++,e}var u,p,d;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(o,n),u=o,(p=[{key:"render",value:function(){return Object(l.createElement)(e,i({},this.props,{instanceId:this.instanceId}))}}])&&r(u.prototype,p),d&&r(u,d),o}(l.Component))}),"withInstanceId")},217:function(e,t,n){"use strict";(function(e){var i=n(20),r=n.n(i),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(7),u=n.n(l),p=n(8),d=n.n(p),g=n(15),m=n.n(g),h=n(9),f=n.n(h),v=n(3),b=n.n(v),y=n(14),_=n.n(y),k=n(41),S=n(1),E=n(0),C=n(2),w=n(218),O=n(45),N=function(t){function OptIn(e){var t;return a()(this,OptIn),(t=u()(this,d()(OptIn).call(this,e))).state={optIn:Object(O.a)(),error:!1},t.handleOptIn=t.handleOptIn.bind(m()(t)),t}return f()(OptIn,t),c()(OptIn,[{key:"handleOptIn",value:function(e){var t=this,n=!!e.target.checked,i=Object(C.k)("googlesitekit_tracking_optin");Object(O.b)(n),n&&Object(O.c)("tracking_plugin",this.props.optinAction),Object(k.default)({path:"/wp/v2/users/me",method:"POST",data:{meta:r()({},i,n)}}).then((function(){t.setState({optIn:n,error:!1})})).catch((function(e){t.setState({optIn:!n,error:{errorCode:e.code,errorMsg:e.message}})}))}},{key:"render",value:function(){var t=this.state,n=t.optIn,i=t.error,r=this.props,o=r.id,a=r.name,s=r.className,c=Object(E.sprintf)(
2
- /* translators: %s: privacy policy URL */
3
- Object(E.__)('Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with <a href="%s" target="_blank" rel="noopener noreferrer">Google Privacy Policy</a>',"google-site-kit"),"https://policies.google.com/privacy");return e.createElement("div",{className:_()("googlesitekit-opt-in",s)},e.createElement(w.a,{id:o,name:a,value:"1",checked:n,onChange:this.handleOptIn},e.createElement("span",{dangerouslySetInnerHTML:Object(C.x)(c,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target","rel"]})})),i&&e.createElement("div",{className:"googlesitekit-error-text"},i.errorMsg))}}]),OptIn}(S.Component);N.propTypes={id:b.a.string,name:b.a.string,className:b.a.string,optinAction:b.a.string},N.defaultProps={id:"googlesitekit-opt-in",name:"optIn"},t.a=N}).call(this,n(1))},218:function(e,t,n){"use strict";(function(e){var i=n(5),r=n.n(i),o=n(6),a=n.n(o),s=n(7),c=n.n(s),l=n(8),u=n.n(l),p=n(9),d=n.n(p),g=n(3),m=n.n(g),h=n(14),f=n.n(h),v=n(1),b=n(25),y=function(t){function Checkbox(e){var t;return r()(this,Checkbox),(t=c()(this,u()(Checkbox).call(this,e))).formFieldRef=Object(v.createRef)(),t.checkboxRef=Object(v.createRef)(),t}return d()(Checkbox,t),a()(Checkbox,[{key:"componentDidMount",value:function(){new b.e(this.formFieldRef.current).input=new b.c(this.checkboxRef.current)}},{key:"render",value:function(){var t=this.props,n=t.onChange,i=t.id,r=t.name,o=t.value,a=t.checked,s=t.disabled,c=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:f()("mdc-checkbox",{"mdc-checkbox--disabled":s}),ref:this.checkboxRef},e.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:i,name:r,value:o,checked:a,disabled:s,onChange:n}),e.createElement("div",{className:"mdc-checkbox__background"},e.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},e.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),e.createElement("div",{className:"mdc-checkbox__mixedmark"}))),e.createElement("label",{htmlFor:i},c))}}]),Checkbox}(v.Component);y.propTypes={onChange:m.a.func.isRequired,id:m.a.string.isRequired,name:m.a.string.isRequired,value:m.a.string.isRequired,checked:m.a.bool,disabled:m.a.bool,children:m.a.node.isRequired},y.defaultProps={checked:!1,disabled:!1},t.a=y}).call(this,n(1))},294:function(e,t,n){var i=n(295),r=n(243),o=null;function a(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,s="string"==typeof e?n.querySelector(e):e,c=r({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),l={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},u={activate:function(e){if(l.active)return;_(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:c.onActivate;t&&t();return d(),u},deactivate:p,pause:function(){if(l.paused||!l.active)return;l.paused=!0,g()},unpause:function(){if(!l.paused||!l.active)return;l.paused=!1,d()}};return u;function p(e){if(l.active){g(),l.active=!1,l.paused=!1;var t=e&&void 0!==e.onDeactivate?e.onDeactivate:c.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:c.returnFocusOnDeactivate)&&a((function(){k(l.nodeFocusedBeforeActivation)})),u}}function d(){if(l.active)return o&&o.pause(),o=u,_(),a((function(){k(h())})),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",f,!0),n.addEventListener("touchstart",f,!0),n.addEventListener("click",y,!0),n.addEventListener("keydown",b,!0),u}function g(){if(l.active&&o===u)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",f,!0),n.removeEventListener("touchstart",f,!0),n.removeEventListener("click",y,!0),n.removeEventListener("keydown",b,!0),o=null,u}function m(e){var t=c[e],i=t;if(!t)return null;if("string"==typeof t&&!(i=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(i=t()))throw new Error("`"+e+"` did not return a node");return i}function h(){var e;if(!(e=null!==m("initialFocus")?m("initialFocus"):s.contains(n.activeElement)?n.activeElement:l.firstTabbableNode||m("fallbackFocus")))throw new Error("You can't have a focus-trap without at least one focusable element");return e}function f(e){s.contains(e.target)||(c.clickOutsideDeactivates?p({returnFocus:!i.isFocusable(e.target)}):e.preventDefault())}function v(e){s.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),k(l.mostRecentlyFocusedNode||h()))}function b(e){if(!1!==c.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void p();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(_(),e.shiftKey&&e.target===l.firstTabbableNode)return e.preventDefault(),void k(l.lastTabbableNode);if(!e.shiftKey&&e.target===l.lastTabbableNode)e.preventDefault(),k(l.firstTabbableNode)}(e)}function y(e){c.clickOutsideDeactivates||s.contains(e.target)||(e.preventDefault(),e.stopImmediatePropagation())}function _(){var e=i(s);l.firstTabbableNode=e[0]||h(),l.lastTabbableNode=e[e.length-1]||h()}function k(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),l.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):k(h()))}}},295:function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],i=n.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function o(e,t){t=t||{};var n,o,s,c=[],p=[],d=new UntouchabilityChecker(e.ownerDocument||e),g=e.querySelectorAll(i);for(t.includeContainer&&r.call(e,i)&&(g=Array.prototype.slice.apply(g)).unshift(e),n=0;n<g.length;n++)a(o=g[n],d)&&(0===(s=l(o))?c.push(o):p.push({documentOrder:n,tabIndex:s,node:o}));return p.sort(u).map((function(e){return e.node})).concat(c)}function a(e,t){return!(!s(e,t)||function(e){return function(e){return p(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||l(e)<0)}function s(e,t){return t=t||new UntouchabilityChecker(e.ownerDocument||e),!(e.disabled||function(e){return p(e)&&"hidden"===e.type}(e)||t.isUntouchable(e))}o.isTabbable=function(e,t){if(!e)throw new Error("No node provided");return!1!==r.call(e,i)&&a(e,t)},o.isFocusable=function(e,t){if(!e)throw new Error("No node provided");return!1!==r.call(e,c)&&s(e,t)};var c=n.concat("iframe").join(",");function l(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function u(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function p(e){return"INPUT"===e.tagName}function UntouchabilityChecker(e){this.doc=e,this.cache=[]}UntouchabilityChecker.prototype.hasDisplayNone=function(e,t){if(e===this.doc.documentElement)return!1;var n=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n]))return e[n]}(this.cache,(function(t){return t===e}));if(n)return n[1];var i=!1;return"none"===(t=t||this.doc.defaultView.getComputedStyle(e)).display?i=!0:e.parentNode&&(i=this.hasDisplayNone(e.parentNode)),this.cache.push([e,i]),i},UntouchabilityChecker.prototype.isUntouchable=function(e){if(e===this.doc.documentElement)return!1;var t=this.doc.defaultView.getComputedStyle(e);return!!this.hasDisplayNone(e,t)||"hidden"===t.visibility},e.exports=o},363:function(e,t,n){"use strict";n.r(t),function(e,i){var r=n(11),o=n.n(r),a=n(5),s=n.n(a),c=n(6),l=n.n(c),u=n(7),p=n.n(u),d=n(8),g=n.n(d),m=n(15),h=n.n(m),f=n(9),v=n.n(f),b=n(13),y=n(0),_=n(1),k=n(56),S=n(31),E=n(21),C=n(10),w=n(2),O=n(365),N=n(372),R=function(t){function Setup(t){var n;s()(this,Setup),n=p()(this,g()(Setup).call(this,t));var i=e.googlesitekit.admin.connectURL,r=e.googlesitekit.setup,o=r.isAuthenticated,a=r.hasSearchConsoleProperty,c=r.isSiteKitConnected,l=r.isVerified,u=r.needReauthenticate,d=e.googlesitekit.permissions.canSetup;return n.state={canSetup:d,isAuthenticated:o,isVerified:l,needReauthenticate:u,hasSearchConsoleProperty:a,hasSearchConsolePropertyFromTheStart:a,connectURL:i,errorMsg:"",isSiteKitConnected:c,completeSetup:!1},n.siteConnectedSetup=n.siteConnectedSetup.bind(h()(n)),n.siteVerificationSetup=n.siteVerificationSetup.bind(h()(n)),n.searchConsoleSetup=n.searchConsoleSetup.bind(h()(n)),n.resetAndRestart=n.resetAndRestart.bind(h()(n)),n.completeSetup=n.completeSetup.bind(h()(n)),n.setErrorMessage=n.setErrorMessage.bind(h()(n)),n}return v()(Setup,t),l()(Setup,[{key:"resetAndRestart",value:function(){return o.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.a.awrap(C.c.set(C.a,"site","reset"));case 2:Object(w.c)(),this.setState({isSiteKitConnected:!1,isAuthenticated:!1,isVerified:!1,hasSearchConsoleProperty:!1,completeSetup:!1,errorMsg:""});case 4:case"end":return e.stop()}}),null,this)}},{key:"completeSetup",value:function(){this.setState({completeSetup:!0})}},{key:"siteConnectedSetup",value:function(e){this.setState({isSiteKitConnected:e})}},{key:"siteVerificationSetup",value:function(e){this.setState({isVerified:e})}},{key:"searchConsoleSetup",value:function(e){this.setState({hasSearchConsoleProperty:e})}},{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,n=e.isAuthenticated,i=e.isVerified,r=e.hasSearchConsoleProperty,o=e.completeSetup;return t&&n&&i&&r&&o}},{key:"setErrorMessage",value:function(e){this.setState({errorMsg:e})}},{key:"getApplicableSteps",value:function(){var e,t=O.a,n=Object.keys(t);for(e=0;e<n.length;e++)t[n[e]].isApplicable(this.state)||delete t[n[e]];return t}},{key:"currentStep",value:function(e){var t,n=Object.keys(e);for(t=0;t<n.length-1;t++)if(!e[n[t]].isCompleted(this.state))return n[t];return n[t]}},{key:"stepStatus",value:function(e,t){return e[t].isCompleted(this.state)?"completed":t===this.currentStep(e)?"inprogress":""}},{key:"render",value:function(){var t=this,n=this.state,r=n.canSetup,o=n.isAuthenticated,a=n.isVerified,s=n.needReauthenticate,c=n.hasSearchConsoleProperty,l=n.connectURL,u=n.isSiteKitConnected;if(this.isSetupFinished()){var p=Object(w.o)("googlesitekit-dashboard",{notification:"authentication_success"});Object(b.delay)((function(){e.location.replace(p)}),500,"later")}var d=this.getApplicableSteps(),g=this.currentStep(d),m=d[g].Component,h=i.createElement(m,{siteConnectedSetup:this.siteConnectedSetup,connectURL:l,siteVerificationSetup:this.siteVerificationSetup,searchConsoleSetup:this.searchConsoleSetup,completeSetup:this.completeSetup,isSiteKitConnected:u,isAuthenticated:o,isVerified:a,needReauthenticate:s,hasSearchConsoleProperty:c,setErrorMessage:this.setErrorMessage,resetAndRestart:d.clientCredentials?this.resetAndRestart:void 0}),f=r,v=!f&&!o;return i.createElement(_.Fragment,null,i.createElement(k.a,null),i.createElement("div",{className:"googlesitekit-wizard"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement(E.a,null,i.createElement("section",{className:"googlesitekit-wizard-progress"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},f&&i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement("div",{className:"googlesitekit-wizard-progress__steps"},Object.keys(d).map((function(e,n){return i.createElement(N.a,{key:d[e].title,currentStep:g===e,title:d[e].title,step:n+1,status:t.stepStatus(d,e),warning:d[e].warning,error:d[e].error,stepKey:e})})))))),v&&i.createElement("div",{className:"googlesitekit-setup__footer"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement("h1",{className:"googlesitekit-setup__title"},Object(y.__)("Authenticate Site Kit","google-site-kit")),i.createElement("p",{className:"googlesitekit-setup__description"},Object(y.__)("Please sign into your Google account to begin.","google-site-kit")),i.createElement(S.a,{href:"#",onClick:function(){Object(w.B)("plugin_setup","signin_with_google"),document.location=l}},Object(y.__)("Sign in with Google","google-site-kit"))))))),f&&h))))))}}]),Setup}(_.Component);t.default=R}.call(this,n(16),n(1))},365:function(e,t,n){"use strict";var i=n(0),r=n(366),o=n(367),a=n(369),s=n(371),c={authentication:{title:Object(i.__)("Authenticate","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&!e.needReauthenticate},Component:r.a},verification:{title:Object(i.__)("Verify URL","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified},Component:o.a},seachConsoleProperty:{title:Object(i.__)("Connect Search Console","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:a.a},completeSetup:{title:Object(i.__)("Finish","google-site-kit"),required:!1,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:s.a}};t.a=c},366:function(e,t,n){"use strict";(function(e){var i=n(5),r=n.n(i),o=n(6),a=n.n(o),s=n(7),c=n.n(s),l=n(8),u=n.n(l),p=n(9),d=n.n(p),g=n(3),m=n.n(g),h=n(0),f=n(1),v=n(2),b=n(31),y=n(18),_=n(217),k=n(55),S=function(t){function WizardStepAuthentication(){return r()(this,WizardStepAuthentication),c()(this,u()(WizardStepAuthentication).apply(this,arguments))}return d()(WizardStepAuthentication,t),a()(WizardStepAuthentication,[{key:"render",value:function(){var t=this.props,n=t.connectURL,i=t.needReauthenticate,r=t.resetAndRestart;return e.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--two"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(h.__)("Authenticate with Google","google-site-kit")),e.createElement("p",null,Object(h.__)("Please sign into your Google account to begin.","google-site-kit")),i&&e.createElement("p",{className:"googlesitekit-error-text"},Object(h.__)("You did not grant access to one or more of the requested scopes. Please grant all scopes that you are prompted for.","google-site-kit")),e.createElement("p",null,e.createElement(b.a,{onClick:function(){Object(v.B)("plugin_setup","signin_with_google"),document.location=n}},Object(h.__)("Sign in with Google","google-site-kit")),r&&e.createElement(y.a,{className:"googlesitekit-wizard-step__back",onClick:r},Object(h.__)("Back","google-site-kit"))),e.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},e.createElement(_.a,{optinAction:"analytics_optin_setup_fallback"}),e.createElement(k.a,null))))))}}]),WizardStepAuthentication}(f.Component);S.propTypes={connectURL:m.a.string.isRequired,resetAndRestart:m.a.func},t.a=S}).call(this,n(1))},367:function(e,t,n){"use strict";(function(e){var i=n(64),r=n.n(i),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(7),u=n.n(l),p=n(8),d=n.n(p),g=n(9),m=n.n(g),h=n(3),f=n.n(h),v=n(1),b=n(368),y=function(t){function WizardStepVerification(){return a()(this,WizardStepVerification),u()(this,d()(WizardStepVerification).apply(this,arguments))}return m()(WizardStepVerification,t),c()(WizardStepVerification,[{key:"render",value:function(){var t=!this.props.isVerified;return e.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--three"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(b.a,r()({shouldSetup:t},this.props))))))}}]),WizardStepVerification}(v.Component);y.propTypes={siteVerificationSetup:f.a.func.isRequired},t.a=y}).call(this,n(1))},368:function(e,t,n){"use strict";(function(e,i){var r=n(11),o=n.n(r),a=n(5),s=n.n(a),c=n(6),l=n.n(c),u=n(7),p=n.n(u),d=n(8),g=n.n(d),m=n(15),h=n.n(m),f=n(9),v=n.n(f),b=n(3),y=n.n(b),_=n(0),k=n(1),S=n(2),E=n(25),C=n(10),w=n(31),O=n(30),N=n(55),R=function(t){function SiteVerification(e){var t;s()(this,SiteVerification);var n=(t=p()(this,g()(SiteVerification).call(this,e))).props,i=n.isAuthenticated,r=n.shouldSetup;return t.state={loading:i&&r,loadingMsg:Object(_.__)("Getting your verified sites...","google-site-kit"),siteURL:" ",selectedURL:"",errorCode:!1,errorMsg:""},t.onProceed=t.onProceed.bind(h()(t)),t}return v()(SiteVerification,t),l()(SiteVerification,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isAuthenticated,n=e.shouldSetup;t&&n&&this.requestSitePropertyList()}},{key:"requestSitePropertyList",value:function(){var t,n,i,r,a,s=this,c=this.props.setErrorMessage;o.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,l.next=3,o.a.awrap(C.c.get(C.b,"site-verification","verification"));case 3:if(t=l.sent,n=t.verified,i=t.identifier,!n){l.next=16;break}return Object(S.B)("verification_setup","verification_check_true"),l.next=10,o.a.awrap(s.insertSiteVerification(i));case 10:if(!0!==l.sent.verified){l.next=14;break}return s.props.siteVerificationSetup(!0),l.abrupt("return",!0);case 14:l.next=17;break;case 16:Object(S.B)("verification_setup","verification_check_false");case 17:s.setState({loading:!1,siteURL:i}),l.next=26;break;case 20:l.prev=20,l.t0=l.catch(0),r=l.t0.message,Object(S.C)(l.t0.message)&&(a=JSON.parse(l.t0.message),r=a.error.message||l.t0.message),c(r),s.setState({loading:!1,errorCode:l.t0.code,errorMsg:r,siteURL:e.googlesitekit.admin.siteURL});case 26:case"end":return l.stop()}}),null,null,[[0,20]])}},{key:"insertSiteVerification",value:function(e){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.a.awrap(C.c.set(C.b,"site-verification","verification",{siteURL:e}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}},{key:"onProceed",value:function(){var t,n,i,r;return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t=this.props.setErrorMessage,n=this.state.siteURL?this.state.siteURL:e.googlesitekit.admin.siteURL,t(""),this.setState({loading:!0,loadingMsg:Object(_.__)("Verifying...","google-site-kit"),errorCode:!1,errorMsg:""}),a.prev=4,a.next=7,o.a.awrap(this.insertSiteVerification(n));case 7:!0===a.sent.verified&&(Object(S.B)("verification_setup","verification_insert_tag"),this.props.siteVerificationSetup(!0)),a.next=17;break;case 11:a.prev=11,a.t0=a.catch(4),i=a.t0.message,Object(S.C)(a.t0.message)&&(r=JSON.parse(a.t0.message),i=r.error.message||a.t0.message),t(i),this.setState({loading:!1,errorCode:a.t0.code,errorMsg:i});case 17:case"end":return a.stop()}}),null,this,[[4,11]])}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,n=e.loadingMsg,r=e.siteURL,o=i.createElement(k.Fragment,null,n&&i.createElement("p",null,n),i.createElement(O.a,null));return t?o:i.createElement(k.Fragment,null,i.createElement("div",{className:"googlesitekit-wizard-step__inputs"},i.createElement(E.l,{label:Object(_.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},i.createElement(E.b,{value:r}))),i.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},i.createElement(w.a,{onClick:this.onProceed},Object(_.__)("Continue","google-site-kit")),i.createElement(N.a,null)))}},{key:"render",value:function(){var e=this.props,t=e.isAuthenticated,n=e.shouldSetup,r=this.state.errorMsg;return n?i.createElement(k.Fragment,null,i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(_.__)("Verify URL","google-site-kit")),i.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(_.__)("We will need to verify your URL for Site Kit.","google-site-kit")),r&&0<r.length&&i.createElement("p",{className:"googlesitekit-error-text"},r),t&&this.renderForm()):SiteVerification.renderSetupDone()}}],[{key:"renderSetupDone",value:function(){return i.createElement(k.Fragment,null,i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(_.__)("Verify URL","google-site-kit")),i.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(_.__)("Congratulations, your site has been verified!","google-site-kit")))}}]),SiteVerification}(k.Component);R.propTypes={isAuthenticated:y.a.bool.isRequired,shouldSetup:y.a.bool.isRequired,siteVerificationSetup:y.a.func.isRequired,completeSetup:y.a.func,setErrorMessage:y.a.func.isRequired},t.a=R}).call(this,n(16),n(1))},369:function(e,t,n){"use strict";(function(e){var i=n(64),r=n.n(i),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(7),u=n.n(l),p=n(8),d=n.n(p),g=n(9),m=n.n(g),h=n(3),f=n.n(h),v=n(1),b=n(370),y=function(t){function WizardStepSearchConsoleProperty(){return a()(this,WizardStepSearchConsoleProperty),u()(this,d()(WizardStepSearchConsoleProperty).apply(this,arguments))}return m()(WizardStepSearchConsoleProperty,t),c()(WizardStepSearchConsoleProperty,[{key:"render",value:function(){var t=this.props,n=t.isVerified,i=t.hasSearchConsoleProperty,o=n&&!i;return e.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--four"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},o?e.createElement(b.a,r()({shouldSetup:o},this.props)):b.a.connected()))))}}]),WizardStepSearchConsoleProperty}(v.Component);y.propTypes={searchConsoleSetup:f.a.func.isRequired},t.a=y}).call(this,n(1))},370:function(e,t,n){"use strict";(function(e,i){var r=n(11),o=n.n(r),a=n(5),s=n.n(a),c=n(6),l=n.n(c),u=n(7),p=n.n(u),d=n(8),g=n.n(d),m=n(15),h=n.n(m),f=n(9),v=n.n(f),b=n(3),y=n.n(b),_=n(0),k=n(1),S=n(2),E=n(10),C=n(30),w=n(55),O=n(25),N=n(31),R=function(t){function SearchConsole(t){var n;s()(this,SearchConsole),n=p()(this,g()(SearchConsole).call(this,t));var i=e.googlesitekit.admin.siteURL;return n.state={loading:!0,sites:!1,selectedURL:i,siteURL:i,connected:!1,errorCode:!1,errorMsg:""},n.handleURLSelect=n.handleURLSelect.bind(h()(n)),n.insertPropertyToSearchConsole=n.insertPropertyToSearchConsole.bind(h()(n)),n.submitPropertyEventHandler=n.submitPropertyEventHandler.bind(h()(n)),n}return v()(SearchConsole,t),l()(SearchConsole,[{key:"componentDidMount",value:function(){var e,t,n;return o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e=this.props,t=e.isAuthenticated,n=e.shouldSetup,t&&n){i.next=3;break}return i.abrupt("return");case 3:this.requestSearchConsoleSiteList();case 4:case"end":return i.stop()}}),null,this)}},{key:"requestSearchConsoleSiteList",value:function(){var e,t=this,n=this.props.setErrorMessage;o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,o.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 3:if(1!==(e=i.sent).length){i.next=9;break}return i.next=7,o.a.awrap(t.insertPropertyToSearchConsole(e[0].siteURL));case 7:return t.props.searchConsoleSetup(e[0].siteURL),i.abrupt("return");case 9:if(e.length){i.next=11;break}throw{code:"no_property_matched",message:Object(_.__)("Your site has not been added to Search Console yet. Would you like to add it now?","google-site-kit")};case 11:throw n(""),t.setState({loading:!1,selectedURL:e[0].siteURL,sites:e}),{code:"multiple_properties_matched",message:Object(_.sprintf)(
4
- /* translators: %d: the number of matching properties */
5
- Object(_.__)("We found %d existing accounts. Please choose which one to use below.","google-site-kit"),e.length)};case 16:i.prev=16,i.t0=i.catch(0),n(i.t0.message),t.setState({loading:!1,errorCode:i.t0.code,errorMsg:i.t0.message});case 20:case"end":return i.stop()}}),null,null,[[0,16]])}},{key:"insertPropertyToSearchConsole",value:function(e){var t,n=arguments;return o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t=n.length>1&&void 0!==n[1]&&n[1],i.next=3,o.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:e}));case 3:t&&Object(S.B)("search_console_setup","add_new_sc_property"),this.setState({loading:!1,connected:!0});case 5:case"end":return i.stop()}}),null,this)}},{key:"submitPropertyEventHandler",value:function(){var e=this,t=this.state,n=t.selectedURL,i=t.errorCode,r=this.props.setErrorMessage;o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.a.awrap(e.insertPropertyToSearchConsole(n,"no_property_matched"===i));case 3:r(""),e.props.searchConsoleSetup(n),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),r(t.t0.message[0].message),e.setState({loading:!1,errorCode:t.t0.code,errorMsg:t.t0.message[0].message});case 11:case"end":return t.stop()}}),null,null,[[0,7]])}},{key:"handleURLSelect",value:function(e,t){this.setState({selectedURL:t.getAttribute("data-value")})}},{key:"matchedForm",value:function(){var e=this.state,t=e.sites,n=e.selectedURL;if(!t)return null;var r=t.map((function(e){var t=e.siteURL;return t.startsWith("sc-domain:")&&(
6
- /* translators: %s: Search Console property domain name */
7
- t=Object(_.sprintf)(Object(_.__)("%s (domain property)","google-site-kit"),t.replace(/^sc-domain:/,""))),{label:t,value:e.siteURL}}));return i.createElement(k.Fragment,null,i.createElement("div",{className:"googlesitekit-setup-module__inputs"},i.createElement(O.k,{enhanced:!0,name:"siteProperty",label:Object(_.__)("Choose URL","google-site-kit"),outlined:!0,onEnhancedChange:this.handleURLSelect,options:r,value:n})),i.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},i.createElement(N.a,{onClick:this.submitPropertyEventHandler},Object(_.__)("Continue","google-site-kit")),i.createElement(w.a,null)))}},{key:"noSiteForm",value:function(){var e=this.state.siteURL;return i.createElement(k.Fragment,null,i.createElement("div",{className:"googlesitekit-setup-module__inputs"},i.createElement(O.l,{label:Object(_.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},i.createElement(O.b,{value:e}))),i.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},i.createElement(N.a,{onClick:this.submitPropertyEventHandler},Object(_.__)("Continue","google-site-kit")),i.createElement(w.a,null)))}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,n=e.sites;return t?i.createElement(k.Fragment,null,i.createElement("p",null,Object(_.__)("We’re locating your Search Console account.","google-site-kit")),i.createElement(C.a,null)):0===n.length?this.noSiteForm():this.matchedForm()}},{key:"render",value:function(){var e=this.props,t=e.isAuthenticated,n=e.shouldSetup,r=this.state,o=r.errorMsg,a=r.connected;return!n||a?SearchConsole.connected():i.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(_._x)("Search Console","Service name","google-site-kit")),o&&0<o.length&&i.createElement("p",{className:"googlesitekit-error-text"},o),t&&n&&this.renderForm())}}],[{key:"connected",value:function(){return i.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(_._x)("Search Console","Service name","google-site-kit")),i.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(_.__)("Your Search Console is set up with Site Kit.","google-site-kit")))}}]),SearchConsole}(k.Component);R.propTypes={isAuthenticated:y.a.bool.isRequired,shouldSetup:y.a.bool.isRequired,searchConsoleSetup:y.a.func.isRequired,setErrorMessage:y.a.func.isRequired},t.a=R}).call(this,n(16),n(1))},371:function(e,t,n){"use strict";(function(e,i){var r=n(5),o=n.n(r),a=n(6),s=n.n(a),c=n(7),l=n.n(c),u=n(8),p=n.n(u),d=n(9),g=n.n(d),m=n(3),h=n.n(m),f=n(0),v=n(1),b=n(2),y=n(31),_=function(t){function WizardStepCompleteSetup(t){var n;return o()(this,WizardStepCompleteSetup),n=l()(this,p()(WizardStepCompleteSetup).call(this,t)),e.googlesitekit.setup.hasSearchConsoleProperty?Object(b.B)("plugin_setup","user_verified"):Object(b.B)("plugin_setup","site_verified"),n}return g()(WizardStepCompleteSetup,t),s()(WizardStepCompleteSetup,[{key:"render",value:function(){return i.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--five"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-9-desktop "},i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(f.__)("Congratulations!","google-site-kit")),i.createElement("p",null,Object(f.__)("You successfully completed the Site Kit setup and connected Search Console. Check the dashboard for more services to connect.","google-site-kit")),i.createElement("div",{className:"googlesitekit-wizard-step__action"},i.createElement(y.a,{id:"wizard-step-five-proceed",onClick:this.props.completeSetup},Object(f.__)("Go to Dashboard","google-site-kit")))),i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-3-tablet mdc-layout-grid__cell--span-3-desktop "},i.createElement("div",{className:"googlesitekit-rocket"},i.createElement("img",{className:"googlesitekit-rocket__body",alt:"",src:e.googlesitekit.admin.assetsRoot+"images/rocket-body.png"}),i.createElement("img",{className:"googlesitekit-rocket__clouds",alt:"",src:e.googlesitekit.admin.assetsRoot+"images/rocket-clouds.png"}),i.createElement("img",{className:"googlesitekit-rocket__dust",alt:"",src:e.googlesitekit.admin.assetsRoot+"images/rocket-dust.png"}))))))}}]),WizardStepCompleteSetup}(v.Component);_.propTypes={completeSetup:h.a.func.isRequired},t.a=_}).call(this,n(16),n(1))},372:function(e,t,n){"use strict";var i=n(5),r=n.n(i),o=n(6),a=n.n(o),s=n(7),c=n.n(s),l=n(8),u=n.n(l),p=n(9),d=n.n(p),g=n(3),m=n.n(g),h=n(1),f=n.n(h),v=n(14),b=n.n(v),y=n(24),_=function(e){function WizardProgressStep(){return r()(this,WizardProgressStep),c()(this,u()(WizardProgressStep).apply(this,arguments))}return d()(WizardProgressStep,e),a()(WizardProgressStep,[{key:"render",value:function(){var e=this.props,t=e.currentStep,n=e.step,i=e.title,r=e.status,o=e.warning,a=e.error,s=e.stepKey,c=r;o?c="warning":a&&(c="error");var l=!1;switch(c){case"warning":case"error":l=f.a.createElement(y.a,{id:"exclamation",height:"12",width:"2"});break;case"completed":l=f.a.createElement(y.a,{id:"check",height:"12",width:"16"})}return f.a.createElement("div",{className:b()("googlesitekit-wizard-progress-step","googlesitekit-wizard-progress-step--".concat(n),"googlesitekit-wizard-progress-step--".concat(s),{"googlesitekit-wizard-progress-step--current":t})},f.a.createElement("div",{className:"googlesitekit-wizard-progress-step__number-wrapper"},f.a.createElement("div",{className:b()("googlesitekit-wizard-progress-step__number","googlesitekit-wizard-progress-step__number--".concat(c))},f.a.createElement("span",{className:b()("googlesitekit-wizard-progress-step__number-text","googlesitekit-wizard-progress-step__number-text--".concat(c))},n),l&&f.a.createElement("span",{className:b()("googlesitekit-wizard-progress-step__number-icon","googlesitekit-wizard-progress-step__number-icon--".concat(c))},l))),f.a.createElement("p",{className:"googlesitekit-wizard-progress-step__text"},i))}}]),WizardProgressStep}(h.Component);_.propTypes={currentStep:m.a.bool.isRequired,step:m.a.number.isRequired,title:m.a.string,status:m.a.string,warning:m.a.bool,error:m.a.bool},_.defaultProps={title:"",status:"",warning:!1,error:!1,removeFirstStep:!1},t.a=_},55:function(e,t,n){"use strict";(function(e){var i=n(0),r=n(18);t.a=function HelpLink(){var t=Object(i.__)("Need help?","google-site-kit");return e.createElement(r.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},t)}}).call(this,n(1))}}]);
dist/assets/js/chunk-googlesitekit-setup-wizard-942ae0fa5502c4f41282.js ADDED
@@ -0,0 +1,7 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{127:function(e,t,n){"use strict";function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(e[i]=n[i])}return e}).apply(this,arguments)}function r(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return!t||"object"!==o(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){return(c=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var l=n(1),u=n(13);var p=function(e,t){return function(n){var i=e(n),r=n.displayName,o=void 0===r?n.name||"Component":r;return i.displayName="".concat(Object(u.upperFirst)(Object(u.camelCase)(t)),"(").concat(o,")"),i}};t.a=p((function(e){var t=0;return(function(n){function o(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(e=a(this,s(o).apply(this,arguments))).instanceId=t++,e}var u,p,d;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&c(e,t)}(o,n),u=o,(p=[{key:"render",value:function(){return Object(l.f)(e,i({},this.props,{instanceId:this.instanceId}))}}])&&r(u.prototype,p),d&&r(u,d),o}(l.a))}),"withInstanceId")},189:function(e,t,n){"use strict";var i=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}();var r=n(11),o=n(243),a=n(304),s=function(e){function FocusTrap(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,FocusTrap);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(FocusTrap.__proto__||Object.getPrototypeOf(FocusTrap)).call(this,e));return t.setFocusTrapElement=function(e){t.focusTrapElement=e},"undefined"!=typeof document&&(t.previouslyFocusedElement=document.activeElement),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(FocusTrap,e),i(FocusTrap,[{key:"componentDidMount",value:function(){var e=this.props.focusTrapOptions,t={returnFocusOnDeactivate:!1};for(var n in e)e.hasOwnProperty(n)&&"returnFocusOnDeactivate"!==n&&(t[n]=e[n]);var i=o.findDOMNode(this.focusTrapElement);this.focusTrap=this.props._createFocusTrap(i,t),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()}},{key:"componentDidUpdate",value:function(e){if(e.active&&!this.props.active){var t={returnFocus:this.props.focusTrapOptions.returnFocusOnDeactivate||!1};this.focusTrap.deactivate(t)}else!e.active&&this.props.active&&this.focusTrap.activate();e.paused&&!this.props.paused?this.focusTrap.unpause():!e.paused&&this.props.paused&&this.focusTrap.pause()}},{key:"componentWillUnmount",value:function(){this.focusTrap.deactivate(),!1!==this.props.focusTrapOptions.returnFocusOnDeactivate&&this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus()}},{key:"render",value:function(){var e=this,t=r.Children.only(this.props.children);return r.cloneElement(t,{ref:function(n){e.setFocusTrapElement(n),"function"==typeof t.ref&&t.ref(n)}})}}]),FocusTrap}(r.Component);s.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:a},e.exports=s},221:function(e,t,n){"use strict";(function(e){var i=n(20),r=n.n(i),o=n(4),a=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),p=n(7),d=n.n(p),g=n(15),h=n.n(g),m=n(8),f=n.n(m),v=n(1),b=n(3),y=n.n(b),_=n(14),k=n.n(_),S=n(43),E=n(0),w=n(2),C=n(222),O=n(45),N=function(t){function OptIn(e){var t;return a()(this,OptIn),(t=u()(this,d()(OptIn).call(this,e))).state={optIn:Object(O.a)(),error:!1},t.handleOptIn=t.handleOptIn.bind(h()(t)),t}return f()(OptIn,t),c()(OptIn,[{key:"handleOptIn",value:function(e){var t=this,n=!!e.target.checked,i=Object(w.k)("googlesitekit_tracking_optin");Object(O.b)(n),n&&Object(O.c)("tracking_plugin",this.props.optinAction),Object(S.default)({path:"/wp/v2/users/me",method:"POST",data:{meta:r()({},i,n)}}).then((function(){t.setState({optIn:n,error:!1})})).catch((function(e){t.setState({optIn:!n,error:{errorCode:e.code,errorMsg:e.message}})}))}},{key:"render",value:function(){var t=this.state,n=t.optIn,i=t.error,r=this.props,o=r.id,a=r.name,s=r.className,c=Object(E.sprintf)(
2
+ /* translators: %s: privacy policy URL */
3
+ Object(E.__)('Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with <a href="%s" target="_blank" rel="noopener noreferrer">Google Privacy Policy</a>',"google-site-kit"),"https://policies.google.com/privacy");return e.createElement("div",{className:k()("googlesitekit-opt-in",s)},e.createElement(C.a,{id:o,name:a,value:"1",checked:n,onChange:this.handleOptIn},e.createElement("span",{dangerouslySetInnerHTML:Object(w.w)(c,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target","rel"]})})),i&&e.createElement("div",{className:"googlesitekit-error-text"},i.errorMsg))}}]),OptIn}(v.a);N.propTypes={id:y.a.string,name:y.a.string,className:y.a.string,optinAction:y.a.string},N.defaultProps={id:"googlesitekit-opt-in",name:"optIn"},t.a=N}).call(this,n(11))},222:function(e,t,n){"use strict";(function(e){var i=n(4),r=n.n(i),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(7),u=n.n(l),p=n(8),d=n.n(p),g=n(1),h=n(3),m=n.n(h),f=n(14),v=n.n(f),b=n(25),y=function(t){function Checkbox(e){var t;return r()(this,Checkbox),(t=c()(this,u()(Checkbox).call(this,e))).formFieldRef=Object(g.h)(),t.checkboxRef=Object(g.h)(),t}return d()(Checkbox,t),a()(Checkbox,[{key:"componentDidMount",value:function(){new b.e(this.formFieldRef.current).input=new b.c(this.checkboxRef.current)}},{key:"render",value:function(){var t=this.props,n=t.onChange,i=t.id,r=t.name,o=t.value,a=t.checked,s=t.disabled,c=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:v()("mdc-checkbox",{"mdc-checkbox--disabled":s}),ref:this.checkboxRef},e.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:i,name:r,value:o,checked:a,disabled:s,onChange:n}),e.createElement("div",{className:"mdc-checkbox__background"},e.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},e.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),e.createElement("div",{className:"mdc-checkbox__mixedmark"}))),e.createElement("label",{htmlFor:i},c))}}]),Checkbox}(g.a);y.propTypes={onChange:m.a.func.isRequired,id:m.a.string.isRequired,name:m.a.string.isRequired,value:m.a.string.isRequired,checked:m.a.bool,disabled:m.a.bool,children:m.a.node.isRequired},y.defaultProps={checked:!1,disabled:!1},t.a=y}).call(this,n(11))},304:function(e,t,n){var i=n(305),r=n(253),o=null;function a(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,s="string"==typeof e?n.querySelector(e):e,c=r({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),l={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},u={activate:function(e){if(l.active)return;_(),l.active=!0,l.paused=!1,l.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:c.onActivate;t&&t();return d(),u},deactivate:p,pause:function(){if(l.paused||!l.active)return;l.paused=!0,g()},unpause:function(){if(!l.paused||!l.active)return;l.paused=!1,d()}};return u;function p(e){if(l.active){g(),l.active=!1,l.paused=!1;var t=e&&void 0!==e.onDeactivate?e.onDeactivate:c.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:c.returnFocusOnDeactivate)&&a((function(){k(l.nodeFocusedBeforeActivation)})),u}}function d(){if(l.active)return o&&o.pause(),o=u,_(),a((function(){k(m())})),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",f,!0),n.addEventListener("touchstart",f,!0),n.addEventListener("click",y,!0),n.addEventListener("keydown",b,!0),u}function g(){if(l.active&&o===u)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",f,!0),n.removeEventListener("touchstart",f,!0),n.removeEventListener("click",y,!0),n.removeEventListener("keydown",b,!0),o=null,u}function h(e){var t=c[e],i=t;if(!t)return null;if("string"==typeof t&&!(i=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(i=t()))throw new Error("`"+e+"` did not return a node");return i}function m(){var e;if(!(e=null!==h("initialFocus")?h("initialFocus"):s.contains(n.activeElement)?n.activeElement:l.firstTabbableNode||h("fallbackFocus")))throw new Error("You can't have a focus-trap without at least one focusable element");return e}function f(e){s.contains(e.target)||(c.clickOutsideDeactivates?p({returnFocus:!i.isFocusable(e.target)}):e.preventDefault())}function v(e){s.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),k(l.mostRecentlyFocusedNode||m()))}function b(e){if(!1!==c.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void p();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(_(),e.shiftKey&&e.target===l.firstTabbableNode)return e.preventDefault(),void k(l.lastTabbableNode);if(!e.shiftKey&&e.target===l.lastTabbableNode)e.preventDefault(),k(l.firstTabbableNode)}(e)}function y(e){c.clickOutsideDeactivates||s.contains(e.target)||(e.preventDefault(),e.stopImmediatePropagation())}function _(){var e=i(s);l.firstTabbableNode=e[0]||m(),l.lastTabbableNode=e[e.length-1]||m()}function k(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),l.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):k(m()))}}},305:function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],i=n.join(","),r="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function o(e,t){t=t||{};var n,o,s,c=[],p=[],d=new UntouchabilityChecker(e.ownerDocument||e),g=e.querySelectorAll(i);for(t.includeContainer&&r.call(e,i)&&(g=Array.prototype.slice.apply(g)).unshift(e),n=0;n<g.length;n++)a(o=g[n],d)&&(0===(s=l(o))?c.push(o):p.push({documentOrder:n,tabIndex:s,node:o}));return p.sort(u).map((function(e){return e.node})).concat(c)}function a(e,t){return!(!s(e,t)||function(e){return function(e){return p(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||l(e)<0)}function s(e,t){return t=t||new UntouchabilityChecker(e.ownerDocument||e),!(e.disabled||function(e){return p(e)&&"hidden"===e.type}(e)||t.isUntouchable(e))}o.isTabbable=function(e,t){if(!e)throw new Error("No node provided");return!1!==r.call(e,i)&&a(e,t)},o.isFocusable=function(e,t){if(!e)throw new Error("No node provided");return!1!==r.call(e,c)&&s(e,t)};var c=n.concat("iframe").join(",");function l(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function u(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function p(e){return"INPUT"===e.tagName}function UntouchabilityChecker(e){this.doc=e,this.cache=[]}UntouchabilityChecker.prototype.hasDisplayNone=function(e,t){if(e===this.doc.documentElement)return!1;var n=function(e,t){for(var n=0,i=e.length;n<i;n++)if(t(e[n]))return e[n]}(this.cache,(function(t){return t===e}));if(n)return n[1];var i=!1;return"none"===(t=t||this.doc.defaultView.getComputedStyle(e)).display?i=!0:e.parentNode&&(i=this.hasDisplayNone(e.parentNode)),this.cache.push([e,i]),i},UntouchabilityChecker.prototype.isUntouchable=function(e){if(e===this.doc.documentElement)return!1;var t=this.doc.defaultView.getComputedStyle(e);return!!this.hasDisplayNone(e,t)||"hidden"===t.visibility},e.exports=o},408:function(e,t,n){"use strict";n.r(t),function(e,i){var r=n(10),o=n.n(r),a=n(4),s=n.n(a),c=n(5),l=n.n(c),u=n(6),p=n.n(u),d=n(7),g=n.n(d),h=n(15),m=n.n(h),f=n(8),v=n.n(f),b=n(1),y=n(13),_=n(0),k=n(56),S=n(30),E=n(21),w=n(9),C=n(2),O=n(410),N=n(417),j=function(t){function Setup(t){var n;s()(this,Setup),n=p()(this,g()(Setup).call(this,t));var i=e.googlesitekit.admin.connectURL,r=e.googlesitekit.setup,o=r.isAuthenticated,a=r.hasSearchConsoleProperty,c=r.isSiteKitConnected,l=r.isVerified,u=r.needReauthenticate,d=e.googlesitekit.permissions.canSetup;return n.state={canSetup:d,isAuthenticated:o,isVerified:l,needReauthenticate:u,hasSearchConsoleProperty:a,hasSearchConsolePropertyFromTheStart:a,connectURL:i,errorMsg:"",isSiteKitConnected:c,completeSetup:!1},n.siteConnectedSetup=n.siteConnectedSetup.bind(m()(n)),n.siteVerificationSetup=n.siteVerificationSetup.bind(m()(n)),n.searchConsoleSetup=n.searchConsoleSetup.bind(m()(n)),n.resetAndRestart=n.resetAndRestart.bind(m()(n)),n.completeSetup=n.completeSetup.bind(m()(n)),n.setErrorMessage=n.setErrorMessage.bind(m()(n)),n}return v()(Setup,t),l()(Setup,[{key:"resetAndRestart",value:function(){return o.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.a.awrap(w.c.set(w.a,"site","reset"));case 2:Object(C.c)(),this.setState({isSiteKitConnected:!1,isAuthenticated:!1,isVerified:!1,hasSearchConsoleProperty:!1,completeSetup:!1,errorMsg:""});case 4:case"end":return e.stop()}}),null,this)}},{key:"completeSetup",value:function(){this.setState({completeSetup:!0})}},{key:"siteConnectedSetup",value:function(e){this.setState({isSiteKitConnected:e})}},{key:"siteVerificationSetup",value:function(e){this.setState({isVerified:e})}},{key:"searchConsoleSetup",value:function(e){this.setState({hasSearchConsoleProperty:e})}},{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,n=e.isAuthenticated,i=e.isVerified,r=e.hasSearchConsoleProperty,o=e.completeSetup;return t&&n&&i&&r&&o}},{key:"setErrorMessage",value:function(e){this.setState({errorMsg:e})}},{key:"getApplicableSteps",value:function(){var e,t=O.a,n=Object.keys(t);for(e=0;e<n.length;e++)t[n[e]].isApplicable(this.state)||delete t[n[e]];return t}},{key:"currentStep",value:function(e){var t,n=Object.keys(e);for(t=0;t<n.length-1;t++)if(!e[n[t]].isCompleted(this.state))return n[t];return n[t]}},{key:"stepStatus",value:function(e,t){return e[t].isCompleted(this.state)?"completed":t===this.currentStep(e)?"inprogress":""}},{key:"render",value:function(){var t=this,n=this.state,r=n.canSetup,o=n.isAuthenticated,a=n.isVerified,s=n.needReauthenticate,c=n.hasSearchConsoleProperty,l=n.connectURL,u=n.isSiteKitConnected;if(this.isSetupFinished()){var p=Object(C.o)("googlesitekit-dashboard",{notification:"authentication_success"});Object(y.delay)((function(){e.location.replace(p)}),500,"later")}var d=this.getApplicableSteps(),g=this.currentStep(d),h=d[g].Component,m=i.createElement(h,{siteConnectedSetup:this.siteConnectedSetup,connectURL:l,siteVerificationSetup:this.siteVerificationSetup,searchConsoleSetup:this.searchConsoleSetup,completeSetup:this.completeSetup,isSiteKitConnected:u,isAuthenticated:o,isVerified:a,needReauthenticate:s,hasSearchConsoleProperty:c,setErrorMessage:this.setErrorMessage,resetAndRestart:d.clientCredentials?this.resetAndRestart:void 0}),f=r,v=!f&&!o;return i.createElement(b.b,null,i.createElement(k.a,null),i.createElement("div",{className:"googlesitekit-wizard"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement(E.a,null,i.createElement("section",{className:"googlesitekit-wizard-progress"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},f&&i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement("div",{className:"googlesitekit-wizard-progress__steps"},Object.keys(d).map((function(e,n){return i.createElement(N.a,{key:d[e].title,currentStep:g===e,title:d[e].title,step:n+1,status:t.stepStatus(d,e),warning:d[e].warning,error:d[e].error,stepKey:e})})))))),v&&i.createElement("div",{className:"googlesitekit-setup__footer"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement("h1",{className:"googlesitekit-setup__title"},Object(_.__)("Authenticate Site Kit","google-site-kit")),i.createElement("p",{className:"googlesitekit-setup__description"},Object(_.__)("Please sign into your Google account to begin.","google-site-kit")),i.createElement(S.a,{href:"#",onClick:function(){Object(C.A)("plugin_setup","signin_with_google"),document.location=l}},Object(_.__)("Sign in with Google","google-site-kit"))))))),f&&m))))))}}]),Setup}(b.a);t.default=j}.call(this,n(16),n(11))},410:function(e,t,n){"use strict";var i=n(0),r=n(411),o=n(412),a=n(414),s=n(416),c={authentication:{title:Object(i.__)("Authenticate","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&!e.needReauthenticate},Component:r.a},verification:{title:Object(i.__)("Verify URL","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified},Component:o.a},seachConsoleProperty:{title:Object(i.__)("Connect Search Console","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:a.a},completeSetup:{title:Object(i.__)("Finish","google-site-kit"),required:!1,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:s.a}};t.a=c},411:function(e,t,n){"use strict";(function(e){var i=n(4),r=n.n(i),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(7),u=n.n(l),p=n(8),d=n.n(p),g=n(1),h=n(3),m=n.n(h),f=n(0),v=n(2),b=n(30),y=n(19),_=n(221),k=n(55),S=function(t){function WizardStepAuthentication(){return r()(this,WizardStepAuthentication),c()(this,u()(WizardStepAuthentication).apply(this,arguments))}return d()(WizardStepAuthentication,t),a()(WizardStepAuthentication,[{key:"render",value:function(){var t=this.props,n=t.connectURL,i=t.needReauthenticate,r=t.resetAndRestart;return e.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--two"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(f.__)("Authenticate with Google","google-site-kit")),e.createElement("p",null,Object(f.__)("Please sign into your Google account to begin.","google-site-kit")),i&&e.createElement("p",{className:"googlesitekit-error-text"},Object(f.__)("You did not grant access to one or more of the requested scopes. Please grant all scopes that you are prompted for.","google-site-kit")),e.createElement("p",null,e.createElement(b.a,{onClick:function(){Object(v.A)("plugin_setup","signin_with_google"),document.location=n}},Object(f.__)("Sign in with Google","google-site-kit")),r&&e.createElement(y.a,{className:"googlesitekit-wizard-step__back",onClick:r},Object(f.__)("Back","google-site-kit"))),e.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},e.createElement(_.a,{optinAction:"analytics_optin_setup_fallback"}),e.createElement(k.a,null))))))}}]),WizardStepAuthentication}(g.a);S.propTypes={connectURL:m.a.string.isRequired,resetAndRestart:m.a.func},t.a=S}).call(this,n(11))},412:function(e,t,n){"use strict";(function(e){var i=n(64),r=n.n(i),o=n(4),a=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),p=n(7),d=n.n(p),g=n(8),h=n.n(g),m=n(1),f=n(3),v=n.n(f),b=n(413),y=function(t){function WizardStepVerification(){return a()(this,WizardStepVerification),u()(this,d()(WizardStepVerification).apply(this,arguments))}return h()(WizardStepVerification,t),c()(WizardStepVerification,[{key:"render",value:function(){var t=!this.props.isVerified;return e.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--three"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(b.a,r()({shouldSetup:t},this.props))))))}}]),WizardStepVerification}(m.a);y.propTypes={siteVerificationSetup:v.a.func.isRequired},t.a=y}).call(this,n(11))},413:function(e,t,n){"use strict";(function(e,i){var r=n(10),o=n.n(r),a=n(4),s=n.n(a),c=n(5),l=n.n(c),u=n(6),p=n.n(u),d=n(7),g=n.n(d),h=n(15),m=n.n(h),f=n(8),v=n.n(f),b=n(1),y=n(3),_=n.n(y),k=n(0),S=n(2),E=n(25),w=n(9),C=n(30),O=n(31),N=n(55),j=function(t){function SiteVerification(e){var t;s()(this,SiteVerification);var n=(t=p()(this,g()(SiteVerification).call(this,e))).props,i=n.isAuthenticated,r=n.shouldSetup;return t.state={loading:i&&r,loadingMsg:Object(k.__)("Getting your verified sites...","google-site-kit"),siteURL:" ",selectedURL:"",errorCode:!1,errorMsg:""},t.onProceed=t.onProceed.bind(m()(t)),t}return v()(SiteVerification,t),l()(SiteVerification,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isAuthenticated,n=e.shouldSetup;t&&n&&this.requestSitePropertyList()}},{key:"requestSitePropertyList",value:function(){var t,n,i,r,a,s=this,c=this.props.setErrorMessage;o.a.async((function(l){for(;;)switch(l.prev=l.next){case 0:return l.prev=0,l.next=3,o.a.awrap(w.c.get(w.b,"site-verification","verification"));case 3:if(t=l.sent,n=t.verified,i=t.identifier,!n){l.next=16;break}return Object(S.A)("verification_setup","verification_check_true"),l.next=10,o.a.awrap(s.insertSiteVerification(i));case 10:if(!0!==l.sent.verified){l.next=14;break}return s.props.siteVerificationSetup(!0),l.abrupt("return",!0);case 14:l.next=17;break;case 16:Object(S.A)("verification_setup","verification_check_false");case 17:s.setState({loading:!1,siteURL:i}),l.next=26;break;case 20:l.prev=20,l.t0=l.catch(0),r=l.t0.message,Object(S.B)(l.t0.message)&&(a=JSON.parse(l.t0.message),r=a.error.message||l.t0.message),c(r),s.setState({loading:!1,errorCode:l.t0.code,errorMsg:r,siteURL:e.googlesitekit.admin.siteURL});case 26:case"end":return l.stop()}}),null,null,[[0,20]])}},{key:"insertSiteVerification",value:function(e){return o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,o.a.awrap(w.c.set(w.b,"site-verification","verification",{siteURL:e}));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}},{key:"onProceed",value:function(){var t,n,i,r;return o.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return t=this.props.setErrorMessage,n=this.state.siteURL?this.state.siteURL:e.googlesitekit.admin.siteURL,t(""),this.setState({loading:!0,loadingMsg:Object(k.__)("Verifying...","google-site-kit"),errorCode:!1,errorMsg:""}),a.prev=4,a.next=7,o.a.awrap(this.insertSiteVerification(n));case 7:!0===a.sent.verified&&(Object(S.A)("verification_setup","verification_insert_tag"),this.props.siteVerificationSetup(!0)),a.next=17;break;case 11:a.prev=11,a.t0=a.catch(4),i=a.t0.message,Object(S.B)(a.t0.message)&&(r=JSON.parse(a.t0.message),i=r.error.message||a.t0.message),t(i),this.setState({loading:!1,errorCode:a.t0.code,errorMsg:i});case 17:case"end":return a.stop()}}),null,this,[[4,11]])}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,n=e.loadingMsg,r=e.siteURL,o=i.createElement(b.b,null,n&&i.createElement("p",null,n),i.createElement(O.a,null));return t?o:i.createElement(b.b,null,i.createElement("div",{className:"googlesitekit-wizard-step__inputs"},i.createElement(E.l,{label:Object(k.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},i.createElement(E.b,{value:r}))),i.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},i.createElement(C.a,{onClick:this.onProceed},Object(k.__)("Continue","google-site-kit")),i.createElement(N.a,null)))}},{key:"render",value:function(){var e=this.props,t=e.isAuthenticated,n=e.shouldSetup,r=this.state.errorMsg;return n?i.createElement(b.b,null,i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(k.__)("Verify URL","google-site-kit")),i.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(k.__)("We will need to verify your URL for Site Kit.","google-site-kit")),r&&0<r.length&&i.createElement("p",{className:"googlesitekit-error-text"},r),t&&this.renderForm()):SiteVerification.renderSetupDone()}}],[{key:"renderSetupDone",value:function(){return i.createElement(b.b,null,i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(k.__)("Verify URL","google-site-kit")),i.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(k.__)("Congratulations, your site has been verified!","google-site-kit")))}}]),SiteVerification}(b.a);j.propTypes={isAuthenticated:_.a.bool.isRequired,shouldSetup:_.a.bool.isRequired,siteVerificationSetup:_.a.func.isRequired,completeSetup:_.a.func,setErrorMessage:_.a.func.isRequired},t.a=j}).call(this,n(16),n(11))},414:function(e,t,n){"use strict";(function(e){var i=n(64),r=n.n(i),o=n(4),a=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),p=n(7),d=n.n(p),g=n(8),h=n.n(g),m=n(1),f=n(3),v=n.n(f),b=n(415),y=function(t){function WizardStepSearchConsoleProperty(){return a()(this,WizardStepSearchConsoleProperty),u()(this,d()(WizardStepSearchConsoleProperty).apply(this,arguments))}return h()(WizardStepSearchConsoleProperty,t),c()(WizardStepSearchConsoleProperty,[{key:"render",value:function(){var t=this.props,n=t.isVerified,i=t.hasSearchConsoleProperty,o=n&&!i;return e.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--four"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},o?e.createElement(b.a,r()({shouldSetup:o},this.props)):b.a.connected()))))}}]),WizardStepSearchConsoleProperty}(m.a);y.propTypes={searchConsoleSetup:v.a.func.isRequired},t.a=y}).call(this,n(11))},415:function(e,t,n){"use strict";(function(e,i){var r=n(10),o=n.n(r),a=n(4),s=n.n(a),c=n(5),l=n.n(c),u=n(6),p=n.n(u),d=n(7),g=n.n(d),h=n(15),m=n.n(h),f=n(8),v=n.n(f),b=n(1),y=n(3),_=n.n(y),k=n(0),S=n(2),E=n(9),w=n(31),C=n(55),O=n(25),N=n(30),j=function(t){function SearchConsole(t){var n;s()(this,SearchConsole),n=p()(this,g()(SearchConsole).call(this,t));var i=e.googlesitekit.admin.siteURL;return n.state={loading:!0,sites:!1,selectedURL:i,siteURL:i,connected:!1,errorCode:!1,errorMsg:""},n.handleURLSelect=n.handleURLSelect.bind(m()(n)),n.insertPropertyToSearchConsole=n.insertPropertyToSearchConsole.bind(m()(n)),n.submitPropertyEventHandler=n.submitPropertyEventHandler.bind(m()(n)),n}return v()(SearchConsole,t),l()(SearchConsole,[{key:"componentDidMount",value:function(){var e,t,n;return o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e=this.props,t=e.isAuthenticated,n=e.shouldSetup,t&&n){i.next=3;break}return i.abrupt("return");case 3:this.requestSearchConsoleSiteList();case 4:case"end":return i.stop()}}),null,this)}},{key:"requestSearchConsoleSiteList",value:function(){var e,t=this,n=this.props.setErrorMessage;o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.prev=0,i.next=3,o.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 3:if(1!==(e=i.sent).length){i.next=9;break}return i.next=7,o.a.awrap(t.insertPropertyToSearchConsole(e[0].siteURL));case 7:return t.props.searchConsoleSetup(e[0].siteURL),i.abrupt("return");case 9:if(e.length){i.next=11;break}throw{code:"no_property_matched",message:Object(k.__)("Your site has not been added to Search Console yet. Would you like to add it now?","google-site-kit")};case 11:throw n(""),t.setState({loading:!1,selectedURL:e[0].siteURL,sites:e}),{code:"multiple_properties_matched",message:Object(k.sprintf)(
4
+ /* translators: %d: the number of matching properties */
5
+ Object(k.__)("We found %d existing accounts. Please choose which one to use below.","google-site-kit"),e.length)};case 16:i.prev=16,i.t0=i.catch(0),n(i.t0.message),t.setState({loading:!1,errorCode:i.t0.code,errorMsg:i.t0.message});case 20:case"end":return i.stop()}}),null,null,[[0,16]])}},{key:"insertPropertyToSearchConsole",value:function(e){var t,n=arguments;return o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return t=n.length>1&&void 0!==n[1]&&n[1],i.next=3,o.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:e}));case 3:t&&Object(S.A)("search_console_setup","add_new_sc_property"),this.setState({loading:!1,connected:!0});case 5:case"end":return i.stop()}}),null,this)}},{key:"submitPropertyEventHandler",value:function(){var e=this,t=this.state,n=t.selectedURL,i=t.errorCode,r=this.props.setErrorMessage;o.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,o.a.awrap(e.insertPropertyToSearchConsole(n,"no_property_matched"===i));case 3:r(""),e.props.searchConsoleSetup(n),t.next=11;break;case 7:t.prev=7,t.t0=t.catch(0),r(t.t0.message[0].message),e.setState({loading:!1,errorCode:t.t0.code,errorMsg:t.t0.message[0].message});case 11:case"end":return t.stop()}}),null,null,[[0,7]])}},{key:"handleURLSelect",value:function(e,t){this.setState({selectedURL:t.getAttribute("data-value")})}},{key:"matchedForm",value:function(){var e=this.state,t=e.sites,n=e.selectedURL;if(!t)return null;var r=t.map((function(e){var t=e.siteURL;return t.startsWith("sc-domain:")&&(
6
+ /* translators: %s: Search Console property domain name */
7
+ t=Object(k.sprintf)(Object(k.__)("%s (domain property)","google-site-kit"),t.replace(/^sc-domain:/,""))),{label:t,value:e.siteURL}}));return i.createElement(b.b,null,i.createElement("div",{className:"googlesitekit-setup-module__inputs"},i.createElement(O.k,{enhanced:!0,name:"siteProperty",label:Object(k.__)("Choose URL","google-site-kit"),outlined:!0,onEnhancedChange:this.handleURLSelect,options:r,value:n})),i.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},i.createElement(N.a,{onClick:this.submitPropertyEventHandler},Object(k.__)("Continue","google-site-kit")),i.createElement(C.a,null)))}},{key:"noSiteForm",value:function(){var e=this.state.siteURL;return i.createElement(b.b,null,i.createElement("div",{className:"googlesitekit-setup-module__inputs"},i.createElement(O.l,{label:Object(k.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},i.createElement(O.b,{value:e}))),i.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},i.createElement(N.a,{onClick:this.submitPropertyEventHandler},Object(k.__)("Continue","google-site-kit")),i.createElement(C.a,null)))}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,n=e.sites;return t?i.createElement(b.b,null,i.createElement("p",null,Object(k.__)("We’re locating your Search Console account.","google-site-kit")),i.createElement(w.a,null)):0===n.length?this.noSiteForm():this.matchedForm()}},{key:"render",value:function(){var e=this.props,t=e.isAuthenticated,n=e.shouldSetup,r=this.state,o=r.errorMsg,a=r.connected;return!n||a?SearchConsole.connected():i.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(k._x)("Search Console","Service name","google-site-kit")),o&&0<o.length&&i.createElement("p",{className:"googlesitekit-error-text"},o),t&&n&&this.renderForm())}}],[{key:"connected",value:function(){return i.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(k._x)("Search Console","Service name","google-site-kit")),i.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(k.__)("Your Search Console is set up with Site Kit.","google-site-kit")))}}]),SearchConsole}(b.a);j.propTypes={isAuthenticated:_.a.bool.isRequired,shouldSetup:_.a.bool.isRequired,searchConsoleSetup:_.a.func.isRequired,setErrorMessage:_.a.func.isRequired},t.a=j}).call(this,n(16),n(11))},416:function(e,t,n){"use strict";(function(e,i){var r=n(4),o=n.n(r),a=n(5),s=n.n(a),c=n(6),l=n.n(c),u=n(7),p=n.n(u),d=n(8),g=n.n(d),h=n(1),m=n(3),f=n.n(m),v=n(0),b=n(2),y=n(30),_=function(t){function WizardStepCompleteSetup(t){var n;return o()(this,WizardStepCompleteSetup),n=l()(this,p()(WizardStepCompleteSetup).call(this,t)),e.googlesitekit.setup.hasSearchConsoleProperty?Object(b.A)("plugin_setup","user_verified"):Object(b.A)("plugin_setup","site_verified"),n}return g()(WizardStepCompleteSetup,t),s()(WizardStepCompleteSetup,[{key:"render",value:function(){return i.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--five"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-9-desktop "},i.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Congratulations!","google-site-kit")),i.createElement("p",null,Object(v.__)("You successfully completed the Site Kit setup and connected Search Console. Check the dashboard for more services to connect.","google-site-kit")),i.createElement("div",{className:"googlesitekit-wizard-step__action"},i.createElement(y.a,{id:"wizard-step-five-proceed",onClick:this.props.completeSetup},Object(v.__)("Go to Dashboard","google-site-kit")))),i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--span-3-tablet mdc-layout-grid__cell--span-3-desktop "},i.createElement("div",{className:"googlesitekit-rocket"},i.createElement("img",{className:"googlesitekit-rocket__body",alt:"",src:e.googlesitekit.admin.assetsRoot+"images/rocket-body.png"}),i.createElement("img",{className:"googlesitekit-rocket__clouds",alt:"",src:e.googlesitekit.admin.assetsRoot+"images/rocket-clouds.png"}),i.createElement("img",{className:"googlesitekit-rocket__dust",alt:"",src:e.googlesitekit.admin.assetsRoot+"images/rocket-dust.png"}))))))}}]),WizardStepCompleteSetup}(h.a);_.propTypes={completeSetup:f.a.func.isRequired},t.a=_}).call(this,n(16),n(11))},417:function(e,t,n){"use strict";var i=n(4),r=n.n(i),o=n(5),a=n.n(o),s=n(6),c=n.n(s),l=n(7),u=n.n(l),p=n(8),d=n.n(p),g=n(1),h=n(3),m=n.n(h),f=n(11),v=n.n(f),b=n(14),y=n.n(b),_=n(23),k=function(e){function WizardProgressStep(){return r()(this,WizardProgressStep),c()(this,u()(WizardProgressStep).apply(this,arguments))}return d()(WizardProgressStep,e),a()(WizardProgressStep,[{key:"render",value:function(){var e=this.props,t=e.currentStep,n=e.step,i=e.title,r=e.status,o=e.warning,a=e.error,s=e.stepKey,c=r;o?c="warning":a&&(c="error");var l=!1;switch(c){case"warning":case"error":l=v.a.createElement(_.a,{id:"exclamation",height:"12",width:"2"});break;case"completed":l=v.a.createElement(_.a,{id:"check",height:"12",width:"16"})}return v.a.createElement("div",{className:y()("googlesitekit-wizard-progress-step","googlesitekit-wizard-progress-step--".concat(n),"googlesitekit-wizard-progress-step--".concat(s),{"googlesitekit-wizard-progress-step--current":t})},v.a.createElement("div",{className:"googlesitekit-wizard-progress-step__number-wrapper"},v.a.createElement("div",{className:y()("googlesitekit-wizard-progress-step__number","googlesitekit-wizard-progress-step__number--".concat(c))},v.a.createElement("span",{className:y()("googlesitekit-wizard-progress-step__number-text","googlesitekit-wizard-progress-step__number-text--".concat(c))},n),l&&v.a.createElement("span",{className:y()("googlesitekit-wizard-progress-step__number-icon","googlesitekit-wizard-progress-step__number-icon--".concat(c))},l))),v.a.createElement("p",{className:"googlesitekit-wizard-progress-step__text"},i))}}]),WizardProgressStep}(g.a);k.propTypes={currentStep:m.a.bool.isRequired,step:m.a.number.isRequired,title:m.a.string,status:m.a.string,warning:m.a.bool,error:m.a.bool},k.defaultProps={title:"",status:"",warning:!1,error:!1,removeFirstStep:!1},t.a=k},55:function(e,t,n){"use strict";(function(e){n(1);var i=n(0),r=n(19);t.a=function HelpLink(){var t=Object(i.__)("Need help?","google-site-kit");return e.createElement(r.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},t)}}).call(this,n(11))}}]);
dist/assets/js/chunk-googlesitekit-setup-wizard-proxy-4b07df8eeb258191269b.js ADDED
@@ -0,0 +1,5 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{221:function(e,t,n){"use strict";(function(e){var i=n(20),a=n.n(i),s=n(4),o=n.n(s),r=n(5),c=n.n(r),l=n(6),u=n.n(l),d=n(7),g=n.n(d),h=n(15),p=n.n(h),m=n(8),k=n.n(m),f=n(1),b=n(3),v=n.n(b),_=n(14),y=n.n(_),x=n(43),O=n(0),S=n(2),E=n(222),w=n(45),C=function(t){function OptIn(e){var t;return o()(this,OptIn),(t=u()(this,g()(OptIn).call(this,e))).state={optIn:Object(w.a)(),error:!1},t.handleOptIn=t.handleOptIn.bind(p()(t)),t}return k()(OptIn,t),c()(OptIn,[{key:"handleOptIn",value:function(e){var t=this,n=!!e.target.checked,i=Object(S.k)("googlesitekit_tracking_optin");Object(w.b)(n),n&&Object(w.c)("tracking_plugin",this.props.optinAction),Object(x.default)({path:"/wp/v2/users/me",method:"POST",data:{meta:a()({},i,n)}}).then((function(){t.setState({optIn:n,error:!1})})).catch((function(e){t.setState({optIn:!n,error:{errorCode:e.code,errorMsg:e.message}})}))}},{key:"render",value:function(){var t=this.state,n=t.optIn,i=t.error,a=this.props,s=a.id,o=a.name,r=a.className,c=Object(O.sprintf)(
2
+ /* translators: %s: privacy policy URL */
3
+ Object(O.__)('Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with <a href="%s" target="_blank" rel="noopener noreferrer">Google Privacy Policy</a>',"google-site-kit"),"https://policies.google.com/privacy");return e.createElement("div",{className:y()("googlesitekit-opt-in",r)},e.createElement(E.a,{id:s,name:o,value:"1",checked:n,onChange:this.handleOptIn},e.createElement("span",{dangerouslySetInnerHTML:Object(S.w)(c,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target","rel"]})})),i&&e.createElement("div",{className:"googlesitekit-error-text"},i.errorMsg))}}]),OptIn}(f.a);C.propTypes={id:v.a.string,name:v.a.string,className:v.a.string,optinAction:v.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"},t.a=C}).call(this,n(11))},222:function(e,t,n){"use strict";(function(e){var i=n(4),a=n.n(i),s=n(5),o=n.n(s),r=n(6),c=n.n(r),l=n(7),u=n.n(l),d=n(8),g=n.n(d),h=n(1),p=n(3),m=n.n(p),k=n(14),f=n.n(k),b=n(25),v=function(t){function Checkbox(e){var t;return a()(this,Checkbox),(t=c()(this,u()(Checkbox).call(this,e))).formFieldRef=Object(h.h)(),t.checkboxRef=Object(h.h)(),t}return g()(Checkbox,t),o()(Checkbox,[{key:"componentDidMount",value:function(){new b.e(this.formFieldRef.current).input=new b.c(this.checkboxRef.current)}},{key:"render",value:function(){var t=this.props,n=t.onChange,i=t.id,a=t.name,s=t.value,o=t.checked,r=t.disabled,c=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:f()("mdc-checkbox",{"mdc-checkbox--disabled":r}),ref:this.checkboxRef},e.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:i,name:a,value:s,checked:o,disabled:r,onChange:n}),e.createElement("div",{className:"mdc-checkbox__background"},e.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},e.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),e.createElement("div",{className:"mdc-checkbox__mixedmark"}))),e.createElement("label",{htmlFor:i},c))}}]),Checkbox}(h.a);v.propTypes={onChange:m.a.func.isRequired,id:m.a.string.isRequired,name:m.a.string.isRequired,value:m.a.string.isRequired,checked:m.a.bool,disabled:m.a.bool,children:m.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1},t.a=v}).call(this,n(11))},265:function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return j}));var a=n(114),s=n.n(a),o=n(4),r=n.n(o),c=n(5),l=n.n(c),u=n(6),d=n.n(u),g=n(7),h=n.n(g),p=n(8),m=n.n(p),k=n(10),f=n.n(k),b=n(1),v=n(0),_=n(3),y=n.n(_),x=n(95),O=n(31),S=n(2),E=n(9),w=n(19),C=[function(){var t;return f.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.location.hostname,!["localhost","127.0.0.1"].includes(t)&&!t.match(/\.(example|invalid|localhost|test)#x2F;)){n.next=3;break}throw"invalid_hostname";case 3:case"end":return n.stop()}}))},function(){var e,t,n;return f.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,f.a.awrap(E.c.set(E.a,"site","setup-tag"));case 2:return e=i.sent,t=e.token,i.next=6,f.a.awrap(Object(S.j)("setup").catch((function(){throw"tag_fetch_failed"})));case 6:if(n=i.sent,t===n){i.next=9;break}throw"setup_token_mismatch";case 9:case"end":return i.stop()}}))}],j=function(t){function CompatibilityChecks(t){var n;r()(this,CompatibilityChecks);var i=e.googlesitekit.setup.isSiteKitConnected;return(n=d()(this,h()(CompatibilityChecks).call(this,t))).state={complete:i,error:null,developerPlugin:{}},n}return m()(CompatibilityChecks,t),l()(CompatibilityChecks,[{key:"componentDidMount",value:function(){var e,t,n,i;return f.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:if(!this.state.complete){a.next=2;break}return a.abrupt("return");case 2:a.prev=2,e=0,t=C;case 4:if(!(e<t.length)){a.next=11;break}return n=t[e],a.next=8,f.a.awrap(n());case 8:e++,a.next=4;break;case 11:a.next=19;break;case 13:return a.prev=13,a.t0=a.catch(2),a.next=17,f.a.awrap(E.c.get(E.a,"site","developer-plugin"));case 17:i=a.sent,this.setState({error:a.t0,developerPlugin:i});case 19:this.setState({complete:!0});case 20:case"end":return a.stop()}}),null,this,[[2,13]])}},{key:"helperCTA",value:function(){var e=this.state.developerPlugin,t=e.installed,n=e.active,i=e.installURL,a=e.activateURL,s=e.configureURL;return!t&&i?{labelHTML:Object(v.__)('Install<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:i,external:!1}:t&&!n&&a?{labelHTML:Object(v.__)('Activate<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:a,external:!1}:t&&n&&s?{labelHTML:Object(v.__)('Configure<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:s,external:!1}:{labelHTML:Object(v.__)('Learn how<span class="screen-reader-text"> to install and use the helper plugin</span>',"google-site-kit"),href:"https://sitekit.withgoogle.com/documentation/using-site-kit-on-a-staging-environment/",external:!0}}},{key:"renderError",value:function(e){var t=this.state.developerPlugin.installed,n=this.helperCTA(),a=n.labelHTML,s=n.href,o=n.external;switch(e){case"invalid_hostname":case"tag_fetch_failed":return i.createElement(b.b,null,!t&&Object(v.__)("Looks like this may be a staging environment. If so, you’ll need to install a helper plugin and verify your production site in Search Console.","google-site-kit"),t&&Object(v.__)("Looks like this may be a staging environment and you already have the helper plugin. Before you can use Site Kit, please make sure you’ve provided the necessary credentials in the Authentication section and verified your production site in Search Console.","google-site-kit")," ",i.createElement(w.a,{href:s,dangerouslySetInnerHTML:{__html:a},external:o,inherit:!0}));case"setup_token_mismatch":return Object(v.__)("Looks like you may be using a caching plugin which could interfere with setup. Please deactivate any caching plugins before setting up Site Kit. You may reactivate them once setup has been completed.","google-site-kit")}}},{key:"render",value:function(){var e,t,n=this.state,a=n.complete,o=n.error,r=this.props,c=r.children,l=s()(r,["children"]);return o&&(e=i.createElement(b.b,null,i.createElement("div",{className:"googlesitekit-setup-compat mdc-layout-grid mdc-layout-grid--align-left"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement(x.a,null),i.createElement("div",{className:"googlesitekit-heading-4 mdc-layout-grid__cell--span-11"},Object(v.__)("Your site may not be ready for Site Kit","google-site-kit"))),i.createElement("p",null,this.renderError(o))))),a||(t=i.createElement("div",{style:{alignSelf:"center",marginLeft:"1rem"}},i.createElement("small",null,Object(v.__)("Checking Compatibility...","google-site-kit")),i.createElement(O.a,{small:!0,compress:!0}))),c({restProps:l,complete:a,error:o,inProgressFeedback:t,CTAFeedback:e})}}]),CompatibilityChecks}(b.a);j.propTypes={children:y.a.func.isRequired}}).call(this,n(16),n(11))},266:function(e,t,n){"use strict";(function(e,i){n.d(t,"a",(function(){return w}));var a=n(10),s=n.n(a),o=n(4),r=n.n(o),c=n(5),l=n.n(c),u=n(6),d=n.n(u),g=n(7),h=n.n(g),p=n(15),m=n.n(p),k=n(8),f=n.n(k),b=n(1),v=n(0),_=n(42),y=n(2),x=n(9),O=n(111),S=n(19),E=n(123),w=function(t){function ResetButton(t){var n;r()(this,ResetButton),n=d()(this,h()(ResetButton).call(this,t));var i=e._googlesitekitBaseData.splashURL;return n.state={dialogActive:!1,postResetURL:Object(_.a)(i,{notification:"reset_success"})},n.handleDialog=n.handleDialog.bind(m()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(m()(n)),n.handleCloseModal=n.handleCloseModal.bind(m()(n)),n}return f()(ResetButton,t),l()(ResetButton,[{key:"componentDidMount",value:function(){e.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){e.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return s.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,s.a.awrap(x.c.set(x.a,"site","reset"));case 2:Object(y.c)(),this.handleDialog(),document.location=this.state.postResetURL;case 5:case"end":return e.stop()}}),null,this)}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"render",value:function(){var e=this,t=this.props.children,n=this.state.dialogActive;return i.createElement(b.b,null,i.createElement(S.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(v.__)("Reset Site Kit","google-site-kit")),i.createElement(E.a,null,i.createElement(O.a,{dialogActive:n,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(v.__)("Reset Site Kit","google-site-kit"),subtitle:Object(v.__)("Resetting this site will remove access to all services. After disconnecting, you will need to re-authorize your access to restore service.","google-site-kit"),confirmButton:Object(v.__)("Reset","google-site-kit"),provides:[]})))}}]),ResetButton}(b.a)}).call(this,n(16),n(11))},407:function(e,t,n){"use strict";n.r(t),function(e,i){var a=n(4),s=n.n(a),o=n(5),r=n.n(o),c=n(6),l=n.n(c),u=n(7),d=n.n(u),g=n(8),h=n.n(g),p=n(1),m=n(306),k=n.n(m),f=n(13),b=n(0),v=n(233),_=n(2),y=n(56),x=n(30),O=n(266),S=n(21),E=n(29),w=n(221),C=n(265),j=function(t){function SetupUsingProxy(t){var n;s()(this,SetupUsingProxy),n=l()(this,d()(SetupUsingProxy).call(this,t));var i=e.googlesitekit.admin,a=i.proxySetupURL,o=i.siteURL,r=e.googlesitekit.setup,c=r.isSiteKitConnected,u=r.isResettable,g=r.errorMessage,h=e.googlesitekit.permissions.canSetup;return n.state={canSetup:h,errorMessage:g,isSiteKitConnected:c,isResettable:u,completeSetup:!1,proxySetupURL:a,resetSuccess:"reset_success"===Object(v.a)(location.href,"notification"),context:Object(v.a)(location.href,"googlesitekit_context"),siteHostname:k.a.toUnicode(new URL(o).hostname)},n}return h()(SetupUsingProxy,t),r()(SetupUsingProxy,[{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,n=e.completeSetup;return t&&n}},{key:"render",value:function(){if(this.isSetupFinished()){var t=Object(_.o)("googlesitekit-dashboard",{notification:"authentication_success"});Object(f.delay)((function(){e.location.replace(t)}),500,"later")}var n,a,s,o=this.state,r=o.context,c=o.errorMessage,l=o.isResettable,u=o.proxySetupURL,d=o.resetSuccess,g=o.siteHostname,h=l;return"revoked"===r?(n=Object(b.sprintf)(
4
+ /* translators: %s is the site's hostname. (e.g. example.com) */
5
+ Object(b.__)("You revoked access to Site Kit for %s","google-site-kit"),g),a=Object(b.__)('Site Kit will no longer have access to your account. If you’d like to reconnect Site Kit, click "Start Setup" below to generate new credentials.',"google-site-kit"),s=Object(b.__)("Sign in with Google","google-site-kit")):h?(n=Object(b.__)("Sign in with Google to configure Site Kit","google-site-kit"),a=Object(b.__)("To use Site Kit, sign in with your Google account. The Site Kit service will guide you through 3 simple steps to complete the connection and configure the plugin.","google-site-kit"),s=Object(b.__)("Sign in with Google","google-site-kit")):(n=Object(b.__)("Sign in with Google to set up Site Kit","google-site-kit"),a=Object(b.__)("The Site Kit service will guide you through 3 simple setup steps.","google-site-kit"),s=Object(b.__)("Start setup","google-site-kit")),i.createElement(p.b,null,i.createElement(y.a,null),c&&i.createElement(E.a,{id:"setup_error",type:"win-error",title:Object(b.__)("Oops! There was a problem during set up. Please try again.","google-site-kit"),description:c,isDismissable:!1}),d&&i.createElement(E.a,{id:"reset_success",title:Object(b.__)("Site Kit by Google was successfully reset.","google-site-kit"),isDismissable:!1}),i.createElement("div",{className:"googlesitekit-wizard"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement(S.a,null,i.createElement("section",{className:"googlesitekit-wizard-progress"},i.createElement("div",{className:"googlesitekit-setup__footer"},i.createElement("div",{className:"mdc-layout-grid"},i.createElement("div",{className:"mdc-layout-grid__inner"},i.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},i.createElement("h1",{className:"googlesitekit-setup__title"},n),i.createElement("p",{className:"googlesitekit-setup__description"},a),i.createElement(C.a,null,(function(e){var t=e.complete,n=e.inProgressFeedback,a=e.CTAFeedback;return i.createElement(p.b,null,a,i.createElement(w.a,{optinAction:"analytics_optin_setup_fallback"}),i.createElement("div",{className:"googlesitekit-start-setup-wrap"},i.createElement(x.a,{className:"googlesitekit-start-setup",href:u,onClick:function(){Object(_.A)("plugin_setup","proxy_start_setup_landing_page")},disabled:!t},s),n,l&&i.createElement(O.a,null)))})))))))))))))}}]),SetupUsingProxy}(p.a);t.default=j}.call(this,n(16),n(11))}}]);
dist/assets/js/chunk-googlesitekit-setup-wizard-proxy-6ab90125e13406ab19e1.js DELETED
@@ -1,5 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{217:function(e,t,i){"use strict";(function(e){var n=i(20),o=i.n(n),a=i(5),s=i.n(a),c=i(6),l=i.n(c),r=i(7),u=i.n(r),d=i(8),g=i.n(d),m=i(15),h=i.n(m),p=i(9),k=i.n(p),f=i(3),b=i.n(f),_=i(14),v=i.n(_),y=i(41),O=i(1),S=i(0),E=i(2),R=i(218),x=i(45),j=function(t){function OptIn(e){var t;return s()(this,OptIn),(t=u()(this,g()(OptIn).call(this,e))).state={optIn:Object(x.a)(),error:!1},t.handleOptIn=t.handleOptIn.bind(h()(t)),t}return k()(OptIn,t),l()(OptIn,[{key:"handleOptIn",value:function(e){var t=this,i=!!e.target.checked,n=Object(E.k)("googlesitekit_tracking_optin");Object(x.b)(i),i&&Object(x.c)("tracking_plugin",this.props.optinAction),Object(y.default)({path:"/wp/v2/users/me",method:"POST",data:{meta:o()({},n,i)}}).then((function(){t.setState({optIn:i,error:!1})})).catch((function(e){t.setState({optIn:!i,error:{errorCode:e.code,errorMsg:e.message}})}))}},{key:"render",value:function(){var t=this.state,i=t.optIn,n=t.error,o=this.props,a=o.id,s=o.name,c=o.className,l=Object(S.sprintf)(
2
- /* translators: %s: privacy policy URL */
3
- Object(S.__)('Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with <a href="%s" target="_blank" rel="noopener noreferrer">Google Privacy Policy</a>',"google-site-kit"),"https://policies.google.com/privacy");return e.createElement("div",{className:v()("googlesitekit-opt-in",c)},e.createElement(R.a,{id:a,name:s,value:"1",checked:i,onChange:this.handleOptIn},e.createElement("span",{dangerouslySetInnerHTML:Object(E.x)(l,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target","rel"]})})),n&&e.createElement("div",{className:"googlesitekit-error-text"},n.errorMsg))}}]),OptIn}(O.Component);j.propTypes={id:b.a.string,name:b.a.string,className:b.a.string,optinAction:b.a.string},j.defaultProps={id:"googlesitekit-opt-in",name:"optIn"},t.a=j}).call(this,i(1))},218:function(e,t,i){"use strict";(function(e){var n=i(5),o=i.n(n),a=i(6),s=i.n(a),c=i(7),l=i.n(c),r=i(8),u=i.n(r),d=i(9),g=i.n(d),m=i(3),h=i.n(m),p=i(14),k=i.n(p),f=i(1),b=i(25),_=function(t){function Checkbox(e){var t;return o()(this,Checkbox),(t=l()(this,u()(Checkbox).call(this,e))).formFieldRef=Object(f.createRef)(),t.checkboxRef=Object(f.createRef)(),t}return g()(Checkbox,t),s()(Checkbox,[{key:"componentDidMount",value:function(){new b.e(this.formFieldRef.current).input=new b.c(this.checkboxRef.current)}},{key:"render",value:function(){var t=this.props,i=t.onChange,n=t.id,o=t.name,a=t.value,s=t.checked,c=t.disabled,l=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:k()("mdc-checkbox",{"mdc-checkbox--disabled":c}),ref:this.checkboxRef},e.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:n,name:o,value:a,checked:s,disabled:c,onChange:i}),e.createElement("div",{className:"mdc-checkbox__background"},e.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},e.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),e.createElement("div",{className:"mdc-checkbox__mixedmark"}))),e.createElement("label",{htmlFor:n},l))}}]),Checkbox}(f.Component);_.propTypes={onChange:h.a.func.isRequired,id:h.a.string.isRequired,name:h.a.string.isRequired,value:h.a.string.isRequired,checked:h.a.bool,disabled:h.a.bool,children:h.a.node.isRequired},_.defaultProps={checked:!1,disabled:!1},t.a=_}).call(this,i(1))},255:function(e,t,i){"use strict";(function(e,n){i.d(t,"a",(function(){return x}));var o=i(11),a=i.n(o),s=i(5),c=i.n(s),l=i(6),r=i.n(l),u=i(7),d=i.n(u),g=i(8),m=i.n(g),h=i(15),p=i.n(h),k=i(9),f=i.n(k),b=i(0),_=i(1),v=i(42),y=i(2),O=i(10),S=i(108),E=i(18),R=i(119),x=function(t){function ResetButton(t){var i;c()(this,ResetButton),i=d()(this,m()(ResetButton).call(this,t));var n=e._googlesitekitBaseData.splashURL;return i.state={dialogActive:!1,postResetURL:Object(v.a)(n,{notification:"reset_success"})},i.handleDialog=i.handleDialog.bind(p()(i)),i.handleUnlinkConfirm=i.handleUnlinkConfirm.bind(p()(i)),i.handleCloseModal=i.handleCloseModal.bind(p()(i)),i}return f()(ResetButton,t),r()(ResetButton,[{key:"componentDidMount",value:function(){e.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){e.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return a.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.a.awrap(O.c.set(O.a,"site","reset"));case 2:Object(y.c)(),this.handleDialog(),document.location=this.state.postResetURL;case 5:case"end":return e.stop()}}),null,this)}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"render",value:function(){var e=this,t=this.props.children,i=this.state.dialogActive;return n.createElement(_.Fragment,null,n.createElement(E.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(b.__)("Reset Site Kit","google-site-kit")),n.createElement(R.a,null,n.createElement(S.a,{dialogActive:i,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(b.__)("Reset Site Kit","google-site-kit"),subtitle:Object(b.__)("Resetting this site will remove access to all services. After disconnecting, you will need to re-authorize your access to restore service.","google-site-kit"),confirmButton:Object(b.__)("Reset","google-site-kit"),provides:[]})))}}]),ResetButton}(_.Component)}).call(this,i(16),i(1))},362:function(e,t,i){"use strict";i.r(t),function(e,n){var o=i(5),a=i.n(o),s=i(6),c=i.n(s),l=i(7),r=i.n(l),u=i(8),d=i.n(u),g=i(9),m=i.n(g),h=i(296),p=i.n(h),k=i(13),f=i(1),b=i(0),_=i(228),v=i(2),y=i(56),O=i(31),S=i(255),E=i(21),R=i(29),x=i(217),j=i(79),w=function(t){function SetupUsingProxy(t){var i;a()(this,SetupUsingProxy),i=r()(this,d()(SetupUsingProxy).call(this,t));var n=e.googlesitekit.admin,o=n.proxySetupURL,s=n.siteURL,c=e.googlesitekit.setup,l=c.isSiteKitConnected,u=c.isResettable,g=c.errorMessage,m=e.googlesitekit.permissions.canSetup;return i.state={canSetup:m,errorMessage:g,isSiteKitConnected:l,isResettable:u,completeSetup:!1,proxySetupURL:o,resetSuccess:"reset_success"===Object(_.a)(location.href,"notification"),context:Object(_.a)(location.href,"googlesitekit_context"),siteHostname:p.a.toUnicode(new URL(s).hostname)},i}return m()(SetupUsingProxy,t),c()(SetupUsingProxy,[{key:"isSetupFinished",value:function(){var e=this.state,t=e.isSiteKitConnected,i=e.completeSetup;return t&&i}},{key:"render",value:function(){if(this.isSetupFinished()){var t=Object(v.o)("googlesitekit-dashboard",{notification:"authentication_success"});Object(k.delay)((function(){e.location.replace(t)}),500,"later")}var i,o,a,s=this.state,c=s.context,l=s.errorMessage,r=s.isResettable,u=s.proxySetupURL,d=s.resetSuccess,g=s.siteHostname,m=r;return"revoked"===c?(i=Object(b.sprintf)(
4
- /* translators: %s is the site's hostname. (e.g. example.com) */
5
- Object(b.__)("You revoked access to Site Kit for %s","google-site-kit"),g),o=Object(b.__)('Site Kit will no longer have access to your account. If you’d like to reconnect Site Kit, click "Start Setup" below to generate new credentials.',"google-site-kit"),a=Object(b.__)("Sign in with Google","google-site-kit")):m?(i=Object(b.__)("Sign in with Google to configure Site Kit","google-site-kit"),o=Object(b.__)("To use Site Kit, sign in with your Google account. The Site Kit service will guide you through 3 simple steps to complete the connection and configure the plugin.","google-site-kit"),a=Object(b.__)("Sign in with Google","google-site-kit")):(i=Object(b.__)("Sign in with Google to set up Site Kit","google-site-kit"),o=Object(b.__)("The Site Kit service will guide you through 3 simple setup steps.","google-site-kit"),a=Object(b.__)("Start setup","google-site-kit")),n.createElement(f.Fragment,null,n.createElement(y.a,null),l&&n.createElement(R.a,{id:"setup_error",type:"win-error",title:Object(b.__)("Oops! There was a problem during set up. Please try again.","google-site-kit"),description:l,isDismissable:!1}),d&&n.createElement(R.a,{id:"reset_success",title:Object(b.__)("Site Kit by Google was successfully reset.","google-site-kit"),isDismissable:!1}),n.createElement("div",{className:"googlesitekit-wizard"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement(E.a,null,n.createElement("section",{className:"googlesitekit-wizard-progress"},n.createElement("div",{className:"googlesitekit-setup__footer"},n.createElement("div",{className:"mdc-layout-grid"},n.createElement("div",{className:"mdc-layout-grid__inner"},n.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n.createElement("h1",{className:"googlesitekit-setup__title"},i),n.createElement("p",{className:"googlesitekit-setup__description"},o),n.createElement(j.a,null,(function(e){var t=e.complete,i=e.inProgressFeedback,o=e.CTAFeedback;return n.createElement(f.Fragment,null,o,n.createElement(x.a,{optinAction:"analytics_optin_setup_fallback"}),n.createElement("div",{className:"googlesitekit-start-setup-wrap"},n.createElement(O.a,{className:"googlesitekit-start-setup",href:u,onClick:function(){Object(v.B)("plugin_setup","proxy_start_setup_landing_page")},disabled:!t},a),i,r&&n.createElement(S.a,null)))})))))))))))))}}]),SetupUsingProxy}(f.Component);t.default=w}.call(this,i(16),i(1))}}]);
dist/assets/js/chunk-googlesitekit-setup-wrapper-3d470b26536110aecd6c.js DELETED
@@ -1 +0,0 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{108:function(e,t,n){"use strict";(function(e){var o=n(5),i=n.n(o),r=n(6),a=n.n(r),c=n(7),u=n.n(c),s=n(8),l=n.n(s),d=n(9),m=n.n(d),p=n(3),f=n.n(p),h=n(184),v=n.n(h),g=n(14),y=n.n(g),b=n(189),_=n(1),k=n(0),E=n(31),O=n(18),N=n(25),D=function(t){function Dialog(){var e;return i()(this,Dialog),(e=u()(this,l()(Dialog).call(this))).state={attributes:[Object(k.__)("Audience overview","google-site-kit"),Object(k.__)("Top pages","google-site-kit"),Object(k.__)("Top acquisition sources","google-site-kit"),Object(k.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(_.createRef)(),e}return m()(Dialog,t),a()(Dialog,[{key:"componentDidMount",value:function(){new N.d(this.dialogRef.current)}},{key:"render",value:function(){var t=this.props,n=t.dialogActive,o=t.handleDialog,i=t.title,r=t.provides,a=t.handleConfirm,c=t.subtitle,u=t.confirmButton,s=t.dependentModules,l=t.instanceId,d="googlesitekit-dialog-label-".concat(l),m="googlesitekit-dialog-description-".concat(l),p=!(!r||!r.length);return e.createElement("div",{ref:this.dialogRef,className:y()("mdc-dialog",{"mdc-dialog--open":n}),role:"alertdialog","aria-modal":"true","aria-labelledby":i?d:void 0,"aria-describedby":p?m:void 0,"aria-hidden":n?"false":"true",tabIndex:"-1"},e.createElement("div",{className:"mdc-dialog__scrim"}," "),e.createElement(v.a,{active:n},e.createElement("div",null,e.createElement("div",{className:"mdc-dialog__container"},e.createElement("div",{className:"mdc-dialog__surface"},i&&e.createElement("h2",{id:d,className:"mdc-dialog__title"},i),c&&e.createElement("p",{className:"mdc-dialog__lead"},c),p&&e.createElement("section",{id:m,className:"mdc-dialog__content"},e.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},r.map((function(t){return e.createElement("li",{className:"mdc-list-item",key:t},e.createElement("span",{className:"mdc-list-item__text"},t))})))),s&&e.createElement("p",{className:"mdc-dialog__dependecies"},e.createElement("strong",null,Object(k.__)("Note: ","google-site-kit")),s),e.createElement("footer",{className:"mdc-dialog__actions"},e.createElement(E.a,{onClick:a,danger:!0},u||Object(k.__)("Disconnect","google-site-kit")),e.createElement(O.a,{className:"mdc-dialog__cancel-button",onClick:function(){return o()},inherit:!0},Object(k.__)("Cancel","google-site-kit"))))))))}}]),Dialog}(_.Component);D.propTypes={dialogActive:f.a.bool,handleDialog:f.a.func,handleConfirm:f.a.func.isRequired,title:f.a.string,description:f.a.string,confirmButton:f.a.string},D.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=Object(b.a)(D)}).call(this,n(1))},119:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var o=n(5),i=n.n(o),r=n(6),a=n.n(r),c=n(7),u=n.n(c),s=n(8),l=n.n(s),d=n(9),m=n.n(d),p=n(118),f=n(1),h=function(e){function Modal(e){var t;return i()(this,Modal),(t=u()(this,l()(Modal).call(this,e))).el=document.createElement("div"),t.root=document.querySelector(".googlesitekit-plugin")||document.body,t}return m()(Modal,e),a()(Modal,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(p.createPortal)(this.props.children,this.el)}}]),Modal}(f.Component)},123:function(e,t,n){"use strict";(function(e,o){var i=n(11),r=n.n(i),a=n(5),c=n.n(a),u=n(6),s=n.n(u),l=n(7),d=n.n(l),m=n(8),p=n.n(m),f=n(15),h=n.n(f),v=n(9),g=n.n(v),y=n(1),b=n(0),_=n(2),k=n(108),E=n(31),O=n(124),N=n(119),D=function(t){function UserMenu(e){var t;return c()(this,UserMenu),(t=d()(this,p()(UserMenu).call(this,e))).state={dialogActive:!1,menuOpen:!1},t.handleMenu=t.handleMenu.bind(h()(t)),t.handleMenuClose=t.handleMenuClose.bind(h()(t)),t.handleMenuItemSelect=t.handleMenuItemSelect.bind(h()(t)),t.handleDialog=t.handleDialog.bind(h()(t)),t.handleDialogClose=t.handleDialogClose.bind(h()(t)),t.handleUnlinkConfirm=t.handleUnlinkConfirm.bind(h()(t)),t.menuButtonRef=Object(y.createRef)(),t.menuRef=Object(y.createRef)(),t}return g()(UserMenu,t),s()(UserMenu,[{key:"componentDidMount",value:function(){e.addEventListener("mouseup",this.handleMenuClose),e.addEventListener("keyup",this.handleMenuClose),e.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){e.removeEventListener("mouseup",this.handleMenuClose),e.removeEventListener("keyup",this.handleMenuClose),e.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(t,n){var o=e.googlesitekit.admin.proxyPermissionsURL;if("keydown"===n.type&&(13===n.keyCode||32===n.keyCode)||"click"===n.type)switch(t){case 0:this.handleDialog();break;case 1:e.location.assign(o);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return r.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(_.c)(),document.location=Object(_.o)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var t=e.googlesitekit.admin,n=t.userData,i=n.email,r=void 0===i?"":i,a=n.picture,c=void 0===a?"":a,u=t.proxyPermissionsURL,s=this.state,l=s.dialogActive,d=s.menuOpen;return o.createElement(y.Fragment,null,o.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},o.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:c?o.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},o.createElement("img",{className:"mdc-button__icon--image",src:c,alt:Object(b.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:d,ariaControls:"user-menu"},r),o.createElement(O.a,{ref:this.menuRef,menuOpen:d,menuItems:[Object(b.__)("Disconnect","google-site-kit")].concat(u?[Object(b.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),o.createElement(N.a,null,o.createElement(k.a,{dialogActive:l,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(b.__)("Disconnect","google-site-kit"),subtitle:Object(b.__)("Disconnecting Site Kit by Google will remove your access to all services. After disconnecting, you will need to re-authorize to restore service.","google-site-kit"),confirmButton:Object(b.__)("Disconnect","google-site-kit"),provides:[]})))}}]),UserMenu}(y.Component);t.a=D}).call(this,n(16),n(1))},124:function(e,t,n){"use strict";(function(e){var o=n(5),i=n.n(o),r=n(6),a=n.n(r),c=n(7),u=n.n(c),s=n(8),l=n.n(s),d=n(9),m=n.n(d),p=n(3),f=n.n(p),h=n(1),v=n(25),g=function(t){function Menu(e){var t;return i()(this,Menu),(t=u()(this,l()(Menu).call(this,e))).menuRef=Object(h.createRef)(),t}return m()(Menu,t),a()(Menu,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new v.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var t=this.props,n=t.menuOpen,o=t.menuItems,i=t.onSelected,r=t.id;return e.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},e.createElement("ul",{id:r,className:"mdc-list",role:"menu","aria-hidden":!n,"aria-orientation":"vertical",tabIndex:"-1"},o.map((function(t,n){return e.createElement("li",{key:n,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,n),onKeyDown:i.bind(null,n)},e.createElement("span",{className:"mdc-list-item__text"},t))}))))}}]),Menu}(h.Component);g.propTypes={menuOpen:f.a.bool.isRequired,menuItems:f.a.array.isRequired,id:f.a.string.isRequired},t.a=g}).call(this,n(1))},125:function(e,t,n){"use strict";var o=n(5),i=n.n(o),r=n(6),a=n.n(r),c=n(7),u=n.n(c),s=n(8),l=n.n(s),d=n(9),m=n.n(d),p=n(51),f=n(1),h=function(e){function ErrorNotification(){return i()(this,ErrorNotification),u()(this,l()(ErrorNotification).apply(this,arguments))}return m()(ErrorNotification,e),a()(ErrorNotification,[{key:"render",value:function(){return null}}]),ErrorNotification}(f.Component);t.a=Object(p.a)("googlesitekit.ErrorNotification")(h)},184:function(e,t,n){"use strict";var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();var i=n(1),r=n(118),a=n(294),c=function(e){function FocusTrap(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,FocusTrap);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(FocusTrap.__proto__||Object.getPrototypeOf(FocusTrap)).call(this,e));return t.setFocusTrapElement=function(e){t.focusTrapElement=e},"undefined"!=typeof document&&(t.previouslyFocusedElement=document.activeElement),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(FocusTrap,e),o(FocusTrap,[{key:"componentDidMount",value:function(){var e=this.props.focusTrapOptions,t={returnFocusOnDeactivate:!1};for(var n in e)e.hasOwnProperty(n)&&"returnFocusOnDeactivate"!==n&&(t[n]=e[n]);var o=r.findDOMNode(this.focusTrapElement);this.focusTrap=this.props._createFocusTrap(o,t),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()}},{key:"componentDidUpdate",value:function(e){if(e.active&&!this.props.active){var t={returnFocus:this.props.focusTrapOptions.returnFocusOnDeactivate||!1};this.focusTrap.deactivate(t)}else!e.active&&this.props.active&&this.focusTrap.activate();e.paused&&!this.props.paused?this.focusTrap.unpause():!e.paused&&this.props.paused&&this.focusTrap.pause()}},{key:"componentWillUnmount",value:function(){this.focusTrap.deactivate(),!1!==this.props.focusTrapOptions.returnFocusOnDeactivate&&this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus()}},{key:"render",value:function(){var e=this,t=i.Children.only(this.props.children);return i.cloneElement(t,{ref:function(n){e.setFocusTrapElement(n),"function"==typeof t.ref&&t.ref(n)}})}}]),FocusTrap}(i.Component);c.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:a},e.exports=c},189:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(1),l=n(13);var d=function(e,t){return function(n){var o=e(n),i=n.displayName,r=void 0===i?n.name||"Component":i;return o.displayName="".concat(Object(l.upperFirst)(Object(l.camelCase)(t)),"(").concat(r,")"),o}};t.a=d((function(e){var t=0;return(function(n){function r(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,r),(e=a(this,c(r).apply(this,arguments))).instanceId=t++,e}var l,d,m;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(r,n),l=r,(d=[{key:"render",value:function(){return Object(s.createElement)(e,o({},this.props,{instanceId:this.instanceId}))}}])&&i(l.prototype,d),m&&i(l,m),r}(s.Component))}),"withInstanceId")},231:function(e,t,n){"use strict";n.r(t),function(e,o){var i=n(15),r=n.n(i),a=n(5),c=n.n(a),u=n(6),s=n.n(u),l=n(7),d=n.n(l),m=n(8),p=n.n(m),f=n(9),h=n.n(f),v=n(13),g=n(51),y=n(1),b=n(0),_=n(12),k=n(56),E=n(18),O=n(55),N=n(2),D=function(t){function BaseComponent(){return c()(this,BaseComponent),d()(this,p()(BaseComponent).apply(this,arguments))}return h()(BaseComponent,t),s()(BaseComponent,[{key:"render",value:function(){var t=this.props.children;return e.createElement(y.Fragment,null,t)}}]),BaseComponent}(y.Component),C=function(t){function SetupWrapper(e){var t;c()(this,SetupWrapper),t=d()(this,p()(SetupWrapper).call(this,e));var n=o.googlesitekit.setup.moduleToSetup;return t.state={currentModule:n,refresh:!1},t.timeoutID=null,t.unfocusedTime=0,t.autoRefreshModules=Object(_.c)("googlesitekit.autoRefreshModules",[]),t.moduleRefresh=t.autoRefreshModules.find((function(e){return t.state.currentModule===e.identifier})),t.refreshStatus=t.refreshStatus.bind(r()(t)),t.startUnfocusedTimer=t.startUnfocusedTimer.bind(r()(t)),t}return h()(SetupWrapper,t),s()(SetupWrapper,[{key:"componentDidMount",value:function(){o.addEventListener("focus",this.refreshStatus),o.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){o.removeEventListener("focus",this.refreshStatus),o.removeEventListener("blur",this.startUnfocusedTimer)}},{key:"startUnfocusedTimer",value:function(){var e=this;if(this.moduleRefresh){var t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(this.timeoutID=o.setInterval((function(){e.unfocusedTime++}),1e3))}}},{key:"refreshStatus",value:function(){if(this.moduleRefresh){var e=this.moduleRefresh.idleTime||15,t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(e<this.unfocusedTime&&this.setState({refresh:this.timeoutID}),o.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var t=this.state.currentModule,n=SetupWrapper.loadSetupModule(t),o=Object(N.o)("googlesitekit-settings",{});return e.createElement(y.Fragment,null,e.createElement(k.a,null),e.createElement("div",{className:"googlesitekit-setup"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("section",{className:"googlesitekit-setup__wrapper"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(b.__)("Connect Service","google-site-kit")),n))),e.createElement("div",{className:"googlesitekit-setup__footer"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(E.a,{id:"setup-".concat(t,"-cancel"),href:o},Object(b.__)("Cancel","google-site-kit"))),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right "},e.createElement(O.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(t){var n=Object(g.a)("googlesitekit.ModuleSetup-".concat(t))(D);return e.createElement(n,{finishSetup:SetupWrapper.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};o.googlesitekit.setup&&o.googlesitekit.setup.moduleToSetup&&(e.slug=o.googlesitekit.setup.moduleToSetup);var t=Object(N.o)("googlesitekit-dashboard",e);Object(v.delay)((function(){o.location.replace(t)}),500,"later")}}]),SetupWrapper}(y.Component);t.default=C}.call(this,n(1),n(16))},294:function(e,t,n){var o=n(295),i=n(243),r=null;function a(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,c="string"==typeof e?n.querySelector(e):e,u=i({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),s={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},l={activate:function(e){if(s.active)return;_(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:u.onActivate;t&&t();return m(),l},deactivate:d,pause:function(){if(s.paused||!s.active)return;s.paused=!0,p()},unpause:function(){if(!s.paused||!s.active)return;s.paused=!1,m()}};return l;function d(e){if(s.active){p(),s.active=!1,s.paused=!1;var t=e&&void 0!==e.onDeactivate?e.onDeactivate:u.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:u.returnFocusOnDeactivate)&&a((function(){k(s.nodeFocusedBeforeActivation)})),l}}function m(){if(s.active)return r&&r.pause(),r=l,_(),a((function(){k(h())})),n.addEventListener("focusin",g,!0),n.addEventListener("mousedown",v,!0),n.addEventListener("touchstart",v,!0),n.addEventListener("click",b,!0),n.addEventListener("keydown",y,!0),l}function p(){if(s.active&&r===l)return n.removeEventListener("focusin",g,!0),n.removeEventListener("mousedown",v,!0),n.removeEventListener("touchstart",v,!0),n.removeEventListener("click",b,!0),n.removeEventListener("keydown",y,!0),r=null,l}function f(e){var t=u[e],o=t;if(!t)return null;if("string"==typeof t&&!(o=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(o=t()))throw new Error("`"+e+"` did not return a node");return o}function h(){var e;if(!(e=null!==f("initialFocus")?f("initialFocus"):c.contains(n.activeElement)?n.activeElement:s.firstTabbableNode||f("fallbackFocus")))throw new Error("You can't have a focus-trap without at least one focusable element");return e}function v(e){c.contains(e.target)||(u.clickOutsideDeactivates?d({returnFocus:!o.isFocusable(e.target)}):e.preventDefault())}function g(e){c.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),k(s.mostRecentlyFocusedNode||h()))}function y(e){if(!1!==u.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void d();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(_(),e.shiftKey&&e.target===s.firstTabbableNode)return e.preventDefault(),void k(s.lastTabbableNode);if(!e.shiftKey&&e.target===s.lastTabbableNode)e.preventDefault(),k(s.firstTabbableNode)}(e)}function b(e){u.clickOutsideDeactivates||c.contains(e.target)||(e.preventDefault(),e.stopImmediatePropagation())}function _(){var e=o(c);s.firstTabbableNode=e[0]||h(),s.lastTabbableNode=e[e.length-1]||h()}function k(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),s.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):k(h()))}}},295:function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],o=n.join(","),i="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function r(e,t){t=t||{};var n,r,c,u=[],d=[],m=new UntouchabilityChecker(e.ownerDocument||e),p=e.querySelectorAll(o);for(t.includeContainer&&i.call(e,o)&&(p=Array.prototype.slice.apply(p)).unshift(e),n=0;n<p.length;n++)a(r=p[n],m)&&(0===(c=s(r))?u.push(r):d.push({documentOrder:n,tabIndex:c,node:r}));return d.sort(l).map((function(e){return e.node})).concat(u)}function a(e,t){return!(!c(e,t)||function(e){return function(e){return d(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||s(e)<0)}function c(e,t){return t=t||new UntouchabilityChecker(e.ownerDocument||e),!(e.disabled||function(e){return d(e)&&"hidden"===e.type}(e)||t.isUntouchable(e))}r.isTabbable=function(e,t){if(!e)throw new Error("No node provided");return!1!==i.call(e,o)&&a(e,t)},r.isFocusable=function(e,t){if(!e)throw new Error("No node provided");return!1!==i.call(e,u)&&c(e,t)};var u=n.concat("iframe").join(",");function s(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function l(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function d(e){return"INPUT"===e.tagName}function UntouchabilityChecker(e){this.doc=e,this.cache=[]}UntouchabilityChecker.prototype.hasDisplayNone=function(e,t){if(e===this.doc.documentElement)return!1;var n=function(e,t){for(var n=0,o=e.length;n<o;n++)if(t(e[n]))return e[n]}(this.cache,(function(t){return t===e}));if(n)return n[1];var o=!1;return"none"===(t=t||this.doc.defaultView.getComputedStyle(e)).display?o=!0:e.parentNode&&(o=this.hasDisplayNone(e.parentNode)),this.cache.push([e,o]),o},UntouchabilityChecker.prototype.isUntouchable=function(e){if(e===this.doc.documentElement)return!1;var t=this.doc.defaultView.getComputedStyle(e);return!!this.hasDisplayNone(e,t)||"hidden"===t.visibility},e.exports=r},55:function(e,t,n){"use strict";(function(e){var o=n(0),i=n(18);t.a=function HelpLink(){var t=Object(o.__)("Need help?","google-site-kit");return e.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},t)}}).call(this,n(1))},56:function(e,t,n){"use strict";(function(e,o){var i=n(5),r=n.n(i),a=n(6),c=n.n(a),u=n(7),s=n.n(u),l=n(8),d=n.n(l),m=n(9),p=n.n(m),f=n(1),h=n(100),v=n(123),g=n(125),y=function(t){function Header(){return r()(this,Header),s()(this,d()(Header).apply(this,arguments))}return p()(Header,t),c()(Header,[{key:"render",value:function(){var t=e.googlesitekit.setup.isAuthenticated;return o.createElement(f.Fragment,null,o.createElement("header",{className:"googlesitekit-header"},o.createElement("section",{className:"mdc-layout-grid"},o.createElement("div",{className:"mdc-layout-grid__inner"},o.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},o.createElement(h.a,null)),o.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},t&&o.createElement(v.a,null))))),o.createElement(g.a,null))}}]),Header}(f.Component);t.a=y}).call(this,n(16),n(1))}}]);
dist/assets/js/chunk-googlesitekit-setup-wrapper-62b5b16776b62af68252.js ADDED
@@ -0,0 +1 @@
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{111:function(e,t,n){"use strict";(function(e){var o=n(4),i=n.n(o),a=n(5),r=n.n(a),c=n(6),u=n.n(c),s=n(7),l=n.n(s),d=n(8),p=n.n(d),f=n(1),m=n(3),h=n.n(m),v=n(189),g=n.n(v),y=n(14),b=n.n(y),_=n(127),k=n(0),E=n(30),O=n(19),N=n(25),D=function(t){function Dialog(){var e;return i()(this,Dialog),(e=u()(this,l()(Dialog).call(this))).state={attributes:[Object(k.__)("Audience overview","google-site-kit"),Object(k.__)("Top pages","google-site-kit"),Object(k.__)("Top acquisition sources","google-site-kit"),Object(k.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(f.h)(),e}return p()(Dialog,t),r()(Dialog,[{key:"componentDidMount",value:function(){new N.d(this.dialogRef.current)}},{key:"render",value:function(){var t=this.props,n=t.dialogActive,o=t.handleDialog,i=t.title,a=t.provides,r=t.handleConfirm,c=t.subtitle,u=t.confirmButton,s=t.dependentModules,l=t.instanceId,d="googlesitekit-dialog-label-".concat(l),p="googlesitekit-dialog-description-".concat(l),f=!(!a||!a.length);return e.createElement("div",{ref:this.dialogRef,className:b()("mdc-dialog",{"mdc-dialog--open":n}),role:"alertdialog","aria-modal":"true","aria-labelledby":i?d:void 0,"aria-describedby":f?p:void 0,"aria-hidden":n?"false":"true",tabIndex:"-1"},e.createElement("div",{className:"mdc-dialog__scrim"}," "),e.createElement(g.a,{active:n},e.createElement("div",null,e.createElement("div",{className:"mdc-dialog__container"},e.createElement("div",{className:"mdc-dialog__surface"},i&&e.createElement("h2",{id:d,className:"mdc-dialog__title"},i),c&&e.createElement("p",{className:"mdc-dialog__lead"},c),f&&e.createElement("section",{id:p,className:"mdc-dialog__content"},e.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},a.map((function(t){return e.createElement("li",{className:"mdc-list-item",key:t},e.createElement("span",{className:"mdc-list-item__text"},t))})))),s&&e.createElement("p",{className:"mdc-dialog__dependecies"},e.createElement("strong",null,Object(k.__)("Note: ","google-site-kit")),s),e.createElement("footer",{className:"mdc-dialog__actions"},e.createElement(E.a,{onClick:r,danger:!0},u||Object(k.__)("Disconnect","google-site-kit")),e.createElement(O.a,{className:"mdc-dialog__cancel-button",onClick:function(){return o()},inherit:!0},Object(k.__)("Cancel","google-site-kit"))))))))}}]),Dialog}(f.a);D.propTypes={dialogActive:h.a.bool,handleDialog:h.a.func,handleConfirm:h.a.func.isRequired,title:h.a.string,description:h.a.string,confirmButton:h.a.string},D.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=Object(_.a)(D)}).call(this,n(11))},123:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var o=n(4),i=n.n(o),a=n(5),r=n.n(a),c=n(6),u=n.n(c),s=n(7),l=n.n(s),d=n(8),p=n.n(d),f=n(1),m=function(e){function Modal(e){var t;return i()(this,Modal),(t=u()(this,l()(Modal).call(this,e))).el=document.createElement("div"),t.root=document.querySelector(".googlesitekit-plugin")||document.body,t}return p()(Modal,e),r()(Modal,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(f.g)(this.props.children,this.el)}}]),Modal}(f.a)},127:function(e,t,n){"use strict";function o(){return(o=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function i(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}function a(e){return(a="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){return!t||"object"!==a(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e,t){return(u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var s=n(1),l=n(13);var d=function(e,t){return function(n){var o=e(n),i=n.displayName,a=void 0===i?n.name||"Component":i;return o.displayName="".concat(Object(l.upperFirst)(Object(l.camelCase)(t)),"(").concat(a,")"),o}};t.a=d((function(e){var t=0;return(function(n){function a(){var e;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),(e=r(this,c(a).apply(this,arguments))).instanceId=t++,e}var l,d,p;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&u(e,t)}(a,n),l=a,(d=[{key:"render",value:function(){return Object(s.f)(e,o({},this.props,{instanceId:this.instanceId}))}}])&&i(l.prototype,d),p&&i(l,p),a}(s.a))}),"withInstanceId")},129:function(e,t,n){"use strict";(function(e,o){var i=n(10),a=n.n(i),r=n(4),c=n.n(r),u=n(5),s=n.n(u),l=n(6),d=n.n(l),p=n(7),f=n.n(p),m=n(15),h=n.n(m),v=n(8),g=n.n(v),y=n(1),b=n(0),_=n(2),k=n(111),E=n(30),O=n(130),N=n(123),D=function(t){function UserMenu(e){var t;return c()(this,UserMenu),(t=d()(this,f()(UserMenu).call(this,e))).state={dialogActive:!1,menuOpen:!1},t.handleMenu=t.handleMenu.bind(h()(t)),t.handleMenuClose=t.handleMenuClose.bind(h()(t)),t.handleMenuItemSelect=t.handleMenuItemSelect.bind(h()(t)),t.handleDialog=t.handleDialog.bind(h()(t)),t.handleDialogClose=t.handleDialogClose.bind(h()(t)),t.handleUnlinkConfirm=t.handleUnlinkConfirm.bind(h()(t)),t.menuButtonRef=Object(y.h)(),t.menuRef=Object(y.h)(),t}return g()(UserMenu,t),s()(UserMenu,[{key:"componentDidMount",value:function(){e.addEventListener("mouseup",this.handleMenuClose),e.addEventListener("keyup",this.handleMenuClose),e.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){e.removeEventListener("mouseup",this.handleMenuClose),e.removeEventListener("keyup",this.handleMenuClose),e.removeEventListener("keyup",this.handleDialogClose)}},{key:"handleMenu",value:function(){var e=this.state.menuOpen;this.setState({menuOpen:!e})}},{key:"handleMenuClose",value:function(e){("keyup"!==e.type||27!==e.keyCode)&&"mouseup"!==e.type||this.menuButtonRef.current.buttonRef.current.contains(e.target)||this.menuRef.current.menuRef.current.contains(e.target)||this.setState({menuOpen:!1})}},{key:"handleMenuItemSelect",value:function(t,n){var o=e.googlesitekit.admin.proxyPermissionsURL;if("keydown"===n.type&&(13===n.keyCode||32===n.keyCode)||"click"===n.type)switch(t){case 0:this.handleDialog();break;case 1:e.location.assign(o);break;default:this.handleMenu()}}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive,menuOpen:!1}}))}},{key:"handleDialogClose",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1,menuOpen:!1})}},{key:"handleUnlinkConfirm",value:function(){return a.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(_.c)(),document.location=Object(_.o)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var t=e.googlesitekit.admin,n=t.userData,i=n.email,a=void 0===i?"":i,r=n.picture,c=void 0===r?"":r,u=t.proxyPermissionsURL,s=this.state,l=s.dialogActive,d=s.menuOpen;return o.createElement(y.b,null,o.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},o.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:c?o.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},o.createElement("img",{className:"mdc-button__icon--image",src:c,alt:Object(b.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:d,ariaControls:"user-menu"},a),o.createElement(O.a,{ref:this.menuRef,menuOpen:d,menuItems:[Object(b.__)("Disconnect","google-site-kit")].concat(u?[Object(b.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),o.createElement(N.a,null,o.createElement(k.a,{dialogActive:l,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(b.__)("Disconnect","google-site-kit"),subtitle:Object(b.__)("Disconnecting Site Kit by Google will remove your access to all services. After disconnecting, you will need to re-authorize to restore service.","google-site-kit"),confirmButton:Object(b.__)("Disconnect","google-site-kit"),provides:[]})))}}]),UserMenu}(y.a);t.a=D}).call(this,n(16),n(11))},130:function(e,t,n){"use strict";(function(e){var o=n(4),i=n.n(o),a=n(5),r=n.n(a),c=n(6),u=n.n(c),s=n(7),l=n.n(s),d=n(8),p=n.n(d),f=n(1),m=n(3),h=n.n(m),v=n(25),g=function(t){function Menu(e){var t;return i()(this,Menu),(t=u()(this,l()(Menu).call(this,e))).menuRef=Object(f.h)(),t}return p()(Menu,t),r()(Menu,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new v.f(this.menuRef.current),this.menu.open=e,this.menu.setDefaultFocusState(1)}},{key:"componentDidUpdate",value:function(e){var t=this.props.menuOpen;t!==e.menuOpen&&(this.menu.open=t)}},{key:"render",value:function(){var t=this.props,n=t.menuOpen,o=t.menuItems,i=t.onSelected,a=t.id;return e.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},e.createElement("ul",{id:a,className:"mdc-list",role:"menu","aria-hidden":!n,"aria-orientation":"vertical",tabIndex:"-1"},o.map((function(t,n){return e.createElement("li",{key:n,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,n),onKeyDown:i.bind(null,n)},e.createElement("span",{className:"mdc-list-item__text"},t))}))))}}]),Menu}(f.a);g.propTypes={menuOpen:h.a.bool.isRequired,menuItems:h.a.array.isRequired,id:h.a.string.isRequired},t.a=g}).call(this,n(11))},131:function(e,t,n){"use strict";var o=n(4),i=n.n(o),a=n(5),r=n.n(a),c=n(6),u=n.n(c),s=n(7),l=n.n(s),d=n(8),p=n.n(d),f=n(51),m=function(e){function ErrorNotification(){return i()(this,ErrorNotification),u()(this,l()(ErrorNotification).apply(this,arguments))}return p()(ErrorNotification,e),r()(ErrorNotification,[{key:"render",value:function(){return null}}]),ErrorNotification}(n(1).a);t.a=Object(f.a)("googlesitekit.ErrorNotification")(m)},189:function(e,t,n){"use strict";var o=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();var i=n(11),a=n(243),r=n(304),c=function(e){function FocusTrap(e){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,FocusTrap);var t=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,(FocusTrap.__proto__||Object.getPrototypeOf(FocusTrap)).call(this,e));return t.setFocusTrapElement=function(e){t.focusTrapElement=e},"undefined"!=typeof document&&(t.previouslyFocusedElement=document.activeElement),t}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(FocusTrap,e),o(FocusTrap,[{key:"componentDidMount",value:function(){var e=this.props.focusTrapOptions,t={returnFocusOnDeactivate:!1};for(var n in e)e.hasOwnProperty(n)&&"returnFocusOnDeactivate"!==n&&(t[n]=e[n]);var o=a.findDOMNode(this.focusTrapElement);this.focusTrap=this.props._createFocusTrap(o,t),this.props.active&&this.focusTrap.activate(),this.props.paused&&this.focusTrap.pause()}},{key:"componentDidUpdate",value:function(e){if(e.active&&!this.props.active){var t={returnFocus:this.props.focusTrapOptions.returnFocusOnDeactivate||!1};this.focusTrap.deactivate(t)}else!e.active&&this.props.active&&this.focusTrap.activate();e.paused&&!this.props.paused?this.focusTrap.unpause():!e.paused&&this.props.paused&&this.focusTrap.pause()}},{key:"componentWillUnmount",value:function(){this.focusTrap.deactivate(),!1!==this.props.focusTrapOptions.returnFocusOnDeactivate&&this.previouslyFocusedElement&&this.previouslyFocusedElement.focus&&this.previouslyFocusedElement.focus()}},{key:"render",value:function(){var e=this,t=i.Children.only(this.props.children);return i.cloneElement(t,{ref:function(n){e.setFocusTrapElement(n),"function"==typeof t.ref&&t.ref(n)}})}}]),FocusTrap}(i.Component);c.defaultProps={active:!0,paused:!1,focusTrapOptions:{},_createFocusTrap:r},e.exports=c},236:function(e,t,n){"use strict";n.r(t),function(e,o){var i=n(15),a=n.n(i),r=n(4),c=n.n(r),u=n(5),s=n.n(u),l=n(6),d=n.n(l),p=n(7),f=n.n(p),m=n(8),h=n.n(m),v=n(1),g=n(13),y=n(51),b=n(0),_=n(12),k=n(56),E=n(19),O=n(55),N=n(2),D=function(t){function BaseComponent(){return c()(this,BaseComponent),d()(this,f()(BaseComponent).apply(this,arguments))}return h()(BaseComponent,t),s()(BaseComponent,[{key:"render",value:function(){var t=this.props.children;return e.createElement(v.b,null,t)}}]),BaseComponent}(v.a),w=function(t){function SetupWrapper(e){var t;c()(this,SetupWrapper),t=d()(this,f()(SetupWrapper).call(this,e));var n=o.googlesitekit.setup.moduleToSetup;return t.state={currentModule:n,refresh:!1},t.timeoutID=null,t.unfocusedTime=0,t.autoRefreshModules=Object(_.c)("googlesitekit.autoRefreshModules",[]),t.moduleRefresh=t.autoRefreshModules.find((function(e){return t.state.currentModule===e.identifier})),t.refreshStatus=t.refreshStatus.bind(a()(t)),t.startUnfocusedTimer=t.startUnfocusedTimer.bind(a()(t)),t}return h()(SetupWrapper,t),s()(SetupWrapper,[{key:"componentDidMount",value:function(){o.addEventListener("focus",this.refreshStatus),o.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){o.removeEventListener("focus",this.refreshStatus),o.removeEventListener("blur",this.startUnfocusedTimer)}},{key:"startUnfocusedTimer",value:function(){var e=this;if(this.moduleRefresh){var t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(this.timeoutID=o.setInterval((function(){e.unfocusedTime++}),1e3))}}},{key:"refreshStatus",value:function(){if(this.moduleRefresh){var e=this.moduleRefresh.idleTime||15,t=!0;this.moduleRefresh.toRefresh&&(t=this.moduleRefresh.toRefresh()),t&&(e<this.unfocusedTime&&this.setState({refresh:this.timeoutID}),o.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var t=this.state.currentModule,n=SetupWrapper.loadSetupModule(t),o=Object(N.o)("googlesitekit-settings",{});return e.createElement(v.b,null,e.createElement(k.a,null),e.createElement("div",{className:"googlesitekit-setup"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("section",{className:"googlesitekit-setup__wrapper"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(b.__)("Connect Service","google-site-kit")),n))),e.createElement("div",{className:"googlesitekit-setup__footer"},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},e.createElement(E.a,{id:"setup-".concat(t,"-cancel"),href:o},Object(b.__)("Cancel","google-site-kit"))),e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--align-right "},e.createElement(O.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(t){var n=Object(y.a)("googlesitekit.ModuleSetup-".concat(t))(D);return e.createElement(n,{finishSetup:SetupWrapper.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};o.googlesitekit.setup&&o.googlesitekit.setup.moduleToSetup&&(e.slug=o.googlesitekit.setup.moduleToSetup);var t=Object(N.o)("googlesitekit-dashboard",e);Object(g.delay)((function(){o.location.replace(t)}),500,"later")}}]),SetupWrapper}(v.a);t.default=w}.call(this,n(11),n(16))},304:function(e,t,n){var o=n(305),i=n(253),a=null;function r(e){return setTimeout(e,0)}e.exports=function(e,t){var n=document,c="string"==typeof e?n.querySelector(e):e,u=i({returnFocusOnDeactivate:!0,escapeDeactivates:!0},t),s={firstTabbableNode:null,lastTabbableNode:null,nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1},l={activate:function(e){if(s.active)return;_(),s.active=!0,s.paused=!1,s.nodeFocusedBeforeActivation=n.activeElement;var t=e&&e.onActivate?e.onActivate:u.onActivate;t&&t();return p(),l},deactivate:d,pause:function(){if(s.paused||!s.active)return;s.paused=!0,f()},unpause:function(){if(!s.paused||!s.active)return;s.paused=!1,p()}};return l;function d(e){if(s.active){f(),s.active=!1,s.paused=!1;var t=e&&void 0!==e.onDeactivate?e.onDeactivate:u.onDeactivate;return t&&t(),(e&&void 0!==e.returnFocus?e.returnFocus:u.returnFocusOnDeactivate)&&r((function(){k(s.nodeFocusedBeforeActivation)})),l}}function p(){if(s.active)return a&&a.pause(),a=l,_(),r((function(){k(h())})),n.addEventListener("focusin",g,!0),n.addEventListener("mousedown",v,!0),n.addEventListener("touchstart",v,!0),n.addEventListener("click",b,!0),n.addEventListener("keydown",y,!0),l}function f(){if(s.active&&a===l)return n.removeEventListener("focusin",g,!0),n.removeEventListener("mousedown",v,!0),n.removeEventListener("touchstart",v,!0),n.removeEventListener("click",b,!0),n.removeEventListener("keydown",y,!0),a=null,l}function m(e){var t=u[e],o=t;if(!t)return null;if("string"==typeof t&&!(o=n.querySelector(t)))throw new Error("`"+e+"` refers to no known node");if("function"==typeof t&&!(o=t()))throw new Error("`"+e+"` did not return a node");return o}function h(){var e;if(!(e=null!==m("initialFocus")?m("initialFocus"):c.contains(n.activeElement)?n.activeElement:s.firstTabbableNode||m("fallbackFocus")))throw new Error("You can't have a focus-trap without at least one focusable element");return e}function v(e){c.contains(e.target)||(u.clickOutsideDeactivates?d({returnFocus:!o.isFocusable(e.target)}):e.preventDefault())}function g(e){c.contains(e.target)||e.target instanceof Document||(e.stopImmediatePropagation(),k(s.mostRecentlyFocusedNode||h()))}function y(e){if(!1!==u.escapeDeactivates&&function(e){return"Escape"===e.key||"Esc"===e.key||27===e.keyCode}(e))return e.preventDefault(),void d();(function(e){return"Tab"===e.key||9===e.keyCode})(e)&&function(e){if(_(),e.shiftKey&&e.target===s.firstTabbableNode)return e.preventDefault(),void k(s.lastTabbableNode);if(!e.shiftKey&&e.target===s.lastTabbableNode)e.preventDefault(),k(s.firstTabbableNode)}(e)}function b(e){u.clickOutsideDeactivates||c.contains(e.target)||(e.preventDefault(),e.stopImmediatePropagation())}function _(){var e=o(c);s.firstTabbableNode=e[0]||h(),s.lastTabbableNode=e[e.length-1]||h()}function k(e){e!==n.activeElement&&(e&&e.focus?(e.focus(),s.mostRecentlyFocusedNode=e,function(e){return e.tagName&&"input"===e.tagName.toLowerCase()&&"function"==typeof e.select}(e)&&e.select()):k(h()))}}},305:function(e,t){var n=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'],o=n.join(","),i="undefined"==typeof Element?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;function a(e,t){t=t||{};var n,a,c,u=[],d=[],p=new UntouchabilityChecker(e.ownerDocument||e),f=e.querySelectorAll(o);for(t.includeContainer&&i.call(e,o)&&(f=Array.prototype.slice.apply(f)).unshift(e),n=0;n<f.length;n++)r(a=f[n],p)&&(0===(c=s(a))?u.push(a):d.push({documentOrder:n,tabIndex:c,node:a}));return d.sort(l).map((function(e){return e.node})).concat(u)}function r(e,t){return!(!c(e,t)||function(e){return function(e){return d(e)&&"radio"===e.type}(e)&&!function(e){if(!e.name)return!0;var t=function(e){for(var t=0;t<e.length;t++)if(e[t].checked)return e[t]}(e.ownerDocument.querySelectorAll('input[type="radio"][name="'+e.name+'"]'));return!t||t===e}(e)}(e)||s(e)<0)}function c(e,t){return t=t||new UntouchabilityChecker(e.ownerDocument||e),!(e.disabled||function(e){return d(e)&&"hidden"===e.type}(e)||t.isUntouchable(e))}a.isTabbable=function(e,t){if(!e)throw new Error("No node provided");return!1!==i.call(e,o)&&r(e,t)},a.isFocusable=function(e,t){if(!e)throw new Error("No node provided");return!1!==i.call(e,u)&&c(e,t)};var u=n.concat("iframe").join(",");function s(e){var t=parseInt(e.getAttribute("tabindex"),10);return isNaN(t)?function(e){return"true"===e.contentEditable}(e)?0:e.tabIndex:t}function l(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex}function d(e){return"INPUT"===e.tagName}function UntouchabilityChecker(e){this.doc=e,this.cache=[]}UntouchabilityChecker.prototype.hasDisplayNone=function(e,t){if(e===this.doc.documentElement)return!1;var n=function(e,t){for(var n=0,o=e.length;n<o;n++)if(t(e[n]))return e[n]}(this.cache,(function(t){return t===e}));if(n)return n[1];var o=!1;return"none"===(t=t||this.doc.defaultView.getComputedStyle(e)).display?o=!0:e.parentNode&&(o=this.hasDisplayNone(e.parentNode)),this.cache.push([e,o]),o},UntouchabilityChecker.prototype.isUntouchable=function(e){if(e===this.doc.documentElement)return!1;var t=this.doc.defaultView.getComputedStyle(e);return!!this.hasDisplayNone(e,t)||"hidden"===t.visibility},e.exports=a},55:function(e,t,n){"use strict";(function(e){n(1);var o=n(0),i=n(19);t.a=function HelpLink(){var t=Object(o.__)("Need help?","google-site-kit");return e.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},t)}}).call(this,n(11))},56:function(e,t,n){"use strict";(function(e,o){var i=n(4),a=n.n(i),r=n(5),c=n.n(r),u=n(6),s=n.n(u),l=n(7),d=n.n(l),p=n(8),f=n.n(p),m=n(1),h=n(99),v=n(129),g=n(131),y=function(t){function Header(){return a()(this,Header),s()(this,d()(Header).apply(this,arguments))}return f()(Header,t),c()(Header,[{key:"render",value:function(){var t=e.googlesitekit.setup.isAuthenticated;return o.createElement(m.b,null,o.createElement("header",{className:"googlesitekit-header"},o.createElement("section",{className:"mdc-layout-grid"},o.createElement("div",{className:"mdc-layout-grid__inner"},o.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--span-3-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},o.createElement(h.a,null)),o.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-phone mdc-layout-grid__cell--span-1-phone mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},t&&o.createElement(v.a,null))))),o.createElement(g.a,null))}}]),Header}(m.a);t.a=y}).call(this,n(16),n(11))}}]);
dist/assets/js/googlesitekit-activation.js CHANGED
@@ -1,13 +1,13 @@
1
- !function(e){function t(t){for(var a,o,c=t[0],s=t[1],u=t[2],d=0,g=[];d<c.length;d++)o=c[d],Object.prototype.hasOwnProperty.call(i,o)&&i[o]&&g.push(i[o][0]),i[o]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a]);for(l&&l(t);g.length;)g.shift()();return r.push.apply(r,u||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],a=!0,o=1;o<n.length;o++){var c=n[o];0!==i[c]&&(a=!1)}a&&(r.splice(t--,1),e=__webpack_require__(__webpack_require__.s=n[0]))}return e}var a={},i={8:0},r=[];function __webpack_require__(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=e,__webpack_require__.c=a,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)__webpack_require__.d(n,a,function(t){return e[t]}.bind(null,a));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var o=window.webpackJsonp=window.webpackJsonp||[],c=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var l=c;r.push([348,0]),n()}({10:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return b}));var a=n(20),i=n.n(a),r=n(33),o=n.n(r),c=n(13),s=n(41),l=n(42),u=n(12),d=n(2),g=n(67),f=n(95);function p(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h="core",b="modules",v=function(){e.googlesitekit.admin=e.googlesitekit.admin||{},"string"==typeof e.googlesitekit.admin.datacache&&(e.googlesitekit.admin.datacache=JSON.parse(e.googlesitekit.admin.datacache)),"object"!==o()(e.googlesitekit.admin.datacache)&&(e.googlesitekit.admin.datacache={})},k=function(e,t){var n=m({data:{}},e);return n.data=m({dateRange:t},n.data),n},_={maxRequests:10,init:function(){Object(u.a)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingData",this.collectModuleData.bind(this))},combinedGetFromCache:function(e){var t=this;return new Promise((function(n,a){try{var i=[],r=Object(d.h)();Object(c.each)(e,(function(e){var n=k(e,r);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var a=t.getCache(n.key,n.maxAge);void 0!==a&&(i[n.key]=a,t.resolve(n,a))})),n(i)}catch(e){a()}}))},combinedGet:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=[],i=25,r=Object(d.h)();Object(c.each)(e,(function(e){var n=k(e,r);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var o=t.getCache(n.key,n.maxAge);void 0!==o?(setTimeout((function(){t.resolve(n,o)}),i),i+=25):a.push(n)})),a=Object(c.sortBy)(a,"priority");var o=[],g=[],f={},p=!!a.find((function(e){return e.priority<10}));Object(c.each)(a,(function(e,t){!n&&10<=e.priority&&p?g.push(e):f[e.key]?f[e.key].push(t):(f[e.key]=[t],o.push(e))}));var m=10,h=o.slice(0,m),b=o.slice(m);if(b=b.concat(g),0!==h.length||0!==b.length){0<b.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(b,!0)}),50):this.maxRequests=10;var v=null!==Object(d.m)("datacache");return Object(s.default)({path:Object(l.a)("/google-site-kit/v1/data/",{datacache:v||void 0}),data:{request:h},method:"POST"}).then((function(e){Object(c.each)(e,(function(e,n){f[n]?(t.handleWPError(e),Object(c.each)(f[n],(function(n){var i=a[n];t.setCache(i.key,e),t.resolve(i,e)})),0===b.length&&Object(u.d)("googlesitekit.dataLoaded","api")):console.error("data_error","unknown response key "+n)}))})).catch((function(e){console.warn("Error caught during combinedGet",e)}))}Object(u.d)("googlesitekit.dataLoaded","cache")},handleWPError:function(e){var t=["code","data","message"],n=Object(c.intersection)(t,Object.keys(e));if(Object(c.isEqual)(t,n)){console.warn("WP Error in data response",e);var a=e.data;if(a&&a.reason){var i=0;["authError","insufficientPermissions"].includes(a.reason)&&(Object(u.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(d.f)(g.a),1),i++),"forbidden"===a.reason&&(Object(u.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(d.f)(f.a),1),i++),i&&Object(u.b)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(u.f)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+i}))}}},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(t,n){if(void 0!==n&&(!n||"object"!==o()(n)||!n.error&&!n.errors)){v(),e.googlesitekit.admin.datacache[t]=Object(c.cloneDeep)(n);var a={value:n,date:Date.now()/1e3};Object(d.p)().setItem("googlesitekit_"+t,JSON.stringify(a))}},getCache:function(t,n){if(!e.googlesitekit.admin.nojscache){if(v(),void 0!==e.googlesitekit.admin.datacache[t])return e.googlesitekit.admin.datacache[t];var a=JSON.parse(Object(d.p)().getItem("googlesitekit_"+t));return a&&"object"===o()(a)&&a.date&&(!n||Date.now()/1e3-a.date<n)?(e.googlesitekit.admin.datacache[t]=Object(c.cloneDeep)(a.value),Object(c.cloneDeep)(e.googlesitekit.admin.datacache[t])):void 0}},deleteCache:function(t){v(),delete e.googlesitekit.admin.datacache[t],Object(d.p)().removeItem("googlesitekit_"+t)},invalidateCacheGroup:function(t,n,a){var i=this.getCacheKey(t,n,a);v(),Object.keys(e.googlesitekit.admin.datacache).forEach((function(t){0!==t.indexOf(i+"::")&&t!==i||delete e.googlesitekit.admin.datacache[t]})),Object.keys(Object(d.p)()).forEach((function(e){0!==e.indexOf("googlesitekit_".concat(i,"::"))&&e!=="googlesitekit_".concat(i)||Object(d.p)().removeItem(e)}))},collectModuleData:function(e,t){var n=Object(u.c)("googlesitekit.module"+e+"DataRequest",[],t);0!==n.length&&this.combinedGet(n)},get:function(e,t,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.getCacheKey(e,t,n,i);if(!r){var c=this.getCache(o,3600);if(void 0!==c)return new Promise((function(e){e(c)}))}return Object(s.default)({path:Object(l.a)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),i)}).then((function(e){return r||a.setCache(o,e),Promise.resolve(e)})).catch((function(e){return a.handleWPError(e),Promise.reject(e)}))},set:function(e,t,n,a){var i={};return i.data=a,Object(s.default)({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),data:i,method:"POST"}).then((function(a){return _.invalidateCacheGroup(e,t,n),new Promise((function(e){e(a)}))}))},getCacheKey:function(e,t,n){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=[],r=[e,t,n],c=0,s=r;c<s.length;c++){var l=s[c];if(!l||!l.length)break;i.push(l)}return 3===i.length&&a&&"object"===o()(a)&&Object.keys(a).length&&i.push(Object(d.z)(a)),i.join("::")},setModuleActive:function(e,t){return this.set(h,"modules","activation",{slug:e,active:t})}};_.init(),t.c=_}).call(this,n(16))},100:function(e,t,n){"use strict";(function(e){var a=n(0),i=n(24);t.a=function Logo(){return e.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},e.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),e.createElement(i.a,{id:"logo-sitekit",className:"googlesitekit-logo__logo-sitekit",height:"26",width:"99"}),e.createElement("span",{className:"screen-reader-text"},Object(a.__)("Site Kit by Google Logo","google-site-kit")))}}).call(this,n(1))},112:function(e,t,n){"use strict";(function(e){var a=n(11),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(9),p=n.n(f),m=n(1),h=n(0),b=n(76),v=n(29),k=function(t){function DashboardCoreSiteAlerts(e){var t;return o()(this,DashboardCoreSiteAlerts),(t=u()(this,g()(DashboardCoreSiteAlerts).call(this,e))).state={notifications:!1},t}return p()(DashboardCoreSiteAlerts,t),s()(DashboardCoreSiteAlerts,[{key:"componentDidMount",value:function(){var e;return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.a.awrap(Object(b.c)());case 3:e=t.sent,this.setState({notifications:e}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.warn("Error caught while fetching notifications",t.t0);case 10:case"end":return t.stop()}}),null,this,[[0,7]])}},{key:"render",value:function(){var t=this.state.notifications;return Array.isArray(t)?t.map((function(t){return e.createElement(v.a,{key:t.id,id:t.id,title:t.title||"",description:t.content||"",learnMoreURL:t.learnMoreURL||"",learnMoreLabel:t.learnMoreLabel||"",ctaLink:t.ctaURL||"",ctaLabel:t.ctaLabel||"",ctaTarget:t.ctaTarget||"",dismiss:t.dismissLabel||Object(h.__)("OK, Got it!","google-site-kit"),isDismissable:t.dismissible,onCTAClick:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(b.a)(t.id));case 2:case"end":return e.stop()}}))},onDismiss:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(b.b)(t.id));case 2:case"end":return e.stop()}}))}})})):null}}]),DashboardCoreSiteAlerts}(m.Component);t.a=k}).call(this,n(1))},113:function(e,t,n){"use strict";(function(e,a){var i=n(5),r=n.n(i),o=n(6),c=n.n(o),s=n(7),l=n.n(s),u=n(8),d=n.n(u),g=n(9),f=n.n(g),p=n(1),m=n(0),h=n(12),b=n(2),v=n(29),k=n(114),_=function(t){function DashboardSetupAlerts(){return r()(this,DashboardSetupAlerts),l()(this,d()(DashboardSetupAlerts).apply(this,arguments))}return f()(DashboardSetupAlerts,t),c()(DashboardSetupAlerts,[{key:"render",value:function(){var t=Object(b.m)("notification");if(!t||""===t)return null;var n={id:"connected-successfully",setupTitle:Object(m.__)("Site Kit","google-site-kit"),description:Object(m.__)("Now you’ll be able to see how your site is doing in search. To get even more detailed stats, activate more modules. Here are our recommendations for what to include in your Site Kit:","google-site-kit"),learnMore:{label:"",url:"",description:""}},i=e.googlesitekit.permissions.canManageOptions;switch(t){case"authentication_success":if(!i)return null;var r=Object(b.l)(),o=Object(b.m)("slug");return o&&r[o]&&!r[o].active?null:(o&&r[o]&&(n.id="".concat(n.id,"-").concat(o),n.setupTitle=r[o].name,n.description=Object(m.__)("Here are some other services you can connect to see even more stats:","google-site-kit"),n=Object(h.c)(" global.googlesitekit.SetupWinNotification-".concat(o),n)),a.createElement(p.Fragment,null,a.createElement(v.a,{id:n.id
2
- /* translators: %s: the name of a module that setup was completed for */,title:Object(m.sprintf)(Object(m.__)("Congrats on completing the setup for %s!","google-site-kit"),n.setupTitle),description:n.description,handleDismiss:function(){},winImage:e.googlesitekit.admin.assetsRoot+"images/rocket.png",dismiss:Object(m.__)("OK, Got it!","google-site-kit"),format:"large",type:"win-success",learnMoreLabel:n.learnMore.label,learnMoreDescription:n.learnMore.description,learnMoreURL:n.learnMore.url},a.createElement(k.a,null))));case"authentication_failure":return a.createElement(p.Fragment,null,a.createElement(v.a,{id:"connection error",title:Object(m.__)("There was a problem connecting to Google!","google-site-kit"),description:"",handleDismiss:function(){},format:"small",type:"win-error"}))}}}]),DashboardSetupAlerts}(p.Component);t.a=_}).call(this,n(16),n(1))},114:function(e,t,n){"use strict";(function(e,a){var i=n(11),r=n.n(i),o=n(5),c=n.n(o),s=n(6),l=n.n(s),u=n(7),d=n.n(u),g=n(8),f=n.n(g),p=n(15),m=n.n(p),h=n(9),b=n.n(h),v=n(13),k=n(14),_=n.n(k),y=n(1),O=n(0),w=n(2),j=n(18),E=n(10),C=n(57),x=n(58),D=function(t){function ModulesList(e){var t;return c()(this,ModulesList),(t=d()(this,f()(ModulesList).call(this,e))).setupModuleClick=t.setupModuleClick.bind(m()(t)),t}return b()(ModulesList,t),l()(ModulesList,[{key:"setupModuleClick",value:function(t){return r.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,this.setState({isSaving:!0}),n.next=4,r.a.awrap(Object(w.a)(E.c,t,!0));case 4:return n.next=6,r.a.awrap(Object(w.w)());case 6:e.location=Object(w.n)(t,!0),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),Object(w.y)(C.a,{id:"setup-module-error",title:Object(O.__)("Internal Server Error","google-site-kit"),description:n.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 13:case"end":return n.stop()}}),null,this,[[0,9]])}},{key:"render",value:function(){var e=this,t=Object(w.l)(),n=Object.values(t).filter((function(e){return!e.internal})),i=n.filter((function(e){return e.active&&e.setupComplete})).reduce((function(e,t){return e[t.slug]=t.name,e}),{}),r=n.filter((function(e){return 0===e.required.length})).sort((function(e,t){return e.sort-t.sort}));return a.createElement("div",{className:"googlesitekit-modules-list"},Object(v.map)(r,(function(t){var n=!1,r="",o=t.slug,c=t.name,s=t.setupComplete,l=t.required;return 0<l.length&&l.forEach((function(e){i[e]&&(n=!0,r=i[e])})),a.createElement("div",{key:o,className:_()("googlesitekit-modules-list__module","googlesitekit-modules-list__module--".concat(o),{"googlesitekit-modules-list__module--disabled":n})},a.createElement("div",{className:"googlesitekit-settings-connect-module__wrapper"},a.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},Object(w.s)(o,n)),a.createElement("h3",{className:"googlesitekit-settings-connect-module__title"},c)),a.createElement(x.a,{slug:o,context:"modules-list"}),s&&a.createElement("span",{className:"googlesitekit-settings-module__status"},a.createElement("span",{className:"googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected"},a.createElement("span",{className:"screen-reader-text"},Object(O.__)("Connected","google-site-kit"))),Object(O.__)("Connected","google-site-kit")),!s&&!n&&a.createElement(j.a,{arrow:!0,small:!0,inherit:!0,onClick:function(){e.setupModuleClick(o)}}," ",Object(O.__)("Connect Service","google-site-kit")),!s&&n&&a.createElement(j.a,{disabled:!0,small:!0,inherit:!0},
3
/* translators: %s: parent module name */
4
- Object(O.sprintf)(Object(O.__)("Enable %s to start setup","google-site-kit"),r)))})))}}]),ModulesList}(y.Component);t.a=D}).call(this,n(16),n(1))},115:function(e,t,n){"use strict";(function(e,a){var i=n(5),r=n.n(i),o=n(6),c=n.n(o),s=n(7),l=n.n(s),u=n(8),d=n.n(u),g=n(9),f=n.n(g),p=n(13),m=n(1),h=n(0),b=n(2),v=n(29),k=n(49),_=function(t){function DashboardModulesAlerts(e){var t;return r()(this,DashboardModulesAlerts),(t=l()(this,d()(DashboardModulesAlerts).call(this,e))).state={data:!1},t}return f()(DashboardModulesAlerts,t),c()(DashboardModulesAlerts,[{key:"componentDidMount",value:function(){var e=this,t=Object(k.f)();t&&Object(k.b)(t).then((function(t){e.setState({data:t.results})}))}},{key:"render",value:function(){var t=this.state.data;if(0===Object.keys(t).length)return null;var n=Object(b.l)(),i=[];return Object.keys(t).forEach((function(r){Object(p.each)(t[r],(function(t){i.push(e.createElement(v.a,{key:t.id,id:t.id,title:t.title||"",description:t.description||"",blockData:t.blockData||[],winImage:t.winImage?"".concat(a.googlesitekit.admin.assetsRoot,"images/").concat(t.winImage):"",format:t.format||"small",learnMoreURL:t.learnMoreURL||"",learnMoreDescription:t.learnMoreDescription||"",learnMoreLabel:t.learnMoreLabel||"",ctaLink:t.ctaURL||"",ctaLabel:t.ctaLabel||"",ctaTarget:t.ctaTarget||"",type:t.severity||"",dismiss:t.dismiss||Object(h.__)("OK, Got it!","google-site-kit"),isDismissable:t.isDismissable||!0,logo:t.logo||!0,module:r,moduleName:n[r].name,pageIndex:t.pageIndex||"",dismissExpires:t.dismissExpires||0,showOnce:t.showOnce||!1}))}))})),e.createElement(m.Fragment,null,i)}}]),DashboardModulesAlerts}(m.Component);t.a=_}).call(this,n(1),n(16))},116:function(e,t,n){"use strict";var a=n(11),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(13),u=n(10),d=function(){function WinsWithData(e){o()(this,WinsWithData),this.wins=e,this.response=[]}return s()(WinsWithData,[{key:"get",value:function(){var e,t=this;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e=Object(l.filter)(this.wins.map((function(e){return!!e.withData&&(e.withData.callback=function(n){t.response[e.identifier]=n},e.withData)}))),n.next=3,i.a.awrap(u.c.combinedGetFromCache(e));case 3:return n.abrupt("return",this.response);case 4:case"end":return n.stop()}}),null,this)}}]),WinsWithData}();t.a=d},117:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(13),p=n(1),m=n(0),h=n(12),b=n(29),v=n(49),k=function(t){function DashboardWinsAlerts(e){var t;return i()(this,DashboardWinsAlerts),(t=s()(this,u()(DashboardWinsAlerts).call(this,e))).state={data:!1},t}return g()(DashboardWinsAlerts,t),o()(DashboardWinsAlerts,[{key:"componentWillMount",value:function(){var e=this;Object(h.a)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(h.e)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications");var t=Object(v.g)();t&&Object(v.d)(t).then((function(t){e.setState({data:t.results})}))}))}},{key:"render",value:function(){var t=this.state.data;if(0===Object.keys(t).length)return null;var n=[];return Object.keys(t).forEach((function(a){Object(f.each)(t[a],(function(t){n.push(e.createElement(b.a,{key:t.id,id:t.id,title:t.title||"",description:t.description||"",blockData:t.blockData||[],winImage:t.winImage||"",format:t.format||"small",learnMoreURL:t.learnMoreURL||"",learnMoreDescription:t.learnMoreDescription||"",learnMoreLabel:t.learnMoreLabel||"",ctaLink:t.ctaLink||"",ctaLabel:t.ctaLabel||"",type:t.severity||"",dismiss:t.dismiss||Object(m.__)("OK, Got it!","google-site-kit"),isDismissable:t.isDismissable||!0,logo:t.logo||!1,pageIndex:t.pageIndex||"",dismissExpires:t.dismissExpires||0,showOnce:t.showOnce||!1}))}))})),e.createElement(p.Fragment,null,n)}}]),DashboardWinsAlerts}(p.Component);t.a=k}).call(this,n(1))},18:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(3),p=n.n(f),m=n(14),h=n.n(m),b=n(1),v=function(t){function Link(){return i()(this,Link),s()(this,u()(Link).apply(this,arguments))}return g()(Link,t),o()(Link,[{key:"render",value:function(){var t=this.props,n=t.dangerouslySetInnerHTML,a=t.onClick,i=t.href,r=t.children,o=t.className,c=t.arrow,s=t.external,l=t.inverse,u=t.back,d=t.small,g=t.inherit,f=t.caps,p=t.danger,m=t.disabled,b=t.id,v=i&&!m,k=v?"a":"button";return e.createElement(k,{className:h()("googlesitekit-cta-link",o,{"googlesitekit-cta-link--arrow":c,"googlesitekit-cta-link--external":s,"googlesitekit-cta-link--inverse":l,"googlesitekit-cta-link--back":u,"googlesitekit-cta-link--small":d,"googlesitekit-cta-link--inherit":g,"googlesitekit-cta-link--caps":f,"googlesitekit-cta-link--danger":p,"googlesitekit-cta-link--disabled":m}),onClick:a,id:b,href:v?i:void 0,target:v&&s?"_blank":void 0,rel:s?"noopener noreferrer":void 0,disabled:m,dangerouslySetInnerHTML:n},r)}}]),Link}(b.Component);v.propTypes={dangerouslySetInnerHTML:p.a.shape({__html:p.a.string}),onClick:p.a.func,href:p.a.string,children:p.a.oneOfType([p.a.string.isRequired,p.a.array.isRequired]),className:p.a.string,arrow:p.a.bool,external:p.a.bool,inverse:p.a.bool,back:p.a.bool,small:p.a.bool,inherit:p.a.bool,caps:p.a.bool,danger:p.a.bool,disabled:p.a.bool},v.defaultProps={dangerouslySetInnerHTML:void 0,onClick:null,href:"",className:"",arrow:!1,external:!1,inverse:!1,back:!1,small:!1,inherit:!1,caps:!1,danger:!1,disabled:!1},t.a=v}).call(this,n(1))},181:function(e,t,n){"use strict";(function(e,t){var a=n(12),i=n(22),r=n(2),o=n(112),c=n(113),s=n(115),l=n(117),u=n(67),d=e.googlesitekit.setup,g=Object(r.m)("notification"),f=Object(i.a)(t.createElement(o.a,null)),p=Object(i.a)(t.createElement(c.a,null)),m=Object(i.a)(t.createElement(s.a,null)),h=Object(i.a)(t.createElement(l.a,null)),b=Object(i.a)(t.createElement(u.a,null));Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",f,10),d.needReauthenticate&&Object(a.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",b,1),"authentication_success"===g||"authentication_failure"===g?Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",p,1):d.isAuthenticated&&d.isVerified&&(Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.ModulesNotification",m,1),Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.WinsNotification",h,1))}).call(this,n(16),n(1))},2:function(e,t,n){"use strict";(function(e){n.d(t,"v",(function(){return I})),n.d(t,"t",(function(){return T})),n.d(t,"q",(function(){return q})),n.d(t,"u",(function(){return F})),n.d(t,"i",(function(){return B})),n.d(t,"b",(function(){return G})),n.d(t,"e",(function(){return W})),n.d(t,"w",(function(){return H})),n.d(t,"l",(function(){return K})),n.d(t,"n",(function(){return z})),n.d(t,"f",(function(){return J})),n.d(t,"o",(function(){return Z})),n.d(t,"C",(function(){return V})),n.d(t,"D",(function(){return Y})),n.d(t,"j",(function(){return $})),n.d(t,"a",(function(){return ee})),n.d(t,"A",(function(){return te})),n.d(t,"y",(function(){return ne})),n.d(t,"d",(function(){return ae})),n.d(t,"g",(function(){return ie})),n.d(t,"h",(function(){return re})),n.d(t,"s",(function(){return oe})),n.d(t,"k",(function(){return ce}));var a=n(64),i=n.n(a),r=n(20),o=n.n(r),c=n(11),s=n.n(c),l=n(73),u=n.n(l),d=n(33),g=n.n(d),f=n(13),p=n(1),m=n.n(p),h=n(41),b=n(12),v=n(0),k=n(42),_=n(187),y=n(24),O=n(79),w=n(96),j=n(97),E=n(34),C=n(45);n.d(t,"B",(function(){return C.c}));var x=n(10),D=n(59);n.d(t,"x",(function(){return D.a}));var N=n(90);n.d(t,"z",(function(){return N.a}));var S=n(75);n.d(t,"c",(function(){return S.b})),n.d(t,"m",(function(){return S.c}));var L=n(91);n.d(t,"p",(function(){return L.a}));var M=n(92);function A(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function P(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?A(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):A(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"r",(function(){return M.a}));var R=function(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=Object(f.isFinite)(e)?e:Number(e),Object(f.isFinite)(e)||(console.warn("Invalid number",e,g()(e)),e=0),t)return T(e,{style:"currency",currency:t});var n={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?Object(v.sprintf)(// translators: %s: an abbreviated number in millions.
5
- Object(v.__)("%sM","google-site-kit"),T(R(e),e%10==0?{}:n)):1e4<=e?Object(v.sprintf)(// translators: %s: an abbreviated number in thousands.
6
- Object(v.__)("%sK","google-site-kit"),T(R(e))):1e3<=e?Object(v.sprintf)(// translators: %s: an abbreviated number in thousands.
7
- Object(v.__)("%sK","google-site-kit"),T(R(e),e%10==0?{}:n)):e.toString()},T=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.locale,a=void 0===n?U():n,i=u()(t,["locale"]);return new Intl.NumberFormat(a,i).format(e)},U=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=Object(f.get)(t,["googlesitekit","locale","","lang"]);if(n){var a=n.match(/^(\w{2})?(_)?(\w{2})/);if(a&&a[0])return a[0].replace(/_/g,"-")}return t.navigator.language},q=function(e){switch(e){case"minute":return 60;case"hour":return 3600;case"day":return 86400;case"week":return 604800;case"month":return 2592e3;case"year":return 31536e3}},F=function(e){if(e=parseInt(e,10),isNaN(e)||0===e)return"0.0s";var t={};return t.hours=Math.floor(e/60/60),t.minutes=Math.floor(e/60%60),t.seconds=Math.floor(e%60),((t.hours?t.hours+"h ":"")+(t.minutes?t.minutes+"m ":"")+(t.seconds?t.seconds+"s ":"")).trim()},B=function(e,t){var n=1e3*q("day"),a=e.getTime(),i=t.getTime();return Math.round(Math.abs(a-i)/n)},G=function(e,t){if("0"===e||0===e||isNaN(e))return"";var n=((t-e)/e*100).toFixed(1);return isNaN(n)||"Infinity"===n?"":n},W=function(e,t){return Object(f.map)(e,(function(e,n){return[e[0],e[t]||(0===n?"":0)]}))},H=function(){var t,n;return s.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,s.a.awrap(x.c.get(x.a,"user","authentication"));case 3:t=a.sent,n=t.grantedScopes.filter((function(e){return-1!==t.requiredScopes.indexOf(e)})),e.googlesitekit.setup=e.googlesitekit.setup||{},e.googlesitekit.setup.isAuthenticated=t.isAuthenticated,e.googlesitekit.setup.requiredScopes=t.requiredScopes,e.googlesitekit.setup.grantedScopes=t.grantedScopes,e.googlesitekit.setup.needReauthenticate=n.length<t.requiredScopes.length,a.next=14;break;case 12:a.prev=12,a.t0=a.catch(0);case 14:case"end":return a.stop()}}),null,null,[[0,12]])},K=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.googlesitekit,n=t.modules;return n?Object.keys(n).reduce((function(e,t){return"object"!==g()(n[t])?e:void 0===n[t].slug||void 0===n[t].name||n[t].slug!==t?e:P({},e,o()({},t,n[t]))}),{}):{}},z=function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.googlesitekit,i=a.admin,r=i.connectURL,o=i.adminRoot,c=a.setup.needReauthenticate,s=K(a)[t].screenID,l="pagespeed-insights"===t?{notification:"authentication_success",reAuth:void 0}:{},u=Object(k.a)(o,P({page:t&&n&&s?s:"googlesitekit-dashboard",slug:t,reAuth:n},l));if(!c)return u;var d=encodeURIComponent(Object(_.a)(u));return u=o+"?"+d,Object(k.a)(r,{redirect:u,status:n})},J=function(e,t){return function(n){return function InnerComponent(a){return m.a.createElement(e,i()({},a,t,{OriginalComponent:n}))}}},Z=function(t,n){var a=e.googlesitekit.admin.adminRoot;return t||(t="googlesitekit-dashboard"),n=P({page:t},n),Object(k.a)(a,n)},V=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},Y=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}#x2F;)},$=function(t){var n,a,i,r,o;return s.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return n=e.googlesitekit.admin,a=n.homeURL,i=n.ampMode,r={tagverify:1,timestamp:Date.now()},c.next=4,s.a.awrap(Q(Object(k.a)(a,r),t));case 4:if((o=c.sent)||"secondary"!==i){c.next=9;break}return c.next=8,s.a.awrap(Object(h.default)({path:"/wp/v2/posts?per_page=1"}).then((function(e){return e.slice(0,1).map((function(e){return s.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,s.a.awrap(Q(Object(k.a)(e.link,P({},r,{amp:1})),t));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))})).pop()})));case 8:o=c.sent;case 9:return c.abrupt("return",Promise.resolve(o||null));case 10:case"end":return c.stop()}}))},Q=function(e,t){var n;return s.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,s.a.awrap(fetch(e,{credentials:"omit"}).then((function(e){return e.text()})));case 3:return n=a.sent,a.abrupt("return",X(n,t)||null);case 7:return a.prev=7,a.t0=a.catch(0),a.abrupt("return",null);case 10:case"end":return a.stop()}}),null,null,[[0,7]])},X=function(e,t){var n=({adsense:w.a,analytics:j.a,tagmanager:E.d,setup:O.b}[t]||[]).find((function(t){return t.test(e)}));return!!n&&n.exec(e)[1]},ee=function(e,t,n){return e.setModuleActive(t,n).then((function(e){var n=K();return n[t]&&(n[t].active=e.active),Object(C.c)("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},te=function(t,n,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.googlesitekit,o=K(r)[t],c=o.settings,s=o.setupComplete,l=i||document.getElementById("confirm-changes-".concat(t));if(s&&l){var u=!!Object.keys(n).find((function(e){var t=n[e];return!Object(f.isEqual)(a[e],c[t])}));return i||(l.disabled=!u),u}},ne=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.b)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",J(e,t),1)},ae=function(e){if(!e)return"";var t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)})).replace(/(\\)/g,"");return Object(f.unescape)(t)};function ie(){var e=Object(b.c)("googlesitekit.dateRange","last-28-days").match(/last-(\d+)-days/);if(e&&e[1])return Object(v.sprintf)(Object(v._n)("%s day","%s days",parseInt(e[1],10),"google-site-kit"),e[1]);throw new Error("Unrecognized date range slug used in `googlesitekit.dateRange`.")}function re(){return Object(b.c)("googlesitekit.dateRange","last-28-days")}function oe(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(e.googlesitekit){var o=m.a.createElement(y.a,{id:t,width:a,height:i,className:r});return n?o=m.a.createElement(y.a,{id:"".concat(t,"-disabled"),width:a,height:i,className:r}):"pagespeed-insights"===t&&(o=m.a.createElement("img",{src:e.googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:a,alt:"",className:r})),o}}function ce(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e._googlesitekitBaseData,a=n.blogPrefix;return n.isNetworkMode?t:a+t}}).call(this,n(16))},205:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(15),g=n.n(d),f=n(9),p=n.n(f),m=n(14),h=n.n(m),b=n(118),v=n(1),k=n(0),_=n(12),y=n(49),O=function(t){function NotificationCounter(e){var t;return i()(this,NotificationCounter),(t=s()(this,u()(NotificationCounter).call(this,e))).state={count:0},t.handleIncrement=t.handleIncrement.bind(g()(t)),t.handleDecrement=t.handleDecrement.bind(g()(t)),t}return p()(NotificationCounter,t),o()(NotificationCounter,[{key:"componentDidMount",value:function(){var e=this;Object(_.a)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(_.e)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications"),Object(y.c)().then((function(t){e.setState({count:t})}))})),document.addEventListener("notificationDismissed",this.handleDecrement,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("notificationDismissed",this.handleDecrement)}},{key:"handleIncrement",value:function(){this.setState(y.e)}},{key:"handleDecrement",value:function(){this.setState(y.a)}},{key:"render",value:function(){var t=Object(k.sprintf)(
8
/* translators: %d: the number of notifications */
9
- Object(k._n)("%d notification","%d notifications",this.state.count,"google-site-kit"),this.state.count),n=e.createElement("span",{className:h()("googlesitekit-notifications-counter","update-plugins","count-".concat(this.state.count))},e.createElement("span",{className:"plugin-count","aria-hidden":"true"},this.state.count),e.createElement("span",{className:"screen-reader-text"},t));return Object(b.createPortal)(n,document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"))}}]),NotificationCounter}(v.Component);t.a=O}).call(this,n(1))},217:function(e,t,n){"use strict";(function(e){var a=n(20),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(15),p=n.n(f),m=n(9),h=n.n(m),b=n(3),v=n.n(b),k=n(14),_=n.n(k),y=n(41),O=n(1),w=n(0),j=n(2),E=n(218),C=n(45),x=function(t){function OptIn(e){var t;return o()(this,OptIn),(t=u()(this,g()(OptIn).call(this,e))).state={optIn:Object(C.a)(),error:!1},t.handleOptIn=t.handleOptIn.bind(p()(t)),t}return h()(OptIn,t),s()(OptIn,[{key:"handleOptIn",value:function(e){var t=this,n=!!e.target.checked,a=Object(j.k)("googlesitekit_tracking_optin");Object(C.b)(n),n&&Object(C.c)("tracking_plugin",this.props.optinAction),Object(y.default)({path:"/wp/v2/users/me",method:"POST",data:{meta:i()({},a,n)}}).then((function(){t.setState({optIn:n,error:!1})})).catch((function(e){t.setState({optIn:!n,error:{errorCode:e.code,errorMsg:e.message}})}))}},{key:"render",value:function(){var t=this.state,n=t.optIn,a=t.error,i=this.props,r=i.id,o=i.name,c=i.className,s=Object(w.sprintf)(
10
/* translators: %s: privacy policy URL */
11
- Object(w.__)('Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with <a href="%s" target="_blank" rel="noopener noreferrer">Google Privacy Policy</a>',"google-site-kit"),"https://policies.google.com/privacy");return e.createElement("div",{className:_()("googlesitekit-opt-in",c)},e.createElement(E.a,{id:r,name:o,value:"1",checked:n,onChange:this.handleOptIn},e.createElement("span",{dangerouslySetInnerHTML:Object(j.x)(s,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target","rel"]})})),a&&e.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),OptIn}(O.Component);x.propTypes={id:v.a.string,name:v.a.string,className:v.a.string,optinAction:v.a.string},x.defaultProps={id:"googlesitekit-opt-in",name:"optIn"},t.a=x}).call(this,n(1))},218:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(3),p=n.n(f),m=n(14),h=n.n(m),b=n(1),v=n(25),k=function(t){function Checkbox(e){var t;return i()(this,Checkbox),(t=s()(this,u()(Checkbox).call(this,e))).formFieldRef=Object(b.createRef)(),t.checkboxRef=Object(b.createRef)(),t}return g()(Checkbox,t),o()(Checkbox,[{key:"componentDidMount",value:function(){new v.e(this.formFieldRef.current).input=new v.c(this.checkboxRef.current)}},{key:"render",value:function(){var t=this.props,n=t.onChange,a=t.id,i=t.name,r=t.value,o=t.checked,c=t.disabled,s=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:h()("mdc-checkbox",{"mdc-checkbox--disabled":c}),ref:this.checkboxRef},e.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:i,value:r,checked:o,disabled:c,onChange:n}),e.createElement("div",{className:"mdc-checkbox__background"},e.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},e.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),e.createElement("div",{className:"mdc-checkbox__mixedmark"}))),e.createElement("label",{htmlFor:a},s))}}]),Checkbox}(b.Component);k.propTypes={onChange:p.a.func.isRequired,id:p.a.string.isRequired,name:p.a.string.isRequired,value:p.a.string.isRequired,checked:p.a.bool,disabled:p.a.bool,children:p.a.node.isRequired},k.defaultProps={checked:!1,disabled:!1},t.a=k}).call(this,n(1))},22:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(1),i=function(e){return function(t){return function FilteredComponent(n){return Object(a.createElement)(a.Fragment,{},"",Object(a.createElement)(t,n),e)}}}},24:function(e,t,n){"use strict";(function(e,a){var i=n(3),r=n.n(i),o=n(14),c=n.n(o),s=function SvgIcon(t){var n=t.id,i=t.className,r=t.height,o=t.width,s="".concat(e.googlesitekit.admin.assetsRoot,"svg/svg.svg");return a.createElement("svg",{className:c()("svg",i),height:r,width:o},a.createElement("use",{xlinkHref:"".concat(s,"#").concat(n)}))};s.propTypes={id:r.a.string.isRequired,className:r.a.string,height:r.a.string,width:r.a.string},s.defaultProps={className:"",height:20,width:20},t.a=s}).call(this,n(16),n(1))},25:function(e,t,n){"use strict";var a=n(72),i=n.n(a);n.d(t,"l",(function(){return i.a})),n.d(t,"a",(function(){return a.HelperText})),n.d(t,"b",(function(){return a.Input}));var r=n(101);n.d(t,"h",(function(){return r.a}));var o=n(200);n.d(t,"e",(function(){return o.a}));var c=n(199);n.d(t,"g",(function(){return c.a}));var s=n(80),l=n.n(s);n.d(t,"k",(function(){return l.a})),n.d(t,"j",(function(){return s.Option}));var u=n(201);n.d(t,"i",(function(){return u.a}));var d=n(198);n.d(t,"d",(function(){return d.a}));var g=n(197);n.d(t,"c",(function(){return g.a}));var f=n(196);n.d(t,"f",(function(){return f.a}))},26:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(15),g=n.n(d),f=n(9),p=n.n(f),m=n(3),h=n.n(m),b=n(14),v=n.n(b),k=n(1),_=n(94),y=n(2),O=n(48),w=function(t){function DataBlock(e){var t;return i()(this,DataBlock),(t=s()(this,u()(DataBlock).call(this,e))).handleClick=t.handleClick.bind(g()(t)),t.handleKeyPress=t.handleKeyPress.bind(g()(t)),t}return p()(DataBlock,t),o()(DataBlock,[{key:"handleClick",value:function(){var e=this.props,t=e.stat;(0,e.handleStatSelection)(t)}},{key:"handleKeyPress",value:function(e){e.preventDefault();var t=this.props,n=t.stat,a=t.handleStatSelection;"Enter"!==e.key&&" "!==e.key||a(n)}},{key:"render",value:function(){var t=this.props,n=t.className,a=t.title,i=t.datapoint,r=t.datapointUnit,o=t.change,c=t.changeDataUnit,s=t.context,l=t.period,u=t.selected,d=t.handleStatSelection,g=t.source,f=t.sparkline,p=t.invertChangeColor,m="button"===s?"button":"",h=f;return h&&p&&(h=Object(k.cloneElement)(f,{invertChangeColor:p})),e.createElement("div",{className:v()("googlesitekit-data-block",n,"googlesitekit-data-block--".concat(s),{"googlesitekit-data-block--selected":u}),tabIndex:"button"===s?"0":"-1",role:d&&m,onClick:d&&this.handleClick,onKeyPress:d&&this.handleKeyPress,"aria-label":d&&a,"aria-pressed":d&&u},e.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},e.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},a),e.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(i).concat(r))),h&&e.createElement("div",{className:"googlesitekit-data-block__sparkline"},h),e.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},e.createElement("div",{className:"googlesitekit-data-block__change"},""===o&&e.createElement(k.Fragment,null," "),o&&e.createElement(k.Fragment,null,e.createElement("span",{className:"googlesitekit-data-block__arrow"},e.createElement(_.a,{direction:0<parseFloat(o)?"up":"down",invertColor:p})),e.createElement("span",{className:"googlesitekit-data-block__value"},"".concat(Object(y.t)(Math.abs(o))).concat(c," ").concat(l)))),g&&e.createElement(O.a,{className:"googlesitekit-data-block__source",name:g.name,href:g.link})))}}]),DataBlock}(k.Component);w.propTypes={stat:h.a.number,onClick:h.a.func,className:h.a.string,title:h.a.string,datapoint:h.a.oneOfType([h.a.string,h.a.number]),datapointUnit:h.a.string,change:h.a.oneOfType([h.a.string,h.a.number]),changeDataUnit:h.a.string,context:h.a.string,period:h.a.string,selected:h.a.bool,handleStatSelection:h.a.func,invertChangeColor:h.a.bool},w.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,invertChangeColor:!1},t.a=w}).call(this,n(1))},263:function(e,t,n){"use strict";(function(e,a){n.d(t,"a",(function(){return _}));var i=n(5),r=n.n(i),o=n(6),c=n.n(o),s=n(7),l=n.n(s),u=n(8),d=n.n(u),g=n(9),f=n.n(g),p=n(1),m=n(0),h=n(89),b=n(2),v=n(264),k=n(205),_=function(t){function ActivationApp(){return r()(this,ActivationApp),l()(this,d()(ActivationApp).apply(this,arguments))}return f()(ActivationApp,t),c()(ActivationApp,[{key:"render",value:function(){var t=e._googlesitekitBaseData,n=t.proxySetupURL,i=t.splashURL,r=e.googlesitekit.permissions.canViewDashboard,o=e.googlesitekit.dashboardPermalink,c=n||i,s=Object(m.__)("Start setup","google-site-kit");return r&&(c=o,s=Object(m.__)("Go to Dashboard","google-site-kit")),a.createElement(h.a,null,a.createElement(k.a,null),a.createElement(v.a,{buttonURL:c,buttonLabel:s,onButtonClick:function(){Object(b.B)("plugin_setup",n?"proxy_start_setup_banner":"goto_sitekit")}}))}}]),ActivationApp}(p.Component)}).call(this,n(16),n(1))},264:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return ActivationMain}));var a=n(1),i=n(0),r=n(3),o=n.n(r),c=n(31),s=n(100),l=n(217),u=n(79);function ActivationMain(t){var n=t.buttonURL,r=t.onButtonClick,o=t.buttonLabel;return e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(s.a,null),e.createElement("h3",{className:"googlesitekit-heading-3 googlesitekit-activation__title"},Object(i.__)("Congratulations, the Site Kit plugin is now activated.","google-site-kit")),e.createElement(u.a,null,(function(t){var i=t.complete,s=t.inProgressFeedback,u=t.CTAFeedback;return e.createElement(a.Fragment,null,u,e.createElement(l.a,{optinAction:"analytics_optin_setup_banner"}),e.createElement("div",{className:"googlesitekit-start-setup-wrap"},e.createElement(c.a,{id:"start-setup-link",className:"googlesitekit-start-setup",href:n,onClick:r,disabled:!i},o),s))})))))}ActivationMain.propTypes={buttonURL:o.a.string.isRequired,onButtonClick:o.a.func,buttonLabel:o.a.string.isRequired}}).call(this,n(1))},29:function(e,t,n){"use strict";(function(e){var a=n(20),i=n.n(a),r=n(11),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(7),g=n.n(d),f=n(8),p=n.n(f),m=n(15),h=n.n(m),b=n(9),v=n.n(b),k=n(3),_=n.n(k),y=n(14),O=n.n(y),w=n(13),j=n(1),E=n(24),C=n(59),x=n(10),D=n(26),N=n(31),S=n(60),L=n(71),M=n(18),A=function(t){function Notification(e){var t;return s()(this,Notification),(t=g()(this,p()(Notification).call(this,e))).state={isClosed:!1},t.cardRef=Object(j.createRef)(),t.handleDismiss=t.handleDismiss.bind(h()(t)),t.handleCTAClick=t.handleCTAClick.bind(h()(t)),0<t.props.dismissExpires&&t.expireDismiss(),t.props.showOnce&&x.c.setCache("notification::displayed::".concat(t.props.id),new Date),t}return v()(Notification,t),u()(Notification,[{key:"handleDismiss",value:function(e){var t;return o.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.persist(),e.preventDefault(),!(t=this.props.onDismiss)){n.next=6;break}return n.next=6,o.a.awrap(t(e));case 6:this.dismiss();case 7:case"end":return n.stop()}}),null,this)}},{key:"dismiss",value:function(){var e=this,t=this.cardRef.current;this.setState({isClosed:!0}),setTimeout((function(){x.c.setCache("notification::dismissed::".concat(e.props.id),new Date),t.style.display="none";var n=new Event("notificationDismissed");document.dispatchEvent(n)}),350)}},{key:"handleCTAClick",value:function(e){var t,n,a;return o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.persist(),t=this.props,n=t.isDismissable,!(a=t.onCTAClick)){i.next=5;break}return i.next=5,o.a.awrap(a(e));case 5:n&&this.dismiss();case 6:case"end":return i.stop()}}),null,this)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,n=e.dismissExpires,a=x.c.getCache("notification::dismissed::".concat(t));if(a){var i=new Date(a);i.setSeconds(i.getSeconds()+parseInt(n,10)),i<new Date&&x.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var t,n=this.state.isClosed,a=this.props,r=a.children,o=a.id,c=a.title,s=a.description,l=a.blockData,u=a.winImage,d=a.smallImage,g=a.format,f=a.learnMoreURL,p=a.learnMoreDescription,m=a.learnMoreLabel,h=a.ctaLink,b=a.ctaLabel,v=a.ctaTarget,k=a.type,_=a.dismiss,y=a.isDismissable,A=a.logo,P=a.module,R=a.moduleName,I=a.pageIndex;if(x.c.getCache("notification::dismissed::".concat(o)))return null;var T,U=n?"is-closed":"is-open",q="large"===g&&"win-stats-increase"===k,F="mdc-layout-grid__cell--span-12";"large"===g?(F="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-8-desktop ",q&&(F="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-8-desktop ")):"small"===g&&(F="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),T="win-warning"===k?e.createElement(S.a,null):"win-error"===k?e.createElement(L.a,null):"";var B=e.createElement(j.Fragment,null,l&&e.createElement("div",{className:"mdc-layout-grid__inner"},Object(w.map)(l,(function(t,n){return e.createElement("div",{key:n,className:O()("mdc-layout-grid__cell",{"mdc-layout-grid__cell--span-5-desktop":q,"mdc-layout-grid__cell--span-4-desktop":!q})},e.createElement("div",{className:"googlesitekit-publisher-win__stats"},e.createElement(D.a,t)))})))),G=e.createElement(j.Fragment,null,c&&e.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},c),s&&e.createElement("div",{className:"googlesitekit-publisher-win__desc"},e.createElement("p",null,Object(j.isValidElement)(s)?s:e.createElement("span",{dangerouslySetInnerHTML:Object(C.a)(s,{ALLOWED_TAGS:["strong","em","br","a"],ALLOWED_ATTR:["href"]})}),m&&e.createElement(j.Fragment,null," ",e.createElement(M.a,{href:f,external:!0,inherit:!0},m),p),I&&e.createElement("span",{className:"googlesitekit-publisher-win__detect"},I))),r),W=P?e.createElement(E.a,{id:P,height:"19",width:"19"}):e.createElement(E.a,{id:"logo-g",height:"34",width:"32"});return e.createElement("section",{ref:this.cardRef,className:O()("googlesitekit-publisher-win",(t={},i()(t,"googlesitekit-publisher-win--".concat(g),g),i()(t,"googlesitekit-publisher-win--".concat(k),k),i()(t,"googlesitekit-publisher-win--".concat(U),U),t))},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},A&&e.createElement("div",{className:O()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",{"mdc-layout-grid__cell--order-2-phone":q,"mdc-layout-grid__cell--order-1-tablet":q})},e.createElement("div",{className:"googlesitekit-publisher-win__logo"},W),R&&e.createElement("div",{className:"googlesitekit-publisher-win__module-name"},R)),d&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:d})),e.createElement("div",{className:O()("mdc-layout-grid__cell",F)},q?e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},G),e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--align-bottom"},B)):e.createElement(j.Fragment,null,G,B),h&&e.createElement(N.a,{href:h,target:v,onClick:this.handleCTAClick},b),y&&_&&e.createElement(M.a,{onClick:this.handleDismiss},_)),u&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--order-1-phone mdc-layout-grid__cell--order-2-tablet mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement("div",{className:"googlesitekit-publisher-win__image-large"},e.createElement("img",{alt:"",src:u}))),("win-error"===k||"win-warning"===k)&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("div",{className:"googlesitekit-publisher-win__icons"},T)))))}}]),Notification}(j.Component);A.propTypes={id:_.a.string.isRequired,title:_.a.string.isRequired,description:_.a.node,learnMoreURL:_.a.string,learnMoreDescription:_.a.string,learnMoreLabel:_.a.string,blockData:_.a.array,winImage:_.a.string,smallImage:_.a.string,format:_.a.string,ctaLink:_.a.string,ctaLabel:_.a.string,type:_.a.string,dismiss:_.a.string,isDismissable:_.a.bool,logo:_.a.bool,module:_.a.string,moduleName:_.a.string,pageIndex:_.a.string,dismissExpires:_.a.number,showOnce:_.a.bool,onCTAClick:_.a.func,onDismiss:_.a.func},A.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1},t.a=A}).call(this,n(1))},30:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(3),p=n.n(f),m=n(14),h=n.n(m),b=n(1),v=function(t){function ProgressBar(){return i()(this,ProgressBar),s()(this,u()(ProgressBar).apply(this,arguments))}return g()(ProgressBar,t),o()(ProgressBar,[{key:"render",value:function(){var t=this.props,n=t.className,a=t.small,i=t.compress,r=t.height,o=r?Math.round(r/2):null;return e.createElement("div",{role:"progressbar",style:{marginTop:o,marginBottom:o},className:h()("mdc-linear-progress","mdc-linear-progress--indeterminate",n,{"mdc-linear-progress--small":a,"mdc-linear-progress--compress":i})},e.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),e.createElement("div",{className:"mdc-linear-progress__buffer"}),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),ProgressBar}(b.Component);v.propTypes={className:p.a.string,small:p.a.bool,compress:p.a.bool},v.defaultProps={className:"",small:!1,compress:!1},t.a=v}).call(this,n(1))},31:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(3),p=n.n(f),m=n(14),h=n.n(m),b=n(1),v=n(25),k=function(t){function Button(e){var t;return i()(this,Button),(t=s()(this,u()(Button).call(this,e))).buttonRef=Object(b.createRef)(),t}return g()(Button,t),o()(Button,[{key:"componentDidMount",value:function(){new v.h(this.buttonRef.current)}},{key:"render",value:function(){var t=this.props,n=t.onClick,a=t.children,i=t.href,r=t.text,o=t.className,c=t.danger,s=t.disabled,l=t.target,u=t.id,d=t.icon,g=t.trailingIcon,f=t.ariaHaspopup,p=t.ariaExpanded,m=t.ariaControls,b=i&&!s?"a":"button";return e.createElement(b,{className:h()("mdc-button",o,{"mdc-button--raised":!r,"mdc-button--danger":c}),onClick:n,href:s?void 0:i,ref:this.buttonRef,disabled:!!s,target:l||"_self",id:u,"aria-haspopup":f,"aria-expanded":p,"aria-controls":m},d&&d,e.createElement("span",{className:"mdc-button__label"},a),g&&g)}}]),Button}(b.Component);k.propTypes={onClick:p.a.func,children:p.a.string.isRequired,href:p.a.string,text:p.a.bool,className:p.a.string,danger:p.a.bool,disabled:p.a.bool,icon:p.a.element,trailingIcon:p.a.element,ariaHaspopup:p.a.string,ariaExpanded:p.a.bool,ariaControls:p.a.string},k.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=k}).call(this,n(1))},34:function(e,t,n){"use strict";function a(e){return{byContext:function(t){return e.filter((function(e){return e.usageContext.includes(t)}))}}}function i(e){return(parseInt(e)||0)>0}function r(e){return!!e&&e.toString().match(/^GTM-[A-Z0-9]+#x2F;)}n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return o}));var o=[/<script[^>]*>[^>]+?www.googletagmanager.com\/gtm[^>]+?['|"](GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtm\.js\?id=(GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/ns.html\?id=(GTM-[0-9A-Z]+)['|"]/,/<amp-analytics [^>]*config=['|"]https:\/\/www.googletagmanager.com\/amp.json\?id=(GTM-[0-9A-Z]+)['|"]/]},348:function(e,t,n){"use strict";n.r(t),function(e){var t=n(178),a=n(118),i=n(12),r=n(2),o=(n(181),n(263));Object(t.a)((function(){var t=document.getElementById("js-googlesitekit-activation");t&&(Object(r.r)(),Object(r.B)("plugin_setup","plugin_activated"),Object(a.render)(e.createElement(o.a,null),t),t.classList.remove("googlesitekit-activation--loading"),Object(i.d)("googlesitekit.moduleLoaded","Activation"))}))}.call(this,n(1))},40:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var a=n(54),i="_googlesitekitDataLayer",r="data-googlesitekit-gtag";function o(t,n){var o=Object(a.a)(n);return function(){t.trackingEnabled=!0;var n=e.document;if(!n.querySelector("script[".concat(r,"]"))){var a=n.createElement("script");a.setAttribute(r,""),a.async=!0,a.src="https://www.googletagmanager.com/gtag/js?id=".concat(t.trackingID,"&l=").concat(i),n.head.appendChild(a),o("js",new Date),o("config",t.trackingID)}}}}).call(this,n(16))},41:function(e,t,n){"use strict";(function(e){var a=n(28),i=n.n(a),r=e._googlesitekitAPIFetchData||{},o=r.nonce,c=r.nonceEndpoint,s=r.preloadedData,l=r.rootURL;i.a.nonceEndpoint=c,i.a.nonceMiddleware=i.a.createNonceMiddleware(o),i.a.rootURLMiddleware=i.a.createRootURLMiddleware(l),i.a.preloadingMiddleware=i.a.createPreloadingMiddleware(s),i.a.use(i.a.nonceMiddleware),i.a.use(i.a.mediaUploadMiddleware),i.a.use(i.a.rootURLMiddleware),i.a.use(i.a.preloadingMiddleware),t.default=i.a}).call(this,n(16))},45:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return u}));var a=n(77),i=e._googlesitekitBaseData||{},r={isFirstAdmin:i.isFirstAdmin,trackingEnabled:i.trackingEnabled,trackingID:i.trackingID,referenceSiteURL:i.referenceSiteURL,userIDHash:i.userIDHash},o=Object(a.a)(r),c=o.enableTracking,s=o.disableTracking,l=o.isTrackingEnabled,u=o.trackEvent;function d(e){e?c():s()}d(l())}).call(this,n(16))},48:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(3),p=n.n(f),m=n(14),h=n.n(m),b=n(1),v=n(0),k=n(18),_=function(t){function SourceLink(){return i()(this,SourceLink),s()(this,u()(SourceLink).apply(this,arguments))}return g()(SourceLink,t),o()(SourceLink,[{key:"render",value:function(){var t=this.props,n=t.name,a=t.href,i=t.className,r=t.external;return e.createElement("div",{className:h()("googlesitekit-source-link",i)},[Object(v.__)("Source:","google-site-kit")," ",e.createElement(k.a,{key:"link",href:a,external:r,inherit:!0},n)])}}]),SourceLink}(b.Component);_.propTypes={name:p.a.string,href:p.a.string,className:p.a.string,external:p.a.bool},_.defaultProps={name:"",href:"",className:"",external:!1},t.a=_}).call(this,n(1))},49:function(e,t,n){"use strict";(function(e){n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return g})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return b})),n.d(t,"e",(function(){return v})),n.d(t,"a",(function(){return k}));var a=n(11),i=n.n(a),r=n(12),o=n(13),c=n(2),s=n(116),l=n(10),u=Object(r.c)("googlesitekit.winCallbacks",{}),d=function(){return Object(r.c)("googlesitekit.WinsNotificationsRequest",[])},g=function(){return Object(r.c)("googlesitekit.ModulesNotificationsRequest",[])};function f(){var t,n,a,o;return i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:if((t=e.googlesitekit.setup).isSiteKitConnected&&(t.isAuthenticated||t.isVerified)){c.next=3;break}return c.abrupt("return",0);case 3:return n=0,c.next=6,i.a.awrap(h());case 6:return(a=c.sent)&&a.total&&(n+=a.total),c.next=10,i.a.awrap(b());case 10:return(o=c.sent)&&o.total&&(n+=o.total),n=Object(r.c)("googlesitekit.TotalNotifications",n),n=Math.max(0,Math.abs(n)),e.localStorage&&e.localStorage.setItem("googlesitekit::total-notifications",n),c.abrupt("return",n);case 16:case"end":return c.stop()}}))}var p=function(e){return e?e.length?e.filter((function(e){return!l.c.getCache("notification::dismissed::".concat(e.id))})):e:[]},m=function(e){var t=function(e){return Object.keys(e).slice(0,1).map((function(t){return e[t]}))};if(1>=Object.keys(e).length)return e;var n=Object.values(e).filter((function(e){var t=l.c.getCache("notification::displayed::".concat(e[0].id));if(t){var n=new Date(t),a=new Date,i=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));if(n.setHours(0,0,0),i.setHours(0,0,0),n.getTime()===i.getTime())return!0;7<=Object(c.i)(n,i)&&l.c.deleteCache("notification::displayed::".concat(e[0].id))}return null===t})),a=null,i=[];return 0<Object.keys(n).length?(a=t(n),i[Object.keys(n)[0]]=a):(a=t(e),i[Object.keys(e)[0]]=a)};function h(){var e,t,n,a;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e={},t=0,r.next=4,i.a.awrap(g());case 4:return n=r.sent,a=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,a;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.identifier,r.t0=p,r.next=4,i.a.awrap(l.c.get(l.b,n,"notifications",{},!1));case 4:r.t1=r.sent,a=(0,r.t0)(r.t1),t({identifier:n,notifications:a});case 7:case"end":return r.stop()}}))})),a.push(t);case 2:case"end":return n.stop()}}))})),r.next=9,i.a.awrap(Promise.all(a).then((function(n){n.forEach((function(n){n.notifications.length&&(t+=n.notifications.length,e[n.identifier]=n.notifications)}))})));case 9:return r.abrupt("return",{results:e,total:t});case 10:case"end":return r.stop()}}))}function b(){var e,t,n,a,r;return i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return e={},t=0,c.next=4,i.a.awrap(d());case 4:return n=c.sent,c.next=7,i.a.awrap(new s.a(n).get());case 7:return a=c.sent,r=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,r,c,s,l;return i.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=e.identifier,r=e.callback||Object(o.camelCase)(n),c=null,s=[],e.withData?(l=a[n]||null,c=u[r](l,n)):c=u[r](n),s=p(s=c?[c]:[]),t({identifier:n,notifications:s});case 8:case"end":return i.stop()}}))})),r.push(t);case 2:case"end":return n.stop()}}))})),c.next=12,i.a.awrap(Promise.all(r).then((function(t){t.forEach((function(t){t.notifications.length&&(e[t.identifier]=t.notifications)}))})));case 12:return e=m(e),t=e.length||Object.keys(e).length||0,c.abrupt("return",{results:e,total:t});case 15:case"end":return c.stop()}}))}var v=function(t){var n=Math.abs(t.count)+1;return e.localStorage&&e.localStorage.setItem("googlesitekit::total-notifications",n),{count:n}},k=function(t){var n=Math.max(0,Math.abs(t.count)-1);return e.localStorage&&e.localStorage.setItem("googlesitekit::total-notifications",n),{count:n}}}).call(this,n(16))},54:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(40);function i(e){return function(){e[a.a]=e[a.a]||[],e[a.a].push(arguments)}}},57:function(e,t,n){"use strict";(function(e){var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(1),p=n(29),m=function(t){function GenericError(){return i()(this,GenericError),s()(this,u()(GenericError).apply(this,arguments))}return g()(GenericError,t),o()(GenericError,[{key:"render",value:function(){return e.createElement(p.a,this.props)}}]),GenericError}(f.Component);t.a=m}).call(this,n(1))},58:function(e,t,n){"use strict";var a=n(5),i=n.n(a),r=n(6),o=n.n(r),c=n(7),s=n.n(c),l=n(8),u=n.n(l),d=n(9),g=n.n(d),f=n(51),p=n(1),m=function(e){function ModuleSettingsWarning(){return i()(this,ModuleSettingsWarning),s()(this,u()(ModuleSettingsWarning).apply(this,arguments))}return g()(ModuleSettingsWarning,e),o()(ModuleSettingsWarning,[{key:"render",value:function(){return null}}]),ModuleSettingsWarning}(p.Component);t.a=Object(f.a)("googlesitekit.ModuleSettingsWarning")(m)},59:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(93),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{__html:a.a.sanitize(e,t)}}},60:function(e,t,n){"use strict";(function(e){t.a=function Warning(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#F9BB2D",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"warning-title warning-desc"},e.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),e.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))}}).call(this,n(1))},67:function(e,t,n){"use strict";(function(e,a){var i=n(0),r=n(29);t.a=function DashboardAuthAlert(){var t=e.googlesitekit.admin.connectURL;return a.createElement(r.a,{id:"authentication error",title:Object(i.__)("Issue accessing data","google-site-kit"),description:Object(i.__)("You need to reauthenticate your Google account.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0,ctaLink:t,ctaLabel:Object(i.__)("Click here","google-site-kit")})}}).call(this,n(16),n(1))},71:function(e,t,n){"use strict";(function(e){t.a=function Error(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#EA4336",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"error-title error-desc"},e.createElement("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z"}))}}).call(this,n(1))},75:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l}));var a=n(50),i=n.n(a),r=n(0),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null,n=null,a=document.querySelector("#toplevel_page_googlesitekit-dashboard .googlesitekit-notifications-counter"),i=document.querySelector("#wp-admin-bar-google-site-kit .googlesitekit-notifications-counter");if(a&&i)return!1;if(t=document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"),n=document.querySelector("#wp-admin-bar-google-site-kit .ab-item"),null===t&&null===n)return!1;var o=document.createElement("span");o.setAttribute("class","googlesitekit-notifications-counter update-plugins count-".concat(e));var c=document.createElement("span");c.setAttribute("class","plugin-count"),c.setAttribute("aria-hidden","true"),c.textContent=e;var s=document.createElement("span");return s.setAttribute("class","screen-reader-text"),s.textContent=Object(r.sprintf)(
12
/* translators: %d is the number of notifications */
13
- Object(r._n)("%d notification","%d notifications",e,"google-site-kit"),e),o.appendChild(c),o.appendChild(s),t&&null===a&&t.appendChild(o),n&&null===i&&n.appendChild(o),o},c=function(){e.localStorage&&e.localStorage.clear(),e.sessionStorage&&e.sessionStorage.clear()},s=function(e){for(var t=location.search.substr(1).split("&"),n={},a=0;a<t.length;a++)n[t[a].split("=")[0]]=decodeURIComponent(t[a].split("=")[1]);return e?n.hasOwnProperty(e)?decodeURIComponent(n[e].replace(/\+/g," ")):"":n},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,n=new URL(t.href);if(e)return n.searchParams&&n.searchParams.get?n.searchParams.get(e):s(e);var a={},r=!0,o=!1,c=void 0;try{for(var l,u=n.searchParams.entries()[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){var d=i()(l.value,2),g=d[0],f=d[1];a[g]=f}}catch(e){o=!0,c=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw c}}return a}}).call(this,n(16))},76:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return g}));var a=n(11),i=n.n(a),r=n(10);function o(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(r.c.get(r.a,"site","notifications",{},!1));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}))}var c=n(45),s="accepted",l="dismissed";function u(e,t){return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return r.c.invalidateCacheGroup(r.a,"site","notifications"),Object(c.c)("site_notifications",t,e),n.next=4,i.a.awrap(r.c.set(r.a,"site","mark-notification",{notificationID:e,notificationState:t}));case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}))}function d(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(u(e,s));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}function g(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(u(e,l));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}},77:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var a=n(20),i=n.n(a),r=n(40),o=n(78);function c(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}var s={isFirstAdmin:!1,trackingEnabled:!1,trackingID:"",referenceSiteURL:"",userIDHash:""};function l(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},s,{},t);return a.referenceSiteURL&&(a.referenceSiteURL=a.referenceSiteURL.toString().replace(/\/+#x2F;,"")),{enableTracking:Object(r.b)(a,n),disableTracking:function(){a.trackingEnabled=!1},isTrackingEnabled:function(){return!!a.trackingEnabled},trackEvent:Object(o.a)(a,n)}}}).call(this,n(16))},78:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(54);function i(e,t){var n=Object(a.a)(t);return function(t,a){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.isFirstAdmin,c=e.referenceSiteURL,s=e.trackingEnabled,l=e.trackingID,u=e.userIDHash;s&&n("event",a,{send_to:l,event_category:t,event_label:i,event_value:r,dimension1:c,dimension2:o?"true":"false",dimension3:u})}}},79:function(e,t,n){"use strict";(function(e,a){n.d(t,"b",(function(){return x})),n.d(t,"a",(function(){return N}));var i=n(73),r=n.n(i),o=n(5),c=n.n(o),s=n(6),l=n.n(s),u=n(7),d=n.n(u),g=n(8),f=n.n(g),p=n(9),m=n.n(p),h=n(11),b=n.n(h),v=n(1),k=n(0),_=n(3),y=n.n(_),O=n(60),w=n(30),j=n(2),E=n(10),C=n(18),x=[/<meta name="googlesitekit-setup" content="([a-z0-9-]+)"/],D=[function(){var t;return b.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.location.hostname,!["localhost","127.0.0.1"].includes(t)&&!t.match(/\.(example|invalid|localhost|test)#x2F;)){n.next=3;break}throw"invalid_hostname";case 3:case"end":return n.stop()}}))},function(){var e,t,n;return b.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,b.a.awrap(E.c.set(E.a,"site","setup-tag"));case 2:return e=a.sent,t=e.token,a.next=6,b.a.awrap(Object(j.j)("setup").catch((function(){throw"tag_fetch_failed"})));case 6:if(n=a.sent,t===n){a.next=9;break}throw"setup_token_mismatch";case 9:case"end":return a.stop()}}))}],N=function(t){function CompatibilityChecks(t){var n;c()(this,CompatibilityChecks);var a=e.googlesitekit.setup.isSiteKitConnected;return(n=d()(this,f()(CompatibilityChecks).call(this,t))).state={complete:a,error:null,developerPlugin:{}},n}return m()(CompatibilityChecks,t),l()(CompatibilityChecks,[{key:"componentDidMount",value:function(){var e,t,n,a;return b.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.state.complete){i.next=2;break}return i.abrupt("return");case 2:i.prev=2,e=0,t=D;case 4:if(!(e<t.length)){i.next=11;break}return n=t[e],i.next=8,b.a.awrap(n());case 8:e++,i.next=4;break;case 11:i.next=19;break;case 13:return i.prev=13,i.t0=i.catch(2),i.next=17,b.a.awrap(E.c.get(E.a,"site","developer-plugin"));case 17:a=i.sent,this.setState({error:i.t0,developerPlugin:a});case 19:this.setState({complete:!0});case 20:case"end":return i.stop()}}),null,this,[[2,13]])}},{key:"helperCTA",value:function(){var e=this.state.developerPlugin,t=e.installed,n=e.active,a=e.installURL,i=e.activateURL,r=e.configureURL;return!t&&a?{labelHTML:Object(k.__)('Install<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:a,external:!1}:t&&!n&&i?{labelHTML:Object(k.__)('Activate<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:i,external:!1}:t&&n&&r?{labelHTML:Object(k.__)('Configure<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:r,external:!1}:{labelHTML:Object(k.__)('Learn how<span class="screen-reader-text"> to install and use the helper plugin</span>',"google-site-kit"),href:"https://sitekit.withgoogle.com/documentation/using-site-kit-on-a-staging-environment/",external:!0}}},{key:"renderError",value:function(e){var t=this.state.developerPlugin.installed,n=this.helperCTA(),i=n.labelHTML,r=n.href,o=n.external;switch(e){case"invalid_hostname":case"tag_fetch_failed":return a.createElement(v.Fragment,null,!t&&Object(k.__)("Looks like this may be a staging environment. If so, you’ll need to install a helper plugin and verify your production site in Search Console.","google-site-kit"),t&&Object(k.__)("Looks like this may be a staging environment and you already have the helper plugin. Before you can use Site Kit, please make sure you’ve provided the necessary credentials in the Authentication section and verified your production site in Search Console.","google-site-kit")," ",a.createElement(C.a,{href:r,dangerouslySetInnerHTML:{__html:i},external:o,inherit:!0}));case"setup_token_mismatch":return Object(k.__)("Looks like you may be using a caching plugin which could interfere with setup. Please deactivate any caching plugins before setting up Site Kit. You may reactivate them once setup has been completed.","google-site-kit")}}},{key:"render",value:function(){var e,t,n=this.state,i=n.complete,o=n.error,c=this.props,s=c.children,l=r()(c,["children"]);return o&&(e=a.createElement(v.Fragment,null,a.createElement("div",{className:"googlesitekit-setup-compat mdc-layout-grid mdc-layout-grid--align-left"},a.createElement("div",{className:"mdc-layout-grid__inner"},a.createElement(O.a,null),a.createElement("div",{className:"googlesitekit-heading-4 mdc-layout-grid__cell--span-11"},Object(k.__)("Your site may not be ready for Site Kit","google-site-kit"))),a.createElement("p",null,this.renderError(o))))),i||(t=a.createElement("div",{style:{alignSelf:"center",marginLeft:"1rem"}},a.createElement("small",null,Object(k.__)("Checking Compatibility...","google-site-kit")),a.createElement(w.a,{small:!0,compress:!0}))),s({restProps:l,complete:i,error:o,inProgressFeedback:t,CTAFeedback:e})}}]),CompatibilityChecks}(v.Component);N.propTypes={children:y.a.func.isRequired}}).call(this,n(16),n(1))},89:function(e,t,n){"use strict";(function(e,a){var i=n(5),r=n.n(i),o=n(6),c=n.n(o),s=n(7),l=n.n(s),u=n(8),d=n.n(u),g=n(9),f=n.n(g),p=n(3),m=n.n(p),h=n(1),b=n(0),v=n(29),k=function(t){function ErrorHandler(e){var t;return r()(this,ErrorHandler),(t=l()(this,d()(ErrorHandler).call(this,e))).state={error:null,info:null},t}return f()(ErrorHandler,t),c()(ErrorHandler,[{key:"componentDidCatch",value:function(t,n){e.console.error("Caught an error:",t,n),this.setState({error:t,info:n})}},{key:"render",value:function(){var e=this.props.children,t=this.state,n=t.error,i=t.info;return n?a.createElement(v.a,{id:"googlesitekit-error",title:Object(b.__)("Site Kit encountered an error","google-site-kit"),description:a.createElement("code",null,n.message),isDismissable:!1,format:"small",type:"win-error"},a.createElement("pre",null,i.componentStack)):e}}]),ErrorHandler}(h.Component);k.defaultProps={},k.propTypes={children:m.a.node.isRequired},t.a=k}).call(this,n(16),n(1))},90:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(33),i=n.n(a),r=n(121),o=n.n(r),c=function(e){return o()(JSON.stringify(function e(t){var n={};Object.keys(t).sort().forEach((function(a){var r=t[a];r&&"object"===i()(r)&&!Array.isArray(r)&&(r=e(r)),n[a]=r}));return n}(e)))}},91:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var a,i=n(5),r=n.n(i),o=n(6),c=n.n(o),s=function(t){var n=e[t];if(!n)return!1;try{var a="__storage_test__";return n.setItem(a,a),n.removeItem(a),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==n.length}},l=function(){function NullStorage(){r()(this,NullStorage)}return c()(NullStorage,[{key:"key",value:function(){return null}},{key:"getItem",value:function(){return null}},{key:"setItem",value:function(){}},{key:"removeItem",value:function(){}},{key:"clear",value:function(){}},{key:"length",get:function(){return 0}}]),NullStorage}(),u=function(){return a||(a=s("sessionStorage")?e.sessionStorage:s("localStorage")?e.localStorage:new l),a}}).call(this,n(16))},92:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var a=n(0);function i(){Object(a.setLocaleData)(e.googlesitekit.locale,"google-site-kit")}}).call(this,n(16))},93:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var a=n(120),i=n.n(a)()(e)}).call(this,n(16))},94:function(e,t,n){"use strict";(function(e){var a=n(3),i=n.n(a),r=n(14),o=n.n(r);function ChangeArrow(t){var n=t.direction,a=t.invertColor;return e.createElement("svg",{className:o()("googlesitekit-change-arrow","googlesitekit-change-arrow--".concat(n),{"googlesitekit-change-arrow--inverted-color":a}),width:"9",height:"9",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.625 10L5.625 2.375L9.125 5.875L10 5L5 -1.76555e-07L-2.7055e-07 5L0.875 5.875L4.375 2.375L4.375 10L5.625 10Z",fill:"currentColor"}))}ChangeArrow.propTypes={direction:i.a.string,invertColor:i.a.bool},ChangeArrow.defaultProps={direction:"up",invertColor:!1},t.a=ChangeArrow}).call(this,n(1))},95:function(e,t,n){"use strict";(function(e){var a=n(0),i=n(29);t.a=function DashboardPermissionAlert(){return e.createElement(i.a,{id:"permission error",title:Object(a.__)("Permissions issue accessing data","google-site-kit"),description:Object(a.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})}}).call(this,n(1))},96:function(e,t,n){"use strict";t.a=[/google_ad_client: ?["|'](.*?)["|']/,/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/]},97:function(e,t,n){"use strict";t.a=[/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/,/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/,/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/,/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/,/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/]}});
1
+ !function(e){function t(t){for(var a,o,c=t[0],s=t[1],u=t[2],d=0,g=[];d<c.length;d++)o=c[d],Object.prototype.hasOwnProperty.call(i,o)&&i[o]&&g.push(i[o][0]),i[o]=0;for(a in s)Object.prototype.hasOwnProperty.call(s,a)&&(e[a]=s[a]);for(l&&l(t);g.length;)g.shift()();return r.push.apply(r,u||[]),n()}function n(){for(var e,t=0;t<r.length;t++){for(var n=r[t],a=!0,o=1;o<n.length;o++){var c=n[o];0!==i[c]&&(a=!1)}a&&(r.splice(t--,1),e=__webpack_require__(__webpack_require__.s=n[0]))}return e}var a={},i={8:0},r=[];function __webpack_require__(t){if(a[t])return a[t].exports;var n=a[t]={i:t,l:!1,exports:{}};return e[t].call(n.exports,n,n.exports,__webpack_require__),n.l=!0,n.exports}__webpack_require__.m=e,__webpack_require__.c=a,__webpack_require__.d=function(e,t,n){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(__webpack_require__.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)__webpack_require__.d(n,a,function(t){return e[t]}.bind(null,a));return n},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var o=window.webpackJsonp=window.webpackJsonp||[],c=o.push.bind(o);o.push=t,o=o.slice();for(var s=0;s<o.length;s++)t(o[s]);var l=c;r.push([392,0]),n()}({1:function(e,t,n){"use strict";(function(e){n.d(t,"d",(function(){return c})),n.d(t,"a",(function(){return s})),n.d(t,"e",(function(){return u})),n.d(t,"f",(function(){return d})),n.d(t,"g",(function(){return g})),n.d(t,"h",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"i",(function(){return v})),n.d(t,"j",(function(){return k})),n.d(t,"k",(function(){return w})),n.d(t,"c",(function(){return C})),n.d(t,"l",(function(){return D})),n.d(t,"m",(function(){return S})),n.d(t,"n",(function(){return L})),n.d(t,"o",(function(){return R})),n.d(t,"p",(function(){return P})),n.d(t,"q",(function(){return I})),n.d(t,"r",(function(){return T}));var a=n(102);void 0===e.googlesitekit&&(e.googlesitekit={});var i=e.googlesitekit._element||a,r=i.__experimentalCreateInterpolateElement,o=i.Children,c=i.cloneElement,s=i.Component,l=i.concatChildren,u=i.createContext,d=i.createElement,g=i.createPortal,f=i.createRef,p=i.findDOMNode,m=i.forwardRef,h=i.Fragment,b=i.isEmptyElement,v=i.isValidElement,k=i.lazy,_=i.memo,y=i.Platform,O=i.RawHTML,w=i.render,E=i.renderToString,j=i.StrictMode,C=i.Suspense,x=i.switchChildrenNodeName,N=i.unmountComponentAtNode,D=i.useCallback,S=i.useContext,A=i.useDebugValue,L=i.useEffect,M=i.useImperativeHandle,R=i.useLayoutEffect,P=i.useMemo,I=i.useReducer,T=i.useRef,U=i.useState;void 0===e.googlesitekit._element&&(e.googlesitekit._element={__experimentalCreateInterpolateElement:r,Children:o,cloneElement:c,Component:s,concatChildren:l,createContext:u,createElement:d,createPortal:g,createRef:f,findDOMNode:p,forwardRef:m,Fragment:h,isEmptyElement:b,isValidElement:v,lazy:k,memo:_,Platform:y,RawHTML:O,render:w,renderToString:E,StrictMode:j,Suspense:C,switchChildrenNodeName:x,unmountComponentAtNode:N,useCallback:D,useContext:S,useDebugValue:A,useEffect:L,useImperativeHandle:M,useLayoutEffect:R,useMemo:P,useReducer:I,useRef:T,useState:U})}).call(this,n(16))},100:function(e,t,n){"use strict";(function(e){n(1);var a=n(3),i=n.n(a),r=n(14),o=n.n(r);function ChangeArrow(t){var n=t.direction,a=t.invertColor;return e.createElement("svg",{className:o()("googlesitekit-change-arrow","googlesitekit-change-arrow--".concat(n),{"googlesitekit-change-arrow--inverted-color":a}),width:"9",height:"9",viewBox:"0 0 10 10",fill:"none",xmlns:"http://www.w3.org/2000/svg"},e.createElement("path",{d:"M5.625 10L5.625 2.375L9.125 5.875L10 5L5 -1.76555e-07L-2.7055e-07 5L0.875 5.875L4.375 2.375L4.375 10L5.625 10Z",fill:"currentColor"}))}ChangeArrow.propTypes={direction:i.a.string,invertColor:i.a.bool},ChangeArrow.defaultProps={direction:"up",invertColor:!1},t.a=ChangeArrow}).call(this,n(11))},101:function(e,t,n){"use strict";(function(e){n(1);var a=n(0),i=n(29);t.a=function DashboardPermissionAlert(){return e.createElement(i.a,{id:"permission error",title:Object(a.__)("Permissions issue accessing data","google-site-kit"),description:Object(a.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})}}).call(this,n(11))},117:function(e,t,n){"use strict";(function(e){var a=n(10),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(7),g=n.n(d),f=n(8),p=n.n(f),m=n(1),h=n(0),b=n(74),v=n(29),k=function(t){function DashboardCoreSiteAlerts(e){var t;return o()(this,DashboardCoreSiteAlerts),(t=u()(this,g()(DashboardCoreSiteAlerts).call(this,e))).state={notifications:!1},t}return p()(DashboardCoreSiteAlerts,t),s()(DashboardCoreSiteAlerts,[{key:"componentDidMount",value:function(){var e;return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,i.a.awrap(Object(b.c)());case 3:e=t.sent,this.setState({notifications:e}),t.next=10;break;case 7:t.prev=7,t.t0=t.catch(0),console.warn("Error caught while fetching notifications",t.t0);case 10:case"end":return t.stop()}}),null,this,[[0,7]])}},{key:"render",value:function(){var t=this.state.notifications;return Array.isArray(t)?t.map((function(t){return e.createElement(v.a,{key:t.id,id:t.id,title:t.title||"",description:t.content||"",learnMoreURL:t.learnMoreURL||"",learnMoreLabel:t.learnMoreLabel||"",ctaLink:t.ctaURL||"",ctaLabel:t.ctaLabel||"",ctaTarget:t.ctaTarget||"",dismiss:t.dismissLabel||Object(h.__)("OK, Got it!","google-site-kit"),isDismissable:t.dismissible,onCTAClick:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(b.a)(t.id));case 2:case"end":return e.stop()}}))},onDismiss:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(Object(b.b)(t.id));case 2:case"end":return e.stop()}}))}})})):null}}]),DashboardCoreSiteAlerts}(m.a);t.a=k}).call(this,n(11))},118:function(e,t,n){"use strict";(function(e,a){var i=n(4),r=n.n(i),o=n(5),c=n.n(o),s=n(6),l=n.n(s),u=n(7),d=n.n(u),g=n(8),f=n.n(g),p=n(1),m=n(0),h=n(12),b=n(2),v=n(29),k=n(119),_=function(t){function DashboardSetupAlerts(){return r()(this,DashboardSetupAlerts),l()(this,d()(DashboardSetupAlerts).apply(this,arguments))}return f()(DashboardSetupAlerts,t),c()(DashboardSetupAlerts,[{key:"render",value:function(){var t=Object(b.m)("notification");if(!t||""===t)return null;var n={id:"connected-successfully",setupTitle:Object(m.__)("Site Kit","google-site-kit"),description:Object(m.__)("Now you’ll be able to see how your site is doing in search. To get even more detailed stats, activate more modules. Here are our recommendations for what to include in your Site Kit:","google-site-kit"),learnMore:{label:"",url:"",description:""}},i=e.googlesitekit.permissions.canManageOptions;switch(t){case"authentication_success":if(!i)return null;var r=Object(b.l)(),o=Object(b.m)("slug");return o&&r[o]&&!r[o].active?null:(o&&r[o]&&(n.id="".concat(n.id,"-").concat(o),n.setupTitle=r[o].name,n.description=Object(m.__)("Here are some other services you can connect to see even more stats:","google-site-kit"),n=Object(h.c)(" global.googlesitekit.SetupWinNotification-".concat(o),n)),a.createElement(p.b,null,a.createElement(v.a,{id:n.id
2
+ /* translators: %s: the name of a module that setup was completed for */,title:Object(m.sprintf)(Object(m.__)("Congrats on completing the setup for %s!","google-site-kit"),n.setupTitle),description:n.description,handleDismiss:function(){},winImage:e.googlesitekit.admin.assetsRoot+"images/rocket.png",dismiss:Object(m.__)("OK, Got it!","google-site-kit"),format:"large",type:"win-success",learnMoreLabel:n.learnMore.label,learnMoreDescription:n.learnMore.description,learnMoreURL:n.learnMore.url},a.createElement(k.a,null))));case"authentication_failure":return a.createElement(p.b,null,a.createElement(v.a,{id:"connection error",title:Object(m.__)("There was a problem connecting to Google!","google-site-kit"),description:"",handleDismiss:function(){},format:"small",type:"win-error"}))}}}]),DashboardSetupAlerts}(p.a);t.a=_}).call(this,n(16),n(11))},119:function(e,t,n){"use strict";(function(e,a){var i=n(10),r=n.n(i),o=n(4),c=n.n(o),s=n(5),l=n.n(s),u=n(6),d=n.n(u),g=n(7),f=n.n(g),p=n(15),m=n.n(p),h=n(8),b=n.n(h),v=n(1),k=n(13),_=n(14),y=n.n(_),O=n(0),w=n(2),E=n(71),j=n(19),C=n(9),x=n(57),N=n(58),D=function(t){function ModulesList(e){var t;return c()(this,ModulesList),(t=d()(this,f()(ModulesList).call(this,e))).setupModuleClick=t.setupModuleClick.bind(m()(t)),t}return b()(ModulesList,t),l()(ModulesList,[{key:"setupModuleClick",value:function(t){return r.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,this.setState({isSaving:!0}),n.next=4,r.a.awrap(Object(w.a)(C.c,t,!0));case 4:return n.next=6,r.a.awrap(Object(E.a)());case 6:e.location=Object(w.n)(t,!0),n.next=13;break;case 9:n.prev=9,n.t0=n.catch(0),Object(w.x)(x.a,{id:"setup-module-error",title:Object(O.__)("Internal Server Error","google-site-kit"),description:n.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 13:case"end":return n.stop()}}),null,this,[[0,9]])}},{key:"render",value:function(){var e=this,t=Object(w.l)(),n=Object.values(t).filter((function(e){return!e.internal})),i=n.filter((function(e){return e.active&&e.setupComplete})).reduce((function(e,t){return e[t.slug]=t.name,e}),{}),r=n.filter((function(e){return 0===e.required.length})).sort((function(e,t){return e.sort-t.sort}));return a.createElement("div",{className:"googlesitekit-modules-list"},Object(k.map)(r,(function(t){var n=!1,r="",o=t.slug,c=t.name,s=t.setupComplete,l=t.required;return 0<l.length&&l.forEach((function(e){i[e]&&(n=!0,r=i[e])})),a.createElement("div",{key:o,className:y()("googlesitekit-modules-list__module","googlesitekit-modules-list__module--".concat(o),{"googlesitekit-modules-list__module--disabled":n})},a.createElement("div",{className:"googlesitekit-settings-connect-module__wrapper"},a.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},Object(w.s)(o,n)),a.createElement("h3",{className:"googlesitekit-settings-connect-module__title"},c)),a.createElement(N.a,{slug:o,context:"modules-list"}),s&&a.createElement("span",{className:"googlesitekit-settings-module__status"},a.createElement("span",{className:"googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected"},a.createElement("span",{className:"screen-reader-text"},Object(O.__)("Connected","google-site-kit"))),Object(O.__)("Connected","google-site-kit")),!s&&!n&&a.createElement(j.a,{arrow:!0,small:!0,inherit:!0,onClick:function(){e.setupModuleClick(o)}}," ",Object(O.__)("Connect Service","google-site-kit")),!s&&n&&a.createElement(j.a,{disabled:!0,small:!0,inherit:!0},
3
/* translators: %s: parent module name */
4
+ Object(O.sprintf)(Object(O.__)("Enable %s to start setup","google-site-kit"),r)))})))}}]),ModulesList}(v.a);t.a=D}).call(this,n(16),n(11))},12:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return r})),n.d(t,"b",(function(){return o})),n.d(t,"f",(function(){return c})),n.d(t,"g",(function(){return s})),n.d(t,"e",(function(){return l})),n.d(t,"d",(function(){return f})),n.d(t,"c",(function(){return p}));var a=n(96);void 0===e.googlesitekit&&(e.googlesitekit={});var i=e.googlesitekit._hooks||a,r=i.addAction,o=i.addFilter,c=i.removeAction,s=i.removeFilter,l=i.hasAction,u=i.hasFilter,d=i.removeAllActions,g=i.removeAllFilters,f=i.doAction,p=i.applyFilters,m=i.currentAction,h=i.currentFilter,b=i.doingAction,v=i.doingFilter,k=i.didAction,_=i.didFilter,y=i.actions,O=i.filters;void 0===e.googlesitekit._hooks&&(e.googlesitekit._hooks={addAction:r,addFilter:o,removeAction:c,removeFilter:s,hasAction:l,hasFilter:u,removeAllActions:d,removeAllFilters:g,doAction:f,applyFilters:p,currentAction:m,currentFilter:h,doingAction:b,doingFilter:v,didAction:k,didFilter:_,actions:y,filters:O})}).call(this,n(16))},120:function(e,t,n){"use strict";(function(e,a){var i=n(4),r=n.n(i),o=n(5),c=n.n(o),s=n(6),l=n.n(s),u=n(7),d=n.n(u),g=n(8),f=n.n(g),p=n(1),m=n(13),h=n(0),b=n(2),v=n(29),k=n(48),_=function(t){function DashboardModulesAlerts(e){var t;return r()(this,DashboardModulesAlerts),(t=l()(this,d()(DashboardModulesAlerts).call(this,e))).state={data:!1},t}return f()(DashboardModulesAlerts,t),c()(DashboardModulesAlerts,[{key:"componentDidMount",value:function(){var e=this,t=Object(k.f)();t&&Object(k.b)(t).then((function(t){e.setState({data:t.results})}))}},{key:"render",value:function(){var t=this.state.data;if(0===Object.keys(t).length)return null;var n=Object(b.l)(),i=[];return Object.keys(t).forEach((function(r){Object(m.each)(t[r],(function(t){i.push(e.createElement(v.a,{key:t.id,id:t.id,title:t.title||"",description:t.description||"",blockData:t.blockData||[],winImage:t.winImage?"".concat(a.googlesitekit.admin.assetsRoot,"images/").concat(t.winImage):"",format:t.format||"small",learnMoreURL:t.learnMoreURL||"",learnMoreDescription:t.learnMoreDescription||"",learnMoreLabel:t.learnMoreLabel||"",ctaLink:t.ctaURL||"",ctaLabel:t.ctaLabel||"",ctaTarget:t.ctaTarget||"",type:t.severity||"",dismiss:t.dismiss||Object(h.__)("OK, Got it!","google-site-kit"),isDismissable:t.isDismissable||!0,logo:t.logo||!0,module:r,moduleName:n[r].name,pageIndex:t.pageIndex||"",dismissExpires:t.dismissExpires||0,showOnce:t.showOnce||!1}))}))})),e.createElement(p.b,null,i)}}]),DashboardModulesAlerts}(p.a);t.a=_}).call(this,n(11),n(16))},121:function(e,t,n){"use strict";var a=n(10),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(13),u=n(9),d=function(){function WinsWithData(e){o()(this,WinsWithData),this.wins=e,this.response=[]}return s()(WinsWithData,[{key:"get",value:function(){var e,t=this;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return e=Object(l.filter)(this.wins.map((function(e){return!!e.withData&&(e.withData.callback=function(n){t.response[e.identifier]=n},e.withData)}))),n.next=3,i.a.awrap(u.c.combinedGetFromCache(e));case 3:return n.abrupt("return",this.response);case 4:case"end":return n.stop()}}),null,this)}}]),WinsWithData}();t.a=d},122:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(1),p=n(13),m=n(0),h=n(12),b=n(29),v=n(48),k=function(t){function DashboardWinsAlerts(e){var t;return i()(this,DashboardWinsAlerts),(t=s()(this,u()(DashboardWinsAlerts).call(this,e))).state={data:!1},t}return g()(DashboardWinsAlerts,t),o()(DashboardWinsAlerts,[{key:"componentWillMount",value:function(){var e=this;Object(h.a)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(h.f)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications");var t=Object(v.g)();t&&Object(v.d)(t).then((function(t){e.setState({data:t.results})}))}))}},{key:"render",value:function(){var t=this.state.data;if(0===Object.keys(t).length)return null;var n=[];return Object.keys(t).forEach((function(a){Object(p.each)(t[a],(function(t){n.push(e.createElement(b.a,{key:t.id,id:t.id,title:t.title||"",description:t.description||"",blockData:t.blockData||[],winImage:t.winImage||"",format:t.format||"small",learnMoreURL:t.learnMoreURL||"",learnMoreDescription:t.learnMoreDescription||"",learnMoreLabel:t.learnMoreLabel||"",ctaLink:t.ctaLink||"",ctaLabel:t.ctaLabel||"",type:t.severity||"",dismiss:t.dismiss||Object(m.__)("OK, Got it!","google-site-kit"),isDismissable:t.isDismissable||!0,logo:t.logo||!1,pageIndex:t.pageIndex||"",dismissExpires:t.dismissExpires||0,showOnce:t.showOnce||!1}))}))})),e.createElement(f.b,null,n)}}]),DashboardWinsAlerts}(f.a);t.a=k}).call(this,n(11))},188:function(e,t,n){"use strict";(function(e,t){n(1);var a=n(12),i=n(22),r=n(2),o=n(117),c=n(118),s=n(120),l=n(122),u=n(70),d=e.googlesitekit.setup,g=Object(r.m)("notification"),f=Object(i.a)(t.createElement(o.a,null)),p=Object(i.a)(t.createElement(c.a,null)),m=Object(i.a)(t.createElement(s.a,null)),h=Object(i.a)(t.createElement(l.a,null)),b=Object(i.a)(t.createElement(u.a,null));Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",f,10),d.needReauthenticate&&Object(a.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",b,1),"authentication_success"===g||"authentication_failure"===g?Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",p,1):d.isAuthenticated&&d.isVerified&&(Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.ModulesNotification",m,1),Object(a.b)("googlesitekit.DashboardNotifications","googlesitekit.WinsNotification",h,1))}).call(this,n(16),n(11))},19:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(1),p=n(3),m=n.n(p),h=n(14),b=n.n(h),v=function(t){function Link(){return i()(this,Link),s()(this,u()(Link).apply(this,arguments))}return g()(Link,t),o()(Link,[{key:"render",value:function(){var t=this.props,n=t.dangerouslySetInnerHTML,a=t.onClick,i=t.href,r=t.children,o=t.className,c=t.arrow,s=t.external,l=t.inverse,u=t.back,d=t.small,g=t.inherit,f=t.caps,p=t.danger,m=t.disabled,h=t.id,v=i&&!m,k=v?"a":"button";return e.createElement(k,{className:b()("googlesitekit-cta-link",o,{"googlesitekit-cta-link--arrow":c,"googlesitekit-cta-link--external":s,"googlesitekit-cta-link--inverse":l,"googlesitekit-cta-link--back":u,"googlesitekit-cta-link--small":d,"googlesitekit-cta-link--inherit":g,"googlesitekit-cta-link--caps":f,"googlesitekit-cta-link--danger":p,"googlesitekit-cta-link--disabled":m}),onClick:a,id:h,href:v?i:void 0,target:v&&s?"_blank":void 0,rel:s?"noopener noreferrer":void 0,disabled:m,dangerouslySetInnerHTML:n},r)}}]),Link}(f.a);v.propTypes={dangerouslySetInnerHTML:m.a.shape({__html:m.a.string}),onClick:m.a.func,href:m.a.string,children:m.a.oneOfType([m.a.string.isRequired,m.a.array.isRequired]),className:m.a.string,arrow:m.a.bool,external:m.a.bool,inverse:m.a.bool,back:m.a.bool,small:m.a.bool,inherit:m.a.bool,caps:m.a.bool,danger:m.a.bool,disabled:m.a.bool},v.defaultProps={dangerouslySetInnerHTML:void 0,onClick:null,href:"",className:"",arrow:!1,external:!1,inverse:!1,back:!1,small:!1,inherit:!1,caps:!1,danger:!1,disabled:!1},t.a=v}).call(this,n(11))},2:function(e,t,n){"use strict";(function(e){n.d(t,"v",(function(){return P})),n.d(t,"t",(function(){return I})),n.d(t,"q",(function(){return U})),n.d(t,"u",(function(){return q})),n.d(t,"i",(function(){return F})),n.d(t,"b",(function(){return H})),n.d(t,"e",(function(){return B})),n.d(t,"l",(function(){return G})),n.d(t,"n",(function(){return W})),n.d(t,"f",(function(){return K})),n.d(t,"o",(function(){return z})),n.d(t,"B",(function(){return V})),n.d(t,"C",(function(){return J})),n.d(t,"j",(function(){return Z})),n.d(t,"a",(function(){return Q})),n.d(t,"z",(function(){return X})),n.d(t,"x",(function(){return ee})),n.d(t,"d",(function(){return te})),n.d(t,"g",(function(){return ne})),n.d(t,"h",(function(){return ae})),n.d(t,"s",(function(){return ie})),n.d(t,"k",(function(){return re}));var a=n(10),i=n.n(a),r=n(64),o=n.n(r),c=n(20),s=n.n(c),l=n(114),u=n.n(l),d=n(34),g=n.n(d),f=(n(1),n(13)),p=n(11),m=n.n(p),h=n(43),b=n(12),v=n(0),k=n(42),_=n(192),y=n(23),O=n(91),w=n(92),E=n(93),j=n(33),C=n(45);n.d(t,"A",(function(){return C.c}));var x=n(62);n.d(t,"w",(function(){return x.a}));var N=n(88);n.d(t,"y",(function(){return N.a}));var D=n(72);n.d(t,"c",(function(){return D.b})),n.d(t,"m",(function(){return D.c}));var S=n(89);n.d(t,"p",(function(){return S.a}));var A=n(90);function L(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?L(n,!0).forEach((function(t){s()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):L(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"r",(function(){return A.a}));var R=function(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e},P=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(e=Object(f.isFinite)(e)?e:Number(e),Object(f.isFinite)(e)||(console.warn("Invalid number",e,g()(e)),e=0),t)return I(e,{style:"currency",currency:t});var n={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?Object(v.sprintf)(// translators: %s: an abbreviated number in millions.
5
+ Object(v.__)("%sM","google-site-kit"),I(R(e),e%10==0?{}:n)):1e4<=e?Object(v.sprintf)(// translators: %s: an abbreviated number in thousands.
6
+ Object(v.__)("%sK","google-site-kit"),I(R(e))):1e3<=e?Object(v.sprintf)(// translators: %s: an abbreviated number in thousands.
7
+ Object(v.__)("%sK","google-site-kit"),I(R(e),e%10==0?{}:n)):e.toString()},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=t.locale,a=void 0===n?T():n,i=u()(t,["locale"]);return new Intl.NumberFormat(a,i).format(e)},T=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,n=Object(f.get)(t,["googlesitekit","locale","","lang"]);if(n){var a=n.match(/^(\w{2})?(_)?(\w{2})/);if(a&&a[0])return a[0].replace(/_/g,"-")}return t.navigator.language},U=function(e){switch(e){case"minute":return 60;case"hour":return 3600;case"day":return 86400;case"week":return 604800;case"month":return 2592e3;case"year":return 31536e3}},q=function(e){if(e=parseInt(e,10),isNaN(e)||0===e)return"0.0s";var t={};return t.hours=Math.floor(e/60/60),t.minutes=Math.floor(e/60%60),t.seconds=Math.floor(e%60),((t.hours?t.hours+"h ":"")+(t.minutes?t.minutes+"m ":"")+(t.seconds?t.seconds+"s ":"")).trim()},F=function(e,t){var n=1e3*U("day"),a=e.getTime(),i=t.getTime();return Math.round(Math.abs(a-i)/n)},H=function(e,t){if("0"===e||0===e||isNaN(e))return"";var n=((t-e)/e*100).toFixed(1);return isNaN(n)||"Infinity"===n?"":n},B=function(e,t){return Object(f.map)(e,(function(e,n){return[e[0],e[t]||(0===n?"":0)]}))},G=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e.googlesitekit,n=t.modules;return n?Object.keys(n).reduce((function(e,t){return"object"!==g()(n[t])?e:void 0===n[t].slug||void 0===n[t].name||n[t].slug!==t?e:M({},e,s()({},t,n[t]))}),{}):{}},W=function(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e.googlesitekit,i=a.admin,r=i.connectURL,o=i.adminRoot,c=a.setup.needReauthenticate,s=G(a)[t].screenID,l="pagespeed-insights"===t?{notification:"authentication_success",reAuth:void 0}:{},u=Object(k.a)(o,M({page:t&&n&&s?s:"googlesitekit-dashboard",slug:t,reAuth:n},l));if(!c)return u;var d=encodeURIComponent(Object(_.a)(u));return u=o+"?"+d,Object(k.a)(r,{redirect:u,status:n})},K=function(e,t){return function(n){return function InnerComponent(a){return m.a.createElement(e,o()({},a,t,{OriginalComponent:n}))}}},z=function(t,n){var a=e.googlesitekit.admin.adminRoot;return t||(t="googlesitekit-dashboard"),n=M({page:t},n),Object(k.a)(a,n)},V=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},J=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}#x2F;)},Z=function(t){var n,a,r,o,c;return i.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return n=e.googlesitekit.admin,a=n.homeURL,r=n.ampMode,o={tagverify:1,timestamp:Date.now()},s.next=4,i.a.awrap(Y(Object(k.a)(a,o),t));case 4:if((c=s.sent)||"secondary"!==r){s.next=9;break}return s.next=8,i.a.awrap(Object(h.default)({path:"/wp/v2/posts?per_page=1"}).then((function(e){return e.slice(0,1).map((function(e){return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,i.a.awrap(Y(Object(k.a)(e.link,M({},o,{amp:1})),t));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))})).pop()})));case 8:c=s.sent;case 9:return s.abrupt("return",Promise.resolve(c||null));case 10:case"end":return s.stop()}}))},Y=function(e,t){var n;return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,i.a.awrap(fetch(e,{credentials:"omit"}).then((function(e){return e.text()})));case 3:return n=a.sent,a.abrupt("return",$(n,t)||null);case 7:return a.prev=7,a.t0=a.catch(0),a.abrupt("return",null);case 10:case"end":return a.stop()}}),null,null,[[0,7]])},$=function(e,t){var n=({adsense:w.a,analytics:E.a,tagmanager:j.d,setup:O.a}[t]||[]).find((function(t){return t.test(e)}));return!!n&&n.exec(e)[1]},Q=function(e,t,n){return e.setModuleActive(t,n).then((function(e){var n=G();return n[t]&&(n[t].active=e.active),Object(C.c)("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},X=function(t,n,a){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:e.googlesitekit,o=G(r)[t],c=o.settings,s=o.setupComplete,l=i||document.getElementById("confirm-changes-".concat(t));if(s&&l){var u=!!Object.keys(n).find((function(e){var t=n[e];return!Object(f.isEqual)(a[e],c[t])}));return i||(l.disabled=!u),u}},ee=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(b.b)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",K(e,t),1)},te=function(e){if(!e)return"";var t=e.replace(/&#(\d+);/g,(function(e,t){return String.fromCharCode(t)})).replace(/(\\)/g,"");return Object(f.unescape)(t)};function ne(){var e=Object(b.c)("googlesitekit.dateRange","last-28-days").match(/last-(\d+)-days/);if(e&&e[1])return Object(v.sprintf)(Object(v._n)("%s day","%s days",parseInt(e[1],10),"google-site-kit"),e[1]);throw new Error("Unrecognized date range slug used in `googlesitekit.dateRange`.")}function ae(){return Object(b.c)("googlesitekit.dateRange","last-28-days")}function ie(t,n){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(e.googlesitekit){var o=m.a.createElement(y.a,{id:t,width:a,height:i,className:r});return n?o=m.a.createElement(y.a,{id:"".concat(t,"-disabled"),width:a,height:i,className:r}):"pagespeed-insights"===t&&(o=m.a.createElement("img",{src:e.googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:a,alt:"",className:r})),o}}function re(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e._googlesitekitBaseData,a=n.blogPrefix;return n.isNetworkMode?t:a+t}}).call(this,n(16))},201:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(15),g=n.n(d),f=n(8),p=n.n(f),m=n(1),h=n(14),b=n.n(h),v=n(0),k=n(12),_=n(48),y=function(t){function NotificationCounter(e){var t;return i()(this,NotificationCounter),(t=s()(this,u()(NotificationCounter).call(this,e))).state={count:0},t.handleIncrement=t.handleIncrement.bind(g()(t)),t.handleDecrement=t.handleDecrement.bind(g()(t)),t}return p()(NotificationCounter,t),o()(NotificationCounter,[{key:"componentDidMount",value:function(){var e=this;Object(k.a)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(k.f)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications"),Object(_.c)().then((function(t){e.setState({count:t})}))})),document.addEventListener("notificationDismissed",this.handleDecrement,!1)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("notificationDismissed",this.handleDecrement)}},{key:"handleIncrement",value:function(){this.setState(_.e)}},{key:"handleDecrement",value:function(){this.setState(_.a)}},{key:"render",value:function(){var t=Object(v.sprintf)(
8
/* translators: %d: the number of notifications */
9
+ Object(v._n)("%d notification","%d notifications",this.state.count,"google-site-kit"),this.state.count),n=e.createElement("span",{className:b()("googlesitekit-notifications-counter","update-plugins","count-".concat(this.state.count))},e.createElement("span",{className:"plugin-count","aria-hidden":"true"},this.state.count),e.createElement("span",{className:"screen-reader-text"},t));return Object(m.g)(n,document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"))}}]),NotificationCounter}(m.a);t.a=y}).call(this,n(11))},22:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(1),i=function(e){return function(t){return function FilteredComponent(n){return Object(a.f)(a.b,{},"",Object(a.f)(t,n),e)}}}},221:function(e,t,n){"use strict";(function(e){var a=n(20),i=n.n(a),r=n(4),o=n.n(r),c=n(5),s=n.n(c),l=n(6),u=n.n(l),d=n(7),g=n.n(d),f=n(15),p=n.n(f),m=n(8),h=n.n(m),b=n(1),v=n(3),k=n.n(v),_=n(14),y=n.n(_),O=n(43),w=n(0),E=n(2),j=n(222),C=n(45),x=function(t){function OptIn(e){var t;return o()(this,OptIn),(t=u()(this,g()(OptIn).call(this,e))).state={optIn:Object(C.a)(),error:!1},t.handleOptIn=t.handleOptIn.bind(p()(t)),t}return h()(OptIn,t),s()(OptIn,[{key:"handleOptIn",value:function(e){var t=this,n=!!e.target.checked,a=Object(E.k)("googlesitekit_tracking_optin");Object(C.b)(n),n&&Object(C.c)("tracking_plugin",this.props.optinAction),Object(O.default)({path:"/wp/v2/users/me",method:"POST",data:{meta:i()({},a,n)}}).then((function(){t.setState({optIn:n,error:!1})})).catch((function(e){t.setState({optIn:!n,error:{errorCode:e.code,errorMsg:e.message}})}))}},{key:"render",value:function(){var t=this.state,n=t.optIn,a=t.error,i=this.props,r=i.id,o=i.name,c=i.className,s=Object(w.sprintf)(
10
/* translators: %s: privacy policy URL */
11
+ Object(w.__)('Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with <a href="%s" target="_blank" rel="noopener noreferrer">Google Privacy Policy</a>',"google-site-kit"),"https://policies.google.com/privacy");return e.createElement("div",{className:y()("googlesitekit-opt-in",c)},e.createElement(j.a,{id:r,name:o,value:"1",checked:n,onChange:this.handleOptIn},e.createElement("span",{dangerouslySetInnerHTML:Object(E.w)(s,{ALLOWED_TAGS:["a"],ALLOWED_ATTR:["href","target","rel"]})})),a&&e.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),OptIn}(b.a);x.propTypes={id:k.a.string,name:k.a.string,className:k.a.string,optinAction:k.a.string},x.defaultProps={id:"googlesitekit-opt-in",name:"optIn"},t.a=x}).call(this,n(11))},222:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(1),p=n(3),m=n.n(p),h=n(14),b=n.n(h),v=n(25),k=function(t){function Checkbox(e){var t;return i()(this,Checkbox),(t=s()(this,u()(Checkbox).call(this,e))).formFieldRef=Object(f.h)(),t.checkboxRef=Object(f.h)(),t}return g()(Checkbox,t),o()(Checkbox,[{key:"componentDidMount",value:function(){new v.e(this.formFieldRef.current).input=new v.c(this.checkboxRef.current)}},{key:"render",value:function(){var t=this.props,n=t.onChange,a=t.id,i=t.name,r=t.value,o=t.checked,c=t.disabled,s=t.children;return e.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},e.createElement("div",{className:b()("mdc-checkbox",{"mdc-checkbox--disabled":c}),ref:this.checkboxRef},e.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:i,value:r,checked:o,disabled:c,onChange:n}),e.createElement("div",{className:"mdc-checkbox__background"},e.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},e.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),e.createElement("div",{className:"mdc-checkbox__mixedmark"}))),e.createElement("label",{htmlFor:a},s))}}]),Checkbox}(f.a);k.propTypes={onChange:m.a.func.isRequired,id:m.a.string.isRequired,name:m.a.string.isRequired,value:m.a.string.isRequired,checked:m.a.bool,disabled:m.a.bool,children:m.a.node.isRequired},k.defaultProps={checked:!1,disabled:!1},t.a=k}).call(this,n(11))},23:function(e,t,n){"use strict";(function(e,a){n(1);var i=n(3),r=n.n(i),o=n(14),c=n.n(o),s=function SvgIcon(t){var n=t.id,i=t.className,r=t.height,o=t.width,s="".concat(e.googlesitekit.admin.assetsRoot,"svg/svg.svg");return a.createElement("svg",{className:c()("svg",i),height:r,width:o},a.createElement("use",{xlinkHref:"".concat(s,"#").concat(n)}))};s.propTypes={id:r.a.string.isRequired,className:r.a.string,height:r.a.string,width:r.a.string},s.defaultProps={className:"",height:20,width:20},t.a=s}).call(this,n(16),n(11))},25:function(e,t,n){"use strict";var a=n(75),i=n.n(a);n.d(t,"l",(function(){return i.a})),n.d(t,"a",(function(){return a.HelperText})),n.d(t,"b",(function(){return a.Input}));var r=n(110);n.d(t,"h",(function(){return r.a}));var o=n(209);n.d(t,"e",(function(){return o.a}));var c=n(208);n.d(t,"g",(function(){return c.a}));var s=n(97),l=n.n(s);n.d(t,"k",(function(){return l.a})),n.d(t,"j",(function(){return s.Option}));var u=n(207);n.d(t,"i",(function(){return u.a}));var d=n(206);n.d(t,"d",(function(){return d.a}));var g=n(205);n.d(t,"c",(function(){return g.a}));var f=n(204);n.d(t,"f",(function(){return f.a}))},26:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(15),g=n.n(d),f=n(8),p=n.n(f),m=n(1),h=n(3),b=n.n(h),v=n(14),k=n.n(v),_=n(100),y=n(2),O=n(49),w=function(t){function DataBlock(e){var t;return i()(this,DataBlock),(t=s()(this,u()(DataBlock).call(this,e))).handleClick=t.handleClick.bind(g()(t)),t.handleKeyPress=t.handleKeyPress.bind(g()(t)),t}return p()(DataBlock,t),o()(DataBlock,[{key:"handleClick",value:function(){var e=this.props,t=e.stat;(0,e.handleStatSelection)(t)}},{key:"handleKeyPress",value:function(e){e.preventDefault();var t=this.props,n=t.stat,a=t.handleStatSelection;"Enter"!==e.key&&" "!==e.key||a(n)}},{key:"render",value:function(){var t=this.props,n=t.className,a=t.title,i=t.datapoint,r=t.datapointUnit,o=t.change,c=t.changeDataUnit,s=t.context,l=t.period,u=t.selected,d=t.handleStatSelection,g=t.source,f=t.sparkline,p=t.invertChangeColor,h="button"===s?"button":"",b=f;return b&&p&&(b=Object(m.d)(f,{invertChangeColor:p})),e.createElement("div",{className:k()("googlesitekit-data-block",n,"googlesitekit-data-block--".concat(s),{"googlesitekit-data-block--selected":u}),tabIndex:"button"===s?"0":"-1",role:d&&h,onClick:d&&this.handleClick,onKeyPress:d&&this.handleKeyPress,"aria-label":d&&a,"aria-pressed":d&&u},e.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},e.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},a),e.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(i).concat(r))),b&&e.createElement("div",{className:"googlesitekit-data-block__sparkline"},b),e.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},e.createElement("div",{className:"googlesitekit-data-block__change"},""===o&&e.createElement(m.b,null," "),o&&e.createElement(m.b,null,e.createElement("span",{className:"googlesitekit-data-block__arrow"},e.createElement(_.a,{direction:0<parseFloat(o)?"up":"down",invertColor:p})),e.createElement("span",{className:"googlesitekit-data-block__value"},"".concat(Object(y.t)(Math.abs(o))).concat(c," ").concat(l)))),g&&e.createElement(O.a,{className:"googlesitekit-data-block__source",name:g.name,href:g.link})))}}]),DataBlock}(m.a);w.propTypes={stat:b.a.number,onClick:b.a.func,className:b.a.string,title:b.a.string,datapoint:b.a.oneOfType([b.a.string,b.a.number]),datapointUnit:b.a.string,change:b.a.oneOfType([b.a.string,b.a.number]),changeDataUnit:b.a.string,context:b.a.string,period:b.a.string,selected:b.a.bool,handleStatSelection:b.a.func,invertChangeColor:b.a.bool},w.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,invertChangeColor:!1},t.a=w}).call(this,n(11))},265:function(e,t,n){"use strict";(function(e,a){n.d(t,"a",(function(){return N}));var i=n(114),r=n.n(i),o=n(4),c=n.n(o),s=n(5),l=n.n(s),u=n(6),d=n.n(u),g=n(7),f=n.n(g),p=n(8),m=n.n(p),h=n(10),b=n.n(h),v=n(1),k=n(0),_=n(3),y=n.n(_),O=n(95),w=n(31),E=n(2),j=n(9),C=n(19),x=[function(){var t;return b.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(t=e.location.hostname,!["localhost","127.0.0.1"].includes(t)&&!t.match(/\.(example|invalid|localhost|test)#x2F;)){n.next=3;break}throw"invalid_hostname";case 3:case"end":return n.stop()}}))},function(){var e,t,n;return b.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.next=2,b.a.awrap(j.c.set(j.a,"site","setup-tag"));case 2:return e=a.sent,t=e.token,a.next=6,b.a.awrap(Object(E.j)("setup").catch((function(){throw"tag_fetch_failed"})));case 6:if(n=a.sent,t===n){a.next=9;break}throw"setup_token_mismatch";case 9:case"end":return a.stop()}}))}],N=function(t){function CompatibilityChecks(t){var n;c()(this,CompatibilityChecks);var a=e.googlesitekit.setup.isSiteKitConnected;return(n=d()(this,f()(CompatibilityChecks).call(this,t))).state={complete:a,error:null,developerPlugin:{}},n}return m()(CompatibilityChecks,t),l()(CompatibilityChecks,[{key:"componentDidMount",value:function(){var e,t,n,a;return b.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(!this.state.complete){i.next=2;break}return i.abrupt("return");case 2:i.prev=2,e=0,t=x;case 4:if(!(e<t.length)){i.next=11;break}return n=t[e],i.next=8,b.a.awrap(n());case 8:e++,i.next=4;break;case 11:i.next=19;break;case 13:return i.prev=13,i.t0=i.catch(2),i.next=17,b.a.awrap(j.c.get(j.a,"site","developer-plugin"));case 17:a=i.sent,this.setState({error:i.t0,developerPlugin:a});case 19:this.setState({complete:!0});case 20:case"end":return i.stop()}}),null,this,[[2,13]])}},{key:"helperCTA",value:function(){var e=this.state.developerPlugin,t=e.installed,n=e.active,a=e.installURL,i=e.activateURL,r=e.configureURL;return!t&&a?{labelHTML:Object(k.__)('Install<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:a,external:!1}:t&&!n&&i?{labelHTML:Object(k.__)('Activate<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:i,external:!1}:t&&n&&r?{labelHTML:Object(k.__)('Configure<span class="screen-reader-text"> the helper plugin</span>',"google-site-kit"),href:r,external:!1}:{labelHTML:Object(k.__)('Learn how<span class="screen-reader-text"> to install and use the helper plugin</span>',"google-site-kit"),href:"https://sitekit.withgoogle.com/documentation/using-site-kit-on-a-staging-environment/",external:!0}}},{key:"renderError",value:function(e){var t=this.state.developerPlugin.installed,n=this.helperCTA(),i=n.labelHTML,r=n.href,o=n.external;switch(e){case"invalid_hostname":case"tag_fetch_failed":return a.createElement(v.b,null,!t&&Object(k.__)("Looks like this may be a staging environment. If so, you’ll need to install a helper plugin and verify your production site in Search Console.","google-site-kit"),t&&Object(k.__)("Looks like this may be a staging environment and you already have the helper plugin. Before you can use Site Kit, please make sure you’ve provided the necessary credentials in the Authentication section and verified your production site in Search Console.","google-site-kit")," ",a.createElement(C.a,{href:r,dangerouslySetInnerHTML:{__html:i},external:o,inherit:!0}));case"setup_token_mismatch":return Object(k.__)("Looks like you may be using a caching plugin which could interfere with setup. Please deactivate any caching plugins before setting up Site Kit. You may reactivate them once setup has been completed.","google-site-kit")}}},{key:"render",value:function(){var e,t,n=this.state,i=n.complete,o=n.error,c=this.props,s=c.children,l=r()(c,["children"]);return o&&(e=a.createElement(v.b,null,a.createElement("div",{className:"googlesitekit-setup-compat mdc-layout-grid mdc-layout-grid--align-left"},a.createElement("div",{className:"mdc-layout-grid__inner"},a.createElement(O.a,null),a.createElement("div",{className:"googlesitekit-heading-4 mdc-layout-grid__cell--span-11"},Object(k.__)("Your site may not be ready for Site Kit","google-site-kit"))),a.createElement("p",null,this.renderError(o))))),i||(t=a.createElement("div",{style:{alignSelf:"center",marginLeft:"1rem"}},a.createElement("small",null,Object(k.__)("Checking Compatibility...","google-site-kit")),a.createElement(w.a,{small:!0,compress:!0}))),s({restProps:l,complete:i,error:o,inProgressFeedback:t,CTAFeedback:e})}}]),CompatibilityChecks}(v.a);N.propTypes={children:y.a.func.isRequired}}).call(this,n(16),n(11))},273:function(e,t,n){"use strict";(function(e,a){n.d(t,"a",(function(){return _}));var i=n(4),r=n.n(i),o=n(5),c=n.n(o),s=n(6),l=n.n(s),u=n(7),d=n.n(u),g=n(8),f=n.n(g),p=n(1),m=n(0),h=n(86),b=n(2),v=n(274),k=n(201),_=function(t){function ActivationApp(){return r()(this,ActivationApp),l()(this,d()(ActivationApp).apply(this,arguments))}return f()(ActivationApp,t),c()(ActivationApp,[{key:"render",value:function(){var t=e._googlesitekitBaseData,n=t.proxySetupURL,i=t.splashURL,r=e.googlesitekit.permissions.canViewDashboard,o=e.googlesitekit.dashboardPermalink,c=n||i,s=Object(m.__)("Start setup","google-site-kit");return r&&(c=o,s=Object(m.__)("Go to Dashboard","google-site-kit")),a.createElement(h.a,null,a.createElement(k.a,null),a.createElement(v.a,{buttonURL:c,buttonLabel:s,onButtonClick:function(){Object(b.A)("plugin_setup",n?"proxy_start_setup_banner":"goto_sitekit")}}))}}]),ActivationApp}(p.a)}).call(this,n(16),n(11))},274:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return ActivationMain}));var a=n(1),i=n(0),r=n(3),o=n.n(r),c=n(30),s=n(99),l=n(221),u=n(265);function ActivationMain(t){var n=t.buttonURL,r=t.onButtonClick,o=t.buttonLabel;return e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e.createElement(s.a,null),e.createElement("h3",{className:"googlesitekit-heading-3 googlesitekit-activation__title"},Object(i.__)("Congratulations, the Site Kit plugin is now activated.","google-site-kit")),e.createElement(u.a,null,(function(t){var i=t.complete,s=t.inProgressFeedback,u=t.CTAFeedback;return e.createElement(a.b,null,u,e.createElement(l.a,{optinAction:"analytics_optin_setup_banner"}),e.createElement("div",{className:"googlesitekit-start-setup-wrap"},e.createElement(c.a,{id:"start-setup-link",className:"googlesitekit-start-setup",href:n,onClick:r,disabled:!i},o),s))})))))}ActivationMain.propTypes={buttonURL:o.a.string.isRequired,onButtonClick:o.a.func,buttonLabel:o.a.string.isRequired}}).call(this,n(11))},29:function(e,t,n){"use strict";(function(e){var a=n(20),i=n.n(a),r=n(10),o=n.n(r),c=n(4),s=n.n(c),l=n(5),u=n.n(l),d=n(6),g=n.n(d),f=n(7),p=n.n(f),m=n(15),h=n.n(m),b=n(8),v=n.n(b),k=n(1),_=n(3),y=n.n(_),O=n(14),w=n.n(O),E=n(13),j=n(23),C=n(62),x=n(9),N=n(26),D=n(30),S=n(95),A=n(73),L=n(19),M=function(t){function Notification(e){var t;return s()(this,Notification),(t=g()(this,p()(Notification).call(this,e))).state={isClosed:!1},t.cardRef=Object(k.h)(),t.handleDismiss=t.handleDismiss.bind(h()(t)),t.handleCTAClick=t.handleCTAClick.bind(h()(t)),0<t.props.dismissExpires&&t.expireDismiss(),t.props.showOnce&&x.c.setCache("notification::displayed::".concat(t.props.id),new Date),t}return v()(Notification,t),u()(Notification,[{key:"handleDismiss",value:function(e){var t;return o.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e.persist(),e.preventDefault(),!(t=this.props.onDismiss)){n.next=6;break}return n.next=6,o.a.awrap(t(e));case 6:this.dismiss();case 7:case"end":return n.stop()}}),null,this)}},{key:"dismiss",value:function(){var e=this,t=this.cardRef.current;this.setState({isClosed:!0}),setTimeout((function(){x.c.setCache("notification::dismissed::".concat(e.props.id),new Date),t.style.display="none";var n=new Event("notificationDismissed");document.dispatchEvent(n)}),350)}},{key:"handleCTAClick",value:function(e){var t,n,a;return o.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:if(e.persist(),t=this.props,n=t.isDismissable,!(a=t.onCTAClick)){i.next=5;break}return i.next=5,o.a.awrap(a(e));case 5:n&&this.dismiss();case 6:case"end":return i.stop()}}),null,this)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,n=e.dismissExpires,a=x.c.getCache("notification::dismissed::".concat(t));if(a){var i=new Date(a);i.setSeconds(i.getSeconds()+parseInt(n,10)),i<new Date&&x.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var t,n=this.state.isClosed,a=this.props,r=a.children,o=a.id,c=a.title,s=a.description,l=a.blockData,u=a.winImage,d=a.smallImage,g=a.format,f=a.learnMoreURL,p=a.learnMoreDescription,m=a.learnMoreLabel,h=a.ctaLink,b=a.ctaLabel,v=a.ctaTarget,_=a.type,y=a.dismiss,O=a.isDismissable,M=a.logo,R=a.module,P=a.moduleName,I=a.pageIndex;if(x.c.getCache("notification::dismissed::".concat(o)))return null;var T,U=n?"is-closed":"is-open",q="large"===g&&"win-stats-increase"===_,F="mdc-layout-grid__cell--span-12";"large"===g?(F="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-8-desktop ",q&&(F="mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet mdc-layout-grid__cell--span-5-tablet mdc-layout-grid__cell--span-8-desktop ")):"small"===g&&(F="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),T="win-warning"===_?e.createElement(S.a,null):"win-error"===_?e.createElement(A.a,null):"";var H=e.createElement(k.b,null,l&&e.createElement("div",{className:"mdc-layout-grid__inner"},Object(E.map)(l,(function(t,n){return e.createElement("div",{key:n,className:w()("mdc-layout-grid__cell",{"mdc-layout-grid__cell--span-5-desktop":q,"mdc-layout-grid__cell--span-4-desktop":!q})},e.createElement("div",{className:"googlesitekit-publisher-win__stats"},e.createElement(N.a,t)))})))),B=e.createElement(k.b,null,c&&e.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},c),s&&e.createElement("div",{className:"googlesitekit-publisher-win__desc"},e.createElement("p",null,Object(k.i)(s)?s:e.createElement("span",{dangerouslySetInnerHTML:Object(C.a)(s,{ALLOWED_TAGS:["strong","em","br","a"],ALLOWED_ATTR:["href"]})}),m&&e.createElement(k.b,null," ",e.createElement(L.a,{href:f,external:!0,inherit:!0},m),p),I&&e.createElement("span",{className:"googlesitekit-publisher-win__detect"},I))),r),G=R?e.createElement(j.a,{id:R,height:"19",width:"19"}):e.createElement(j.a,{id:"logo-g",height:"34",width:"32"});return e.createElement("section",{ref:this.cardRef,className:w()("googlesitekit-publisher-win",(t={},i()(t,"googlesitekit-publisher-win--".concat(g),g),i()(t,"googlesitekit-publisher-win--".concat(_),_),i()(t,"googlesitekit-publisher-win--".concat(U),U),t))},e.createElement("div",{className:"mdc-layout-grid"},e.createElement("div",{className:"mdc-layout-grid__inner"},M&&e.createElement("div",{className:w()("mdc-layout-grid__cell","mdc-layout-grid__cell--span-12",{"mdc-layout-grid__cell--order-2-phone":q,"mdc-layout-grid__cell--order-1-tablet":q})},e.createElement("div",{className:"googlesitekit-publisher-win__logo"},G),P&&e.createElement("div",{className:"googlesitekit-publisher-win__module-name"},P)),d&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:d})),e.createElement("div",{className:w()("mdc-layout-grid__cell",F)},q?e.createElement("div",{className:"mdc-layout-grid__inner"},e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},B),e.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-7-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--align-bottom"},H)):e.createElement(k.b,null,B,H),h&&e.createElement(D.a,{href:h,target:v,onClick:this.handleCTAClick},b),O&&y&&e.createElement(L.a,{onClick:this.handleDismiss},y)),u&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--order-1-phone mdc-layout-grid__cell--order-2-tablet mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-4-desktop "},e.createElement("div",{className:"googlesitekit-publisher-win__image-large"},e.createElement("img",{alt:"",src:u}))),("win-error"===_||"win-warning"===_)&&e.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},e.createElement("div",{className:"googlesitekit-publisher-win__icons"},T)))))}}]),Notification}(k.a);M.propTypes={id:y.a.string.isRequired,title:y.a.string.isRequired,description:y.a.node,learnMoreURL:y.a.string,learnMoreDescription:y.a.string,learnMoreLabel:y.a.string,blockData:y.a.array,winImage:y.a.string,smallImage:y.a.string,format:y.a.string,ctaLink:y.a.string,ctaLabel:y.a.string,type:y.a.string,dismiss:y.a.string,isDismissable:y.a.bool,logo:y.a.bool,module:y.a.string,moduleName:y.a.string,pageIndex:y.a.string,dismissExpires:y.a.number,showOnce:y.a.bool,onCTAClick:y.a.func,onDismiss:y.a.func},M.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1},t.a=M}).call(this,n(11))},30:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(1),p=n(3),m=n.n(p),h=n(14),b=n.n(h),v=n(25),k=function(t){function Button(e){var t;return i()(this,Button),(t=s()(this,u()(Button).call(this,e))).buttonRef=Object(f.h)(),t}return g()(Button,t),o()(Button,[{key:"componentDidMount",value:function(){new v.h(this.buttonRef.current)}},{key:"render",value:function(){var t=this.props,n=t.onClick,a=t.children,i=t.href,r=t.text,o=t.className,c=t.danger,s=t.disabled,l=t.target,u=t.id,d=t.icon,g=t.trailingIcon,f=t.ariaHaspopup,p=t.ariaExpanded,m=t.ariaControls,h=i&&!s?"a":"button";return e.createElement(h,{className:b()("mdc-button",o,{"mdc-button--raised":!r,"mdc-button--danger":c}),onClick:n,href:s?void 0:i,ref:this.buttonRef,disabled:!!s,target:l||"_self",id:u,"aria-haspopup":f,"aria-expanded":p,"aria-controls":m},d&&d,e.createElement("span",{className:"mdc-button__label"},a),g&&g)}}]),Button}(f.a);k.propTypes={onClick:m.a.func,children:m.a.string.isRequired,href:m.a.string,text:m.a.bool,className:m.a.string,danger:m.a.bool,disabled:m.a.bool,icon:m.a.element,trailingIcon:m.a.element,ariaHaspopup:m.a.string,ariaExpanded:m.a.bool,ariaControls:m.a.string},k.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=k}).call(this,n(11))},31:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(1),p=n(3),m=n.n(p),h=n(14),b=n.n(h),v=function(t){function ProgressBar(){return i()(this,ProgressBar),s()(this,u()(ProgressBar).apply(this,arguments))}return g()(ProgressBar,t),o()(ProgressBar,[{key:"render",value:function(){var t=this.props,n=t.className,a=t.small,i=t.compress,r=t.height,o=r?Math.round(r/2):null;return e.createElement("div",{role:"progressbar",style:{marginTop:o,marginBottom:o},className:b()("mdc-linear-progress","mdc-linear-progress--indeterminate",n,{"mdc-linear-progress--small":a,"mdc-linear-progress--compress":i})},e.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),e.createElement("div",{className:"mdc-linear-progress__buffer"}),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})),e.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},e.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),ProgressBar}(f.a);v.propTypes={className:m.a.string,small:m.a.bool,compress:m.a.bool},v.defaultProps={className:"",small:!1,compress:!1},t.a=v}).call(this,n(11))},33:function(e,t,n){"use strict";function a(e){return{byContext:function(t){return e.filter((function(e){return e.usageContext.includes(t)}))}}}function i(e){return(parseInt(e)||0)>0}function r(e){return!!e&&e.toString().match(/^GTM-[A-Z0-9]+#x2F;)}n.d(t,"a",(function(){return a})),n.d(t,"b",(function(){return i})),n.d(t,"c",(function(){return r})),n.d(t,"d",(function(){return o}));var o=[/<script[^>]*>[^>]+?www.googletagmanager.com\/gtm[^>]+?['|"](GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtm\.js\?id=(GTM-[0-9A-Z]+)['|"]/,/<script[^>]*src=['|"]https:\/\/www.googletagmanager.com\/ns.html\?id=(GTM-[0-9A-Z]+)['|"]/,/<amp-analytics [^>]*config=['|"]https:\/\/www.googletagmanager.com\/amp.json\?id=(GTM-[0-9A-Z]+)['|"]/]},392:function(e,t,n){"use strict";n.r(t),function(e){var t=n(1),a=n(184),i=n(12),r=n(2),o=(n(188),n(273));Object(a.a)((function(){var n=document.getElementById("js-googlesitekit-activation");n&&(Object(r.r)(),Object(r.A)("plugin_setup","plugin_activated"),Object(t.k)(e.createElement(o.a,null),n),n.classList.remove("googlesitekit-activation--loading"),Object(i.d)("googlesitekit.moduleLoaded","Activation"))}))}.call(this,n(11))},40:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i})),n.d(t,"b",(function(){return o}));var a=n(54),i="_googlesitekitDataLayer",r="data-googlesitekit-gtag";function o(t,n){var o=Object(a.a)(n);return function(){t.trackingEnabled=!0;var n=e.document;if(!n.querySelector("script[".concat(r,"]"))){var a=n.createElement("script");a.setAttribute(r,""),a.async=!0,a.src="https://www.googletagmanager.com/gtag/js?id=".concat(t.trackingID,"&l=").concat(i),n.head.appendChild(a),o("js",new Date),o("config",t.trackingID)}}}}).call(this,n(16))},43:function(e,t,n){"use strict";(function(e){var a=n(28),i=n.n(a),r=e._googlesitekitAPIFetchData||{},o=r.nonce,c=r.nonceEndpoint,s=r.preloadedData,l=r.rootURL;i.a.nonceEndpoint=c,i.a.nonceMiddleware=i.a.createNonceMiddleware(o),i.a.rootURLMiddleware=i.a.createRootURLMiddleware(l),i.a.preloadingMiddleware=i.a.createPreloadingMiddleware(s),i.a.use(i.a.nonceMiddleware),i.a.use(i.a.mediaUploadMiddleware),i.a.use(i.a.rootURLMiddleware),i.a.use(i.a.preloadingMiddleware),t.default=i.a}).call(this,n(16))},45:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l})),n.d(t,"b",(function(){return d})),n.d(t,"c",(function(){return u}));var a=n(76),i=e._googlesitekitBaseData||{},r={isFirstAdmin:i.isFirstAdmin,trackingEnabled:i.trackingEnabled,trackingID:i.trackingID,referenceSiteURL:i.referenceSiteURL,userIDHash:i.userIDHash},o=Object(a.a)(r),c=o.enableTracking,s=o.disableTracking,l=o.isTrackingEnabled,u=o.trackEvent;function d(e){e?c():s()}d(l())}).call(this,n(16))},48:function(e,t,n){"use strict";(function(e){n.d(t,"g",(function(){return d})),n.d(t,"f",(function(){return g})),n.d(t,"c",(function(){return f})),n.d(t,"b",(function(){return h})),n.d(t,"d",(function(){return b})),n.d(t,"e",(function(){return v})),n.d(t,"a",(function(){return k}));var a=n(10),i=n.n(a),r=n(12),o=n(13),c=n(2),s=n(121),l=n(9),u=Object(r.c)("googlesitekit.winCallbacks",{}),d=function(){return Object(r.c)("googlesitekit.WinsNotificationsRequest",[])},g=function(){return Object(r.c)("googlesitekit.ModulesNotificationsRequest",[])};function f(){var t,n,a,o;return i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:if((t=e.googlesitekit.setup).isSiteKitConnected&&(t.isAuthenticated||t.isVerified)){c.next=3;break}return c.abrupt("return",0);case 3:return n=0,c.next=6,i.a.awrap(h());case 6:return(a=c.sent)&&a.total&&(n+=a.total),c.next=10,i.a.awrap(b());case 10:return(o=c.sent)&&o.total&&(n+=o.total),n=Object(r.c)("googlesitekit.TotalNotifications",n),n=Math.max(0,Math.abs(n)),e.localStorage&&e.localStorage.setItem("googlesitekit::total-notifications",n),c.abrupt("return",n);case 16:case"end":return c.stop()}}))}var p=function(e){return e?e.length?e.filter((function(e){return!l.c.getCache("notification::dismissed::".concat(e.id))})):e:[]},m=function(e){var t=function(e){return Object.keys(e).slice(0,1).map((function(t){return e[t]}))};if(1>=Object.keys(e).length)return e;var n=Object.values(e).filter((function(e){var t=l.c.getCache("notification::displayed::".concat(e[0].id));if(t){var n=new Date(t),a=new Date,i=new Date(Date.UTC(a.getUTCFullYear(),a.getUTCMonth(),a.getUTCDate()));if(n.setHours(0,0,0),i.setHours(0,0,0),n.getTime()===i.getTime())return!0;7<=Object(c.i)(n,i)&&l.c.deleteCache("notification::displayed::".concat(e[0].id))}return null===t})),a=null,i=[];return 0<Object.keys(n).length?(a=t(n),i[Object.keys(n)[0]]=a):(a=t(e),i[Object.keys(e)[0]]=a)};function h(){var e,t,n,a;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e={},t=0,r.next=4,i.a.awrap(g());case 4:return n=r.sent,a=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,a;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return n=e.identifier,r.t0=p,r.next=4,i.a.awrap(l.c.get(l.b,n,"notifications",{},!1));case 4:r.t1=r.sent,a=(0,r.t0)(r.t1),t({identifier:n,notifications:a});case 7:case"end":return r.stop()}}))})),a.push(t);case 2:case"end":return n.stop()}}))})),r.next=9,i.a.awrap(Promise.all(a).then((function(n){n.forEach((function(n){n.notifications.length&&(t+=n.notifications.length,e[n.identifier]=n.notifications)}))})));case 9:return r.abrupt("return",{results:e,total:t});case 10:case"end":return r.stop()}}))}function b(){var e,t,n,a,r;return i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return e={},t=0,c.next=4,i.a.awrap(d());case 4:return n=c.sent,c.next=7,i.a.awrap(new s.a(n).get());case 7:return a=c.sent,r=[],n.map((function(e){var t;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:t=new Promise((function(t){var n,r,c,s,l;return i.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=e.identifier,r=e.callback||Object(o.camelCase)(n),c=null,s=[],e.withData?(l=a[n]||null,c=u[r](l,n)):c=u[r](n),s=p(s=c?[c]:[]),t({identifier:n,notifications:s});case 8:case"end":return i.stop()}}))})),r.push(t);case 2:case"end":return n.stop()}}))})),c.next=12,i.a.awrap(Promise.all(r).then((function(t){t.forEach((function(t){t.notifications.length&&(e[t.identifier]=t.notifications)}))})));case 12:return e=m(e),t=e.length||Object.keys(e).length||0,c.abrupt("return",{results:e,total:t});case 15:case"end":return c.stop()}}))}var v=function(t){var n=Math.abs(t.count)+1;return e.localStorage&&e.localStorage.setItem("googlesitekit::total-notifications",n),{count:n}},k=function(t){var n=Math.max(0,Math.abs(t.count)-1);return e.localStorage&&e.localStorage.setItem("googlesitekit::total-notifications",n),{count:n}}}).call(this,n(16))},49:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(1),p=n(3),m=n.n(p),h=n(14),b=n.n(h),v=n(0),k=n(19),_=function(t){function SourceLink(){return i()(this,SourceLink),s()(this,u()(SourceLink).apply(this,arguments))}return g()(SourceLink,t),o()(SourceLink,[{key:"render",value:function(){var t=this.props,n=t.name,a=t.href,i=t.className,r=t.external;return e.createElement("div",{className:b()("googlesitekit-source-link",i)},[Object(v.__)("Source:","google-site-kit")," ",e.createElement(k.a,{key:"link",href:a,external:r,inherit:!0},n)])}}]),SourceLink}(f.a);_.propTypes={name:m.a.string,href:m.a.string,className:m.a.string,external:m.a.bool},_.defaultProps={name:"",href:"",className:"",external:!1},t.a=_}).call(this,n(11))},54:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(40);function i(e){return function(){e[a.a]=e[a.a]||[],e[a.a].push(arguments)}}},57:function(e,t,n){"use strict";(function(e){var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(1),p=n(29),m=function(t){function GenericError(){return i()(this,GenericError),s()(this,u()(GenericError).apply(this,arguments))}return g()(GenericError,t),o()(GenericError,[{key:"render",value:function(){return e.createElement(p.a,this.props)}}]),GenericError}(f.a);t.a=m}).call(this,n(11))},58:function(e,t,n){"use strict";var a=n(4),i=n.n(a),r=n(5),o=n.n(r),c=n(6),s=n.n(c),l=n(7),u=n.n(l),d=n(8),g=n.n(d),f=n(51),p=function(e){function ModuleSettingsWarning(){return i()(this,ModuleSettingsWarning),s()(this,u()(ModuleSettingsWarning).apply(this,arguments))}return g()(ModuleSettingsWarning,e),o()(ModuleSettingsWarning,[{key:"render",value:function(){return null}}]),ModuleSettingsWarning}(n(1).a);t.a=Object(f.a)("googlesitekit.ModuleSettingsWarning")(p)},62:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(94),i=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{__html:a.a.sanitize(e,t)}}},70:function(e,t,n){"use strict";(function(e,a){n(1);var i=n(0),r=n(29);t.a=function DashboardAuthAlert(){var t=e.googlesitekit.admin.connectURL;return a.createElement(r.a,{id:"authentication error",title:Object(i.__)("Issue accessing data","google-site-kit"),description:Object(i.__)("You need to reauthenticate your Google account.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0,ctaLink:t,ctaLabel:Object(i.__)("Click here","google-site-kit")})}}).call(this,n(16),n(11))},71:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o}));var a=n(10),i=n.n(a),r=n(9),o=function(){var t,n;return i.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,i.a.awrap(r.c.get(r.a,"user","authentication"));case 3:t=a.sent,n=t.grantedScopes.filter((function(e){return-1!==t.requiredScopes.indexOf(e)})),e.googlesitekit.setup=e.googlesitekit.setup||{},e.googlesitekit.setup.isAuthenticated=t.isAuthenticated,e.googlesitekit.setup.requiredScopes=t.requiredScopes,e.googlesitekit.setup.grantedScopes=t.grantedScopes,e.googlesitekit.setup.needReauthenticate=n.length<t.requiredScopes.length,a.next=14;break;case 12:a.prev=12,a.t0=a.catch(0);case 14:case"end":return a.stop()}}),null,null,[[0,12]])}}).call(this,n(16))},72:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"c",(function(){return l}));var a=n(50),i=n.n(a),r=n(0),o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null,n=null,a=document.querySelector("#toplevel_page_googlesitekit-dashboard .googlesitekit-notifications-counter"),i=document.querySelector("#wp-admin-bar-google-site-kit .googlesitekit-notifications-counter");if(a&&i)return!1;if(t=document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"),n=document.querySelector("#wp-admin-bar-google-site-kit .ab-item"),null===t&&null===n)return!1;var o=document.createElement("span");o.setAttribute("class","googlesitekit-notifications-counter update-plugins count-".concat(e));var c=document.createElement("span");c.setAttribute("class","plugin-count"),c.setAttribute("aria-hidden","true"),c.textContent=e;var s=document.createElement("span");return s.setAttribute("class","screen-reader-text"),s.textContent=Object(r.sprintf)(
12
/* translators: %d is the number of notifications */
13
+ Object(r._n)("%d notification","%d notifications",e,"google-site-kit"),e),o.appendChild(c),o.appendChild(s),t&&null===a&&t.appendChild(o),n&&null===i&&n.appendChild(o),o},c=function(){e.localStorage&&e.localStorage.clear(),e.sessionStorage&&e.sessionStorage.clear()},s=function(e){for(var t=location.search.substr(1).split("&"),n={},a=0;a<t.length;a++)n[t[a].split("=")[0]]=decodeURIComponent(t[a].split("=")[1]);return e?n.hasOwnProperty(e)?decodeURIComponent(n[e].replace(/\+/g," ")):"":n},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,n=new URL(t.href);if(e)return n.searchParams&&n.searchParams.get?n.searchParams.get(e):s(e);var a={},r=!0,o=!1,c=void 0;try{for(var l,u=n.searchParams.entries()[Symbol.iterator]();!(r=(l=u.next()).done);r=!0){var d=i()(l.value,2),g=d[0],f=d[1];a[g]=f}}catch(e){o=!0,c=e}finally{try{r||null==u.return||u.return()}finally{if(o)throw c}}return a}}).call(this,n(16))},73:function(e,t,n){"use strict";(function(e){n(1);t.a=function Error(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#EA4336",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"error-title error-desc"},e.createElement("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3zM12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1zm1 4h-2v-2h2v2z"}))}}).call(this,n(11))},74:function(e,t,n){"use strict";n.d(t,"c",(function(){return o})),n.d(t,"a",(function(){return d})),n.d(t,"b",(function(){return g}));var a=n(10),i=n.n(a),r=n(9);function o(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(r.c.get(r.a,"site","notifications",{},!1));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}))}var c=n(45),s="accepted",l="dismissed";function u(e,t){return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return r.c.invalidateCacheGroup(r.a,"site","notifications"),Object(c.c)("site_notifications",t,e),n.next=4,i.a.awrap(r.c.set(r.a,"site","mark-notification",{notificationID:e,notificationState:t}));case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}))}function d(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(u(e,s));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}function g(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(u(e,l));case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}))}},76:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return l}));var a=n(20),i=n.n(a),r=n(40),o=n(77);function c(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}var s={isFirstAdmin:!1,trackingEnabled:!1,trackingID:"",referenceSiteURL:"",userIDHash:""};function l(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,a=function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?c(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):c(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},s,{},t);return a.referenceSiteURL&&(a.referenceSiteURL=a.referenceSiteURL.toString().replace(/\/+#x2F;,"")),{enableTracking:Object(r.b)(a,n),disableTracking:function(){a.trackingEnabled=!1},isTrackingEnabled:function(){return!!a.trackingEnabled},trackEvent:Object(o.a)(a,n)}}}).call(this,n(16))},77:function(e,t,n){"use strict";n.d(t,"a",(function(){return i}));var a=n(54);function i(e,t){var n=Object(a.a)(t);return function(t,a){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",o=e.isFirstAdmin,c=e.referenceSiteURL,s=e.trackingEnabled,l=e.trackingID,u=e.userIDHash;s&&n("event",a,{send_to:l,event_category:t,event_label:i,event_value:r,dimension1:c,dimension2:o?"true":"false",dimension3:u})}}},86:function(e,t,n){"use strict";(function(e,a){var i=n(4),r=n.n(i),o=n(5),c=n.n(o),s=n(6),l=n.n(s),u=n(7),d=n.n(u),g=n(8),f=n.n(g),p=n(1),m=n(3),h=n.n(m),b=n(0),v=n(29),k=function(t){function ErrorHandler(e){var t;return r()(this,ErrorHandler),(t=l()(this,d()(ErrorHandler).call(this,e))).state={error:null,info:null},t}return f()(ErrorHandler,t),c()(ErrorHandler,[{key:"componentDidCatch",value:function(t,n){e.console.error("Caught an error:",t,n),this.setState({error:t,info:n})}},{key:"render",value:function(){var e=this.props.children,t=this.state,n=t.error,i=t.info;return n?a.createElement(v.a,{id:"googlesitekit-error",title:Object(b.__)("Site Kit encountered an error","google-site-kit"),description:a.createElement("code",null,n.message),isDismissable:!1,format:"small",type:"win-error"},a.createElement("pre",null,i.componentStack)):e}}]),ErrorHandler}(p.a);k.defaultProps={},k.propTypes={children:h.a.node.isRequired},t.a=k}).call(this,n(16),n(11))},88:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var a=n(34),i=n.n(a),r=n(125),o=n.n(r),c=function(e){return o()(JSON.stringify(function e(t){var n={};Object.keys(t).sort().forEach((function(a){var r=t[a];r&&"object"===i()(r)&&!Array.isArray(r)&&(r=e(r)),n[a]=r}));return n}(e)))}},89:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return u}));var a,i=n(4),r=n.n(i),o=n(5),c=n.n(o),s=function(t){var n=e[t];if(!n)return!1;try{var a="__storage_test__";return n.setItem(a,a),n.removeItem(a),!0}catch(e){return e instanceof DOMException&&(22===e.code||1014===e.code||"QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&0!==n.length}},l=function(){function NullStorage(){r()(this,NullStorage)}return c()(NullStorage,[{key:"key",value:function(){return null}},{key:"getItem",value:function(){return null}},{key:"setItem",value:function(){}},{key:"removeItem",value:function(){}},{key:"clear",value:function(){}},{key:"length",get:function(){return 0}}]),NullStorage}(),u=function(){return a||(a=s("sessionStorage")?e.sessionStorage:s("localStorage")?e.localStorage:new l),a}}).call(this,n(16))},9:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return h})),n.d(t,"b",(function(){return b}));var a=n(20),i=n.n(a),r=n(34),o=n.n(r),c=n(13),s=n(43),l=n(42),u=n(12),d=n(2),g=n(70),f=n(101);function p(e,t){var n=Object.keys(e);return Object.getOwnPropertySymbols&&n.push.apply(n,Object.getOwnPropertySymbols(e)),t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n}function m(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?p(n,!0).forEach((function(t){i()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):p(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var h="core",b="modules",v=function(){e.googlesitekit.admin=e.googlesitekit.admin||{},"string"==typeof e.googlesitekit.admin.datacache&&(e.googlesitekit.admin.datacache=JSON.parse(e.googlesitekit.admin.datacache)),"object"!==o()(e.googlesitekit.admin.datacache)&&(e.googlesitekit.admin.datacache={})},k=function(e,t){var n=m({data:{}},e);return n.data=m({dateRange:t},n.data),n},_={maxRequests:10,combinedGetFromCache:function(e){var t=this;return new Promise((function(n,a){try{var i=[],r=Object(d.h)();Object(c.each)(e,(function(e){var n=k(e,r);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var a=t.getCache(n.key,n.maxAge);void 0!==a&&(i[n.key]=a,t.resolve(n,a))})),n(i)}catch(e){a()}}))},combinedGet:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=[],i=25,r=Object(d.h)();Object(c.each)(e,(function(e){var n=k(e,r);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var o=t.getCache(n.key,n.maxAge);void 0!==o?(setTimeout((function(){t.resolve(n,o)}),i),i+=25):a.push(n)})),a=Object(c.sortBy)(a,"priority");var o=[],g=[],f={},p=!!a.find((function(e){return e.priority<10}));Object(c.each)(a,(function(e,t){!n&&10<=e.priority&&p?g.push(e):f[e.key]?f[e.key].push(t):(f[e.key]=[t],o.push(e))}));var m=10,h=o.slice(0,m),b=o.slice(m);if(b=b.concat(g),0!==h.length||0!==b.length){0<b.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(b,!0)}),50):this.maxRequests=10;var v=null!==Object(d.m)("datacache");return Object(s.default)({path:Object(l.a)("/google-site-kit/v1/data/",{datacache:v||void 0}),data:{request:h},method:"POST"}).then((function(e){Object(c.each)(e,(function(e,n){f[n]?(t.handleWPError(e),Object(c.each)(f[n],(function(n){var i=a[n];t.setCache(i.key,e),t.resolve(i,e)})),0===b.length&&Object(u.d)("googlesitekit.dataLoaded","api")):console.error("data_error","unknown response key "+n)}))})).catch((function(e){console.warn("Error caught during combinedGet",e)}))}Object(u.d)("googlesitekit.dataLoaded","cache")},handleWPError:function(e){var t=["code","data","message"],n=Object(c.intersection)(t,Object.keys(e));if(Object(c.isEqual)(t,n)){console.warn("WP Error in data response",e);var a=e.data;if(a&&a.reason){var i=0;["authError","insufficientPermissions"].includes(a.reason)&&(Object(u.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(d.f)(g.a),1),i++),"forbidden"===a.reason&&(Object(u.b)("googlesitekit.ErrorNotification","googlesitekit.AuthNotification",Object(d.f)(f.a),1),i++),i&&Object(u.b)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(u.g)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+i}))}}},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(t,n){if(void 0!==n&&(!n||"object"!==o()(n)||!n.error&&!n.errors)){v(),e.googlesitekit.admin.datacache[t]=Object(c.cloneDeep)(n);var a={value:n,date:Date.now()/1e3};Object(d.p)().setItem("googlesitekit_"+t,JSON.stringify(a))}},getCache:function(t,n){if(!e.googlesitekit.admin.nojscache){if(v(),void 0!==e.googlesitekit.admin.datacache[t])return e.googlesitekit.admin.datacache[t];var a=JSON.parse(Object(d.p)().getItem("googlesitekit_"+t));return a&&"object"===o()(a)&&a.date&&(!n||Date.now()/1e3-a.date<n)?(e.googlesitekit.admin.datacache[t]=Object(c.cloneDeep)(a.value),Object(c.cloneDeep)(e.googlesitekit.admin.datacache[t])):void 0}},deleteCache:function(t){v(),delete e.googlesitekit.admin.datacache[t],Object(d.p)().removeItem("googlesitekit_"+t)},invalidateCacheGroup:function(t,n,a){var i=this.getCacheKey(t,n,a);v(),Object.keys(e.googlesitekit.admin.datacache).forEach((function(t){0!==t.indexOf(i+"::")&&t!==i||delete e.googlesitekit.admin.datacache[t]})),Object.keys(Object(d.p)()).forEach((function(e){0!==e.indexOf("googlesitekit_".concat(i,"::"))&&e!=="googlesitekit_".concat(i)||Object(d.p)().removeItem(e)}))},collectModuleData:function(e,t){var n=Object(u.c)("googlesitekit.module"+e+"DataRequest",[],t);0!==n.length&&this.combinedGet(n)},get:function(e,t,n){var a=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},r=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],o=this.getCacheKey(e,t,n,i);if(!r){var c=this.getCache(o,3600);if(void 0!==c)return new Promise((function(e){e(c)}))}return Object(s.default)({path:Object(l.a)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),i)}).then((function(e){return r||a.setCache(o,e),Promise.resolve(e)})).catch((function(e){return a.handleWPError(e),Promise.reject(e)}))},set:function(e,t,n,a){var i={};return i.data=a,Object(s.default)({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),data:i,method:"POST"}).then((function(a){return _.invalidateCacheGroup(e,t,n),new Promise((function(e){e(a)}))}))},getCacheKey:function(e,t,n){for(var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:null,i=[],r=[e,t,n],c=0,s=r;c<s.length;c++){var l=s[c];if(!l||!l.length)break;i.push(l)}return 3===i.length&&a&&"object"===o()(a)&&Object.keys(a).length&&i.push(Object(d.y)(a)),i.join("::")},setModuleActive:function(e,t){return this.set(h,"modules","activation",{slug:e,active:t})}};Object(u.e)("googlesitekit.moduleLoaded","googlesitekit.collectModuleData")||Object(u.a)("googlesitekit.moduleLoaded","googlesitekit.collectModuleData",_.collectModuleData.bind(_)),t.c=_}).call(this,n(16))},90:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var a=n(0);function i(){Object(a.setLocaleData)(e.googlesitekit.locale,"google-site-kit")}}).call(this,n(16))},91:function(e,t,n){"use strict";t.a=[/<meta name="googlesitekit-setup" content="([a-z0-9-]+)"/]},92:function(e,t,n){"use strict";t.a=[/google_ad_client: ?["|'](.*?)["|']/,/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/]},93:function(e,t,n){"use strict";t.a=[/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/,/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/,/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/,/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/,/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/,/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/]},94:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return i}));var a=n(124),i=n.n(a)()(e)}).call(this,n(16))},95:function(e,t,n){"use strict";(function(e){n(1);t.a=function Warning(){return e.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"#F9BB2D",width:"34",height:"34",viewBox:"0 0 24 24","aria-labelledby":"warning-title warning-desc"},e.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),e.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2v2zm0-4h-2V7h2v6z"}))}}).call(this,n(11))},99:function(e,t,n){"use strict";(function(e){n(1);var a=n(0),i=n(23);t.a=function Logo(){return e.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},e.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),e.createElement(i.a,{id:"logo-sitekit",className:"googlesitekit-logo__logo-sitekit",height:"26",width:"99"}),e.createElement("span",{className:"screen-reader-text"},Object(a.__)("Site Kit by Google Logo","google-site-kit")))}}).call(this,n(11))}});
dist/assets/js/googlesitekit-admin.js CHANGED
@@ -1,3 +1,3 @@
1
- !function(e){function t(t){for(var n,i,u=t[0],c=t[1],_=t[2],s=0,p=[];s<u.length;s++)i=u[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(t);p.length;)p.shift()();return a.push.apply(a,_||[]),r()}function r(){for(var e,t=0;t<a.length;t++){for(var r=a[t],n=!0,i=1;i<r.length;i++){var u=r[i];0!==o[u]&&(n=!1)}n&&(a.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},o={9:0},a=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var i=window.webpackJsonp=window.webpackJsonp||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var l=u;a.push([358,0]),r()}({358:function(e,t,r){"use strict";r.r(t),function(e){var t=r(75);if("toplevel_page_googlesitekit-dashboard"!==e.pagenow&&"site-kit_page_googlesitekit-splash"!==e.pagenow&&"admin_page_googlesitekit-splash"!==e.pagenow&&e.localStorage){var n=e.localStorage.getItem("googlesitekit::total-notifications")||0;Object(t.a)(n)}var o=document.querySelector("#wp-admin-bar-logout a");o||(o=document.querySelector(".sidebar__me-signout button")),o&&o.addEventListener("click",(function(){Object(t.b)()}))}.call(this,r(16))},75:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return l}));var n=r(50),o=r.n(n),a=r(0),i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null,r=null,n=document.querySelector("#toplevel_page_googlesitekit-dashboard .googlesitekit-notifications-counter"),o=document.querySelector("#wp-admin-bar-google-site-kit .googlesitekit-notifications-counter");if(n&&o)return!1;if(t=document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"),r=document.querySelector("#wp-admin-bar-google-site-kit .ab-item"),null===t&&null===r)return!1;var i=document.createElement("span");i.setAttribute("class","googlesitekit-notifications-counter update-plugins count-".concat(e));var u=document.createElement("span");u.setAttribute("class","plugin-count"),u.setAttribute("aria-hidden","true"),u.textContent=e;var c=document.createElement("span");return c.setAttribute("class","screen-reader-text"),c.textContent=Object(a.sprintf)(
2
/* translators: %d is the number of notifications */
3
Object(a._n)("%d notification","%d notifications",e,"google-site-kit"),e),i.appendChild(u),i.appendChild(c),t&&null===n&&t.appendChild(i),r&&null===o&&r.appendChild(i),i},u=function(){e.localStorage&&e.localStorage.clear(),e.sessionStorage&&e.sessionStorage.clear()},c=function(e){for(var t=location.search.substr(1).split("&"),r={},n=0;n<t.length;n++)r[t[n].split("=")[0]]=decodeURIComponent(t[n].split("=")[1]);return e?r.hasOwnProperty(e)?decodeURIComponent(r[e].replace(/\+/g," ")):"":r},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,r=new URL(t.href);if(e)return r.searchParams&&r.searchParams.get?r.searchParams.get(e):c(e);var n={},a=!0,i=!1,u=void 0;try{for(var l,_=r.searchParams.entries()[Symbol.iterator]();!(a=(l=_.next()).done);a=!0){var s=o()(l.value,2),p=s[0],d=s[1];n[p]=d}}catch(e){i=!0,u=e}finally{try{a||null==_.return||_.return()}finally{if(i)throw u}}return n}}).call(this,r(16))}});
1
+ !function(e){function t(t){for(var n,i,u=t[0],c=t[1],_=t[2],s=0,p=[];s<u.length;s++)i=u[s],Object.prototype.hasOwnProperty.call(o,i)&&o[i]&&p.push(o[i][0]),o[i]=0;for(n in c)Object.prototype.hasOwnProperty.call(c,n)&&(e[n]=c[n]);for(l&&l(t);p.length;)p.shift()();return a.push.apply(a,_||[]),r()}function r(){for(var e,t=0;t<a.length;t++){for(var r=a[t],n=!0,i=1;i<r.length;i++){var u=r[i];0!==o[u]&&(n=!1)}n&&(a.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},o={9:0},a=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="";var i=window.webpackJsonp=window.webpackJsonp||[],u=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var l=u;a.push([402,0]),r()}({402:function(e,t,r){"use strict";r.r(t),function(e){var t=r(72);if("toplevel_page_googlesitekit-dashboard"!==e.pagenow&&"site-kit_page_googlesitekit-splash"!==e.pagenow&&"admin_page_googlesitekit-splash"!==e.pagenow&&e.localStorage){var n=e.localStorage.getItem("googlesitekit::total-notifications")||0;Object(t.a)(n)}var o=document.querySelector("#wp-admin-bar-logout a");o||(o=document.querySelector(".sidebar__me-signout button")),o&&o.addEventListener("click",(function(){Object(t.b)()}))}.call(this,r(16))},72:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return u})),r.d(t,"c",(function(){return l}));var n=r(50),o=r.n(n),a=r(0),i=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null,r=null,n=document.querySelector("#toplevel_page_googlesitekit-dashboard .googlesitekit-notifications-counter"),o=document.querySelector("#wp-admin-bar-google-site-kit .googlesitekit-notifications-counter");if(n&&o)return!1;if(t=document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"),r=document.querySelector("#wp-admin-bar-google-site-kit .ab-item"),null===t&&null===r)return!1;var i=document.createElement("span");i.setAttribute("class","googlesitekit-notifications-counter update-plugins count-".concat(e));var u=document.createElement("span");u.setAttribute("class","plugin-count"),u.setAttribute("aria-hidden","true"),u.textContent=e;var c=document.createElement("span");return c.setAttribute("class","screen-reader-text"),c.textContent=Object(a.sprintf)(
2
/* translators: %d is the number of notifications */
3
Object(a._n)("%d notification","%d notifications",e,"google-site-kit"),e),i.appendChild(u),i.appendChild(c),t&&null===n&&t.appendChild(i),r&&null===o&&r.appendChild(i),i},u=function(){e.localStorage&&e.localStorage.clear(),e.sessionStorage&&e.sessionStorage.clear()},c=function(e){for(var t=location.search.substr(1).split("&"),r={},n=0;n<t.length;n++)r[t[n].split("=")[0]]=decodeURIComponent(t[n].split("=")[1]);return e?r.hasOwnProperty(e)?decodeURIComponent(r[e].replace(/\+/g," ")):"":r},l=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,r=new URL(t.href);if(e)return r.searchParams&&r.searchParams.get?r.searchParams.get(e):c(e);var n={},a=!0,i=!1,u=void 0;try{for(var l,_=r.searchParams.entries()[Symbol.iterator]();!(a=(l=_.next()).done);a=!0){var s=o()(l.value,2),p=s[0],d=s[1];n[p]=d}}catch(e){i=!0,u=e}finally{try{a||null==_.return||_.return()}finally{if(i)throw u}}return n}}).call(this,r(16))}});
dist/assets/js/googlesitekit-adminbar-loader.js CHANGED
@@ -1,3 +1,3 @@
1
- !function(e){function t(t){for(var n,a,c=t[0],u=t[1],l=t[2],d=0,g=[];d<c.length;d++)a=c[d],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&g.push(i[a][0]),i[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);g.length;)g.shift()();return o.push.apply(o,l||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==i[c]&&(n=!1)}n&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},i={10:0},o=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.e=function(e){var t=[],r=i[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=i[e]=[t,n]}));t.push(r[2]=n);var o,a=document.createElement("script");a.charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.src=function(e){return __webpack_require__.p+""+({1:"chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard~chunk-googlesitekit-setup-wizard-proxy",2:"vendors~chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard-proxy",4:"chunk-googlesitekit-adminbar",21:"vendors~chunk-googlesitekit-adminbar"}[e]||e)+"-"+{1:"521957e350e8b8963c17",2:"ab1432a35d53db6a9ee4",4:"6a3138e50217e279fc5b",21:"a7f81ecf39a2695b860a"}[e]+".js"}(e);var c=new Error;o=function(t){a.onerror=a.onload=null,clearTimeout(u);var r=i[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",c.name="ChunkLoadError",c.type=n,c.request=o,r[1](c)}i[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:a})}),12e4);a.onerror=a.onload=o,document.head.appendChild(a)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=c;o.push([357,0]),r()}({357:function(e,t,r){"use strict";r.r(t),function(e){var t=r(75),n=r(45);e.googlesitekitAdminbar&&e.googlesitekitAdminbar.publicPath&&(r.p=e.googlesitekitAdminbar.publicPath);var i=!1;function o(){Promise.all([r.e(2),r.e(21),r.e(1),r.e(4)]).then(r.bind(null,364)).then((function(e){return e})).catch((function(){return new Error("Site Kit: An error occurred while loading the Adminbar component files.")})).then((function(e){try{e.init()}catch(e){console.error("Site Kit: An error occurred while loading the Adminbar components."),document.getElementById("js-googlesitekit-adminbar").classList.add("googlesitekit-adminbar--has-error")}document.getElementById("js-googlesitekit-adminbar").classList.remove("googlesitekit-adminbar--loading")}))}e.addEventListener("load",(function(){var r=document.getElementById("wp-admin-bar-google-site-kit");if(r&&e.localStorage){var a=e.localStorage.getItem("googlesitekit::total-notifications")||0;Object(t.a)(a);var c=function(){i||(Object(n.c)("admin_bar","page_stats_view"),o(),i=!0)};"true"===Object(t.c)("googlesitekit_adminbar_open")?(c(),r.classList.add("hover")):r.addEventListener("mouseenter",c,!1)}}))}.call(this,r(16))},40:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return a}));var n=r(54),i="_googlesitekitDataLayer",o="data-googlesitekit-gtag";function a(t,r){var a=Object(n.a)(r);return function(){t.trackingEnabled=!0;var r=e.document;if(!r.querySelector("script[".concat(o,"]"))){var n=r.createElement("script");n.setAttribute(o,""),n.async=!0,n.src="https://www.googletagmanager.com/gtag/js?id=".concat(t.trackingID,"&l=").concat(i),r.head.appendChild(n),a("js",new Date),a("config",t.trackingID)}}}}).call(this,r(16))},45:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return l}));var n=r(77),i=e._googlesitekitBaseData||{},o={isFirstAdmin:i.isFirstAdmin,trackingEnabled:i.trackingEnabled,trackingID:i.trackingID,referenceSiteURL:i.referenceSiteURL,userIDHash:i.userIDHash},a=Object(n.a)(o),c=a.enableTracking,u=a.disableTracking,s=a.isTrackingEnabled,l=a.trackEvent;function d(e){e?c():u()}d(s())}).call(this,r(16))},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(40);function i(e){return function(){e[n.a]=e[n.a]||[],e[n.a].push(arguments)}}},75:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return a})),r.d(t,"b",(function(){return c})),r.d(t,"c",(function(){return s}));var n=r(50),i=r.n(n),o=r(0),a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,t=null,r=null,n=document.querySelector("#toplevel_page_googlesitekit-dashboard .googlesitekit-notifications-counter"),i=document.querySelector("#wp-admin-bar-google-site-kit .googlesitekit-notifications-counter");if(n&&i)return!1;if(t=document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"),r=document.querySelector("#wp-admin-bar-google-site-kit .ab-item"),null===t&&null===r)return!1;var a=document.createElement("span");a.setAttribute("class","googlesitekit-notifications-counter update-plugins count-".concat(e));var c=document.createElement("span");c.setAttribute("class","plugin-count"),c.setAttribute("aria-hidden","true"),c.textContent=e;var u=document.createElement("span");return u.setAttribute("class","screen-reader-text"),u.textContent=Object(o.sprintf)(
2
/* translators: %d is the number of notifications */
3
- Object(o._n)("%d notification","%d notifications",e,"google-site-kit"),e),a.appendChild(c),a.appendChild(u),t&&null===n&&t.appendChild(a),r&&null===i&&r.appendChild(a),a},c=function(){e.localStorage&&e.localStorage.clear(),e.sessionStorage&&e.sessionStorage.clear()},u=function(e){for(var t=location.search.substr(1).split("&"),r={},n=0;n<t.length;n++)r[t[n].split("=")[0]]=decodeURIComponent(t[n].split("=")[1]);return e?r.hasOwnProperty(e)?decodeURIComponent(r[e].replace(/\+/g," ")):"":r},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,r=new URL(t.href);if(e)return r.searchParams&&r.searchParams.get?r.searchParams.get(e):u(e);var n={},o=!0,a=!1,c=void 0;try{for(var s,l=r.searchParams.entries()[Symbol.iterator]();!(o=(s=l.next()).done);o=!0){var d=i()(s.value,2),g=d[0],_=d[1];n[g]=_}}catch(e){a=!0,c=e}finally{try{o||null==l.return||l.return()}finally{if(a)throw c}}return n}}).call(this,r(16))},77:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s}));var n=r(20),i=r.n(n),o=r(40),a=r(78);function c(e,t){var r=Object.keys(e);return Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(e)),t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r}var u={isFirstAdmin:!1,trackingEnabled:!1,trackingID:"",referenceSiteURL:"",userIDHash:""};function s(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,n=function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?c(r,!0).forEach((function(t){i()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):c(r).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},u,{},t);return n.referenceSiteURL&&(n.referenceSiteURL=n.referenceSiteURL.toString().replace(/\/+#x2F;,"")),{enableTracking:Object(o.b)(n,r),disableTracking:function(){n.trackingEnabled=!1},isTrackingEnabled:function(){return!!n.trackingEnabled},trackEvent:Object(a.a)(n,r)}}}).call(this,r(16))},78:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(54);function i(e,t){var r=Object(n.a)(t);return function(t,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",a=e.isFirstAdmin,c=e.referenceSiteURL,u=e.trackingEnabled,s=e.trackingID,l=e.userIDHash;u&&r("event",n,{send_to:s,event_category:t,event_label:i,event_value:o,dimension1:c,dimension2:a?"true":"false",dimension3:l})}}}});
1
+ !function(e){function t(t){for(var n,a,c=t[0],u=t[1],l=t[2],d=0,g=[];d<c.length;d++)a=c[d],Object.prototype.hasOwnProperty.call(i,a)&&i[a]&&g.push(i[a][0]),i[a]=0;for(n in u)Object.prototype.hasOwnProperty.call(u,n)&&(e[n]=u[n]);for(s&&s(t);g.length;)g.shift()();return o.push.apply(o,l||[]),r()}function r(){for(var e,t=0;t<o.length;t++){for(var r=o[t],n=!0,a=1;a<r.length;a++){var c=r[a];0!==i[c]&&(n=!1)}n&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var n={},i={10:0},o=[];function __webpack_require__(t){if(n[t])return n[t].exports;var r=n[t]={i:t,l:!1,exports:{}};return e[t].call(r.exports,r,r.exports,__webpack_require__),r.l=!0,r.exports}__webpack_require__.e=function(e){var t=[],r=i[e];if(0!==r)if(r)t.push(r[2]);else{var n=new Promise((function(t,n){r=i[e]=[t,n]}));t.push(r[2]=n);var o,a=document.createElement("script");a.charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.src=function(e){return __webpack_require__.p+""+({1:"chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard~chunk-googlesitekit-setup-wizard-proxy",2:"vendors~chunk-googlesitekit-adminbar~chunk-googlesitekit-setup-wizard-proxy",4:"chunk-googlesitekit-adminbar",21:"vendors~chunk-googlesitekit-adminbar"}[e]||e)+"-"+{1:"2422cbe0801b8fe596c6",2:"afa5462390409683f6d7",4:"0e532f3d6c0b4943f6fd",21:"711f81202b21622c492a"}[e]+".js"}(e);var c=new Error;o=function(t){a.onerror=a.onload=null,clearTimeout(u);var r=i[e];if(0!==r){if(r){var n=t&&("load"===t.type?"missing":t.type),o=t&&t.target&&t.target.src;c.message="Loading chunk "+e+" failed.\n("+n+": "+o+")",c.name="ChunkLoadError",c.type=n,c.request=o,r[1](c)}i[e]=void 0}};var u=setTimeout((function(){o({type:"timeout",target:a})}),12e4);a.onerror=a.onload=o,document.head.appendChild(a)}return Promise.all(t)},__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,r){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},__webpack_require__.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.t=function(e,t){if(1&t&&(e=__webpack_require__(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(__webpack_require__.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(r,n,function(t){return e[t]}.bind(null,n));return r},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,"a",t),t},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},__webpack_require__.p="",__webpack_require__.oe=function(e){throw console.error(e),e};var a=window.webpackJsonp=window.webpackJsonp||[],c=a.push.bind(a);a.push=t,a=a.slice();for(var u=0;u<a.length;u++)t(a[u]);var s=c;o.push([401,0]),r()}({40:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return i})),r.d(t,"b",(function(){return a}));var n=r(54),i="_googlesitekitDataLayer",o="data-googlesitekit-gtag";function a(t,r){var a=Object(n.a)(r);return function(){t.trackingEnabled=!0;var r=e.document;if(!r.querySelector("script[".concat(o,"]"))){var n=r.createElement("script");n.setAttribute(o,""),n.async=!0,n.src="https://www.googletagmanager.com/gtag/js?id=".concat(t.trackingID,"&l=").concat(i),r.head.appendChild(n),a("js",new Date),a("config",t.trackingID)}}}}).call(this,r(16))},401:function(e,t,r){"use strict";r.r(t),function(e){var t=r(72),n=r(45);e.googlesitekitAdminbar&&e.googlesitekitAdminbar.publicPath&&(r.p=e.googlesitekitAdminbar.publicPath);var i=!1;function o(){Promise.all([r.e(2),r.e(21),r.e(1),r.e(4)]).then(r.bind(null,409)).then((function(e){return e})).catch((function(){return new Error("Site Kit: An error occurred while loading the Adminbar component files.")})).then((function(e){try{e.init()}catch(e){console.error("Site Kit: An error occurred while loading the Adminbar components."),document.getElementById("js-googlesitekit-adminbar").classList.add("googlesitekit-adminbar--has-error")}document.getElementById("js-googlesitekit-adminbar").classList.remove("googlesitekit-adminbar--loading")}))}e.addEventListener("load",(function(){var r=document.getElementById("wp-admin-bar-google-site-kit");if(r&&e.localStorage){var a=e.localStorage.getItem("googlesitekit::total-notifications")||0;Object(t.a)(a);var c=function(){i||(Object(n.c)("admin_bar","page_stats_view"),o(),i=!0)};"true"===Object(t.c)("googlesitekit_adminbar_open")?(c(),r.classList.add("hover")):r.addEventListener("mouseenter",c,!1)}}))}.call(this,r(16))},45:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return s})),r.d(t,"b",(function(){return d})),r.d(t,"c",(function(){return l}));var n=r(76),i=e._googlesitekitBaseData||{},o={isFirstAdmin:i.isFirstAdmin,trackingEnabled:i.trackingEnabled,trackingID:i.trackingID,referenceSiteURL:i.referenceSiteURL,userIDHash:i.userIDHash},a=Object(n.a)(o),c=a.enableTracking,u=a.disableTracking,s=a.isTrackingEnabled,l=a.trackEvent;function d(e){e?c():u()}d(s())}).call(this,r(16))},54:function(e,t,r){"use strict";r.d(t,"a",(function(){return i}));var n=r(40);function i(e){return function(){e[n.a]=e[n.a]||[],e[n.a].push