Site Kit by Google - Version 1.1.3

Version Description

Download this release

Release Info

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

Code changes from version 1.1.2 to 1.1.3

dist/assets/js/allmodules.js CHANGED
@@ -1,11 +1,11 @@
1
- !function(e){function t(t){for(var n,c,s=t[0],r=t[1],d=t[2],u=0,g=[];u<s.length;u++)c=s[u],i[c]&&g.push(i[c][0]),i[c]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);for(l&&l(t);g.length;)g.shift()();return o.push.apply(o,d||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],n=!0,c=1;c<a.length;c++){var s=a[c];0!==i[s]&&(n=!1)}n&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=a[0]))}return e}var n={},i={3:0},o=[];function __webpack_require__(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,a){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},__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 a=Object.create(null);if(__webpack_require__.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(a,n,function(t){return e[t]}.bind(null,n));return a},__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 c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var r=0;r<c.length;r++)t(c[r]);var l=s;o.push([187,0,1]),a()}([function(e,t){e.exports=wp.i18n},function(e,t){e.exports=wp.element},,,,,,,,,function(e,t){e.exports=wp.hooks},function(e,t){e.exports=lodash},,,,,,,function(e,t){e.exports=React},function(e,t,a){"use strict";var n=a(68),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(11),b=a(55),f=a(45),k=a(90),y=a(10),v=a(0);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{inGrid:!1,fullWidth:!1,createGrid:!1},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1},s=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(v.__)("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(v.__)("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(l){function u(e){var a;c()(this,u),(a=d()(this,g()(u).call(this,e))).state={data:!1,zeroData:!1,error:!1},Object(y.addAction)("googlesitekit.moduleDataReset","googlesitekit.moduleDataResetHandler",(function(){a.setState({data:!1})}));var n=function(e,t){var n=a.props,i=n.handleDataError,c=n.handleDataSuccess,r=t.datapoint,l=t.identifier,d=t.toState,u=s(e);u?(a.setState({error:u,module:l}),i&&i(u)):o(e,r,t)?(i&&i(u),a.setState({zeroData:!0})):c&&c(),a.setState({requestDataToState:d,data:e,datapoint:r,module:l})};return Object(_.each)(t,(function(e){Array.isArray(e.context)?Object(_.each)(e.context,(function(t){Object(y.addFilter)("googlesitekit.module".concat(t,"DataRequest"),"googlesitekit.data".concat(t),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})):Object(y.addFilter)("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}))})),a}return m()(u,l),r()(u,[{key:"render",value:function(){var t=this.state,o=t.data,c=t.datapoint,s=t.module,r=t.zeroData,l=t.error,d=t.requestDataToState;if(!o)return a;var u=s?googlesitekit.modules[s].name:Object(v.__)("Site Kit","google-site-kit");return s&&googlesitekit.modules[s].active&&!googlesitekit.modules[s].setupComplete?Object(k.a)(s,n.inGrid,n.fullWidth,n.createGrid):l?"string"!=typeof l?l:Object(f.a)(u,l,n.inGrid,n.fullWidth,n.createGrid):r?Object(b.a)(u,n.inGrid,n.fullWidth,n.createGrid):React.createElement(e,i()({data:o,datapoint:c,requestDataToState:d},this.props))}}]),u}(h.Component)}},,,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(8),h=a.n(m),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.padding;return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block\n\t\t\t\t\t".concat(i?"googlesitekit-preview-block--padding":"","\n\t\t\t\t"),style:{width:t,height:a}},React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block__wrapper\n\t\t\t\t\t".concat("circular"===n?"googlesitekit-preview-block__wrapper--circle":"","\n\t\t\t\t")}))}}]),t}(p.Component);_.propTypes={width:h.a.string,height:h.a.string,shape:h.a.string,padding:h.a.bool},_.defaultProps={width:"100px",height:"100px",shape:"square",padding:!1},t.a=_},,,,,function(e,t,a){"use strict";a.d(t,"b",(function(){return v})),a.d(t,"a",(function(){return O}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(8),b=a.n(_),f=a(60),k=a(14),y=a(11),v=function(e,t,a){var n=[],i=a.links,o=a.source,c=a.showURLs;return a.cap&&(e=e.slice(0,a.cap)),Object(y.each)(e,(function(e,t){var a=[],o=i&&i[t];Object(y.each)(e,(function(t,n){"string"==typeof t&&(t=t.replace(/\(none\)/gi,"direct")),a.push(React.createElement("td",{key:"cell-"+n,className:"googlesitekit-table__body-item"},e[0]===t&&o?React.createElement("div",{className:"googlesitekit-table__body-item-content"},React.createElement(k.a,{className:"googlesitekit-table__body-item-link",href:o,external:!0,inherit:!0},t),c&&""!==Object(y.trim)(o,"/")&&React.createElement(k.a,{className:"googlesitekit-table__body-item-url",href:o,inherit:!0,external:!0},Object(y.trim)(o,"/"))):React.createElement("div",{className:"googlesitekit-table__body-item-content"},t)))})),n.push(React.createElement("tr",{key:"tr-"+t,className:"googlesitekit-table__body-row"},a))})),React.createElement("div",{className:"googlesitekit-table".concat(a&&a.disableListMode?"":" googlesitekit-table--with-list")},React.createElement("table",{className:"\n\t\t\t\t\tgooglesitekit-table__wrapper\n\t\t\t\t\tgooglesitekit-table__wrapper--".concat(e&&e[0]?e[0].length:1,"-col\n\t\t\t\t")},React.createElement("thead",{className:"googlesitekit-table__head"},React.createElement("tr",{key:"gksc_data_row_header-wrap",style:a&&a.hideHeader?{display:"none"}:{},className:"googlesitekit-table__head-row"},t.map((function(e,t){return React.createElement("th",{key:"gksc_data_row_header-".concat(t),className:"\n\t\t\t\t\t\t\t\t\tgooglesitekit-table__head-item\n\t\t\t\t\t\t\t\t\t".concat(e.primary?"googlesitekit-table__head-item--primary":"","\n\t\t\t\t\t\t\t\t"),"data-tooltip":e.tooltip},e.title)})))),React.createElement("tbody",{className:"googlesitekit-table__body"},n)),o&&React.createElement(f.a,{className:"googlesitekit-table__source",name:o.name,href:o.link}))},O=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).call(this))).state={isScrolling:!1},e.scrollRef=Object(h.createRef)(),e.updateFadeOnScroll=e.updateFadeOnScroll.bind(g()(e)),e}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;e.updateFadeOnScroll(),this.resize=Object(y.debounce)((function(){e.updateFadeOnScroll()}),100),window.addEventListener("resize",this.resize)}},{key:"componentWillUnmount",value:function(){window.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 e=this.props.children,t=this.state.isScrolling;return React.createElement("div",{onScroll:Object(y.debounce)(this.updateFadeOnScroll,100),className:"\n\t\t\t\t\tgooglesitekit-table-overflow\n\t\t\t\t\t".concat(t?"googlesitekit-table-overflow--gradient":"","\n\t\t\t\t")},React.createElement("div",{ref:this.scrollRef,className:"googlesitekit-table-overflow__container"},e))}}]),t}(h.Component);O.propTypes={children:b.a.element}},,,,,,,function(e,t){e.exports=wp.apiFetch},function(e,t){e.exports=wp.url},,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(23),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.rows,a=e.rowHeight,n=e.padding,i=[],o=0;t>o;o++)i.push(React.createElement("div",{className:"googlesitekit-preview-table__row",key:"table-row-"+o},React.createElement(m.a,{width:"100%",height:a+"px"})));return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-preview-table\n\t\t\t\t".concat(n?"googlesitekit-preview-table--padding":"","\n\t\t\t")},i)}}]),t}(p.Component);b.propTypes={rows:_.a.number,rowHeight:_.a.number,padding:_.a.bool},b.defaultProps={rows:11,rowHeight:35,padding:!1},t.a=b},,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(8),h=a.n(m),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.description;return React.createElement("header",{className:"googlesitekit-dashboard-module-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.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 "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-module-header__title "},t),a&&React.createElement("p",{className:"googlesitekit-dashboard-module-header__description"},a))))}}]),t}(p.Component);_.propTypes={title:h.a.string,description:h.a.string},_.defaultProps={title:"",description:""},t.a=_},,,function(e,t,a){"use strict";a.r(t),a.d(t,"reduceAdSenseData",(function(){return d})),a.d(t,"getAdSenseAccountStatus",(function(){return u})),a.d(t,"isAdsenseConnectedAnalytics",(function(){return g})),a.d(t,"isDataZeroAdSense",(function(){return p}));var n=a(12),i=a.n(n),o=a(9),c=a(2),s=a(11),r=a(0),l=a(15);function d(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 u=function(){var e,t,a,n,l,d,u,g,p,m,h,_,b,f,k,y,v,O,R,E,S,j,w,D,C,x,N,A,P,L=arguments;return i.a.async((function(M){for(;;)switch(M.prev=M.next){case 0:return e=L.length>0&&void 0!==L[0]&&L[0],t=L.length>1&&void 0!==L[1]?L[1]:function(){},n=!1,M.prev=3,t(Object(r.__)("Locating accounts…","google-site-kit")),M.next=7,i.a.awrap(o.c.get(o.b,"adsense","accounts").then((function(e){return e})).catch((function(e){return e})));case 7:if(l=M.sent,!(1<(d=!l.data||l.data.status&&200!==l.data.status?l:l.data).length)){M.next=42;break}t(Object(r.__)("Searching for domain…","google-site-kit")),u=!0,g=!1,p=void 0,M.prev=14,m=d[Symbol.iterator]();case 16:if(u=(h=m.next()).done){M.next=28;break}return _=h.value,b=_.id,M.next=21,i.a.awrap(o.c.get(o.b,"adsense","urlchannels",{clientID:b}).then((function(e){return e})).catch((function(e){return e})));case 21:f=M.sent,k=new URL(googlesitekit.admin.siteURL),(y=f&&f.length?Object(s.filter)(f,{urlPattern:k.hostname}):[])&&0!==y.length?(O=y[0].id,Object(c.v)("adsense_setup","adsense_account_detected")):(a="account-pending-review",Object(c.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"));case 25:u=!0,M.next=16;break;case 28:M.next=34;break;case 30:M.prev=30,M.t0=M.catch(14),g=!0,p=M.t0;case 34:M.prev=34,M.prev=35,u||null==m.return||m.return();case 37:if(M.prev=37,!g){M.next=40;break}throw p;case 40:return M.finish(37);case 41:return M.finish(34);case 42:if(v=d&&d.message&&d.message.error,O=!!(d&&d.length&&d[0])&&d[0].id,d&&O&&!v){M.next=50;break}R=(v||{}).errors,"noAdSenseAccount"!==(E=R[0].reason)&&d&&O||(a="disapprovedAccount"===E?"disapproved-account":e?"no-account-tag-found":"no-account"),M.next=118;break;case 50:return googlesitekit.modules.adsense.accountURL=Object(r.sprintf)("https://www.google.com/adsense/new/%s/home",O),t(Object(r.__)("Account found, checking account status…","google-site-kit")),M.next=54,i.a.awrap(o.c.get(o.b,"adsense","alerts",{accountID:O}).then((function(e){return e})).catch((function(e){return e})));case 54:if(S=M.sent,j=!S.data||S.data.status&&200!==S.data.status?S:S.data,w=j&&j.message&&j.message.error,!Object(s.find)(S,{type:"GRAYLISTED_PUBLISHER"})){M.next=62;break}a="ads-display-pending",Object(c.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=118;break;case 62:return M.next=64,i.a.awrap(o.c.get(o.b,"adsense","clients").then((function(e){return e})).catch((function(e){return e})));case 64:if(D=M.sent,C=!D.data||D.data.status&&200!==D.data.status?D:D.data,x=C&&C.message&&C.message.error,!(N=!(!C||!C.length)&&Object(s.find)(C,{productCode:"AFC"}))){M.next=72;break}return n=N.id,M.next=72,i.a.awrap(o.c.set(o.b,"adsense","client-id",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 72:if(!w){M.next=77;break}"accountPendingReview"===j.message.error.errors[0].reason&&(a="ads-display-pending",Object(c.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending")),M.next=118;break;case 77:if(t(Object(r.__)("Looking for AdSense client…","google-site-kit")),!x){M.next=83;break}a="account-required-action",Object(c.v)("adsense_setup","adsense_required_action","accountRequiredAction status"),M.next=118;break;case 83:if(!N){M.next=117;break}return n=N.id,t(Object(r.__)("Looking for site domain…","google-site-kit")),M.next=88,i.a.awrap(o.c.get(o.b,"adsense","urlchannels",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 88:if(A=M.sent,P=A&&A.length&&Object(s.filter)(A,(function(e){return 0<googlesitekit.admin.siteURL.indexOf(e.urlPattern)})),0!==A.length){M.next=95;break}a="ads-display-pending",Object(c.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=115;break;case 95:if(P&&0!==P.length){M.next=100;break}a="account-pending-review",Object(c.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"),M.next=115;break;case 100:if(!e||n!==e){M.next=105;break}a="account-connected",Object(c.v)("adsense_setup","adsense_account_connected","existing_matching_tag"),M.next=115;break;case 105:if(!e||n===e){M.next=110;break}a="account-connected-nonmatching",Object(c.v)("adsense_setup","adsense_account_connected","existing_non_matching_tag"),M.next=115;break;case 110:return a="account-connected",t(Object(r.__)("Connecting…","google-site-kit")),Object(c.v)("adsense_setup","adsense_account_connected"),M.next=115,i.a.awrap(o.c.set(o.b,"adsense","setup-complete",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 115:M.next=118;break;case 117:a="disapproved-account-afc";case 118:return M.next=120,i.a.awrap(o.c.set(o.b,"adsense","account-status",{accountStatus:a}).then((function(e){return e})).catch((function(e){return e})));case 120:return M.abrupt("return",{accountStatus:a,clientID:n});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]])},g=function(){var e,t,a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=googlesitekit.modules.adsense.active,t=googlesitekit.modules.analytics.active,a=!0,!e||!t){n.next=6;break}return n.next=6,i.a.awrap(o.c.get(o.b,"analytics","report",l.analyticsAdsenseReportDataDefaults).then((function(e){e&&(a=!0)})).catch((function(e){400===e.code&&"INVALID_ARGUMENT"===e.message&&(a=!1)})));case 6:return n.abrupt("return",new Promise((function(e){e(a)})));case 7:case"end":return n.stop()}}))},p=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}},function(e,t,a){"use strict";var n=a(1),i=a(32),o=a(71),c=a(2),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),p=a(6),m=a.n(p),h=a(7),_=a.n(h),b=a(26),f=a(0),k=function(e){function t(){return r()(this,t),g()(this,m()(t).apply(this,arguments))}return _()(t,e),d()(t,[{key:"render",value:function(){return React.createElement(b.a,{id:"notification-id",title:Object(f.__)("Security Token Error","google-site-kit"),description:Object(f.__)("We’re unable to retrieve your data because your security token is expired or revoked. Please ","google-site-kit"),learnMoreURL:googlesitekit.admin.connectURL,learnMoreLabel:Object(f.__)("reauthenticate your account","google-site-kit"),format:"small",type:"win-error"})}}]),t}(n.Component);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=React.createElement(i.a,{title:Object(f.sprintf)(Object(f.__)("Data error in %s","google-site-kit"),e),description:t,error:!0});return"Invalid Credentials"===t&&Object(c.w)(k),Object(o.a)(r,a,n,s)}},,,,,function(e,t){e.exports=ReactDOM},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(56),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.change,n=e.id,i=e.loadSmall,o=e.loadCompressed,c=e.loadHeight,s=e.loadText;if(!t)return"loading...";var r={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<=+a?"green":"red"]};return React.createElement("div",{className:"googlesitekit-analytics-sparkline-chart-wrap"},React.createElement(m.a,{data:t,options:r,id:n,loadSmall:i,loadCompressed:o,loadHeight:c,loadText:s}))}}]),t}(p.Component);b.propTypes={loadSmall:_.a.bool,loadCompressed:_.a.bool,loadHeight:_.a.number,loadText:_.a.bool},b.defaultProps={loadSmall:!0,loadCompressed:!0,loadHeight:46,loadText:!1},t.a=b},,,,function(e,t,a){"use strict";a(1);var n=a(32),i=a(71),o=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=React.createElement(n.a
2
  /* translators: %s: Module name */,{title:Object(o.sprintf)(Object(o.__)("%s Gathering Data","google-site-kit"),e)
3
- /* translators: %s: Module name */,description:Object(o.sprintf)(Object(o.__)("%s data is not yet available, please check back later.","google-site-kit"),e)});return Object(i.a)(s,t,a,c)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(31),b=a(8),f=a.n(b),k=a(0),y=a(10),v=a(11),O=function(e){function t(e){var a;if(i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,chart:null},a.waitForChart=a.waitForChart.bind(g()(a)),a.getData=a.getData.bind(g()(a)),a.prepareChart=a.prepareChart.bind(g()(a)),a.drawChart=a.drawChart.bind(g()(a)),a.updateChart=a.updateChart.bind(g()(a)),a.chartRef=Object(h.createRef)(),window.google||window.googleChartLoaded)window.google&&window.google.charts?window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()})):Object(y.addAction)("googlesitekit.ChartLoaderLoaded","googlesitekit.HandleChartLoaderLoaded",(function(){window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()}))}));else{window.googleChartLoaded=!0;var n=document.createElement("script");n.type="text/javascript",n.onload=function(){n.onload=null,window.google.charts.load("visualization","1",{packages:["corechart"]}),window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart(),a.setState({loading:!1})})),Object(y.doAction)("googlesitekit.ChartLoaderLoaded")},document.getElementsByTagName("head")[0].appendChild(n),n.src="https://www.gstatic.com/charts/loader.js"}return a}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this.resize=Object(v.debounce)((function(){e.drawChart()}),100),window.addEventListener("resize",this.resize)}},{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(){window.removeEventListener("resize",this.resize)}},{key:"waitForChart",value:function(e){setTimeout((function(){e()}),500)}},{key:"getData",value:function(){return window.google&&window.google.visualization&&window.google.visualization.arrayToDataTable(this.props.data)}},{key:"prepareChart",value:function(){if(window.google){var e=this.chartRef.current,t="pie"===this.props.chartType?new window.google.visualization.PieChart(e):new window.google.visualization.LineChart(e);this.setState({chart:t})}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 e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=t.singleStat,o=this.getData();if(null!==o&&null!==e){var c=new window.google.visualization.DataView(o);if(!i){var s=[0];s=s.concat(a.map((function(e){return e+1}))),c.setColumns(s)}e.draw(c,n)}else this.waitForChart(this.drawChart)}},{key:"render",value:function(){var e=this.state.loading,t=this.props,a=t.className,n=t.loadSmall,i=t.loadCompressed,o=t.loadHeight,c=t.loadText;return React.createElement("div",{className:"googlesitekit-graph-wrapper"},React.createElement("div",{ref:this.chartRef,className:"googlesitekit-line-chart"},React.createElement("div",{className:"googlesitekit-chart-loading"},e&&React.createElement("div",{className:"googlesitekit-chart-loading__wrapper"},c&&React.createElement("p",null,Object(k.__)("Loading chart...","google-site-kit")),React.createElement(_.a,{className:a,small:n,compress:i,height:o})))))}}]),t}(h.Component);O.propTypes={selectedStats:f.a.array,options:f.a.object.isRequired,id:f.a.string,singleStat:f.a.bool,className:f.a.string,loadSmall:f.a.bool,loadCompressed:f.a.bool,loadHeight:f.a.number,loadText:f.a.bool},O.defaultProps={selectedStats:[],id:"",singleStat:!0,className:"",loadSmall:!1,loadCompressed:!1,loadHeight:null,loadText:!0},t.a=O},,,function(e,t){e.exports=wp.compose},,,,,function(e,t,a){"use strict";a.r(t),a.d(t,"getScoreCategoryLabel",(function(){return o})),a.d(t,"PageSpeedReportScoreCategoryWrapper",(function(){return c})),a.d(t,"PageSpeedReportScoreGauge",(function(){return s})),a.d(t,"PageSpeedReportScale",(function(){return r}));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")},c=function(e){var t=e.score,a=e.children,n="googlesitekit-pagespeed-report__score-category-wrapper googlesitekit-pagespeed-report__score-category-wrapper--".concat(i(t)),o="googlesitekit-pagespeed-report__score-icon googlesitekit-pagespeed-report__score-icon--".concat(i(t));return React.createElement("span",{className:n},a," ",React.createElement("span",{className:o}))},s=function(e){var t=e.score,a=parseInt(100*t,10),o="\n\t\tgooglesitekit-percentage-circle\n\t\tgooglesitekit-percentage-circle--".concat(i(t),"\n\t\tgooglesitekit-percentage-circle--percent-").concat(a,"\n\t");return React.createElement("div",{className:"googlesitekit-pagespeed-report__score-gauge"},React.createElement("div",{className:o},React.createElement("div",{className:"googlesitekit-percentage-circle__text"},a),React.createElement("div",{className:"googlesitekit-percentage-circle__slice"},React.createElement("div",{className:"googlesitekit-percentage-circle__bar"}),React.createElement("div",{className:"googlesitekit-percentage-circle__fill"}))),React.createElement("span",{className:"googlesitekit-pagespeed-report__score-gauge-label screen-reader-only"},Object(n.__)("Performance","google-site-kit")))},r=function(){return React.createElement("div",{className:"googlesitekit-pagespeed-report__scale"},React.createElement("span",null,Object(n.__)("Scale:","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--fast"},Object(n.__)("90-100 (fast)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--average"},Object(n.__)("50-89 (average)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--slow"},Object(n.__)("0-49 (slow)","google-site-kit")))}},,function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(56),b=a(2),f=a(19),k=a(9),y=a(0),v=a(8),O=a.n(v),R=a(14),E=a(23),S=a(15);function j(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(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.source;if(!t||t.error||!t.length)return null;var n=Object(S.extractAnalyticsDataForTrafficChart)(t);return React.createElement("div",{className:"googlesitekit-chart googlesitekit-chart--pie"},React.createElement(_.a,{data:n,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}),a&&React.createElement("div",{className:"googlesitekit-chart__source"},[Object(y.__)("Source:","google-site-kit")," ",React.createElement(R.a,{key:"link",href:Object(b.n)("googlesitekit-module-analytics"),inherit:!0},Object(y._x)("Analytics","Service name","google-site-kit"))]))}}]),t}(h.Component);w.defaultProps={source:!1},w.propTypes={source:O.a.bool},t.default=Object(f.a)(w,[{type:k.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?j(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},S.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(b.p)("day"),context:["Dashboard","Single"]}],React.createElement(E.a,{width:"282px",height:"282px",shape:"circular"}),{},S.isDataZeroForReporting,S.getAnalyticsErrorMessageFromData)},,,,,function(e,t,a){"use strict";var n=a(1),i=a(17);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return React.createElement(n.Fragment,null,t&&a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&!a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e),t&&!a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e),!t&&!a&&o&&React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))),!t&&!a&&!o&&e)}},function(e,t,a){"use strict";var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(9),b=a(26),f=a(8),k=a.n(f),y=a(0),v=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,alerts:[],error:!1,message:""},a}return m()(t,e),r()(t,[{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(_.c.getNotifications(e,3600));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 e=this.state,t=e.alerts,a=e.error,n=e.isLoading;if(a||n||!t||!t.length)return null;var i=t.map((function(e){return React.createElement(b.a,{id:e.id,key:e.id,title:e.title,description:e.message||e.description,dismiss:Object(y.__)("Dismiss","google-site-kit"),isDismissable:e.isDismissible,format:"small",ctaLink:e.ctaURL,ctaLabel:e.ctaLabel,ctaTarget:e.ctaTarget,type:e.severity})}));return React.createElement(h.Fragment,null,i)}}]),t}(h.Component);v.propTypes={module:k.a.string.isRequired},t.a=v},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(8),h=a.n(m),_=a(14),b=a(88),f=a(31),k=a(0),y=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLink,a=e.ctaLinkText,n=e.header,i=e.incomplete,o=e.loadingMessage,c=e.subHeader,s=e.required,r=new URL(googlesitekit.admin.siteURL),l="https://www.google.com/adsense/new/sites?url=".concat(r.hostname,"&source=site-kit"),d=[{id:1,
4
  /* translators: %s: Site URL */
5
- text:Object(k.sprintf)(Object(k.__)("Added your site %s in ","google-site-kit"),r.hostname),linkText:Object(k.__)("Sites","google-site-kit"),linkURL:l},{id:2,text:Object(k.__)("Enabled ads in","google-site-kit"),linkText:Object(k.__)("Ads","google-site-kit"),linkURL:"https://www.google.com/adsense/new/myads/auto-ads"}];return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},s&&React.createElement(b.a,null),o&&React.createElement(p.Fragment,null,o,React.createElement(f.a,null)),n&&React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},n),c&&React.createElement("p",null,c),i&&React.createElement("div",{className:"googlesitekit-setup-module__list-wrapper"},React.createElement("ol",{className:"googlesitekit-setup-module__list"},d.map((function(e){return React.createElement("li",{className:"googlesitekit-setup-module__list-item",key:e.id},e.text," ",React.createElement(_.a,{href:e.linkURL,external:!0,inherit:!0},e.linkText))})))),t&&a&&React.createElement("div",{className:"googlesitekit-setup-module__cta"},React.createElement(_.a,{className:"googlesitekit-setup-module__cta-link",href:t,external:!0},a)))}}]),t}(p.Component);y.propTypes={status:h.a.string,module:h.a.string},t.default=y},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(79),b=a(9),f=a(8),k=a.n(f),y=a(2),v=a(0),O=a(10),R=function(e){function t(e){var a;i()(this,t),a=r()(this,d()(t).call(this,e));var n=googlesitekit.modules.adsense.settings.useSnippet,o=void 0===n||n;return a.state={useSnippet:!!o,disabled:!1},a.handleUseSnippetSwitch=a.handleUseSnippetSwitch.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(O.addFilter)("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(O.removeFilter)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"save",value:function(){var e=this.state.useSnippet;this._isMounted&&this.setState({useSnippet:e});var t={useSnippet:e||!1};return googlesitekit.modules.adsense.settings&&(googlesitekit.modules.adsense.settings.useSnippet=e),b.c.set(b.b,"adsense","use-snippet",t).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.v)("adsense_setup",t?"adsense_tag_enabled":"adsense_tag_disabled"),e&&b.c.set(b.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.y)("adsense",{useSnippet:"useSnippet"},this.state)}}},{key:"render",value:function(){var e=this.state.useSnippet,t=this.props,a=t.isEditing,n=t.switchLabel,i=t.switchOnMessage,o=t.switchOffMessage;return React.createElement(h.Fragment,null,a?React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__switch"},React.createElement(_.a,{id:"enableAutoAds",label:n,onClick:this.handleUseSnippetSwitch,checked:e,hideLabel:!1})," ",React.createElement("span",{className:"googlesitekit-recommended"},Object(v.__)("RECOMMENDED","google-site-kit"))),e&&i&&React.createElement("div",{className:"googlesitekit-settings-notice googlesitekit-settings-notice--suggestion"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},i)),!e&&o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o))):React.createElement(h.Fragment,null,Object(v.__)("The AdSense code has","google-site-kit")," ",e?Object(v.__)("been placed on your site.","google-site-kit"):Object(v.__)("not been placed on your site.","google-site-kit")))}}]),t}(h.Component);R.propTypes={isEditing:k.a.bool,accountTagMatch:k.a.bool,existingTag:k.a.oneOfType([k.a.bool,k.a.string]),switchLabel:k.a.string,switchOnMessage:k.a.string,switchOffMessage:k.a.string},R.defaultProps={isEditing:!1,accountTagMatch:!1,existingTag:!1,switchLabel:Object(v.__)("Let Site Kit place code on your site","google-site-kit"),switchOnMessage:"",switchOffMessage:""},t.default=R},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(20),h=a(29),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.modules.adsense.accountURL;return React.createElement("section",{className:"googlesitekit-module-outro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-module-outro__logo"},React.createElement(m.a,{id:"adsense",height:"36",width:"42"}),React.createElement(m.a,{id:"plus",height:"13",width:"13"}),React.createElement(m.a,{id:"analytics",height:"36",width:"34"})),React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-module-outro__title "},Object(_.__)("Connect Analytics with AdSense to create a powerful team that shows robust metrics for your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-module-outro__button"},React.createElement(h.a,{href:e,target:"_blank"},Object(_.__)("Connect Accounts","google-site-kit")))))))}}]),t}(p.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(95),O=a(11),R=a(0),E=a(15);function S(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(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(f.i)().dateRangeFrom,a=[{title:Object(R.__)("Medium","google-site-kit"),tooltip:Object(R.__)("Medium refers to where your traffic originated from","google-site-kit")},{title:Object(R.__)("Users","google-site-kit"),tooltip:Object(R.__)("Number of users that originated from that traffic","google-site-kit")},{title:Object(R.__)("New Users","google-site-kit"),tooltip:Object(R.sprintf)(Object(R.__)("Number of new users to visit your page over %s","google-site-kit"),t)},{title:Object(R.__)("Sessions","google-site-kit"),tooltip:Object(R.sprintf)(Object(R.__)("Number of sessions users had on your website over %s","google-site-kit"),t)},{title:Object(R.__)("Percentage","google-site-kit"),tooltip:Object(R.__)("Percentage of sessions","google-site-kit")}],n=e[0].data.totals[0].values[0],i=Object(O.map)(e[0].data.rows,(function(e,t){var a=e.metrics[0].values[0]/n*100;return!(1>a)&&[e.dimensions[0],Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),Object(f.r)(e.metrics[0].values[2]),React.createElement(h.Fragment,{key:"minichart-analytics-top-as-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(a.toFixed(2),"%")," ",React.createElement(v.a,{percent:a.toFixed(1),index:t})))]})),o=Object(k.b)(i,a,{hideHeader:!1,chartsEnabled:!1});return React.createElement("div",{className:"googlesitekit-details-widget"},React.createElement(k.a,null,o))}}]),t}(h.Component);t.default=Object(_.a)(j,[{type:b.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?S(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},E.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{rows:4,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(38),k=a(11),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(y.__)("Keyword","google-site-kit"),tooltip:Object(y.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(y.__)("Clicks","google-site-kit"),tooltip:Object(y.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(y.__)("Impressions","google-site-kit"),tooltip:Object(y.__)("Counted each time your content appears in search results","google-site-kit")}],a=googlesitekit.admin.siteURL,n=[],i=Object(k.map)(e,(function(e,t){var i=e.keys[0];return n[t]=Object(y.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",a,i),[i,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),o={hideHeader:!1,chartsEnabled:!1,links:n},c=Object(b.b)(i,t,o);return React.createElement(b.a,null,c)}}]),t}(p.Component);t.default=Object(m.a)(v,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"query",limit:10},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"]}],React.createElement(f.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.DashboardSearchFunnel")(h)},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(22),h=a(8),_=a.n(h),b=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).switchRef=Object(p.createRef)(),a}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){new m.i(this.switchRef.current)}},{key:"render",value:function(){var e=this.props,t=e.id,a=e.onClick,n=e.label,i=e.checked,o=e.hideLabel;return React.createElement(p.Fragment,null,React.createElement("div",{"aria-checked":i?"true":"false",className:"mdc-switch ".concat(i?"mdc-switch--checked":""),onClick:a,onKeyPress:function(e){"function"==typeof a&&"Enter"===e.code&&a(e)},role:"switch",ref:this.switchRef,tabIndex:0},React.createElement("div",{className:"mdc-switch__track"}," "),React.createElement("div",{className:"mdc-switch__thumb-underlay"},React.createElement("div",{className:"mdc-switch__thumb"},React.createElement("input",{type:"checkbox",id:t,className:"mdc-switch__native-control",role:"switch",checked:i,onChange:function(){}})))),React.createElement("label",{className:o?"screen-reader-only":"",htmlFor:t},n))}}]),t}(p.Component);b.propTypes={id:_.a.string.isRequired,onClick:_.a.func,label:_.a.string.isRequired,checked:_.a.bool,hideLabel:_.a.bool},b.defaultProps={checked:!1,hideLabel:!0},t.a=b},,,,,,,,,,,function(e,t,a){"use strict";a(1);var n=a(32),i=a(71),o=a(2),c=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=googlesitekit.modules[e].name,l=React.createElement(n.a
6
  /* translators: %s: Module name */,{title:Object(c.sprintf)(Object(c.__)("%s activation","google-site-kit"),r)
7
  /* translators: %s: Module name */,description:Object(c.sprintf)(Object(c.__)("%s module needs to be configured","google-site-kit"),r),ctaLabel:Object(c.__)("Complete activation","google-site-kit"),onClick:function(){window.location=Object(o.m)(e,!0)}});return Object(i.a)(l,t,a,s)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(23),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.count,o=[],c=0;c++<i;)o.push(React.createElement(m.a,{width:t,height:a,shape:n,key:c}));return o}}]),t}(p.Component);b.propTypes={width:_.a.string,height:_.a.string,shape:_.a.string,count:_.a.number},b.defaultProps={width:"100px",height:"100px",shape:"square",count:1},t.a=b},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(13),m=a.n(p),h=a(7),_=a.n(h),b=a(1),f=a(29),k=a(14),y=a(9),v=a(22),O=a(20),R=a(8),E=a.n(R),S=a(2),j=a(0),w=a(10),D=function(e){function t(e){var a;c()(this,t),a=d()(this,g()(t).call(this,e));var n=googlesitekit.modules.optimize.settings,i=n.optimizeID,o=n.ampClientIDOptIn,s=n.ampExperimentJSON,r=(googlesitekit.modules.analytics||{}).settings,l=googlesitekit.modules.tagmanager||{},u=l.active,p=l.settings,h=!!r&&r.useSnippet,_=!(!u||!p)&&p.useSnippet;return a.state={optimizeID:i||"",analyticsUseSnippet:h,gtmUseSnippet:_,errorCode:!1,errorMsg:"",ampClientIDOptIn:o||!1,ampExperimentJSON:s||"",ampExperimentJSONValidated:!0,OptimizeIDValidated:!0},a.handleOptimizeIDEntry=a.handleOptimizeIDEntry.bind(m()(a)),a.handleSubmit=a.handleSubmit.bind(m()(a)),a.renderInstructionInfo=a.renderInstructionInfo.bind(m()(a)),a.handleAMPOptimizeEntry=a.handleAMPOptimizeEntry.bind(m()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(w.addFilter)("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(w.removeFilter)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(S.y)("optimize",{optimizeID:"optimizeID",ampExperimentJSON:"ampExperimentJSON"},this.state)}}},{key:"handleSubmit",value:function(){var e,t,a,n,o,c,s=this;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=this.state,t=e.optimizeID,a=e.ampExperimentJSON,n=e.OptimizeIDValidated,o=this.props.finishSetup,n&&0!==t.length){r.next=4;break}return r.abrupt("return",!1);case 4:return c={optimizeID:t,ampExperimentJSON:a},r.next=7,i.a.awrap(y.c.set(y.b,"optimize","settings",c).then((function(){o&&o(),googlesitekit.modules.optimize.settings.optimizeID=t,s._isMounted&&s.setState({isSaving:!1})})).catch((function(e){s._isMounted&&s.setState({errorCode:!0,errorMsg:e.errorMsg})})));case 7:return r.abrupt("return",r.sent);case 8:case"end":return r.stop()}}),null,this)}},{key:"handleOptimizeIDEntry",value:function(e){var t=Object(S.A)(e.target.value);this._isMounted&&this.setState({optimizeID:e.target.value,OptimizeIDValidated:t})}},{key:"handleAMPOptimizeEntry",value:function(e){var t=Object(S.z)(e.target.value);this._isMounted&&this.setState({ampExperimentJSON:e.target.value,ampExperimentJSONValidated:t})}},{key:"renderInfo",value:function(){var e=this.state.optimizeID;return React.createElement(b.Fragment,null,e?React.createElement("div",null,Object(j.__)("Your Optimize Container ID","google-site-kit"),": ",React.createElement("strong",null,e)):React.createElement("div",null,Object(j.__)('Optimize Container ID missing, press "edit" to add',"google-site-kit"),"."))}},{key:"renderInstructionInfo",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.gtmUseSnippet,n=e.optimizeID;return!t&&a?React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("You are using auto insert snippet with Tag Manager","google-site-kit")),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6314801"},Object(j.__)("Click here","google-site-kit"))," ",Object(j.__)("for how to implement Optimize tag through your Tag Manager","google-site-kit"))):t?null:React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("You disabled analytics auto insert snippet. If You are using Google Analytics code snippet, add the code below:","google-site-kit")),React.createElement("pre",null,'ga("require", "',n||"GTM-XXXXXXX",'");'),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6262084"},Object(j.__)("Click here","google-site-kit"))," ",Object(j.__)("for how to implement Optimize tag in Google Analytics Code Snippet","google-site-kit")))}},{key:"renderAMPSnippet",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.ampClientIDOptIn,n=e.ampExperimentJSON,i=e.ampExperimentJSONValidated,o=window.googlesitekit.admin.ampEnabled;return t&&o?React.createElement(b.Fragment,null,a&&React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("Please input your AMP experiment settings in JSON format below.","google-site-kit")," ",React.createElement(k.a,{href:"https://developers.google.com/optimize/devguides/amp-experiments",external:!0,inherit:!0},Object(j.__)("Learn More.","google-site-kit"))),React.createElement(v.l,{className:"\n\t\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t\t".concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t\t"),name:"amp-experiment",onChange:this.handleAMPOptimizeEntry,textarea:!0},React.createElement(v.b,{inputType:"textarea",value:null===n?"":n})),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error: AMP experiment settings are not in a valid JSON format.","google-site-kit")))):null}},{key:"renderForm",value:function(){var e=this.state,t=e.optimizeID,a=e.errorCode,n=e.errorMsg,i=e.OptimizeIDValidated;return React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("Please copy and paste your Optimize ID to complete your setup.","google-site-kit")," ",React.createElement(k.a,{href:"https://support.google.com/optimize/answer/6211921",external:!0,inherit:!0},Object(j.__)("You can locate this here.","google-site-kit"))),a&&0<n.length&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error:","google-site-kit")," ",n),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(v.l,{className:"\n\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t".concat(a?"mdc-text-field--error":"","\n\t\t\t\t\t\t\t").concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t"),label:Object(j.__)("Optimize Container ID","google-site-kit"),name:"optimizeID",onChange:this.handleOptimizeIDEntry,helperText:React.createElement(v.a,null,Object(j.__)("Format: GTM-XXXXXXX.","google-site-kit")),outlined:!0,required:!0},React.createElement(v.b,{value:t}))),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error: Not a valid Optimize ID.","google-site-kit")),this.renderAMPSnippet(),this.renderInstructionInfo())}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--optimize"},!t&&React.createElement(b.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(O.a,{id:"optimize",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(j._x)("Optimize","Service name","google-site-kit"))),a&&this.renderForm(),!a&&this.renderInfo(),!t&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(f.a,{onClick:this.handleSubmit},Object(j.__)("Configure Optimize","google-site-kit"))))}}]),t}(b.Component);D.propTypes={onSettingsPage:E.a.bool,finishSetup:E.a.func,isEditing:E.a.bool},D.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=D},function(e,t,a){"use strict";a.r(t),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedMobile",(function(){return O})),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop",(function(){return R}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(45),_=a(9),b=a(2),f=a(28),k=a(0),y=a(64),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.handleDataLoaded;t&&a&&a()}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.title;if(!t||t.error)return null;if(function(e){return 0===e.categories.performance.score}(t))return Object(h.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),Object(k.__)("An unknown error occurred while trying to fetch PageSpeed Insights data. Please try again later.","google-site-kit"),!0);var n=t.categories.performance.score,i=Object(y.getScoreCategoryLabel)(n),o=t.audits.interactive.displayValue,c=Object(f.b)([[Object(k.__)("Real user speed data","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},i)],[Object(k.__)("Time to become fully interactive","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},o)]],[],{hideHeader:!0,disableListMode:!0,chartsEnabled:!1,links:[]});return React.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 "},React.createElement("div",{className:"googlesitekit-pagespeed-report__heading-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 "},a),React.createElement(y.PageSpeedReportScoreGauge,{score:n})),React.createElement(f.a,null,c))}}]),t}(p.Component),O=Object(m.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"mobile"},priority:10,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0}),R=Object(m.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"desktop"},priority:10,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(12),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),p=a(6),m=a.n(p),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(29),v=a(14),O=a(9),R=a(31),E=a(22),S=a(20),j=a(8),w=a.n(j),D=a(2),C=a(11),x=a(0),N=a(10),A=function(e){function t(e){var a;r()(this,t),a=g()(this,m()(t).call(this,e));var n=googlesitekit.modules.tagmanager.settings,i="primary"===googlesitekit.admin.ampMode?"amp":"web",o="amp"===i?"ampContainerID":"containerID";return a.state={isLoading:!0,accounts:[],containers:[],errorCode:!1,errorMsg:"",refetch:!1,selectedAccount:n.accountID,selectedContainer:n[o],containersLoading:!1,usageContext:i,containerKey:o},a.handleSubmit=a.handleSubmit.bind(_()(a)),a.renderAccountDropdownForm=a.renderAccountDropdownForm.bind(_()(a)),a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handleContainerChange=a.handleContainerChange.bind(_()(a)),a.refetchAccount=a.refetchAccount.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,a=t.isOpen,n=t.onSettingsPage;this._isMounted=!0,n&&!a||(this.requestTagManagerAccounts(),Object(N.addFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed",(function(t,a){return"tagmanager"!==a.replace("-module","")?t:e.props.isEditing?e.handleSubmit():void 0})),this.toggleConfirmChangesButton())}},{key:"componentDidUpdate",value:function(){this.state.refetch&&this.requestTagManagerAccounts(),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(N.removeFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed")}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={selectedContainer:this.state.containerKey,selectedAccount:"selectedAccount"};Object(D.y)("tagmanager",e,this.state)}}},{key:"requestTagManagerAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d;return c.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,e=this.state,t=e.selectedAccount,a=e.usageContext,n=this.state.selectedContainer,i={accountID:t,usageContext:a},o=!1,s="",u.next=8,c.a.awrap(O.c.get(O.b,"tagmanager","accounts-containers",i));case 8:r=u.sent,l=r.accounts,d=r.containers,t||0!==l.length||(o="accountEmpty",s=Object(x.__)("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")),t&&!l.find((function(e){return e.accountId===t}))&&(O.c.invalidateCacheGroup(O.b,"tagmanager","accounts-containers"),o="insufficientPermissions",s=Object(x.__)("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")),n&&!d.find((function(e){return e.publicId===n}))&&(n=null),this._isMounted&&this.setState({isLoading:!1,accounts:l,selectedAccount:t||Object(C.get)(d,[0,"accountId"]),containers:d,selectedContainer:n||Object(C.get)(d,[0,"publicId"]),refetch:!1,errorCode:o,errorMsg:s}),u.next=20;break;case 17:u.prev=17,u.t0=u.catch(0),this._isMounted&&this.setState({isLoading:!1,errorCode:u.t0.code,errorMsg:u.t0.message,refetch:!1});case 20:case"end":return u.stop()}}),null,this,[[0,17]])}},{key:"requestTagManagerContainers",value:function(e){var t,a;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,t={accountID:e,usageContext:this.state.usageContext},n.next=4,c.a.awrap(O.c.get(O.b,"tagmanager","containers",t));case 4:a=n.sent,this._isMounted&&this.setState({containersLoading:!1,containers:a,selectedContainer:Object(C.get)(a,[0,"publicId"]),errorCode:!1}),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),this._isMounted&&this.setState({errorCode:n.t0.code,errorMsg:n.t0.message});case 11:case"end":return n.stop()}}),null,this,[[0,8]])}},{key:"handleSubmit",value:function(){var e,t,a,n,o,s,r,l,d;return c.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return e=this.state,t=e.selectedAccount,a=e.selectedContainer,n=e.usageContext,o=e.containerKey,s=this.props.finishSetup,u.prev=2,r={accountID:t},i()(r,o,a),i()(r,"usageContext",n),l=r,u.next=6,c.a.awrap(O.c.set(O.b,"tagmanager","settings",l));case 6:d=u.sent,s&&s(),googlesitekit.modules.tagmanager.settings=d,this._isMounted&&this.setState({isSaving:!1}),u.next=16;break;case 12:return u.prev=12,u.t0=u.catch(2),this._isMounted&&this.setState({isLoading:!1,errorCode:u.t0.code,errorMsg:u.t0.message}),u.abrupt("return",new Promise((function(e,t){t(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.getAttribute("data-value");n!==a&&(this._isMounted&&this.setState({containersLoading:!0,selectedAccount:n}),this.requestTagManagerContainers(n))}},{key:"handleContainerChange",value:function(e,t){var a=this.state.selectedContainer,n=t.getAttribute("data-value");n!==a&&this._isMounted&&this.setState({selectedContainer:n})}},{key:"refetchAccount",value:function(e){e.preventDefault(),this._isMounted&&this.setState({isLoading:!0,refetch:!0,errorCode:!1})}},{key:"renderSettingsInfo",value:function(){var e=this.state,t=e.isLoading,a=e.selectedAccount,n=e.selectedContainer;return t?React.createElement(R.a,null):React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(x.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(x.__)("Container ID","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},n||!1))))}},{key:"renderAccountDropdownForm",value:function(){var e=this.state,a=e.accounts,n=e.selectedAccount,i=e.containers,o=e.selectedContainer,c=e.isLoading,s=e.containersLoading,r=this.props.onSettingsPage;return c?React.createElement(R.a,null):0>=a.length?React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:t.createNewAccount},Object(x.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(v.a,{onClick:this.refetchAccount},Object(x.__)("Re-fetch My Account","google-site-kit"))))):React.createElement(k.Fragment,null,React.createElement("p",null,Object(x.__)("Please select your Tag Manager account and container below, the snippet will be inserted automatically into your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(E.k,{enhanced:!0,name:"accounts",label:Object(x.__)("Account","google-site-kit"),value:n,onEnhancedChange:this.handleAccountChange,outlined:!0},a.map((function(e){return React.createElement(E.j,{key:e.accountId,value:e.accountId},e.name)}))),s?React.createElement(R.a,{small:!0}):React.createElement(E.k,{enhanced:!0,name:"containers",label:Object(x.__)("Container","google-site-kit"),value:o,onEnhancedChange:this.handleContainerChange,outlined:!0},i.concat({name:Object(x.__)("Set up a new container","google-site-kit"),publicId:0}).map((function(e,t){var a=e.name,n=e.publicId;return React.createElement(E.j,{key:t,value:n},a)})))),!r&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:this.handleSubmit},Object(x.__)("Confirm & Continue","google-site-kit"))))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,n=this.props.onSettingsPage;if(0===a.length)return null;var i=!n||"insufficientPermissions"!==t;return React.createElement("div",{className:i?"googlesitekit-error-text":""},React.createElement("p",null,i?
8
  /* translators: %s: Error message */
9
- Object(x.sprintf)(Object(x.__)("Error: %s","google-site-kit"),a):a))}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--tag-manager"},!t&&React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(S.a,{id:"tagmanager",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(x._x)("Tag Manager","Service name","google-site-kit"))),this.renderErrorOrNotice(),a&&this.renderAccountDropdownForm(),!a&&this.renderSettingsInfo())}}],[{key:"createNewAccount",value:function(e){e.preventDefault(),window.open("https://marketingplatform.google.com/about/tag-manager/","_blank")}}]),t}(k.Component);A.propTypes={onSettingsPage:w.a.bool,finishSetup:w.a.func,isEditing:w.a.bool},A.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=A},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(56),h=["#178EC5","#54B23B","#EB5729","#ECED33","#34CBE3","#82E88E"],_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.index,a=e.percent,n={backgroundColor:"transparent",chartArea:{width:"100%",height:"100%"},enableInteractivity:!1,height:28,legend:{position:"none"},slices:{0:{color:h[t]},1:{color:"#e6e6e6"}},title:null,tooltip:{trigger:"none"},width:28},i=[["source","percent"],["",+a],["",100-a]];return React.createElement("div",{className:"googlesitekit-mini-chart"},React.createElement(m.a,{data:i,options:n,chartType:"pie",loadSmall:!0,loadCompressed:!0,loadHeight:24,loadText:!1,id:"minichart"+t}))}}]),t}(p.Component);t.a=_},function(e,t,a){"use strict";a.r(t);var n=a(169),i=a.n(n),o=a(12),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),p=a(6),m=a.n(p),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(27),y=a.n(k),v=a(1),O=a(9),R=a(8),E=a.n(R),S=a(29),j=a(31),w=a(14),D=a(22),C=function(e){function t(e){var a;return r()(this,t),(a=g()(this,m()(t).call(this,e))).formFieldRef=Object(v.createRef)(),a.radioRef=Object(v.createRef)(),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){new D.e(this.formFieldRef.current).input=new D.g(this.radioRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,a=e.id,n=e.name,i=e.value,o=e.checked,c=e.disabled,s=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-radio\n\t\t\t\t\t\t".concat(c?"mdc-radio--disabled":"","\n\t\t\t\t\t"),ref:this.radioRef},React.createElement("input",{className:"mdc-radio__native-control",onClick:t,type:"radio",id:a,name:n,value:i,checked:o,disabled:c,onChange:function(){}}),React.createElement("div",{className:"mdc-radio__background"},React.createElement("div",{className:"mdc-radio__outer-circle"}),React.createElement("div",{className:"mdc-radio__inner-circle"}))),React.createElement("label",{htmlFor:a},s))}}]),t}(v.Component);C.propTypes={onClick:E.a.func,id:E.a.string.isRequired,name:E.a.string.isRequired,value:E.a.string.isRequired,checked:E.a.bool,disabled:E.a.bool,children:E.a.string.isRequired},C.defaultProps={onClick:null,checked:!1,disabled:!1};var x=C,N=a(79),A=a(20),P=a(2),L=a(0),M=a(10);function I(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?I(a,!0).forEach((function(t){y()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):I(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var F=y()({},"loggedinUsers",Object(L.__)("Logged-in users","google-site-kit")),U=function(e){function t(e){var a;r()(this,t),a=g()(this,m()(t).call(this,e));var n=googlesitekit.modules.analytics.settings,i=n.accountID,o=n.internalWebPropertyID,c=n.profileID,s=n.propertyID,l=n.useSnippet,d=n.ampClientIDOptIn,u=n.trackingDisabled;return a.state={isLoading:!0,isSaving:!1,propertiesLoading:!1,profilesLoading:!1,useSnippet:l||!1,errorCode:!1,errorMsg:"",errorReason:!1,accounts:[],properties:[],profiles:[],selectedAccount:i,selectedProperty:s,selectedProfile:c,selectedinternalWebProperty:o,ampClientIDOptIn:d,existingTag:!1,trackingDisabled:u||[]},a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handlePropertyChange=a.handlePropertyChange.bind(_()(a)),a.handleProfileChange=a.handleProfileChange.bind(_()(a)),a.processAccountChange=a.processAccountChange.bind(_()(a)),a.processPropertyChange=a.processPropertyChange.bind(_()(a)),a.handleSubmit=a.handleSubmit.bind(_()(a)),a.handleRadioClick=a.handleRadioClick.bind(_()(a)),a.handleAMPClientIDSwitch=a.handleAMPClientIDSwitch.bind(_()(a)),a.handleRefetchAccount=a.handleRefetchAccount.bind(_()(a)),a.handleExclusionsChange=a.handleExclusionsChange.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,i,o=this;return c.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,c.a.awrap(Object(P.k)("analytics"));case 6:if(!(n=s.sent)||!n.length){s.next=21;break}return s.prev=8,s.next=11,c.a.awrap(O.c.get(O.b,"analytics","tag-permission",{tag:n}));case 11:return i=s.sent,s.next=14,c.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,c.a.awrap(this.getAccounts());case 23:Object(M.addFilter)("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(M.removeFilter)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(P.y)("analytics",{selectedAccount:"accountID",selectedProperty:"propertyID",selectedProfile:"profileID",selectedinternalWebProperty:"internalWebPropertyID",useSnippet:"useSnippet",ampClientIDOptIn:"ampClientIDOptIn",trackingDisabled:"trackingDisabled"},this.state)}}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.getAttribute("data-value");n!==a&&("0"!==n?(this.setState({propertiesLoading:!0,profilesLoading:!0,selectedAccount:n}),Object(P.v)("analytics_setup","account_change",n),this.processAccountChange(n)):this.setState({selectedAccount:n,selectedProperty:"-1",selectedProfile:"-1",properties:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}],profiles:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}]}))}},{key:"handlePropertyChange",value:function(e,t){var a=this.state.selectedProperty,n=t.getAttribute("data-value");n!==a&&("0"!==n?(this.setState({profilesLoading:!0,selectedProperty:n}),Object(P.v)("analytics_setup","property_change",n),this.processPropertyChange(n)):this.setState({selectedProperty:n,selectedProfile:n,profiles:[{id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}]}))}},{key:"handleProfileChange",value:function(e,t){var a=t.getAttribute("data-value");this.setState({selectedProfile:a}),Object(P.v)("analytics_setup","profile_change",a)}},{key:"getAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d,u,g,p,m,h,_,b=this,f=arguments;return c.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,r=s.isEditing,l=s.onSettingsPage,d=this.state.errorCode,u={},k.prev=5,g=e?{existingAccountID:e.accountId,existingPropertyID:e.propertyId}:{},k.next=9,c.a.awrap(O.c.get(O.b,"analytics","accounts-properties-profiles",g));case 9:0===(p=k.sent).accounts.length?(u=T({},u,{errorCode:"no_account",errorReason:"noAccount"}),O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles")):a?a&&!p.accounts.find((function(e){return e.id===a}))&&(O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),p.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")}),r&&(a="0",n="-1",i="-1"),u=T({},u,{errorCode:"insufficient_permissions",errorReason:"insufficientPermissions"})):(m=null,p.matchedProperty&&(m=p.matchedProperty),m?(a=m.accountId,n=m.id,(h=p.profiles.find((function(e){return e.accountId===a})))&&(i=h.id)):p.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")})),_={id:"-1",name:Object(L.__)("Select an account","google-site-kit")},this.state.existingTag||p.properties.push({id:0,name:Object(L.__)("Setup a New Property","google-site-kit")}),p.profiles.push({id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}),l||(o=!e),u=T({},u,{isLoading:!1,accounts:p.accounts,errorCode:d||u.errorCode,selectedAccount:a,selectedProperty:n,selectedProfile:i,properties:[_],profiles:[_],existingTag:!!e&&e.propertyID,useSnippet:o}),a&&"0"!==a&&(u=Object.assign(u,{properties:p.properties,profiles:p.profiles,selectedinternalWebProperty:p.properties[0]?p.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){b._isMounted?b.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 c.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,t={accountID:e},o.next=4,c.a.awrap(O.c.get(O.b,"analytics","properties-profiles",t));case 4:a=o.sent,n={id:0,name:Object(L.__)("Setup a New Property","google-site-kit")},a.properties.push(n),i={id:0,name:Object(L.__)("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 c.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,c.a.awrap(O.c.get(O.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,r,l,d,u,g,p,m,h,_,b,f;return c.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.selectedAccount,n=t.selectedProperty,i=t.selectedProfile,o=t.useSnippet,s=t.selectedinternalWebProperty,r=t.accounts,l=t.properties,d=t.profiles,u=t.ampClientIDOptIn,g=t.trackingDisabled,this.setState({isSaving:!0}),p=this.props.finishSetup,m=i||(d[0].id||0===d[0].id?d[0].id.toString():null),h=n||(l[0].id||0===l[0].id?l[0].id.toString():null),_="0"===h?"0":s||(l[0].internalWebPropertyId||0===l[0].internalWebPropertyId?l[0].internalWebPropertyId.toString():null),b={accountID:a||r[0].id||null,profileID:m,propertyID:h,internalWebPropertyID:_,useSnippet:o||!1,ampClientIDOptIn:u||!1,trackingDisabled:g},k.prev=10,k.next=13,c.a.awrap(O.c.set(O.b,"analytics","settings",b));case 13:return f=k.sent,O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),k.next=17,c.a.awrap(this.getAccounts());case 17:googlesitekit.modules.analytics.settings=f,Object(P.v)("analytics_setup","analytics_configured"),p&&p(),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(P.v)("analytics_setup",t?"analytics_tag_enabled":"analytics_tag_disabled")}},{key:"handleAMPClientIDSwitch",value:function(){this.setState({ampClientIDOptIn:!this.state.ampClientIDOptIn})}},{key:"handleRefetchAccount",value:function(){this.setState({isLoading:!0,errorCode:!1,errorMsg:""}),this.getAccounts()}},{key:"handleExclusionsChange",value:function(e){var t=this.state.trackingDisabled,a=e.target,n=a.id,o=a.checked,c=Object.assign.apply(Object,[{}].concat(i()(t.map((function(e){return y()({},e,!0)}))),[y()({},n,o)]));this.setState({trackingDisabled:Object.keys(c).filter((function(e){return c[e]}))})}},{key:"renderAutoInsertSnippetForm",value:function(){var e=this.state,t=e.useSnippet,a=e.isSaving,n=e.ampClientIDOptIn,i=e.existingTag,o=this.props,c=o.isEditing,s=o.onSettingsPage,r=!c,l=window.googlesitekit.admin.ampEnabled,d=window.googlesitekit.modules.analytics.settings.useSnippet;return React.createElement("div",{className:"googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--multiline"},(c||a)&&React.createElement(v.Fragment,null,s&&React.createElement(v.Fragment,null,!d&&!i&&React.createElement(v.Fragment,null,React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("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"))),d&&React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("Do you want to remove the Analytics snippet inserted by Site Kit?","google-site-kit"))),s&&!i&&!t&&d&&React.createElement("p",null,Object(L.__)("If the code snippet is removed, you will no longer be able to gather Analytics insights about your site.","google-site-kit"))),s&&React.createElement(v.Fragment,null,i&&React.createElement("p",null,Object(L.__)("Placing two tags at the same time is not recommended.","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetTrue",name:"useSnippet",value:"1",checked:t,disabled:r},d?Object(L.__)("Not at this time","google-site-kit"):Object(L.__)("Insert snippet","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetFalse",name:"useSnippet",value:"0",checked:!t,disabled:r},d?Object(L.__)("Remove snippet","google-site-kit"):Object(L.__)("Not at this time","google-site-kit"))),t&&l&&React.createElement("div",{className:"googlesitekit-setup-module__input"},React.createElement(N.a,{id:"ampClientIDOptIn",label:Object(L.__)("Opt in AMP Client ID","google-site-kit"),onClick:this.handleAMPClientIDSwitch,checked:n,hideLabel:!1}),React.createElement("p",null,n?Object(L.__)("Sessions will be combined across AMP/non-AMP pages.","google-site-kit")+" ":Object(L.__)("Sessions will be tracked separately between AMP/non-AMP pages.","google-site-kit")+" ",React.createElement(w.a,{href:"https://support.google.com/analytics/answer/7486764",external:!0,inherit:!0},Object(L.__)("Learn more","google-site-kit")))))}},{key:"accountsDropdown",value:function(){var e=this.state,t=e.accounts,a=e.selectedAccount,n=e.existingTag,i=!this.props.isEditing;return n&&a&&(i=!0),React.createElement(D.k,{enhanced:!0,name:"accounts",value:a||"0",onEnhancedChange:this.handleAccountChange,label:Object(L.__)("Account","google-site-kit"),disabled:i,outlined:!0},t.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))}},{key:"hasAccessToExistingTagProperty",value:function(){var e=this.state,t=e.existingTag,a=e.selectedProfile;return t&&a}},{key:"renderForm",value:function(){var e=this.state,a=e.isLoading,n=e.propertiesLoading,i=e.profilesLoading,o=e.accounts,c=e.properties,s=e.profiles,r=e.selectedAccount,l=e.selectedProperty,d=e.selectedProfile,u=e.useSnippet,g=e.existingTag,p=e.errorCode,m=e.trackingDisabled,h=this.props,_=h.onSettingsPage,b=h.isEditing,f=!b,k=!b;g&&l&&(k=!0);var y=googlesitekit.modules.analytics.setupComplete;if(a)return React.createElement(j.a,null);if("google_analytics_existing_tag_permission"===p)return null;if(0>=o.length){if(!b)return Object(L.__)("No account found.","google-site-kit");if(!y||b)return React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(S.a,{onClick:t.createNewAccount},Object(L.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(w.a,{onClick:this.handleRefetchAccount},Object(L.__)("Re-fetch My Account","google-site-kit")))))}if(!b){var O=u?Object(L.__)("Snippet is inserted","google-site-kit"):Object(L.__)("Snippet is not inserted","google-site-kit");return g&&(O=Object(L.__)("Inserted by another plugin or theme","google-site-kit")),React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},r||o[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Property","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},l||c[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("View","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},d||s[0].name||!1))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Analytics Code Snippet","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},O))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Excluded from Analytics","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},!!m.length&&m.map((function(e){return F[e]})).join(Object(L._x)(", ","list separator","google-site-kit")),!m.length&&Object(L.__)("Analytics is currently enabled for all visitors.","google-site-kit")))))}return React.createElement(v.Fragment,null,!_&&0<o.length&&!g&&React.createElement("p",null,Object(L.__)("Please select the account information below. You can change this view later in your settings.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},this.accountsDropdown(),n?React.createElement(j.a,{small:!0}):React.createElement(D.k,{enhanced:!0,name:"properties",value:l||0===l?l.toString():"-1",onEnhancedChange:this.handlePropertyChange,label:Object(L.__)("Property","google-site-kit"),disabled:k,outlined:!0},c.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)}))),i?React.createElement(j.a,{small:!0}):React.createElement(D.k,{enhanced:!0,name:"profiles",value:d||0===d?d.toString():"-1",onEnhancedChange:this.handleProfileChange,label:Object(L.__)("View","google-site-kit"),disabled:f,outlined:!0},s.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))),this.renderAutoInsertSnippetForm(),_&&this.renderExclusionsForm(),!_&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(S.a,{disabled:!this.state.selectedAccount,onClick:this.handleSubmit},Object(L.__)("Configure Analytics","google-site-kit"))))}},{key:"renderExclusionsForm",value:function(){var e=this.state.trackingDisabled;return React.createElement("div",null,React.createElement("p",{className:"googlesitekit-setup-module__text"},Object(L.__)("Exclude from Analytics","google-site-kit")),React.createElement("div",{className:"mdc-form-field"},React.createElement(N.a,{id:"loggedinUsers",label:F.loggedinUsers,onClick:this.handleExclusionsChange,checked:e.includes("loggedinUsers"),hideLabel:!1})),React.createElement("p",null,e.includes("loggedinUsers")?Object(L.__)("Logged-in users will be excluded from Analytics tracking.","google-site-kit"):Object(L.__)("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,n=e.errorReason,i=e.accounts,o=this.props.onSettingsPage;if(!t)return null;var c=!0,s=a;switch(!0){case"google_analytics_existing_tag_permission"===t:c=!1;break;case o&&t&&"insufficientPermissions"===n:c=!1,s=Object(L.__)("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!o&&0===i.length:c=!1,s=Object(L.__)('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 0===s.length?null:React.createElement("div",{className:c?"googlesitekit-error-text":""},React.createElement("p",null,c?
10
  /* translators: %s: Error message */
11
- Object(L.sprintf)(Object(L.__)("Error: %s","google-site-kit"),s):s))}},{key:"render",value:function(){var e=this.props.onSettingsPage,t=this.state.existingTag;return e||Object(P.v)("analytics_setup","configure_analytics_screen"),React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--analytics"},!e&&React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(A.a,{id:"analytics",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(L._x)("Analytics","Service name","google-site-kit"))),this.hasAccessToExistingTagProperty()&&t!==googlesitekit.admin.trackingID&&React.createElement("p",null,Object(L.sprintf)(Object(L.__)("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(e){e.preventDefault(),Object(P.v)("analytics_setup","new_analytics_account"),window.open("https://analytics.google.com/analytics/web/?#/provision/SignUp","_blank")}}]),t}(v.Component);U.propTypes={onSettingsPage:E.a.bool,finishSetup:E.a.func,isEditing:E.a.bool},U.defaultProps={onSettingsPage:!0,isEditing:!1};t.default=U},,function(e,t,a){"use strict";a.r(t);var n=a(68),i=a.n(n),o=a(27),c=a.n(o),s=a(12),r=a.n(s),l=a(3),d=a.n(l),u=a(4),g=a.n(u),p=a(5),m=a.n(p),h=a(6),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(168),v=a(8),O=a.n(v),R=a(20),E=a(0),S=a(99),j=a(73),w=a(2),D=a(44);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 x(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?C(a,!0).forEach((function(t){c()(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 N=function(e){function t(e){var a;return d()(this,t),(a=m()(this,_()(t).call(this,e))).state={accountStatus:void 0,loadingMessage:Object(E.__)("Loading…","google-site-kit"),instructionProps:{}},a}return f()(t,e),g()(t,[{key:"componentDidMount",value:function(){return r.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.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=function(e,t){var a,n,i,o,c,s,r,l,d,u,g,p,m,h=!1,_=!1,b=!1,f=!1,k=!1,v=!1,O=googlesitekit.modules.adsense,R=O.accountURL,S=O.signupURL,j=Object(w.n)("googlesitekit-module-adsense",{}),D=new URL(googlesitekit.admin.siteURL);switch(e){case"account-connected":t?(l=!1,r="alert",d=Object(E.__)("Site Kit will place AdSense code to your site","google-site-kit"),u=Object(E.__)("This means Google will automatically place ads for you in all the best places.","google-site-kit"),n=Object(E.__)("Continue","google-site-kit"),a=j,h=!0,g=Object(E.__)("Let Site Kit place code on your site","google-site-kit"),p=Object(E.__)("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"),m=Object(E.__)("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")):(l=!1,r=!1,d=Object(E.__)("Looks like you’re already using AdSense","google-site-kit"),u=Object(E.__)("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"),n=Object(E.__)("Continue","google-site-kit"),a=j,v={eventCategory:"adsense_setup",eventName:"complete_adsense_setup"},g=Object(E.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),p=Object(E.__)("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":l=!1,r=!1,d=Object(E.__)("Your site has code from another AdSense account","google-site-kit"),u=Object(E.__)("We’ve found some AdSense code on your site, but it’s not linked to this AdSense account.","google-site-kit"),f=!1,n=Object(E.__)("Switch Google account","google-site-kit"),a=Object(w.m)("adsense",!0),_={accountStatus:"account-connected",continueText:Object(E.__)("Continue anyway","google-site-kit"),statusHeadline:Object(E.__)("Site Kit will place AdSense code on your site","google-site-kit"),statusMessage:Object(E.__)("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:j,ctaLinkText:Object(E.__)("Continue","google-site-kit"),continueAction:!1,switchLabel:Object(E.__)("Let Site Kit place code on your site","google-site-kit"),switchOffMessage:Object(E.__)("You can let Site Kit do this later.","google-site-kit")};break;case"ads-display-pending":var C=Object(y.parse)(D.hostname).domain;d=Object(E.__)("Let’s get your site ready for ads","google-site-kit"),u=Object(E.__)("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"),n=Object(E.__)("Go to your AdSense account to check on your site’s status or to complete setting up","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(C||D.hostname,"&source=site-kit");break;case"account-pending-review":d=Object(E.__)("We’re getting your site ready for ads","google-site-kit"),u=Object(E.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),n=Object(E.__)("Go to your AdSense account to check on your site’s status","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(D.hostname,"&source=site-kit"),b=!0;break;case"account-required-action":k=!0;break;case"disapproved-account":a=R,n=Object(E.__)("Go to AdSense to find out how to fix the issue","google-site-kit"),d=Object(E.__)("Your site isn’t ready to show ads yet","google-site-kit"),u=Object(E.__)("You need to fix some things before we can connect Site Kit to your AdSense account.","google-site-kit");break;case"disapproved-account-afc":l=Object(E.__)("There is an AdSense account, but the AFC account is disapproved","google-site-kit"),r="error",d=Object(E.__)("Create Account","google-site-kit"),u=Object(E.__)("Create an AdMob account, then open AdSense and try to upgrade.","google-site-kit"),n=Object(E.__)("Create an AdMob Account","google-site-kit"),a="https://google.com/admob";break;case"no-account":d=Object(E.__)("Create your AdSense account","google-site-kit"),u=Object(E.__)("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"),f=!0,n=Object(E.__)("Create AdSense Account","google-site-kit"),a=S,s=Object(E.__)("Already have an AdSense account?","google-site-kit"),i=Object(E.__)("to connect to it","google-site-kit"),o=Object(E.__)("Switch Google account","google-site-kit"),c=Object(w.m)("adsense",!0),v={eventCategory:"adsense_setup",eventName:"create_adsense_account"};break;case"no-account-tag-found":d=Object(E.__)("Looks like you’re already using AdSense","google-site-kit"),u=Object(E.__)("We’ve found some AdSense code on your site, but it’s not linked to this Google account.","google-site-kit"),f=!1,n=Object(E.__)("Switch Google account","google-site-kit"),a=Object(w.m)("adsense",!0),g=Object(E.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),_={statusHeadline:Object(E.__)("Create a new AdSense account","google-site-kit"),statusMessage:Object(E.__)("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(E.__)("We recommend you remove the old AdSense code from this site.","google-site-kit"),icon:"warning",continueText:Object(E.__)("Continue anyway","google-site-kit"),ctaLinkText:Object(E.__)("Create AdSense Account","google-site-kit"),ctaLink:S,ctaTarget:"_blank",continueAction:!1}}return{accountTagMatch:h,continueAction:_,ctaLink:a,ctaLinkText:n,footerAppendedText:i,footerCTA:o,footerCTALink:c,footerText:s,icon:r,incomplete:b,issue:l,profile:f,required:k,setupComplete:!1,statusHeadline:d,statusMessage:u,switchLabel:g,switchOffMessage:p,switchOnMessage:m,tracking:v}}(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=this;return r.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,r.a.awrap(Object(w.k)("adsense"));case 2:return e=i.sent,t=function(e){n.setState({loadingMessage:e})},i.next=6,r.a.awrap(Object(D.getAdSenseAccountStatus)(e,t));case 6:a=i.sent,this.setState({accountStatus:a.accountStatus});case 8:case"end":return i.stop()}}),null,this)}},{key:"render",value:function(){var e=this.state,t=e.accountStatus,a=e.loadingMessage,n=e.instructionProps,o=!t||!googlesitekit.modules.adsense.setupComplete||["ads-display-pending","account-pending-review","account-required-action"].includes(t);return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(R.a,{id:"adsense",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(E._x)("AdSense","Service name","google-site-kit"))),React.createElement("div",{className:"googlesitekit-setup-module__step"},!googlesitekit.canAdsRun&&!googlesitekit.modules.adsense.setupComplete&&React.createElement("div",{className:"googlesitekit-settings-module-warning"},React.createElement(R.a,{id:"error",height:"20",width:"23"}),Object(E.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit")),o&&React.createElement(j.default,{ctaLink:n.ctaLink,ctaLinkText:n.ctaLinkText,header:n.statusHeadline,subHeader:n.statusMessage,incomplete:n.incomplete,required:n.required,loadingMessage:!t&&a}),googlesitekit.canAdsRun&&googlesitekit.modules.adsense.setupComplete&&t&&React.createElement(S.default,i()({},n,{accountStatus:t,continueSetup:this.continueSetup,goBack:this.goBack}))))}}]),t}(k.Component);N.propTypes={status:O.a.string,module:O.a.string},t.default=N},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(20),h=a(14),_=a(29),b=a(74),f=a(9),k=a(62),y=a(18),v=a(2),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={isSaving:!1},a}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.error,n=t.message,i=t.issue,o=t.notice,c=t.statusHeadline,s=t.statusMessage,r=t.profile,l=t.ctaLinkText,d=t.ctaLink,u=t.footerText,g=t.footerAppendedText,p=t.footerCTA,R=t.footerCTALink,E=t.continueAction,S=t.continueSetup,j=t.accountStatus,w=t.accountTagMatch,D=t.clientId,C=t.existingTag,x=t.switchLabel,N=t.tracking,A=t.switchOffMessage,P=t.switchOnMessage,L=t.goBack,M=t.existingState,I=this.state.isSaving,T=googlesitekit.admin.userData,F=T.email,U=void 0===F?"":F,z=T.picture,q=void 0===z?"":z;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},i&&React.createElement("p",{className:"googlesitekit-setup__notice"},React.createElement(m.a,{id:"error",height:"20",width:"23"}),React.createElement("span",{className:"googlesitekit-setup__notice-text"},i)),React.createElement("h2",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},c),React.createElement("p",null,s),r&&React.createElement("p",{className:"googlesitekit-setup-module__user"},q&&React.createElement("img",{className:"googlesitekit-setup-module__user-image",src:q,alt:Object(O.__)("User Avatar","google-site-kit")}),React.createElement("span",{className:"googlesitekit-setup-module__user-email"},U)),"account-connected"===j&&React.createElement(b.default,{isEditing:!0,accountTagMatch:w,existingTag:C,saveOnChange:!0,switchLabel:x,switchOffMessage:A,switchOnMessage:P}),o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o)),a&&0<n.length&&React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(O.__)("Error:","google-site-kit")," ",n)),React.createElement("div",{className:"googlesitekit-setup-module__action"},"account-connected"===j&&D&&React.createElement(y.Fragment,null,React.createElement(_.a,{disabled:I,onClick:function(){N&&Object(v.v)(N.eventCategory,N.eventName),e.setState({isSaving:!0});var t=document.getElementById("enableAutoAds"),a=t&&t.checked;f.c.set(f.b,"adsense","setup-complete",{clientId:D,useSnippet:a}).then((function(){document.location=d})).catch((function(){e.setState({isSaving:!1})}))}},l),React.createElement(k.a,{isSaving:I})),(!1===j||!D)&&React.createElement(h.a,{className:"googlesitekit-setup-module__cta-link",external:!0,inherit:!0,href:d},l),E&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){S(E)}},E.continueText)),M&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){L()}},Object(O.__)("Back","google-site-kit")))),u&&React.createElement("p",{className:"googlesitekit-setup-module__footer-text"},u," ",p&&React.createElement(h.a,{href:R,inherit:!0,external:!0},p)," ",g)))}}]),t}(p.Component);t.default=R},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.AnalyticsAdSenseTopPagesTable")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(41),h=a(100),_=a(103),b=a(53),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(m.a,{title:Object(f.__)("Earnings","google-site-kit"),description:Object(f.__)("How much you’re earning from your content through AdSense.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")}),React.createElement(b.a,{slug:"adsense",context:"module-sitekit-dashboard"})),React.createElement(_.default,null),React.createElement(h.default,null))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(23),b=a(2),f=a(25),k=a(51),y=a(0),v=a(44),O=a(17),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={today:!1,period:!1,daily:!1},a}return g()(t,e),c()(t,[{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.period,n=e.daily;if(!(t&&a&&n&&a.totals))return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0})));var i=Object(v.reduceAdSenseData)(n.rows),o=Object(b.n)("googlesitekit-module-adsense",{}),c=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),s=!!c&&c.currency;return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-rpm",title:Object(y.__)("RPM","google-site-kit"),datapoint:Object(b.t)(a.totals[1],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,2),change:1,id:"adsense-rpm-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-earnings",title:Object(y.__)("Total Earnings","google-site-kit"),datapoint:Object(b.t)(a.totals[0],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},change:t.totals[0],changeDataUnit:"$",sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,1),change:1,id:"adsense-earnings-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-impressions",title:Object(y.__)("Ad Impressions","google-site-kit"),datapoint:Object(b.t)(a.totals[2]),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,3),change:1,id:"adsense-impressions-sparkline",loadSmall:!1}),context:"compact"})))))))}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.period)return{period:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month",dimensions:["DATE"]},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.daily)return{daily:a}}}],React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0}))),{inGrid:!0,createGrid:!0},v.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(23),_=a(2),b=a(19),f=a(9),k=a(44),y=a(0),v=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).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:""},a}return g()(t,e),c()(t,[{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,a=e.today,n=e.yesterday,i=e.sevenDays,o=e.month,c=e.twentyEightDays,s=e.sameDayLastWeek,r=e.prev7Days,l=e.monthLastYear,d=e.prev28Days;if(!(a&&n&&i&&o&&c&&s&&r&&l&&d))return null;var u=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),g=!!u&&u.currency,p=a.totals?[{className:"googlesitekit-data-block--today",title:Object(y.__)("Today so far","google-site-kit"),datapoint:Object(_.t)(a.totals[0],g)},{className:"googlesitekit-data-block--yesterday",title:Object(y.__)("Yesterday","google-site-kit"),datapoint:Object(_.t)(n.totals[0],g),change:s.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--7days",title:Object(y.__)("Last 7 days","google-site-kit"),datapoint:Object(_.t)(i.totals[0],g),change:r.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--month",title:Object(y.__)("This month","google-site-kit"),datapoint:Object(_.t)(o.totals[0],g),change:l.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--28days",title:Object(y.__)("Last 28 days","google-site-kit"),datapoint:Object(_.t)(c.totals[0],g),change:d.totals[0],changeDataUnit:"%"}]:[];return t.renderLayout(p)}}],[{key:"renderLayout",value:function(e){return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(m.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}},{key:"renderPreviews",value:function(){for(var e=[],t=0;5>t;t++)e.push(React.createElement("div",{key:t,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 "},React.createElement(h.a,{width:"100%",height:"104px"})));return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e))}}]),t}(p.Component);t.default=Object(b.a)(v,[{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"yesterday"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.yesterday)return{yesterday:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"same-day-last-week"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sameDayLastWeek)return{sameDayLastWeek:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-7-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sevenDays)return{sevenDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-7-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev7Days)return{prev7Days:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.month)return{month:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month-last-year"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.monthLastYear)return{monthLastYear:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],v.renderPreviews(),{createGrid:!0},k.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(9),h=a(25),_=a(23),b=a(2),f=a(44),k=a(19),y=a(0),v=a(11),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={twentyEightDays:!1,prev28Days:!1},a}return g()(t,e),c()(t,[{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.twentyEightDays,a=e.prev28Days,n=t.totals?[{className:"googlesitekit-data-block--page-rpm",title:Object(y.__)("Page RPM","google-site-kit"),datapoint:Object(b.t)(t.totals[1]),change:Object(v.isUndefined)(a.totals)?0:a.totals[1],changeDataUnit:"%"},{className:"googlesitekit-data-block--impression",title:Object(y.__)("Impressions","google-site-kit"),datapoint:Object(b.t)(t.totals[2]),change:Object(v.isUndefined)(a.totals)?0:a.totals[2],changeDataUnit:"%"}]:[];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},n.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(h.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}}]),t}(p.Component);t.default=Object(k.a)(O,[{type:m.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:m.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],React.createElement(_.a,{width:"100%",height:"250px"}),{},f.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(13),m=a.n(p),h=a(7),_=a.n(h),b=a(1),f=a(43),k=a(47),y=a(17),v=a(0),O=a(104),R=a(105),E=a(72),S=a(101),j=a(55),w=a(45),D=a(31),C=a(75),x=a(44),N=a(53),A=a(73),P=a(42),L=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0,zeroData:!1},a.handleDataError=a.handleDataError.bind(m()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(m()(a)),a.handleZeroData=a.handleZeroData.bind(m()(a)),a}return _()(t,e),r()(t,[{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(x.isAdsenseConnectedAnalytics)());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(){this.setState({zeroData:!0,loading:!1})}},{key:"render",value:function(){var e=this,t=this.state,a=t.receivingData,n=t.error,i=t.loading,o=t.isAdSenseConnected,c=t.zeroData,s=googlesitekit.modules.adsense.homepage,r=i||!a||c?"googlesitekit-nodata":"";return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement("div",{className:"".concat(r)},React.createElement(E.a,{module:"adsense"})),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},!n&&googlesitekit.modules.adsense.setupComplete?React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"connected",statusText:Object(v.__)("AdSense is connected","google-site-kit")}):React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"not-connected",statusText:Object(v.__)("AdSense is not connected","google-site-kit")}),i&&React.createElement(D.a,null)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(y.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(A.default,{status:"incomplete"})))))),!a&&(n?Object(w.a)(Object(v._x)("AdSense","Service name","google-site-kit"),n,!0,!0,!0):Object(j.a)(Object(v._x)("AdSense","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(r,"\n\t\t\t\t\t\t\t")},React.createElement(N.a,{slug:"adsense",context:"module-dashboard"}),React.createElement(y.a,{header:!0,title:Object(v.__)("Estimated earnings","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:s},React.createElement(O.default,{handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(r,"\n\t\t\t\t\t\t\t")},React.createElement(y.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:s},React.createElement(R.default,{handleDataError:function(t){t||e.handleZeroData()}}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(r,"\n\t\t\t\t\t\t\t")},React.createElement(S.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(P.a,null))))),!o&&React.createElement(C.default,null))}}]),t}(b.Component);t.default=L},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(2),h=a(14),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.screenID,n=e.OriginalComponent,i=googlesitekit.modules.adsense.settings.accountStatus;return i&&"adsense"===t&&("account-pending-review"===i||"ads-display-pending"===i)?React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},Object(_.__)("Site Kit has placed the code on your site, ","google-site-kit"),React.createElement(h.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){var e=a||"googlesitekit-dashboard";window.location=Object(m.n)(e,{reAuth:!0,slug:t})},inherit:!0},Object(_.__)("check module page","google-site-kit"))):React.createElement(n,this.props)}}]),t}(p.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(20),h=a(0),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.context,n=e.OriginalComponent;if("adsense"!==t)return React.createElement(n,this.props);var i=googlesitekit.modules.adsense,o=i.active,c=i.setupComplete,s=Object(h.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit");return o&&c&&(s=Object(h.__)("Ad blocker detected, You need to disable it to get the AdSense latest data.","google-site-kit")),googlesitekit.canAdsRun?React.createElement(n,this.props):React.createElement("div",{className:"googlesitekit-settings-module-warning googlesitekit-settings-module-warning--".concat(a)},React.createElement(m.a,{id:"error",height:"20",width:"23"})," ",s)}}]),t}(p.Component);t.default=_},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(29),b=a(0),f=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).renderAccountSetup=a.renderAccountSetup.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"renderAccountSetup",value:function(){if("no-account"===this.props.accountStatus)return React.createElement(_.a,{onClick:t.createNewAccount},Object(b.__)("Sign up for AdSense","google-site-kit"))}},{key:"render",value:function(){return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},this.renderAccountSetup()))}}],[{key:"createNewAccount",value:function(e){e.preventDefault();var t=googlesitekit.modules.adsense.signupURL;window.open(t,"_blank")}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(25),b=a(19),f=a(9),k=a(2),y=a(15),v=a(23),O=a(0);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}var E=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.totalSessions,i=t.totalUsersChange,o=t.totalSessionsChange;return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-users",title:Object(O.__)("Total Users","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-sessions",title:Object(O.__)("Total Sessions","google-site-kit"),datapoint:Object(k.t)(n),change:o,changeDataUnit:"%"})))}}]),t}(h.Component);t.default=Object(b.a)(E,[{type:f.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?R(a,!0).forEach((function(t){i()(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}({},y.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(k.p)("day"),context:"Adminbar"}],React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"}))),{inGrid:!0},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(49),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(110),b=a(63),f=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:googlesitekit.modules.analytics.active?React.createElement(_.default,null):React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)))}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(41),h=a(17),_=a(0),b=a(76),f=a(66),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(m.a,{title:Object(_.__)("All Traffic","google-site-kit"),description:Object(_.__)("How people found your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-analytics-acquisition-sources",footer:!0,headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(_.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(_._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(f.default,null)),React.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 "},React.createElement(b.default,null)))))))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(95),k=a(38),y=a(11),v=a(0),O=a(15),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(v.__)("Source","google-site-kit"),primary:!0},{title:Object(v.__)("Percent","google-site-kit")}],a=e[0].data.totals[0].values[0],n=Object(y.map)(e[0].data.rows,(function(e,t){var n=e.metrics[0].values[0]/a*100;return!(1>n)&&[e.dimensions[0],React.createElement(p.Fragment,{key:"minichart-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")," ",React.createElement(f.a,{percent:n.toFixed(1),index:t})))]})),i=Object(b.b)(n,t,{hideHeader:!0,chartsEnabled:!0});return React.createElement("div",{className:"googlesitekit-alltraffic-widget"},React.createElement(b.a,null,i))}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.trafficSourcesReportDataDefaults,priority:1,maxAge:Object(_.p)("day"),context:"Dashboard"}],React.createElement(k.a,{rows:3,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(66),b=a(113),f=a(0),k=a(17),y=a(41),v=a(55),O=a(45),R=a(90),E=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={receivingData:!0,error:!1},a.handleDataError=a.handleDataError.bind(g()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(g()(a)),a}return m()(t,e),c()(t,[{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=googlesitekit.modules.analytics,t=e.active,a=e.setupComplete,n=this.state,i=n.error,o=n.receivingData;return t&&!a?Object(R.a)("analytics",!0,!0,!0):o?null:i?Object(O.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 e=this.state,t=e.error,a=e.receivingData,n=t||!a?"googlesitekit-nodata":"";return React.createElement(h.Fragment,null,React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t"},React.createElement(y.a,{timePeriod:Object(f.__)("Last 28 days","google-site-kit"),description:Object(f.__)("How people found your site.","google-site-kit"),title:Object(f.__)("All Traffic","google-site-kit")})),this.getErrorDataComponent(),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t".concat(n,"\n\t\t\t\t")},React.createElement(k.a,{className:"googlesitekit-dashboard-all-traffic"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(_.default,{source:!0,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess})),React.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 "},React.createElement(b.default,null)))))))}}]),t}(h.Component);t.default=E},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(17),k=a(38),y=a(11),v=a(0),O=a(15),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Page Title","google-site-kit"),tooltip:Object(v.__)("Page Title","google-site-kit"),primary:!0},{title:Object(v.__)("Earnings","google-site-kit"),tooltip:Object(v.__)("Earnings","google-site-kit")},{title:Object(v.__)("Page RPM","google-site-kit"),tooltip:Object(v.__)("Page RPM","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Impressions","google-site-kit")}],n=Object(y.map)(e[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(_.r)(e.metrics[0].values[2])]})),i=googlesitekit.modules.analytics.settings,o=i.accountID,c=i.internalWebPropertyID,s=i.profileID,r="https://analytics.google.com/analytics/web/?pli=1#/report/content-pages/a".concat(o,"w").concat(c,"p").concat(s,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:~2F"),l={hideHeader:!1,chartsEnabled:!1,links:Object(y.map)(e[0].data.rows,(function(e){var t=e.dimensions[1].replace(/\//g,"~2F");return r+t}))},d=Object(b.b)(n,a,l);return t.renderLayout(React.createElement(b.a,null,d))}}],[{key:"renderLayout",value:function(e){var t=googlesitekit.modules.adsense.accountURL;return React.createElement(f.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:t},e)}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(_.p)("day"),context:"Single"}],R.renderLayout(React.createElement(k.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&&googlesitekit.modules.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(v.__)("Unidentified error","google-site-kit"))}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(2),f=a(15),k=a(23),y=a(8),v=a.n(y),O=a(0),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(f.calculateOverviewData)(t);if(!i)return null;var o=i.totalUsers,c=i.totalSessions,s=i.averageBounceRate,r=i.averageSessionDuration,l=i.totalUsersChange,d=i.totalSessionsChange,u=i.averageBounceRateChange,g=i.averageSessionDurationChange,p=[{className:"googlesitekit-data-block--users googlesitekit-data-block--button-1",title:Object(O.__)("Users","google-site-kit"),datapoint:Object(b.t)(o),change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--sessions googlesitekit-data-block--button-2",title:Object(O.__)("Sessions","google-site-kit"),datapoint:Object(b.t)(c),change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--bounce googlesitekit-data-block--button-3",title:Object(O.__)("Bounce Rate","google-site-kit"),datapoint:Number(s).toFixed(2),change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n,datapointUnit:"%",reverseArrowDirection:!0},{className:"googlesitekit-data-block--duration googlesitekit-data-block--button-4",title:Object(O.__)("Session Duration","google-site-kit"),datapoint:Object(b.s)(r),change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},p.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(m.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection,datapointUnit:e.datapointUnit,reverseArrowDirection:e.reverseArrowDirection}))}))))}}]),t}(p.Component);R.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(R,[{type:_.b,identifier:"analytics",datapoint:"report",data:f.overviewReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],React.createElement(k.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},f.isDataZeroForReporting,f.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(17),O=a(11),R=a(0),E=a(15),S=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,a=googlesitekit.admin.siteURL;if(!e||!e.length)return null;var n=[{title:Object(R.__)("Most popular content","google-site-kit"),primary:!0},{title:Object(R.__)("Views","google-site-kit")}],o=[],c=Object(O.map)(e[0].data.rows,(function(e,t){var n=i()(e.dimensions,2),c=n[0],s=n[1];return o[t]=a+s,[c,Object(f.r)(e.metrics[0].values[0])]})),s={hideHeader:!1,chartsEnabled:!1,links:o,showURLs:!0},r=Object(k.b)(c,n,s);return t.renderLayout(React.createElement(k.a,null,r))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(v.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(R._x)("Analytics","Service name","google-site-kit"),footerCtaLink:googlesitekit.modules.analytics.homepage,fill:!0},e))}}]),t}(h.Component);t.default=Object(_.a)(S,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(E.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],S.renderLayout(React.createElement(y.a,{padding:!0})),{inGrid:!0,createGrid:!0},E.isDataZeroForReporting)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(56),b=a(2),f=a(19),k=a(9),y=a(15),v=a(23),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.series,a=e.vAxes,n={chart:{title:""===googlesitekit.pageTitle?"":Object(O.__)("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 n.series=t,n.vAxes=a,n}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.dateRangeFrom;if(!t||!t.length)return null;var i=n?n.match(/\d+/).map(Number)[0]:28,o=Object(y.extractAnalyticsDashboardData)(t,a,i);if(!o)return null;var c=this.setOptions();return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{selectedStats:a,data:o,options:c}))))}}]),t}(h.Component);t.default=Object(f.a)(R,[{type:k.b,identifier:"analytics",datapoint:"report",data:y.siteAnalyticsReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:"Single"}],React.createElement(v.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(11),h=a(19),_=a(9),b=a(2),f=a(28),k=a(38),y=a(17),v=a(32),O=a(0),R=a(15),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(O.__)("Top Earning Pages","google-site-kit"),tooltip:Object(O.__)("Top Earning Pages","google-site-kit"),primary:!0},{title:Object(O.__)("Revenue","google-site-kit"),tooltip:Object(O.__)("Revenue","google-site-kit")}],n=[],i=Object(m.map)(e[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},c=Object(f.b)(i,a,o);return t.renderLayout(React.createElement(f.a,null,c))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",footer:!0,footerCtaLabel:Object(O._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"http://analytics.google.com",fill:!0},e))}}]),t}(p.Component);t.default=Object(h.a)(E,[{type:_.b,identifier:"analytics",datapoint:"report",data:R.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:"Dashboard"}],E.renderLayout(React.createElement(k.a,{rows:5,padding:!0})),{inGrid:!0,createGrid:!0},(function(){return!1}),(function(e){if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"badRequest"===t[0].reason)return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",fill:!0},React.createElement(v.a,{title:Object(O.__)("Restricted metric(s)","google-site-kit"),description:Object(O.__)("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(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1}))},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(25),b=a(19),f=a(9),k=a(51),y=a(32),v=a(23),O=a(2),R=a(11),E=a(0),S=a(15);function j(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?j(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var D=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={accounts:!1,goals:!1},a}return m()(t,e),r()(t,[{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.overview,a=e.extractedAnalytics,n=e.goals,i=googlesitekit.permaLink,o=Object(O.n)("googlesitekit-module-analytics",{}),c="",s="",r="",l="",d="",u="";return t&&(c=t.totalUsers,s=t.totalUsersChange,r=t.goalCompletions,l=t.goalCompletionsChange,d=t.averageBounceRate,u=t.averageBounceRateChange),React.createElement(h.Fragment,null,React.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 "},React.createElement(_.a,{className:"overview-total-users",title:Object(E.__)("Unique Visitors from Search","google-site-kit"),datapoint:Object(O.t)(c),change:s,changeDataUnit:"%",source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,1),change:s,id:"analytics-users-sparkline"})})),React.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 "},i&&React.createElement(_.a,{className:"overview-bounce-rate",title:Object(E.__)("Bounce Rate","google-site-kit"),datapoint:Number(d).toFixed(2),datapointUnit:Object(E.__)("%","google-site-kit"),change:u,changeDataUnit:"%",reverseArrowDirection:!0,source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,2),change:u,id:"analytics-sessions-sparkline"})}),!i&&n&&Object(R.isEmpty)(n.items)&&React.createElement(y.a,{title:Object(E.__)("Use goals to measure success.","google-site-kit"),description:Object(E.__)("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(E.__)("Create a new goal","google-site-kit")}),!i&&n&&!Object(R.isEmpty)(n.items)&&React.createElement(_.a,{className:"overview-goals-completed",title:Object(E.__)("Goals Completed","google-site-kit"),datapoint:Object(O.t)(r),change:l,changeDataUnit:"%",source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,3),change:l,id:"analytics-sessions-sparkline"})}),!i&&!n&&React.createElement(v.a,{width:"100%",height:"202px"})))}}]),t}(h.Component);t.default=Object(b.a)(D,[{type:f.b,identifier:"analytics",datapoint:"report",data:w({},S.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.overview)return{overview:Object(S.calculateOverviewData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"report",data:w({},S.siteAnalyticsReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.extractedAnalytics)return{extractedAnalytics:Object(S.extractAnalyticsDashboardSparklineData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"goals",data:{url:googlesitekit.permaLink},priority:1,maxAge:Object(O.p)("hour"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.goals)return{goals:a}}}],React.createElement(h.Fragment,null,React.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 "},React.createElement(v.a,{width:"100%",height:"202px"})),React.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 "},React.createElement(v.a,{width:"100%",height:"202px"}))),{inGrid:!0},(function(e,t){return"report"===t&&Object(S.isDataZeroForReporting)(e)}),S.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(11),O=a(8),R=a.n(O),E=a(0),S=a(15),j=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,a=e.data,n=e.colspan;if(!a||!a.length)return null;var o=[{title:Object(E.__)("Title","google-site-kit"),tooltip:Object(E.__)("Page Title","google-site-kit"),primary:!0},{title:Object(E.__)("Pageviews","google-site-kit"),tooltip:Object(E.__)("Pageviews","google-site-kit")},{title:Object(E.__)("Unique Pageviews","google-site-kit"),tooltip:Object(E.__)("Unique Pageviews","google-site-kit")},{title:Object(E.__)("Bounce Rate","google-site-kit"),tooltip:Object(E.__)("Bounce Rate","google-site-kit")}],c=[],s=Object(v.map)(a[0].data.rows,(function(e,a){var n=Number(e.metrics[0].values[2]),o=i()(e.dimensions,2),s=o[0],r=o[1];return c[a]=t.addDeepLink(r),[s,Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),React.createElement(h.Fragment,{key:"minichart-"+a},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")))]})),r={hideHeader:!1,chartsEnabled:!1,links:c},l=Object(k.b)(s,o,r);return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-".concat(n)},React.createElement(k.a,null,l))}}],[{key:"addDeepLink",value:function(e){var t=googlesitekit.modules.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/"}}]),t}(h.Component);j.propTypes={data:R.a.array,colspan:R.a.number},j.defaultProps={data:null,colspan:12},t.default=Object(_.a)(j,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(S.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(13),m=a.n(p),h=a(7),_=a.n(h),b=a(1),f=a(43),k=a(0),y=a(118),v=a(121),O=a(116),R=a(76),E=a(17),S=a(47),j=a(66),w=a(72),D=a(31),C=a(55),x=a(45),N=a(75),A=a(44),P=a(2),L=a(42),M=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={selectedStats:[0],receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0},a.handleStatSelection=a.handleStatSelection.bind(m()(a)),a.buildSeries=a.buildSeries.bind(m()(a)),a.handleDataError=a.handleDataError.bind(m()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(m()(a)),a}return _()(t,e),r()(t,[{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.isAdsenseConnectedAnalytics)());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 e=this.state,t=e.selectedStats,a=e.error,n=e.receivingData,i=e.loading,o=e.isAdSenseConnected,c=this.buildSeries(),s=!i&&n?"":"googlesitekit-nodata",r=Object(P.i)();return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement(w.a,{module:"analytics"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--analytics"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(S.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")}),i&&React.createElement(D.a,null)),!n&&(a?Object(x.a)(Object(k._x)("Analytics","Service name","google-site-kit"),a,!0,!0,!0):Object(C.a)(Object(k._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,title:Object(k.sprintf)(Object(k.__)("Audience overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),headerCtaLink:"http://analytics.google.com"},React.createElement(O.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(y.default,{selectedStats:t,series:c,vAxes:null,dateRangeFrom:r}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top content over the last %s","google-site-kit"),r),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"},React.createElement(v.default,null))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top acquisition sources over the last %s","google-site-kit"),r),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"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(j.default,null)),React.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 "},React.createElement(R.default,null)))))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(L.a,null))))),!i&&!o&&React.createElement(N.default,null))}}]),t}(b.Component);t.default=M},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(91),h=a(25),_=a(32),b=a(19),f=a(9),k=a(2),y=a(15),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.averageSessionDuration,i=t.totalUsersChange,o=t.averageSessionDurationChange;return React.createElement(p.Fragment,null,e.length?React.createElement(p.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-users",title:Object(v.__)("Total Unique Visitors","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-average-session-duration",title:Object(v.__)("Avg. Time on Page","google-site-kit"),datapoint:Object(k.s)(n),change:o,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(_.a,{title:Object(v.__)("Analytics Gathering Data","google-site-kit"),description:Object(v.__)("Analytics data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(p.Component);t.default=Object(b.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:y.overviewReportDataDefaults,priority:1,maxAge:Object(k.p)("day"),context:["WPDashboard"]}],React.createElement(m.a,{width:"23%",height:"94px",count:2}),{},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(11),O=a(0),R=a(15),E=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,t=googlesitekit.admin.siteURL;if(Object(R.isDataZeroForReporting)(e))return null;var a=[],n=Object(v.map)(e[0].data.rows,(function(e,n){var o=i()(e.dimensions,2),c=o[0],s=o[1];return a[n]=t+s,[c,Object(f.r)(e.metrics[0].values[0])]})),o=[{title:Object(O.__)("Title","google-site-kit"),tooltip:Object(O.__)("Page Title","google-site-kit"),primary:!0},{title:Object(O.__)("Pageviews","google-site-kit"),tooltip:Object(O.__)("Pageviews","google-site-kit")}],c={chartsEnabled:!0,links:a,cap:5,showURLs:!0},s=Object(k.b)(n,o,c);return React.createElement("div",{className:"googlesitekit-search-console-widget"},React.createElement("h2",{className:"googlesitekit-search-console-widget__title"},Object(O.__)("Top content over the last 28 days","google-site-kit")),React.createElement(k.a,null,s))}}]),t}(h.Component);t.default=Object(_.a)(E,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(R.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:"WPDashboard"}],React.createElement(y.a,{rows:6}))},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=(a(1),a(32)),c=a(9),s=a(54),r=a(2),l=a(0);t.default=function(){var e=googlesitekit.modules["pagespeed-insights"],t=e.active,a=e.setupComplete;if(!googlesitekit.permissions.canManageOptions&&!a)return null;return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(o.a,{title:!a&&t?Object(l.__)("Complete PageSpeed Insights activation.","google-site-kit"):Object(l.__)("Activate PageSpeed Insights.","google-site-kit"),description:Object(l.__)("Google PageSpeed Insights gives you metrics about performance, accessibility, SEO and PWA.","google-site-kit"),ctaLink:"#",ctaLabel:!a&&t?Object(l.__)("Complete activation","google-site-kit"):Object(l.__)("Activate PageSpeed Insights","google-site-kit"),onClick:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(r.a)(c.c,"pagespeed-insights",!0));case 3:window.location=Object(r.m)("pagespeed-insights"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),Object(r.w)(s.a,{id:"pagespeed-insights-setup-error",title:Object(l.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 9:case"end":return e.stop()}}),null,null,[[0,6]])}}))}},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(60),b=a(31),f=a(45),k=a(0),y=a(93),v=a(64),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,error:!1},a.handleDataLoaded=a.handleDataLoaded.bind(g()(a)),a.handleDataError=a.handleDataError.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"handleDataLoaded",value:function(){this.setState({loading:!1})}},{key:"handleDataError",value:function(e){this.setState({error:e})}},{key:"render",value:function(){var e=this.state,t=e.loading,a=e.error,n={name:Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),link:Object(k.sprintf)("https://developers.google.com/speed/pagespeed/insights/?url=%s",googlesitekit.permaLink||googlesitekit.admin.siteURL)};return a?React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(f.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),a,!0,!0,!1)):React.createElement(h.Fragment,null,t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-pagespeed-report__loading"},React.createElement(b.a,null),React.createElement("p",null,Object(k.__)("PageSpeed Insights is preparing data…","google-site-kit")))),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedMobile,{handleDataLoaded:this.handleDataLoaded,handleDataError:this.handleDataError,title:Object(k.__)("Mobile","google-site-kit")}),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop,{title:Object(k.__)("Desktop","google-site-kit")}),!t&&React.createElement(h.Fragment,null,React.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 "},React.createElement(_.a,{name:n.name,href:n.link,external:!0})),React.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 "},React.createElement(v.PageSpeedReportScale,null))))}}]),t}(h.Component);t.default=O},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.DashboardSpeed")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(127),h=a(17),_=a(41),b=a(0),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permaLink?Object(b.__)("How fast this page is.","google-site-kit"):Object(b.__)("How fast your home page is.","google-site-kit");return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(b.__)("Speed","google-site-kit"),description:e})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-pagespeed-report"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(m.default,null))))))}}]),t}(p.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(2),f=a(33),k=a(23),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error)return null;var t=Object(f.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(m.a,{className:"overview-total-clicks",title:Object(y.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(m.a,{className:"overview-total-impressions",title:Object(y.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})))}}]),t}(p.Component);t.default=Object(h.a)(v,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(b.p)("day"),context:"Adminbar"}],React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(49),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(129),b=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:React.createElement(_.default,null)}}]),t}(h.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(41),h=a(17),_=a(0),b=a(77),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(m.a,{title:Object(_.__)("Top Queries","google-site-kit"),description:Object(_.__)("What people searched for to find your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{footer:!0,footerCtaLabel:Object(_._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(_.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL)},React.createElement(b.default,null))))}}]),t}(p.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(63),h=a(41),_=a(17),b=a(0),f=a(78),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{description:Object(b.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),title:Object(b.__)("Search Funnel","google-site-kit")})),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(f.default,null),!googlesitekit.modules.analytics.active&&React.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 "},React.createElement(m.a,null)))))))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(23),f=a(2),k=a(33),y=a(8),v=a.n(y),O=a(0),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(k.extractSearchConsoleDashboardData)(t),o=i.totalClicks,c=i.totalImpressions,s=i.averageCTR,r=i.averagePosition,l=i.totalClicksChange,d=i.totalImpressionsChange,u=i.averageCTRChange,g=i.averagePositionChange,h=[{className:"googlesitekit-data-block--clicks googlesitekit-data-block--button-1",title:Object(O.__)("Total Clicks","google-site-kit"),datapoint:o,change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--impressions googlesitekit-data-block--button-2",title:Object(O.__)("Total Impressions","google-site-kit"),datapoint:c,change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--ctr googlesitekit-data-block--button-3",title:Object(O.__)("Average CTR","google-site-kit"),datapoint:s+"%",change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n},{className:"googlesitekit-data-block--position googlesitekit-data-block--button-4",title:Object(O.__)("Average Position","google-site-kit"),datapoint:r,change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement(p.Fragment,null,React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},h.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(m.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))})))))}}]),t}(p.Component);R.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(R,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(b.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(38),k=a(17),y=a(11),v=a(0),O=a(33),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Top search queries for your site","google-site-kit"),tooltip:Object(v.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(v.__)("Clicks","google-site-kit"),tooltip:Object(v.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Counted each time your content appears in search results","google-site-kit")}],n=googlesitekit.admin.siteURL,i=[],o=Object(y.map)(e,(function(e,t){var a=e.keys[0];return i[t]=Object(v.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",n,a),[a,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),c={hideHeader:!1,chartsEnabled:!1,links:i},s=Object(b.b)(o,a,c);return t.renderLayout(React.createElement(b.a,null,s))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(k.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(v._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(v.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL),fill:!0},e))}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"query",limit:10},priority:1,maxAge:Object(_.p)("day"),context:["Dashboard"]}],R.renderLayout(React.createElement(f.a,{padding:!0})),{inGrid:!0,createGrid:!0},O.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.DashboardPopularity")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(135),h=a(41),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{title:Object(_.__)("Popularity","google-site-kit"),description:Object(_.__)("Your most popular pages and how people found them from Search.","google-site-kit"),timePeriod:Object(_.__)("Last 28 days","google-site-kit")})),React.createElement(m.default,null))}}]),t}(p.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(78),h=a(17),_=a(41),b=a(63),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permissions.canManageOptions,t=googlesitekit.modules.analytics.active||e?12:6;return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(f.__)("Search Funnel","google-site-kit"),description:Object(f.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")})),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-".concat(t,"\n\t\t\t\t")},React.createElement(h.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(m.default,null),!googlesitekit.modules.analytics.active&&React.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 "},React.createElement(b.a,null)))))))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(56),k=a(23),y=a(2),v=a(33),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.selectedStats,a=e.series,n=e.vAxes,i={chart:{title:googlesitekit.pageTitle&&googlesitekit.pageTitle.length?Object(O.sprintf)(Object(O.__)("Search Traffic Summary for %s","google-site-kit"),Object(y.e)(googlesitekit.pageTitle)):Object(O.__)("Search 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,3<=t.length&&(i.vAxis.textPosition="none",i.vAxis.gridlines.color="#fff",i.vAxis.minorGridlines.color="#fff",i.vAxes={},i.chartArea.width="98%"),i}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats;if(!t||!t.length)return null;var n=this.setOptions(),i=Object(v.extractSearchConsoleDashboardData)(t);return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(f.a,{selectedStats:a,data:i.dataMap,options:n,singleStat:!1}))))}}]),t}(h.Component);t.default=Object(_.a)(R,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(y.p)("day"),context:"Single"}],React.createElement(k.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(0),f=a(33),k=a(51),y=a(23),v=a(2),O=a(32),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data,t=e.error;if(t)return Object(v.v)("plugin_setup","search_console_error",t.message),React.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 "},React.createElement(O.a,{title:Object(b.__)("Something went wrong","google-site-kit"),description:t.message,error:!0}));if(!e)return null;if(!e.length)return React.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 "},React.createElement(O.a,{title:Object(b.__)("Search Console Data Empty","google-site-kit"),description:Object(b.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""}));var a=Object(f.extractSearchConsoleDashboardData)(e),n=Object(v.n)("googlesitekit-module-search-console",{}),i=a.totalClicks,o=a.totalImpressions,c=a.totalClicksChange,s=a.totalImpressionsChange;return React.createElement(p.Fragment,null,React.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 "},React.createElement(m.a,{className:"overview-total-impressions",title:Object(b.__)("Impressions","google-site-kit"),datapoint:o,change:c,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:React.createElement(k.a,{data:Object(v.f)(a.dataMap,1),change:c,id:"search-console-impressions-sparkline"})})),React.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 "},React.createElement(m.a,{className:"overview-total-clicks",title:Object(b.__)("Clicks","google-site-kit"),datapoint:i,change:s,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:React.createElement(k.a,{data:Object(v.f)(a.dataMap,2),change:s,id:"search-console-clicks-sparkline"})})))}}]),t}(p.Component);t.default=Object(h.a)(R,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(v.p)("day"),context:["Single","Dashboard"]}],React.createElement(p.Fragment,null,React.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 "},React.createElement(y.a,{width:"100%",height:"202px"})),React.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 "},React.createElement(y.a,{width:"100%",height:"202px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(43),b=a(0),f=a(138),k=a(77),y=a(133),v=a(47),O=a(17),R=a(72),E=a(31),S=a(55),j=a(45),w=a(2),D=a(42),C=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={selectedStats:[0,1],receivingData:!0,error:!1,loading:!0},a.handleStatSelection=a.handleStatSelection.bind(g()(a)),a.buildSeries=a.buildSeries.bind(g()(a)),a.buildVAxes=a.buildVAxes.bind(g()(a)),a.handleDataError=a.handleDataError.bind(g()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(g()(a)),a}return m()(t,e),c()(t,[{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:"Clicks",1:"Impressions",2:"Average CTR",3:"Average Position"};return e.map((function(e){return{title:t[e]}}))}},{key:"render",value:function(){var e=this.state,t=e.selectedStats,a=e.receivingData,n=e.error,i=e.loading,o=this.buildSeries(),c=this.buildVAxes(),s=!i&&a?"":"googlesitekit-nodata",r=Object(w.i)(),l=Object(b.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL);return React.createElement(h.Fragment,null,React.createElement(_.a,null),React.createElement(R.a,{module:"search-console"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--search-console"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(v.a,{title:Object(b._x)("Search Console","Service name","google-site-kit"),icon:!0,iconWidth:"23",iconHeight:"21",iconID:"search-console",status:"connected",statusText:Object(b.__)("Search Console is connected","google-site-kit")}),i&&React.createElement(E.a,null)),!a&&(n?Object(j.a)(Object(b._x)("Search Console","Service name","google-site-kit"),n,!0,!0,!0):Object(S.a)(Object(b._x)("Search Console","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(O.a,{header:!0,title:Object(b.sprintf)(Object(b.__)("Overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(b.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l},React.createElement(y.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(f.default,{selectedStats:t,series:o,vAxes:c}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(O.a,{title:Object(b.sprintf)(Object(b.__)("Top search queries over the last %s","google-site-kit"),r),header:!0,footer:!0,headerCtaLabel:Object(b.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l,footerCtaLabel:Object(b._x)("Search Console","Service name","google-site-kit"),footerCtaLink:l},React.createElement(k.default,null))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(D.a,null))))))}}]),t}(h.Component);t.default=C},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(142),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement(m.default,null))}}]),t}(p.Component);t.default=h},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(91),h=a(25),_=a(19),b=a(9),f=a(2),k=a(33),y=a(32),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(k.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(p.Fragment,null,e.length?React.createElement(p.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-impressions",title:Object(v.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-clicks",title:Object(v.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(y.a,{title:Object(v.__)("Search Console Data Empty","google-site-kit"),description:Object(v.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(p.Component);t.default=Object(_.a)(O,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.p)("day"),context:["WPDashboard"]}],React.createElement(m.a,{width:"23%",height:"94px",count:2}),{},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(0),h=googlesitekit.admin.siteURL,_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-item-type"},Object(m.__)("Connected URL","google-site-kit")),React.createElement("div",{className:"googlesitekit-settings-module__meta-item-data"},h))}}]),t}(p.Component);t.default=_},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){a(73),a(98),a(100),a(101),a(102),a(75),a(104),a(103),a(105),a(106),a(191),a(107),a(108),a(74),a(99),a(192),a(109),a(44),a(110),a(111),a(112),a(113),a(66),a(114),a(115),a(116),a(117),a(118),a(76),a(119),a(120),a(121),a(122),a(193),a(96),a(15),a(123),a(124),a(197),a(92),a(125),a(93),a(126),a(127),a(128),a(64),a(198),a(129),a(130),a(131),a(132),a(77),a(133),a(134),a(135),a(136),a(78),a(137),a(138),a(139),a(140),a(33),a(207),a(143),a(142),a(141),a(200),e.exports=a(94)},,,,function(e,t,a){"use strict";a.r(t);a(1);var n=a(24),i=a(2),o=a(106),c=a(102),s=a(74),r=a(98),l=a(107),d=a(108),u=a(10),g="adsense";if(Object(u.addFilter)("googlesitekit.ModuleSettingsWarning","googlesitekit.adsenseSettingsWarning",Object(i.g)(d.default,{})),Object(u.addFilter)("googlesitekit.SetupModuleShowLink","googlesitekit.adsenseSetupModuleShowLink",(function(e,t){return!("adsense"===t&&!googlesitekit.canAdsRun)&&e})),googlesitekit.modules.adsense.active){var p=Object(n.a)(React.createElement(o.default,null)),m=Object(n.a)(React.createElement(c.default,null));if(googlesitekit.modules[g].setupComplete)Object(u.addFilter)("googlesitekit.ModuleApp-".concat(g),"googlesitekit.ModuleApp",p),Object(u.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardEarningModule",m,50);else{var h=googlesitekit.admin,_=h.reAuth,b=h.currentScreen,f=b?b.id:null;_||"site-kit_page_googlesitekit-module-adsense"!==f||(window.location=Object(i.n)("googlesitekit-module-".concat(g),{reAuth:!0,slug:g})),Object(u.addFilter)("googlesitekit.Connected-".concat(g),"googlesitekit.AdSenseModuleConnected",(function(e){var t=googlesitekit.modules[g].settings;return!(e||void 0===t||"account-pending-review"!==t.accountStatus&&"ads-display-pending"!==t.accountStatus)||e}))}Object(u.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(g),"googlesitekit.AdSenseModuleSettingsDetails",Object(i.g)(s.default,{onSettingsPage:!0})),Object(u.addFilter)("googlesitekit.ModuleSetup-".concat(g),"googlesitekit.TagmanagerModuleSetupWizard",Object(i.g)(r.default,{onSettingsPage:!1})),Object(u.addFilter)("googlesitekit.autoRefreshModules","googlesitekit.AdSenseAutoRefresh",(function(e){return e.push({identifier:"adsense",toRefresh:function(){var e="";return googlesitekit.modules.adsense&&googlesitekit.modules.adsense["account-status"]&&(e=googlesitekit.modules.adsense["account-status"].accountStatus),!(e&&-1<e.indexOf("account-connected"))}}),e})),Object(u.addFilter)("googlesitekit.ModulesNotificationsRequest","googlesitekit.adsenseNotifications",(function(e){return e.push({identifier:"adsense"}),e})),Object(u.addFilter)("googlesitekit.ModuleSetupIncomplete","googlesitekit.adsenseSettingStatus",Object(i.g)(l.default,{}))}},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(9),b=a(109),f=a(62),k=a(0),y=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,error:!1,message:"",accounts:[],accountStatus:""},a}return m()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isOpen;e.onSettingsPage&&!t||this.getAccounts()}},{key:"getAccounts",value:function(){var e,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(_.c.get(_.b,"adsense","accounts"));case 3:e=n.sent,t="",e&&e.length||(t="no-account"),a=e,this.setState({isLoading:!1,accountStatus:t,accounts:a,error:!1}),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(0),this.setState({isLoading:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[0,10]])}},{key:"renderErrorMessage",value:function(){var e=this.state,t=e.error,a=e.message;return t&&0<a.length?React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(k.__)("Error:","google-site-kit")," ",a)):null}},{key:"render",value:function(){var e=this.state,t=e.isLoading,a=e.accounts,n=e.accountStatus;return React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t?React.createElement(f.a,{isSaving:t}):React.createElement(b.default,{accountStatus:n,accounts:a}),t?null:this.renderErrorMessage()))))}}]),t}(h.Component);t.default=y},function(e,t,a){"use strict";a.r(t);a(1);var n=a(2),i=a(24),o=a(122),c=a(111),s=a(114),r=a(120),l=a(123),d=a(112),u=a(124),g=a(115),p=a(117),m=a(119),h=a(96),_=a(10),b="analytics",f=Object(i.a)(React.createElement(c.default,null));if(Object(_.addFilter)("googlesitekit.AdminbarModules","googlesitekit.Analytics",f,11),!googlesitekit.modules[b].setupComplete){var k=googlesitekit.admin,y=k.reAuth,v=k.currentScreen,O=v?v.id:null;y||"site-kit_page_googlesitekit-module-analytics"!==O||(window.location=Object(n.n)("googlesitekit-module-".concat(b),{reAuth:!0,slug:b}))}if(googlesitekit.modules.analytics.active){var R=Object(i.a)(React.createElement(o.default,null)),E=Object(i.a)(React.createElement(s.default,null)),S=Object(i.a)(React.createElement(l.default,null)),j=Object(i.a)(React.createElement(u.default,null)),w=Object(i.a)(React.createElement(r.default,null)),D=Object(i.a)(React.createElement(d.default,null)),C=Object(i.a)(React.createElement(g.default,null)),x=Object(i.a)(React.createElement(p.default,null)),N=Object(i.a)(React.createElement(m.default,null));Object(_.addFilter)("googlesitekit.DashboardModule","googlesitekit.Analytics",E,9),Object(_.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.Analytics",w,11),Object(_.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.Analytics",x,20),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall","googlesitekit.Analytics",N,20),Object(_.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.Analytics",D,20),Object(_.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.Analytics",S),Object(_.addFilter)("googlesitekit.WPDashboardModule","googlesitekit.Analytics",j),Object(_.addFilter)("googlesitekit.ModuleApp-"+b,"googlesitekit.Analytics",R),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTable","googlesitekit.Analytics",C,11),Object(_.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(b),"googlesitekit.AnalyticsModuleSettingsDetails",Object(n.g)(h.default,{onSettingsPage:!0})),Object(_.addFilter)("googlesitekit.showDateRangeSelector-".concat(b),"googlesitekit.analyticsShowDateRangeSelector",(function(){return!0})),Object(_.addFilter)("googlesitekit.ModuleSetup-".concat(b),"googlesitekit.AnalyticsModuleSetupWizard",Object(n.g)(h.default,{onSettingsPage:!1}))}},,,,function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(92),o=a(10),c=a(0),s="optimize";googlesitekit.modules.optimize.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(s),"googlesitekit.OptimizeModuleSettingsDetails",Object(n.g)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat(s),"googlesitekit.OptimizeModuleSetupWizard",Object(n.g)(i.default,{onSettingsPage:!1})),Object(o.addFilter)("googlesitekit.SetupWinNotification-".concat(s),"googlesitekit.OptimizeSetupWinNotification",(function(e){return e.description=Object(c.__)("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})))},function(e,t,a){"use strict";a.r(t);a(1);var n=a(24),i=a(128),o=a(126),c=a(125),s=a(10),r=googlesitekit.modules["pagespeed-insights"],l=r.active,d=r.setupComplete;if(l&&d){var u=Object(n.a)(React.createElement(i.default,null)),g=Object(n.a)(React.createElement(o.default,null));Object(s.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",u,45),Object(s.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.PageSpeedInsights",u,45),Object(s.addFilter)("googlesitekit.DashboardSpeed","googlesitekit.PageSpeedInsightsHomepageSpeed",g)}else{var p=Object(n.a)(React.createElement(c.default,null));Object(s.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",p,45)}},,function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(94),o=a(10);googlesitekit.modules.tagmanager.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSettingsDetails",Object(n.g)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSetupWizard",Object(n.g)(i.default,{onSettingsPage:!1})))},,,,,,,function(e,t,a){"use strict";a.r(t);var n=a(1),i=a(140),o=a(130),c=a(141),s=a(137),r=a(139),l=a(131),d=a(134),u=a(132),g=a(136),p=a(12),m=a.n(p),h=a(3),_=a.n(h),b=a(4),f=a.n(b),k=a(5),y=a.n(k),v=a(6),O=a.n(v),R=a(13),E=a.n(R),S=a(7),j=a.n(S),w=a(11),D=a(170),C=a.n(D),x=a(9),N=a(29),A=a(17),P=a(2),L=a(0),M=function(e){function t(e){var a;return _()(this,t),(a=y()(this,O()(t).call(this,e))).state={isSearching:!1,results:[],error:!1,message:""},a.postSearch=a.postSearch.bind(E()(a)),a.onClick=a.onClick.bind(E()(a)),a.onConfirm=a.onConfirm.bind(E()(a)),a}return j()(t,e),f()(t,[{key:"postSearch",value:function(e,t){var a;return m.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t([Object(L.__)("Loading...","google-site-kit")]),n.prev=1,n.next=4,m.a.awrap(x.c.get(x.a,"search","post-search",{query:encodeURIComponent(e)}));case 4:0<(a=n.sent).length?t(Object(w.map)(a,(function(e){return e.post_title}))):t([Object(L.__)("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(L.__)("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(w.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(w.find)(t,(function(e){return e.post_title===a}));document.location=Object(P.n)("googlesitekit-dashboard",{id:n.id,permaLink:n.permalink,pageTitle:a})}},{key:"render",value:function(){var e=googlesitekit.modules,t=e.analytics&&e.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 React.createElement("div",{className:t},React.createElement(A.a,{title:Object(L.__)("Search for individual page or post information","google-site-kit"),header:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement("div",{className:"googlesitekit-post-searcher"},React.createElement("label",{className:"googlesitekit-post-searcher__label",htmlFor:"autocomplete"},Object(L.__)("Title or URL","google-site-kit")),React.createElement(C.a,{id:"autocomplete",source:Object(w.debounce)(this.postSearch,200),minLength:2,onConfirm:this.onConfirm,showNoOptionsFound:!1}),React.createElement("div",{className:"googlesitekit-post-searcher__button-wrapper"},React.createElement(N.a,{onClick:this.onClick,className:"googlesitekit-post-searcher__button"},Object(L.__)("View Data","google-site-kit")))))))))}}]),t}(n.Component),I=a(143),T=a(24),F=a(10),U="search-console",z=Object(T.a)(React.createElement(i.default,null)),q=Object(T.a)(React.createElement(o.default,null)),W=Object(T.a)(React.createElement(c.default,null)),G=Object(T.a)(React.createElement(s.default,null)),H=Object(T.a)(React.createElement(r.default,null)),B=Object(T.a)(React.createElement(u.default,null)),K=Object(T.a)(React.createElement(l.default,null)),Y=Object(T.a)(React.createElement(d.default,null)),V=Object(T.a)(React.createElement(g.default,null)),Z=Object(T.a)(React.createElement(M,null));Object(F.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(U),"googlesitekit.SearchConsoleModuleSettingsDetails",Object(P.g)(I.default,{onSettingsPage:!0})),Object(F.addFilter)("googlesitekit.DashboardModule","googlesitekit.SearchConsole",G,11),Object(F.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardPopularityModule",V,40),Object(F.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.SearchConsoleSearchFunnel",H),Object(F.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",B),Object(F.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",K,40),Object(F.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.SearchConsoleDashboardPopularity",Y),Object(F.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.DashboardPPostSearcherModule",Z,30),Object(F.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.SearchConsole",W,11),Object(F.addFilter)("googlesitekit.ModuleApp-"+U,"googlesitekit.ModuleApp",z),Object(F.addFilter)("googlesitekit.showDateRangeSelector-".concat(U),"googlesitekit.searchConsoleShowDateRangeSelector",(function(){return!0})),Object(F.addFilter)("googlesitekit.AdminbarModules","googlesitekit.SearchConsole",q)}]);
1
+ !function(e){function t(t){for(var n,c,s=t[0],r=t[1],d=t[2],u=0,g=[];u<s.length;u++)c=s[u],i[c]&&g.push(i[c][0]),i[c]=0;for(n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n]);for(l&&l(t);g.length;)g.shift()();return o.push.apply(o,d||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],n=!0,c=1;c<a.length;c++){var s=a[c];0!==i[s]&&(n=!1)}n&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=a[0]))}return e}var n={},i={3:0},o=[];function __webpack_require__(t){if(n[t])return n[t].exports;var a=n[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.m=e,__webpack_require__.c=n,__webpack_require__.d=function(e,t,a){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},__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 a=Object.create(null);if(__webpack_require__.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)__webpack_require__.d(a,n,function(t){return e[t]}.bind(null,n));return a},__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 c=window.webpackJsonp=window.webpackJsonp||[],s=c.push.bind(c);c.push=t,c=c.slice();for(var r=0;r<c.length;r++)t(c[r]);var l=s;o.push([187,0,1]),a()}([function(e,t){e.exports=wp.i18n},function(e,t){e.exports=wp.element},,,,,,,,,function(e,t){e.exports=wp.hooks},function(e,t){e.exports=lodash},,,,,,,function(e,t){e.exports=React},function(e,t,a){"use strict";var n=a(68),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(11),b=a(55),f=a(45),k=a(90),y=a(10),v=a(0);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{inGrid:!1,fullWidth:!1,createGrid:!1},o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){return!1},s=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(v.__)("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(v.__)("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(l){function u(e){var a;c()(this,u),(a=d()(this,g()(u).call(this,e))).state={data:!1,zeroData:!1,error:!1},Object(y.addAction)("googlesitekit.moduleDataReset","googlesitekit.moduleDataResetHandler",(function(){a.setState({data:!1})}));var n=function(e,t){var n=a.props,i=n.handleDataError,c=n.handleDataSuccess,r=t.datapoint,l=t.identifier,d=t.toState,u=s(e);u?(a.setState({error:u,module:l}),i&&i(u)):o(e,r,t)?(i&&i(u),a.setState({zeroData:!0})):c&&c(),a.setState({requestDataToState:d,data:e,datapoint:r,module:l})};return Object(_.each)(t,(function(e){Array.isArray(e.context)?Object(_.each)(e.context,(function(t){Object(y.addFilter)("googlesitekit.module".concat(t,"DataRequest"),"googlesitekit.data".concat(t),(function(t){return e.callback=function(t){n(t,e)},t.push(e),t}))})):Object(y.addFilter)("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}))})),a}return m()(u,l),r()(u,[{key:"render",value:function(){var t=this.state,o=t.data,c=t.datapoint,s=t.module,r=t.zeroData,l=t.error,d=t.requestDataToState;if(!o)return a;var u=s?googlesitekit.modules[s].name:Object(v.__)("Site Kit","google-site-kit");return s&&googlesitekit.modules[s].active&&!googlesitekit.modules[s].setupComplete?Object(k.a)(s,n.inGrid,n.fullWidth,n.createGrid):l?"string"!=typeof l?l:Object(f.a)(u,l,n.inGrid,n.fullWidth,n.createGrid):r?Object(b.a)(u,n.inGrid,n.fullWidth,n.createGrid):React.createElement(e,i()({data:o,datapoint:c,requestDataToState:d},this.props))}}]),u}(h.Component)}},,,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(8),h=a.n(m),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.padding;return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block\n\t\t\t\t\t".concat(i?"googlesitekit-preview-block--padding":"","\n\t\t\t\t"),style:{width:t,height:a}},React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-preview-block__wrapper\n\t\t\t\t\t".concat("circular"===n?"googlesitekit-preview-block__wrapper--circle":"","\n\t\t\t\t")}))}}]),t}(p.Component);_.propTypes={width:h.a.string,height:h.a.string,shape:h.a.string,padding:h.a.bool},_.defaultProps={width:"100px",height:"100px",shape:"square",padding:!1},t.a=_},,,,,function(e,t,a){"use strict";a.d(t,"b",(function(){return v})),a.d(t,"a",(function(){return O}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(8),b=a.n(_),f=a(60),k=a(14),y=a(11),v=function(e,t,a){var n=[],i=a.links,o=a.source,c=a.showURLs;return a.cap&&(e=e.slice(0,a.cap)),Object(y.each)(e,(function(e,t){var a=[],o=i&&i[t];Object(y.each)(e,(function(t,n){"string"==typeof t&&(t=t.replace(/\(none\)/gi,"direct")),a.push(React.createElement("td",{key:"cell-"+n,className:"googlesitekit-table__body-item"},e[0]===t&&o?React.createElement("div",{className:"googlesitekit-table__body-item-content"},React.createElement(k.a,{className:"googlesitekit-table__body-item-link",href:o,external:!0,inherit:!0},t),c&&""!==Object(y.trim)(o,"/")&&React.createElement(k.a,{className:"googlesitekit-table__body-item-url",href:o,inherit:!0,external:!0},Object(y.trim)(o,"/"))):React.createElement("div",{className:"googlesitekit-table__body-item-content"},t)))})),n.push(React.createElement("tr",{key:"tr-"+t,className:"googlesitekit-table__body-row"},a))})),React.createElement("div",{className:"googlesitekit-table".concat(a&&a.disableListMode?"":" googlesitekit-table--with-list")},React.createElement("table",{className:"\n\t\t\t\t\tgooglesitekit-table__wrapper\n\t\t\t\t\tgooglesitekit-table__wrapper--".concat(e&&e[0]?e[0].length:1,"-col\n\t\t\t\t")},React.createElement("thead",{className:"googlesitekit-table__head"},React.createElement("tr",{key:"gksc_data_row_header-wrap",style:a&&a.hideHeader?{display:"none"}:{},className:"googlesitekit-table__head-row"},t.map((function(e,t){return React.createElement("th",{key:"gksc_data_row_header-".concat(t),className:"\n\t\t\t\t\t\t\t\t\tgooglesitekit-table__head-item\n\t\t\t\t\t\t\t\t\t".concat(e.primary?"googlesitekit-table__head-item--primary":"","\n\t\t\t\t\t\t\t\t"),"data-tooltip":e.tooltip},e.title)})))),React.createElement("tbody",{className:"googlesitekit-table__body"},n)),o&&React.createElement(f.a,{className:"googlesitekit-table__source",name:o.name,href:o.link}))},O=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).call(this))).state={isScrolling:!1},e.scrollRef=Object(h.createRef)(),e.updateFadeOnScroll=e.updateFadeOnScroll.bind(g()(e)),e}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;e.updateFadeOnScroll(),this.resize=Object(y.debounce)((function(){e.updateFadeOnScroll()}),100),window.addEventListener("resize",this.resize)}},{key:"componentWillUnmount",value:function(){window.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 e=this.props.children,t=this.state.isScrolling;return React.createElement("div",{onScroll:Object(y.debounce)(this.updateFadeOnScroll,100),className:"\n\t\t\t\t\tgooglesitekit-table-overflow\n\t\t\t\t\t".concat(t?"googlesitekit-table-overflow--gradient":"","\n\t\t\t\t")},React.createElement("div",{ref:this.scrollRef,className:"googlesitekit-table-overflow__container"},e))}}]),t}(h.Component);O.propTypes={children:b.a.element}},,,,,,,function(e,t){e.exports=wp.apiFetch},function(e,t){e.exports=wp.url},,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(23),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.rows,a=e.rowHeight,n=e.padding,i=[],o=0;t>o;o++)i.push(React.createElement("div",{className:"googlesitekit-preview-table__row",key:"table-row-"+o},React.createElement(m.a,{width:"100%",height:a+"px"})));return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-preview-table\n\t\t\t\t".concat(n?"googlesitekit-preview-table--padding":"","\n\t\t\t")},i)}}]),t}(p.Component);b.propTypes={rows:_.a.number,rowHeight:_.a.number,padding:_.a.bool},b.defaultProps={rows:11,rowHeight:35,padding:!1},t.a=b},,,function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(8),h=a.n(m),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.description;return React.createElement("header",{className:"googlesitekit-dashboard-module-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.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 "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-module-header__title "},t),a&&React.createElement("p",{className:"googlesitekit-dashboard-module-header__description"},a))))}}]),t}(p.Component);_.propTypes={title:h.a.string,description:h.a.string},_.defaultProps={title:"",description:""},t.a=_},function(e,t,a){"use strict";a.r(t),a.d(t,"reduceAdSenseData",(function(){return u})),a.d(t,"propsFromAccountStatus",(function(){return g})),a.d(t,"getAdSenseAccountStatus",(function(){return p})),a.d(t,"isAdsenseConnectedAnalytics",(function(){return m})),a.d(t,"isDataZeroAdSense",(function(){return h}));var n=a(12),i=a.n(n),o=a(168),c=a(9),s=a(2),r=a(11),l=a(0),d=a(15);function u(e){var t=[[{type:"date",label:"Day"},{type:"number",label:"RPM"},{type:"number",label:"Earnings"},{type:"number",label:"Impressions"}]];return Object(r.each)(e,(function(e){var a=new Date(e[0]);t.push([a,e[2],e[1],e[3]])})),{dataMap:t}}var g=function(e,t){var a,n,i,c,r,d,u,g,p,m,h,_,b,f=!1,k=!1,y=!1,v=!1,O=!1,R=!1,E=googlesitekit.modules.adsense,S=E.accountURL,j=E.signupURL,w=Object(s.n)("googlesitekit-module-adsense",{}),D=new URL(googlesitekit.admin.siteURL);switch(e){case"account-connected":t?(g=!1,u="alert",p=Object(l.__)("Site Kit will place AdSense code to your site","google-site-kit"),m=Object(l.__)("This means Google will automatically place ads for you in all the best places.","google-site-kit"),n=Object(l.__)("Continue","google-site-kit"),a=w,f=!0,h=Object(l.__)("Let Site Kit place code on your site","google-site-kit"),_=Object(l.__)("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"),b=Object(l.__)("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")):(g=!1,u=!1,p=Object(l.__)("Looks like you’re already using AdSense","google-site-kit"),m=Object(l.__)("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"),n=Object(l.__)("Continue","google-site-kit"),a=w,R={eventCategory:"adsense_setup",eventName:"complete_adsense_setup"},h=Object(l.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),_=Object(l.__)("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":g=!1,u=!1,p=Object(l.__)("Your site has code from another AdSense account","google-site-kit"),m=Object(l.__)("We’ve found some AdSense code on your site, but it’s not linked to this AdSense account.","google-site-kit"),v=!1,n=Object(l.__)("Switch Google account","google-site-kit"),a=Object(s.m)("adsense",!0),k={accountStatus:"account-connected",continueText:Object(l.__)("Continue anyway","google-site-kit"),statusHeadline:Object(l.__)("Site Kit will place AdSense code on your site","google-site-kit"),statusMessage:Object(l.__)("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(l.__)("Continue","google-site-kit"),continueAction:!1,switchLabel:Object(l.__)("Let Site Kit place code on your site","google-site-kit"),switchOffMessage:Object(l.__)("You can let Site Kit do this later.","google-site-kit")};break;case"ads-display-pending":var C=Object(o.parse)(D.hostname).domain;p=Object(l.__)("Let’s get your site ready for ads","google-site-kit"),m=Object(l.__)("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"),n=Object(l.__)("Go to your AdSense account to check on your site’s status or to complete setting up","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(C||D.hostname,"&source=site-kit");break;case"account-pending-review":p=Object(l.__)("We’re getting your site ready for ads","google-site-kit"),m=Object(l.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),n=Object(l.__)("Go to your AdSense account to check on your site’s status","google-site-kit"),a="https://www.google.com/adsense/new/sites?url=".concat(D.hostname,"&source=site-kit"),y=!0;break;case"account-required-action":O=!0;break;case"disapproved-account":a=S,n=Object(l.__)("Go to AdSense to find out how to fix the issue","google-site-kit"),p=Object(l.__)("Your site isn’t ready to show ads yet","google-site-kit"),m=Object(l.__)("You need to fix some things before we can connect Site Kit to your AdSense account.","google-site-kit");break;case"disapproved-account-afc":g=Object(l.__)("There is an AdSense account, but the AFC account is disapproved","google-site-kit"),u="error",p=Object(l.__)("Create Account","google-site-kit"),m=Object(l.__)("Create an AdMob account, then open AdSense and try to upgrade.","google-site-kit"),n=Object(l.__)("Create an AdMob Account","google-site-kit"),a="https://google.com/admob";break;case"no-account":p=Object(l.__)("Create your AdSense account","google-site-kit"),m=Object(l.__)("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"),v=!0,n=Object(l.__)("Create AdSense Account","google-site-kit"),a=j,d=Object(l.__)("Already have an AdSense account?","google-site-kit"),i=Object(l.__)("to connect to it","google-site-kit"),c=Object(l.__)("Switch Google account","google-site-kit"),r=Object(s.m)("adsense",!0),R={eventCategory:"adsense_setup",eventName:"create_adsense_account"};break;case"no-account-tag-found":p=Object(l.__)("Looks like you’re already using AdSense","google-site-kit"),m=Object(l.__)("We’ve found some AdSense code on your site, but it’s not linked to this Google account.","google-site-kit"),v=!1,n=Object(l.__)("Switch Google account","google-site-kit"),a=Object(s.m)("adsense",!0),h=Object(l.__)("Let Site Kit place code on your site to get your site approved","google-site-kit"),k={statusHeadline:Object(l.__)("Create a new AdSense account","google-site-kit"),statusMessage:Object(l.__)("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(l.__)("We recommend you remove the old AdSense code from this site.","google-site-kit"),icon:"warning",continueText:Object(l.__)("Continue anyway","google-site-kit"),ctaLinkText:Object(l.__)("Create AdSense Account","google-site-kit"),ctaLink:j,ctaTarget:"_blank",continueAction:!1};break;case"account-connected-no-data":p=Object(l.__)("We’re getting your site ready for ads","google-site-kit"),m=Object(l.__)("AdSense is reviewing your site. Meanwhile, make sure you’ve completed these steps in AdSense.","google-site-kit"),y=!0}return{accountTagMatch:f,continueAction:k,ctaLink:a,ctaLinkText:n,footerAppendedText:i,footerCTA:c,footerCTALink:r,footerText:d,icon:u,incomplete:y,issue:g,profile:v,required:O,setupComplete:!1,statusHeadline:p,statusMessage:m,switchLabel:h,switchOffMessage:_,switchOnMessage:b,tracking:R}},p=function(){var e,t,a,n,o,d,u,g,p,m,h,_,b,f,k,y,v,O,R,E,S,j,w,D,C,x,N,A,P,L=arguments;return i.a.async((function(M){for(;;)switch(M.prev=M.next){case 0:return e=L.length>0&&void 0!==L[0]&&L[0],t=L.length>1&&void 0!==L[1]?L[1]:function(){},n=!1,M.prev=3,t(Object(l.__)("Locating accounts…","google-site-kit")),M.next=7,i.a.awrap(c.c.get(c.b,"adsense","accounts").then((function(e){return e})).catch((function(e){return e})));case 7:if(o=M.sent,!(1<(d=!o.data||o.data.status&&200!==o.data.status?o:o.data).length)){M.next=42;break}t(Object(l.__)("Searching for domain…","google-site-kit")),u=!0,g=!1,p=void 0,M.prev=14,m=d[Symbol.iterator]();case 16:if(u=(h=m.next()).done){M.next=28;break}return _=h.value,b=_.id,M.next=21,i.a.awrap(c.c.get(c.b,"adsense","urlchannels",{clientID:b}).then((function(e){return e})).catch((function(e){return e})));case 21:f=M.sent,k=new URL(googlesitekit.admin.siteURL),(y=f&&f.length?Object(r.filter)(f,{urlPattern:k.hostname}):[])&&0!==y.length?(O=y[0].id,Object(s.v)("adsense_setup","adsense_account_detected")):(a="account-pending-review",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"));case 25:u=!0,M.next=16;break;case 28:M.next=34;break;case 30:M.prev=30,M.t0=M.catch(14),g=!0,p=M.t0;case 34:M.prev=34,M.prev=35,u||null==m.return||m.return();case 37:if(M.prev=37,!g){M.next=40;break}throw p;case 40:return M.finish(37);case 41:return M.finish(34);case 42:if(v=d&&d.message&&d.message.error,O=!!(d&&d.length&&d[0])&&d[0].id,d&&O&&!v){M.next=50;break}R=(v||{}).errors,"noAdSenseAccount"!==(E=R[0].reason)&&d&&O||(a="disapprovedAccount"===E?"disapproved-account":e?"no-account-tag-found":"no-account"),M.next=118;break;case 50:return googlesitekit.modules.adsense.accountURL=Object(l.sprintf)("https://www.google.com/adsense/new/%s/home",O),t(Object(l.__)("Account found, checking account status…","google-site-kit")),M.next=54,i.a.awrap(c.c.get(c.b,"adsense","alerts",{accountID:O}).then((function(e){return e})).catch((function(e){return e})));case 54:if(S=M.sent,j=!S.data||S.data.status&&200!==S.data.status?S:S.data,w=j&&j.message&&j.message.error,!Object(r.find)(S,{type:"GRAYLISTED_PUBLISHER"})){M.next=62;break}a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=118;break;case 62:return M.next=64,i.a.awrap(c.c.get(c.b,"adsense","clients").then((function(e){return e})).catch((function(e){return e})));case 64:if(D=M.sent,C=!D.data||D.data.status&&200!==D.data.status?D:D.data,x=C&&C.message&&C.message.error,!(N=!(!C||!C.length)&&Object(r.find)(C,{productCode:"AFC"}))){M.next=72;break}return n=N.id,M.next=72,i.a.awrap(c.c.set(c.b,"adsense","client-id",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 72:if(!w){M.next=77;break}"accountPendingReview"===j.message.error.errors[0].reason&&(a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending")),M.next=118;break;case 77:if(t(Object(l.__)("Looking for AdSense client…","google-site-kit")),!x){M.next=83;break}a="account-required-action",Object(s.v)("adsense_setup","adsense_required_action","accountRequiredAction status"),M.next=118;break;case 83:if(!N){M.next=117;break}return n=N.id,t(Object(l.__)("Looking for site domain…","google-site-kit")),M.next=88,i.a.awrap(c.c.get(c.b,"adsense","urlchannels",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 88:if(A=M.sent,P=A&&A.length&&Object(r.filter)(A,(function(e){return 0<googlesitekit.admin.siteURL.indexOf(e.urlPattern)})),0!==A.length){M.next=95;break}a="ads-display-pending",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status ads-display-pending"),M.next=115;break;case 95:if(P&&0!==P.length){M.next=100;break}a="account-pending-review",Object(s.v)("adsense_setup","adsense_account_pending","accountPendingReview status account-pending-review"),M.next=115;break;case 100:if(!e||n!==e){M.next=105;break}a="account-connected",Object(s.v)("adsense_setup","adsense_account_connected","existing_matching_tag"),M.next=115;break;case 105:if(!e||n===e){M.next=110;break}a="account-connected-nonmatching",Object(s.v)("adsense_setup","adsense_account_connected","existing_non_matching_tag"),M.next=115;break;case 110:return a="account-connected",t(Object(l.__)("Connecting…","google-site-kit")),Object(s.v)("adsense_setup","adsense_account_connected"),M.next=115,i.a.awrap(c.c.set(c.b,"adsense","setup-complete",{clientID:n}).then((function(e){return e})).catch((function(e){return e})));case 115:M.next=118;break;case 117:a="disapproved-account-afc";case 118:return M.next=120,i.a.awrap(c.c.set(c.b,"adsense","account-status",{accountStatus:a}).then((function(e){return e})).catch((function(e){return e})));case 120:return M.abrupt("return",{accountStatus:a,clientID:n});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]])},m=function(){var e,t,a;return i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:if(e=googlesitekit.modules.adsense.active,t=googlesitekit.modules.analytics.active,a=!0,!e||!t){n.next=6;break}return n.next=6,i.a.awrap(c.c.get(c.b,"analytics","report",d.analyticsAdsenseReportDataDefaults).then((function(e){e&&(a=!0)})).catch((function(e){400===e.code&&"INVALID_ARGUMENT"===e.message&&(a=!1)})));case 6:return n.abrupt("return",new Promise((function(e){e(a)})));case 7:case"end":return n.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}},,,function(e,t,a){"use strict";var n=a(1),i=a(32),o=a(71),c=a(2),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),p=a(6),m=a.n(p),h=a(7),_=a.n(h),b=a(26),f=a(0),k=function(e){function t(){return r()(this,t),g()(this,m()(t).apply(this,arguments))}return _()(t,e),d()(t,[{key:"render",value:function(){return React.createElement(b.a,{id:"notification-id",title:Object(f.__)("Security Token Error","google-site-kit"),description:Object(f.__)("We’re unable to retrieve your data because your security token is expired or revoked. Please ","google-site-kit"),learnMoreURL:googlesitekit.admin.connectURL,learnMoreLabel:Object(f.__)("reauthenticate your account","google-site-kit"),format:"small",type:"win-error"})}}]),t}(n.Component);t.a=function(e,t){var a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=arguments.length>4&&void 0!==arguments[4]&&arguments[4],r=React.createElement(i.a,{title:Object(f.sprintf)(Object(f.__)("Data error in %s","google-site-kit"),e),description:t,error:!0});return"Invalid Credentials"===t&&Object(c.w)(k),Object(o.a)(r,a,n,s)}},,,,,function(e,t){e.exports=ReactDOM},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(56),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.change,n=e.id,i=e.loadSmall,o=e.loadCompressed,c=e.loadHeight,s=e.loadText;if(!t)return"loading...";var r={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<=+a?"green":"red"]};return React.createElement("div",{className:"googlesitekit-analytics-sparkline-chart-wrap"},React.createElement(m.a,{data:t,options:r,id:n,loadSmall:i,loadCompressed:o,loadHeight:c,loadText:s}))}}]),t}(p.Component);b.propTypes={loadSmall:_.a.bool,loadCompressed:_.a.bool,loadHeight:_.a.number,loadText:_.a.bool},b.defaultProps={loadSmall:!0,loadCompressed:!0,loadHeight:46,loadText:!1},t.a=b},,,,function(e,t,a){"use strict";a(1);var n=a(32),i=a(71),o=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],c=arguments.length>3&&void 0!==arguments[3]&&arguments[3],s=React.createElement(n.a
2
  /* translators: %s: Module name */,{title:Object(o.sprintf)(Object(o.__)("%s Gathering Data","google-site-kit"),e)
3
+ /* translators: %s: Module name */,description:Object(o.sprintf)(Object(o.__)("%s data is not yet available, please check back later.","google-site-kit"),e)});return Object(i.a)(s,t,a,c)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(31),b=a(8),f=a.n(b),k=a(0),y=a(10),v=a(11),O=function(e){function t(e){var a;if(i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,chart:null},a.waitForChart=a.waitForChart.bind(g()(a)),a.getData=a.getData.bind(g()(a)),a.prepareChart=a.prepareChart.bind(g()(a)),a.drawChart=a.drawChart.bind(g()(a)),a.updateChart=a.updateChart.bind(g()(a)),a.chartRef=Object(h.createRef)(),window.google||window.googleChartLoaded)window.google&&window.google.charts?window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()})):Object(y.addAction)("googlesitekit.ChartLoaderLoaded","googlesitekit.HandleChartLoaderLoaded",(function(){window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart()}))}));else{window.googleChartLoaded=!0;var n=document.createElement("script");n.type="text/javascript",n.onload=function(){n.onload=null,window.google.charts.load("visualization","1",{packages:["corechart"]}),window.google.charts.setOnLoadCallback((function(){a.getData(),a.prepareChart(),a.drawChart(),a.setState({loading:!1})})),Object(y.doAction)("googlesitekit.ChartLoaderLoaded")},document.getElementsByTagName("head")[0].appendChild(n),n.src="https://www.gstatic.com/charts/loader.js"}return a}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this.resize=Object(v.debounce)((function(){e.drawChart()}),100),window.addEventListener("resize",this.resize)}},{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(){window.removeEventListener("resize",this.resize)}},{key:"waitForChart",value:function(e){setTimeout((function(){e()}),500)}},{key:"getData",value:function(){return window.google&&window.google.visualization&&window.google.visualization.arrayToDataTable(this.props.data)}},{key:"prepareChart",value:function(){if(window.google){var e=this.chartRef.current,t="pie"===this.props.chartType?new window.google.visualization.PieChart(e):new window.google.visualization.LineChart(e);this.setState({chart:t})}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 e=this.state.chart,t=this.props,a=t.selectedStats,n=t.options,i=t.singleStat,o=this.getData();if(null!==o&&null!==e){var c=new window.google.visualization.DataView(o);if(!i){var s=[0];s=s.concat(a.map((function(e){return e+1}))),c.setColumns(s)}e.draw(c,n)}else this.waitForChart(this.drawChart)}},{key:"render",value:function(){var e=this.state.loading,t=this.props,a=t.className,n=t.loadSmall,i=t.loadCompressed,o=t.loadHeight,c=t.loadText;return React.createElement("div",{className:"googlesitekit-graph-wrapper"},React.createElement("div",{ref:this.chartRef,className:"googlesitekit-line-chart"},React.createElement("div",{className:"googlesitekit-chart-loading"},e&&React.createElement("div",{className:"googlesitekit-chart-loading__wrapper"},c&&React.createElement("p",null,Object(k.__)("Loading chart...","google-site-kit")),React.createElement(_.a,{className:a,small:n,compress:i,height:o})))))}}]),t}(h.Component);O.propTypes={selectedStats:f.a.array,options:f.a.object.isRequired,id:f.a.string,singleStat:f.a.bool,className:f.a.string,loadSmall:f.a.bool,loadCompressed:f.a.bool,loadHeight:f.a.number,loadText:f.a.bool},O.defaultProps={selectedStats:[],id:"",singleStat:!0,className:"",loadSmall:!1,loadCompressed:!1,loadHeight:null,loadText:!0},t.a=O},,,function(e,t){e.exports=wp.compose},,,,,function(e,t,a){"use strict";a.r(t),a.d(t,"getScoreCategoryLabel",(function(){return o})),a.d(t,"PageSpeedReportScoreCategoryWrapper",(function(){return c})),a.d(t,"PageSpeedReportScoreGauge",(function(){return s})),a.d(t,"PageSpeedReportScale",(function(){return r}));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")},c=function(e){var t=e.score,a=e.children,n="googlesitekit-pagespeed-report__score-category-wrapper googlesitekit-pagespeed-report__score-category-wrapper--".concat(i(t)),o="googlesitekit-pagespeed-report__score-icon googlesitekit-pagespeed-report__score-icon--".concat(i(t));return React.createElement("span",{className:n},a," ",React.createElement("span",{className:o}))},s=function(e){var t=e.score,a=parseInt(100*t,10),o="\n\t\tgooglesitekit-percentage-circle\n\t\tgooglesitekit-percentage-circle--".concat(i(t),"\n\t\tgooglesitekit-percentage-circle--percent-").concat(a,"\n\t");return React.createElement("div",{className:"googlesitekit-pagespeed-report__score-gauge"},React.createElement("div",{className:o},React.createElement("div",{className:"googlesitekit-percentage-circle__text"},a),React.createElement("div",{className:"googlesitekit-percentage-circle__slice"},React.createElement("div",{className:"googlesitekit-percentage-circle__bar"}),React.createElement("div",{className:"googlesitekit-percentage-circle__fill"}))),React.createElement("span",{className:"googlesitekit-pagespeed-report__score-gauge-label screen-reader-only"},Object(n.__)("Performance","google-site-kit")))},r=function(){return React.createElement("div",{className:"googlesitekit-pagespeed-report__scale"},React.createElement("span",null,Object(n.__)("Scale:","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--fast"},Object(n.__)("90-100 (fast)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--average"},Object(n.__)("50-89 (average)","google-site-kit")),React.createElement("span",{className:"googlesitekit-pagespeed-report__scale-range googlesitekit-pagespeed-report__scale-range--slow"},Object(n.__)("0-49 (slow)","google-site-kit")))}},,function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(56),b=a(2),f=a(19),k=a(9),y=a(0),v=a(8),O=a.n(v),R=a(14),E=a(23),S=a(15);function j(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(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.source;if(!t||t.error||!t.length)return null;var n=Object(S.extractAnalyticsDataForTrafficChart)(t);return React.createElement("div",{className:"googlesitekit-chart googlesitekit-chart--pie"},React.createElement(_.a,{data:n,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}),a&&React.createElement("div",{className:"googlesitekit-chart__source"},[Object(y.__)("Source:","google-site-kit")," ",React.createElement(R.a,{key:"link",href:Object(b.n)("googlesitekit-module-analytics"),inherit:!0},Object(y._x)("Analytics","Service name","google-site-kit"))]))}}]),t}(h.Component);w.defaultProps={source:!1},w.propTypes={source:O.a.bool},t.default=Object(f.a)(w,[{type:k.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?j(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},S.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(b.p)("day"),context:["Dashboard","Single"]}],React.createElement(E.a,{width:"282px",height:"282px",shape:"circular"}),{},S.isDataZeroForReporting,S.getAnalyticsErrorMessageFromData)},,,,,function(e,t,a){"use strict";var n=a(1),i=a(17);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];return React.createElement(n.Fragment,null,t&&a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&!a&&o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(i.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))))),t&&a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},e),t&&!a&&!o&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},e),!t&&!a&&o&&React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},e))),!t&&!a&&!o&&e)}},function(e,t,a){"use strict";var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(9),b=a(26),f=a(8),k=a.n(f),y=a(0),v=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,alerts:[],error:!1,message:""},a}return m()(t,e),r()(t,[{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(_.c.getNotifications(e,3600));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 e=this.state,t=e.alerts,a=e.error,n=e.isLoading;if(a||n||!t||!t.length)return null;var i=t.map((function(e){return React.createElement(b.a,{id:e.id,key:e.id,title:e.title,description:e.message||e.description,dismiss:Object(y.__)("Dismiss","google-site-kit"),isDismissable:e.isDismissible,format:"small",ctaLink:e.ctaURL,ctaLabel:e.ctaLabel,ctaTarget:e.ctaTarget,type:e.severity})}));return React.createElement(h.Fragment,null,i)}}]),t}(h.Component);v.propTypes={module:k.a.string.isRequired},t.a=v},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(14),h=a(88),_=a(31),b=a(0),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLink,a=e.ctaLinkText,n=e.header,i=e.incomplete,o=e.loadingMessage,c=e.subHeader,s=e.required,r=new URL(googlesitekit.admin.siteURL),l="https://www.google.com/adsense/new/sites?url=".concat(r.hostname,"&source=site-kit"),d=[{id:1,
4
  /* translators: %s: Site URL */
5
+ text:Object(b.sprintf)(Object(b.__)("Added your site %s in ","google-site-kit"),r.hostname),linkText:Object(b.__)("Sites","google-site-kit"),linkURL:l},{id:2,text:Object(b.__)("Enabled ads in","google-site-kit"),linkText:Object(b.__)("Ads","google-site-kit"),linkURL:"https://www.google.com/adsense/new/myads/auto-ads"}];return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},s&&React.createElement(h.a,null),o&&React.createElement(p.Fragment,null,o,React.createElement(_.a,null)),n&&React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},n),c&&React.createElement("p",null,c),i&&React.createElement("div",{className:"googlesitekit-setup-module__list-wrapper"},React.createElement("ol",{className:"googlesitekit-setup-module__list"},d.map((function(e){return React.createElement("li",{className:"googlesitekit-setup-module__list-item",key:e.id},e.text," ",React.createElement(m.a,{href:e.linkURL,external:!0,inherit:!0},e.linkText))})))),t&&a&&React.createElement("div",{className:"googlesitekit-setup-module__cta"},React.createElement(m.a,{className:"googlesitekit-setup-module__cta-link",href:t,external:!0},a)))}}]),t}(p.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(79),b=a(9),f=a(8),k=a.n(f),y=a(2),v=a(0),O=a(10),R=function(e){function t(e){var a;i()(this,t),a=r()(this,d()(t).call(this,e));var n=googlesitekit.modules.adsense.settings.useSnippet,o=void 0===n||n;return a.state={useSnippet:!!o,disabled:!1},a.handleUseSnippetSwitch=a.handleUseSnippetSwitch.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(O.addFilter)("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(O.removeFilter)("googlekit.SettingsConfirmed","googlekit.AdSenseSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"save",value:function(){var e=this.state.useSnippet;this._isMounted&&this.setState({useSnippet:e});var t={useSnippet:e||!1};return googlesitekit.modules.adsense.settings&&(googlesitekit.modules.adsense.settings.useSnippet=e),b.c.set(b.b,"adsense","use-snippet",t).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.v)("adsense_setup",t?"adsense_tag_enabled":"adsense_tag_disabled"),e&&b.c.set(b.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.y)("adsense",{useSnippet:"useSnippet"},this.state)}}},{key:"render",value:function(){var e=this.state.useSnippet,t=this.props,a=t.isEditing,n=t.switchLabel,i=t.switchOnMessage,o=t.switchOffMessage;return React.createElement(h.Fragment,null,a?React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__switch"},React.createElement(_.a,{id:"enableAutoAds",label:n,onClick:this.handleUseSnippetSwitch,checked:e,hideLabel:!1})," ",React.createElement("span",{className:"googlesitekit-recommended"},Object(v.__)("RECOMMENDED","google-site-kit"))),e&&i&&React.createElement("div",{className:"googlesitekit-settings-notice googlesitekit-settings-notice--suggestion"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},i)),!e&&o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o))):React.createElement(h.Fragment,null,Object(v.__)("The AdSense code has","google-site-kit")," ",e?Object(v.__)("been placed on your site.","google-site-kit"):Object(v.__)("not been placed on your site.","google-site-kit")))}}]),t}(h.Component);R.propTypes={isEditing:k.a.bool,accountTagMatch:k.a.bool,existingTag:k.a.oneOfType([k.a.bool,k.a.string]),switchLabel:k.a.string,switchOnMessage:k.a.string,switchOffMessage:k.a.string},R.defaultProps={isEditing:!1,accountTagMatch:!1,existingTag:!1,switchLabel:Object(v.__)("Let Site Kit place code on your site","google-site-kit"),switchOnMessage:"",switchOffMessage:""},t.default=R},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(20),h=a(29),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.modules.adsense.accountURL;return React.createElement("section",{className:"googlesitekit-module-outro"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-module-outro__logo"},React.createElement(m.a,{id:"adsense",height:"36",width:"42"}),React.createElement(m.a,{id:"plus",height:"13",width:"13"}),React.createElement(m.a,{id:"analytics",height:"36",width:"34"})),React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-module-outro__title "},Object(_.__)("Connect Analytics with AdSense to create a powerful team that shows robust metrics for your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-module-outro__button"},React.createElement(h.a,{href:e,target:"_blank"},Object(_.__)("Connect Accounts","google-site-kit")))))))}}]),t}(p.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(95),O=a(11),R=a(0),E=a(15);function S(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(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(f.i)().dateRangeFrom,a=[{title:Object(R.__)("Medium","google-site-kit"),tooltip:Object(R.__)("Medium refers to where your traffic originated from","google-site-kit")},{title:Object(R.__)("Users","google-site-kit"),tooltip:Object(R.__)("Number of users that originated from that traffic","google-site-kit")},{title:Object(R.__)("New Users","google-site-kit"),tooltip:Object(R.sprintf)(Object(R.__)("Number of new users to visit your page over %s","google-site-kit"),t)},{title:Object(R.__)("Sessions","google-site-kit"),tooltip:Object(R.sprintf)(Object(R.__)("Number of sessions users had on your website over %s","google-site-kit"),t)},{title:Object(R.__)("Percentage","google-site-kit"),tooltip:Object(R.__)("Percentage of sessions","google-site-kit")}],n=e[0].data.totals[0].values[0],i=Object(O.map)(e[0].data.rows,(function(e,t){var a=e.metrics[0].values[0]/n*100;return!(1>a)&&[e.dimensions[0],Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),Object(f.r)(e.metrics[0].values[2]),React.createElement(h.Fragment,{key:"minichart-analytics-top-as-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(a.toFixed(2),"%")," ",React.createElement(v.a,{percent:a.toFixed(1),index:t})))]})),o=Object(k.b)(i,a,{hideHeader:!1,chartsEnabled:!1});return React.createElement("div",{className:"googlesitekit-details-widget"},React.createElement(k.a,null,o))}}]),t}(h.Component);t.default=Object(_.a)(j,[{type:b.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?S(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):S(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}({},E.trafficSourcesReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{rows:4,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(38),k=a(11),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(y.__)("Keyword","google-site-kit"),tooltip:Object(y.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(y.__)("Clicks","google-site-kit"),tooltip:Object(y.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(y.__)("Impressions","google-site-kit"),tooltip:Object(y.__)("Counted each time your content appears in search results","google-site-kit")}],a=googlesitekit.admin.siteURL,n=[],i=Object(k.map)(e,(function(e,t){var i=e.keys[0];return n[t]=Object(y.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",a,i),[i,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),o={hideHeader:!1,chartsEnabled:!1,links:n},c=Object(b.b)(i,t,o);return React.createElement(b.a,null,c)}}]),t}(p.Component);t.default=Object(m.a)(v,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"query",limit:10},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"]}],React.createElement(f.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.DashboardSearchFunnel")(h)},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(22),h=a(8),_=a.n(h),b=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).switchRef=Object(p.createRef)(),a}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){new m.i(this.switchRef.current)}},{key:"render",value:function(){var e=this.props,t=e.id,a=e.onClick,n=e.label,i=e.checked,o=e.hideLabel;return React.createElement(p.Fragment,null,React.createElement("div",{"aria-checked":i?"true":"false",className:"mdc-switch ".concat(i?"mdc-switch--checked":""),onClick:a,onKeyPress:function(e){"function"==typeof a&&"Enter"===e.code&&a(e)},role:"switch",ref:this.switchRef,tabIndex:0},React.createElement("div",{className:"mdc-switch__track"}," "),React.createElement("div",{className:"mdc-switch__thumb-underlay"},React.createElement("div",{className:"mdc-switch__thumb"},React.createElement("input",{type:"checkbox",id:t,className:"mdc-switch__native-control",role:"switch",checked:i,onChange:function(){}})))),React.createElement("label",{className:o?"screen-reader-only":"",htmlFor:t},n))}}]),t}(p.Component);b.propTypes={id:_.a.string.isRequired,onClick:_.a.func,label:_.a.string.isRequired,checked:_.a.bool,hideLabel:_.a.bool},b.defaultProps={checked:!1,hideLabel:!0},t.a=b},,,,,,,,,,,function(e,t,a){"use strict";a(1);var n=a(32),i=a(71),o=a(2),c=a(0);t.a=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=arguments.length>2&&void 0!==arguments[2]&&arguments[2],s=arguments.length>3&&void 0!==arguments[3]&&arguments[3],r=googlesitekit.modules[e].name,l=React.createElement(n.a
6
  /* translators: %s: Module name */,{title:Object(c.sprintf)(Object(c.__)("%s activation","google-site-kit"),r)
7
  /* translators: %s: Module name */,description:Object(c.sprintf)(Object(c.__)("%s module needs to be configured","google-site-kit"),r),ctaLabel:Object(c.__)("Complete activation","google-site-kit"),onClick:function(){window.location=Object(o.m)(e,!0)}});return Object(i.a)(l,t,a,s)}},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(23),h=a(8),_=a.n(h),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){for(var e=this.props,t=e.width,a=e.height,n=e.shape,i=e.count,o=[],c=0;c++<i;)o.push(React.createElement(m.a,{width:t,height:a,shape:n,key:c}));return o}}]),t}(p.Component);b.propTypes={width:_.a.string,height:_.a.string,shape:_.a.string,count:_.a.number},b.defaultProps={width:"100px",height:"100px",shape:"square",count:1},t.a=b},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(13),m=a.n(p),h=a(7),_=a.n(h),b=a(1),f=a(29),k=a(14),y=a(9),v=a(22),O=a(20),R=a(8),E=a.n(R),S=a(2),j=a(0),w=a(10),D=function(e){function t(e){var a;c()(this,t),a=d()(this,g()(t).call(this,e));var n=googlesitekit.modules.optimize.settings,i=n.optimizeID,o=n.ampClientIDOptIn,s=n.ampExperimentJSON,r=(googlesitekit.modules.analytics||{}).settings,l=googlesitekit.modules.tagmanager||{},u=l.active,p=l.settings,h=!!r&&r.useSnippet,_=!(!u||!p)&&p.useSnippet;return a.state={optimizeID:i||"",analyticsUseSnippet:h,gtmUseSnippet:_,errorCode:!1,errorMsg:"",ampClientIDOptIn:o||!1,ampExperimentJSON:s||"",ampExperimentJSONValidated:!0,OptimizeIDValidated:!0},a.handleOptimizeIDEntry=a.handleOptimizeIDEntry.bind(m()(a)),a.handleSubmit=a.handleSubmit.bind(m()(a)),a.renderInstructionInfo=a.renderInstructionInfo.bind(m()(a)),a.handleAMPOptimizeEntry=a.handleAMPOptimizeEntry.bind(m()(a)),a}return _()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;this._isMounted=!0,Object(w.addFilter)("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(w.removeFilter)("googlekit.SettingsConfirmed","googlekit.OptimizeSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(S.y)("optimize",{optimizeID:"optimizeID",ampExperimentJSON:"ampExperimentJSON"},this.state)}}},{key:"handleSubmit",value:function(){var e,t,a,n,o,c,s=this;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(e=this.state,t=e.optimizeID,a=e.ampExperimentJSON,n=e.OptimizeIDValidated,o=this.props.finishSetup,n&&0!==t.length){r.next=4;break}return r.abrupt("return",!1);case 4:return c={optimizeID:t,ampExperimentJSON:a},r.next=7,i.a.awrap(y.c.set(y.b,"optimize","settings",c).then((function(){o&&o(),googlesitekit.modules.optimize.settings.optimizeID=t,s._isMounted&&s.setState({isSaving:!1})})).catch((function(e){s._isMounted&&s.setState({errorCode:!0,errorMsg:e.errorMsg})})));case 7:return r.abrupt("return",r.sent);case 8:case"end":return r.stop()}}),null,this)}},{key:"handleOptimizeIDEntry",value:function(e){var t=Object(S.A)(e.target.value);this._isMounted&&this.setState({optimizeID:e.target.value,OptimizeIDValidated:t})}},{key:"handleAMPOptimizeEntry",value:function(e){var t=Object(S.z)(e.target.value);this._isMounted&&this.setState({ampExperimentJSON:e.target.value,ampExperimentJSONValidated:t})}},{key:"renderInfo",value:function(){var e=this.state.optimizeID;return React.createElement(b.Fragment,null,e?React.createElement("div",null,Object(j.__)("Your Optimize Container ID","google-site-kit"),": ",React.createElement("strong",null,e)):React.createElement("div",null,Object(j.__)('Optimize Container ID missing, press "edit" to add',"google-site-kit"),"."))}},{key:"renderInstructionInfo",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.gtmUseSnippet,n=e.optimizeID;return!t&&a?React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("You are using auto insert snippet with Tag Manager","google-site-kit")),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6314801"},Object(j.__)("Click here","google-site-kit"))," ",Object(j.__)("for how to implement Optimize tag through your Tag Manager","google-site-kit"))):t?null:React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("You disabled analytics auto insert snippet. If You are using Google Analytics code snippet, add the code below:","google-site-kit")),React.createElement("pre",null,'ga("require", "',n||"GTM-XXXXXXX",'");'),React.createElement("p",null,React.createElement("a",{href:"https://support.google.com/optimize/answer/6262084"},Object(j.__)("Click here","google-site-kit"))," ",Object(j.__)("for how to implement Optimize tag in Google Analytics Code Snippet","google-site-kit")))}},{key:"renderAMPSnippet",value:function(){var e=this.state,t=e.analyticsUseSnippet,a=e.ampClientIDOptIn,n=e.ampExperimentJSON,i=e.ampExperimentJSONValidated,o=window.googlesitekit.admin.ampEnabled;return t&&o?React.createElement(b.Fragment,null,a&&React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("Please input your AMP experiment settings in JSON format below.","google-site-kit")," ",React.createElement(k.a,{href:"https://developers.google.com/optimize/devguides/amp-experiments",external:!0,inherit:!0},Object(j.__)("Learn More.","google-site-kit"))),React.createElement(v.l,{className:"\n\t\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t\t".concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t\t"),name:"amp-experiment",onChange:this.handleAMPOptimizeEntry,textarea:!0},React.createElement(v.b,{inputType:"textarea",value:null===n?"":n})),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error: AMP experiment settings are not in a valid JSON format.","google-site-kit")))):null}},{key:"renderForm",value:function(){var e=this.state,t=e.optimizeID,a=e.errorCode,n=e.errorMsg,i=e.OptimizeIDValidated;return React.createElement(b.Fragment,null,React.createElement("p",null,Object(j.__)("Please copy and paste your Optimize ID to complete your setup.","google-site-kit")," ",React.createElement(k.a,{href:"https://support.google.com/optimize/answer/6211921",external:!0,inherit:!0},Object(j.__)("You can locate this here.","google-site-kit"))),a&&0<n.length&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error:","google-site-kit")," ",n),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(v.l,{className:"\n\t\t\t\t\t\t\tmdc-text-field\n\t\t\t\t\t\t\t".concat(a?"mdc-text-field--error":"","\n\t\t\t\t\t\t\t").concat(i?"":"mdc-text-field--error","\n\t\t\t\t\t\t"),label:Object(j.__)("Optimize Container ID","google-site-kit"),name:"optimizeID",onChange:this.handleOptimizeIDEntry,helperText:React.createElement(v.a,null,Object(j.__)("Format: GTM-XXXXXXX.","google-site-kit")),outlined:!0,required:!0},React.createElement(v.b,{value:t}))),!i&&React.createElement("p",{className:"googlesitekit-error-text"},Object(j.__)("Error: Not a valid Optimize ID.","google-site-kit")),this.renderAMPSnippet(),this.renderInstructionInfo())}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--optimize"},!t&&React.createElement(b.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(O.a,{id:"optimize",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(j._x)("Optimize","Service name","google-site-kit"))),a&&this.renderForm(),!a&&this.renderInfo(),!t&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(f.a,{onClick:this.handleSubmit},Object(j.__)("Configure Optimize","google-site-kit"))))}}]),t}(b.Component);D.propTypes={onSettingsPage:E.a.bool,finishSetup:E.a.func,isEditing:E.a.bool},D.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=D},function(e,t,a){"use strict";a.r(t),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedMobile",(function(){return O})),a.d(t,"PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop",(function(){return R}));var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(45),_=a(9),b=a(2),f=a(28),k=a(0),y=a(64),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.data,a=e.handleDataLoaded;t&&a&&a()}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.title;if(!t||t.error)return null;if(function(e){return 0===e.categories.performance.score}(t))return Object(h.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),Object(k.__)("An unknown error occurred while trying to fetch PageSpeed Insights data. Please try again later.","google-site-kit"),!0);var n=t.categories.performance.score,i=Object(y.getScoreCategoryLabel)(n),o=t.audits.interactive.displayValue,c=Object(f.b)([[Object(k.__)("Real user speed data","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},i)],[Object(k.__)("Time to become fully interactive","google-site-kit"),React.createElement(y.PageSpeedReportScoreCategoryWrapper,{key:"0",score:n},o)]],[],{hideHeader:!0,disableListMode:!0,chartsEnabled:!1,links:[]});return React.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 "},React.createElement("div",{className:"googlesitekit-pagespeed-report__heading-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 "},a),React.createElement(y.PageSpeedReportScoreGauge,{score:n})),React.createElement(f.a,null,c))}}]),t}(p.Component),O=Object(m.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"mobile"},priority:10,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0}),R=Object(m.a)(v,[{type:_.b,identifier:"pagespeed-insights",datapoint:"pagespeed",data:{url:googlesitekit.permaLink,strategy:"desktop"},priority:10,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],null,{inGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(12),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),p=a(6),m=a.n(p),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(29),v=a(14),O=a(9),R=a(31),E=a(22),S=a(20),j=a(8),w=a.n(j),D=a(2),C=a(11),x=a(0),N=a(10),A=function(e){function t(e){var a;r()(this,t),a=g()(this,m()(t).call(this,e));var n=googlesitekit.modules.tagmanager.settings,i="primary"===googlesitekit.admin.ampMode?"amp":"web",o="amp"===i?"ampContainerID":"containerID";return a.state={isLoading:!0,accounts:[],containers:[],errorCode:!1,errorMsg:"",refetch:!1,selectedAccount:n.accountID,selectedContainer:n[o],containersLoading:!1,usageContext:i,containerKey:o},a.handleSubmit=a.handleSubmit.bind(_()(a)),a.renderAccountDropdownForm=a.renderAccountDropdownForm.bind(_()(a)),a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handleContainerChange=a.handleContainerChange.bind(_()(a)),a.refetchAccount=a.refetchAccount.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e=this,t=this.props,a=t.isOpen,n=t.onSettingsPage;this._isMounted=!0,n&&!a||(this.requestTagManagerAccounts(),Object(N.addFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed",(function(t,a){return"tagmanager"!==a.replace("-module","")?t:e.props.isEditing?e.handleSubmit():void 0})),this.toggleConfirmChangesButton())}},{key:"componentDidUpdate",value:function(){this.state.refetch&&this.requestTagManagerAccounts(),this.toggleConfirmChangesButton()}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,Object(N.removeFilter)("googlekit.SettingsConfirmed","googlekit.TagmanagerSettingsConfirmed")}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){var e={selectedContainer:this.state.containerKey,selectedAccount:"selectedAccount"};Object(D.y)("tagmanager",e,this.state)}}},{key:"requestTagManagerAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d;return c.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return u.prev=0,e=this.state,t=e.selectedAccount,a=e.usageContext,n=this.state.selectedContainer,i={accountID:t,usageContext:a},o=!1,s="",u.next=8,c.a.awrap(O.c.get(O.b,"tagmanager","accounts-containers",i));case 8:r=u.sent,l=r.accounts,d=r.containers,t||0!==l.length||(o="accountEmpty",s=Object(x.__)("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")),t&&!l.find((function(e){return e.accountId===t}))&&(O.c.invalidateCacheGroup(O.b,"tagmanager","accounts-containers"),o="insufficientPermissions",s=Object(x.__)("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")),n&&!d.find((function(e){return e.publicId===n}))&&(n=null),this._isMounted&&this.setState({isLoading:!1,accounts:l,selectedAccount:t||Object(C.get)(d,[0,"accountId"]),containers:d,selectedContainer:n||Object(C.get)(d,[0,"publicId"]),refetch:!1,errorCode:o,errorMsg:s}),u.next=20;break;case 17:u.prev=17,u.t0=u.catch(0),this._isMounted&&this.setState({isLoading:!1,errorCode:u.t0.code,errorMsg:u.t0.message,refetch:!1});case 20:case"end":return u.stop()}}),null,this,[[0,17]])}},{key:"requestTagManagerContainers",value:function(e){var t,a;return c.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,t={accountID:e,usageContext:this.state.usageContext},n.next=4,c.a.awrap(O.c.get(O.b,"tagmanager","containers",t));case 4:a=n.sent,this._isMounted&&this.setState({containersLoading:!1,containers:a,selectedContainer:Object(C.get)(a,[0,"publicId"]),errorCode:!1}),n.next=11;break;case 8:n.prev=8,n.t0=n.catch(0),this._isMounted&&this.setState({errorCode:n.t0.code,errorMsg:n.t0.message});case 11:case"end":return n.stop()}}),null,this,[[0,8]])}},{key:"handleSubmit",value:function(){var e,t,a,n,o,s,r,l,d;return c.a.async((function(u){for(;;)switch(u.prev=u.next){case 0:return e=this.state,t=e.selectedAccount,a=e.selectedContainer,n=e.usageContext,o=e.containerKey,s=this.props.finishSetup,u.prev=2,r={accountID:t},i()(r,o,a),i()(r,"usageContext",n),l=r,u.next=6,c.a.awrap(O.c.set(O.b,"tagmanager","settings",l));case 6:d=u.sent,s&&s(),googlesitekit.modules.tagmanager.settings=d,this._isMounted&&this.setState({isSaving:!1}),u.next=16;break;case 12:return u.prev=12,u.t0=u.catch(2),this._isMounted&&this.setState({isLoading:!1,errorCode:u.t0.code,errorMsg:u.t0.message}),u.abrupt("return",new Promise((function(e,t){t(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.getAttribute("data-value");n!==a&&(this._isMounted&&this.setState({containersLoading:!0,selectedAccount:n}),this.requestTagManagerContainers(n))}},{key:"handleContainerChange",value:function(e,t){var a=this.state.selectedContainer,n=t.getAttribute("data-value");n!==a&&this._isMounted&&this.setState({selectedContainer:n})}},{key:"refetchAccount",value:function(e){e.preventDefault(),this._isMounted&&this.setState({isLoading:!0,refetch:!0,errorCode:!1})}},{key:"renderSettingsInfo",value:function(){var e=this.state,t=e.isLoading,a=e.selectedAccount,n=e.selectedContainer;return t?React.createElement(R.a,null):React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(x.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},a||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(x.__)("Container ID","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},n||!1))))}},{key:"renderAccountDropdownForm",value:function(){var e=this.state,a=e.accounts,n=e.selectedAccount,i=e.containers,o=e.selectedContainer,c=e.isLoading,s=e.containersLoading,r=this.props.onSettingsPage;return c?React.createElement(R.a,null):0>=a.length?React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:t.createNewAccount},Object(x.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(v.a,{onClick:this.refetchAccount},Object(x.__)("Re-fetch My Account","google-site-kit"))))):React.createElement(k.Fragment,null,React.createElement("p",null,Object(x.__)("Please select your Tag Manager account and container below, the snippet will be inserted automatically into your site.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(E.k,{enhanced:!0,name:"accounts",label:Object(x.__)("Account","google-site-kit"),value:n,onEnhancedChange:this.handleAccountChange,outlined:!0},a.map((function(e){return React.createElement(E.j,{key:e.accountId,value:e.accountId},e.name)}))),s?React.createElement(R.a,{small:!0}):React.createElement(E.k,{enhanced:!0,name:"containers",label:Object(x.__)("Container","google-site-kit"),value:o,onEnhancedChange:this.handleContainerChange,outlined:!0},i.concat({name:Object(x.__)("Set up a new container","google-site-kit"),publicId:0}).map((function(e,t){var a=e.name,n=e.publicId;return React.createElement(E.j,{key:t,value:n},a)})))),!r&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(y.a,{onClick:this.handleSubmit},Object(x.__)("Confirm & Continue","google-site-kit"))))}},{key:"renderErrorOrNotice",value:function(){var e=this.state,t=e.errorCode,a=e.errorMsg,n=this.props.onSettingsPage;if(0===a.length)return null;var i=!n||"insufficientPermissions"!==t;return React.createElement("div",{className:i?"googlesitekit-error-text":""},React.createElement("p",null,i?
8
  /* translators: %s: Error message */
9
+ Object(x.sprintf)(Object(x.__)("Error: %s","google-site-kit"),a):a))}},{key:"render",value:function(){var e=this.props,t=e.onSettingsPage,a=e.isEditing;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--tag-manager"},!t&&React.createElement(k.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(S.a,{id:"tagmanager",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(x._x)("Tag Manager","Service name","google-site-kit"))),this.renderErrorOrNotice(),a&&this.renderAccountDropdownForm(),!a&&this.renderSettingsInfo())}}],[{key:"createNewAccount",value:function(e){e.preventDefault(),window.open("https://marketingplatform.google.com/about/tag-manager/","_blank")}}]),t}(k.Component);A.propTypes={onSettingsPage:w.a.bool,finishSetup:w.a.func,isEditing:w.a.bool},A.defaultProps={onSettingsPage:!0,isEditing:!1},t.default=A},function(e,t,a){"use strict";var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(56),h=["#178EC5","#54B23B","#EB5729","#ECED33","#34CBE3","#82E88E"],_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.index,a=e.percent,n={backgroundColor:"transparent",chartArea:{width:"100%",height:"100%"},enableInteractivity:!1,height:28,legend:{position:"none"},slices:{0:{color:h[t]},1:{color:"#e6e6e6"}},title:null,tooltip:{trigger:"none"},width:28},i=[["source","percent"],["",+a],["",100-a]];return React.createElement("div",{className:"googlesitekit-mini-chart"},React.createElement(m.a,{data:i,options:n,chartType:"pie",loadSmall:!0,loadCompressed:!0,loadHeight:24,loadText:!1,id:"minichart"+t}))}}]),t}(p.Component);t.a=_},function(e,t,a){"use strict";a.r(t);var n=a(169),i=a.n(n),o=a(12),c=a.n(o),s=a(3),r=a.n(s),l=a(4),d=a.n(l),u=a(5),g=a.n(u),p=a(6),m=a.n(p),h=a(13),_=a.n(h),b=a(7),f=a.n(b),k=a(27),y=a.n(k),v=a(1),O=a(9),R=a(8),E=a.n(R),S=a(29),j=a(31),w=a(14),D=a(22),C=function(e){function t(e){var a;return r()(this,t),(a=g()(this,m()(t).call(this,e))).formFieldRef=Object(v.createRef)(),a.radioRef=Object(v.createRef)(),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){new D.e(this.formFieldRef.current).input=new D.g(this.radioRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,a=e.id,n=e.name,i=e.value,o=e.checked,c=e.disabled,s=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-radio\n\t\t\t\t\t\t".concat(c?"mdc-radio--disabled":"","\n\t\t\t\t\t"),ref:this.radioRef},React.createElement("input",{className:"mdc-radio__native-control",onClick:t,type:"radio",id:a,name:n,value:i,checked:o,disabled:c,onChange:function(){}}),React.createElement("div",{className:"mdc-radio__background"},React.createElement("div",{className:"mdc-radio__outer-circle"}),React.createElement("div",{className:"mdc-radio__inner-circle"}))),React.createElement("label",{htmlFor:a},s))}}]),t}(v.Component);C.propTypes={onClick:E.a.func,id:E.a.string.isRequired,name:E.a.string.isRequired,value:E.a.string.isRequired,checked:E.a.bool,disabled:E.a.bool,children:E.a.string.isRequired},C.defaultProps={onClick:null,checked:!1,disabled:!1};var x=C,N=a(79),A=a(20),P=a(2),L=a(0),M=a(10);function I(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 F(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?I(a,!0).forEach((function(t){y()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):I(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var T=y()({},"loggedinUsers",Object(L.__)("Logged-in users","google-site-kit")),U=function(e){function t(e){var a;r()(this,t),a=g()(this,m()(t).call(this,e));var n=googlesitekit.modules.analytics.settings,i=n.accountID,o=n.internalWebPropertyID,c=n.profileID,s=n.propertyID,l=n.useSnippet,d=n.ampClientIDOptIn,u=n.trackingDisabled;return a.state={isLoading:!0,isSaving:!1,propertiesLoading:!1,profilesLoading:!1,useSnippet:l||!1,errorCode:!1,errorMsg:"",errorReason:!1,accounts:[],properties:[],profiles:[],selectedAccount:i,selectedProperty:s,selectedProfile:c,selectedinternalWebProperty:o,ampClientIDOptIn:d,existingTag:!1,trackingDisabled:u||[]},a.handleAccountChange=a.handleAccountChange.bind(_()(a)),a.handlePropertyChange=a.handlePropertyChange.bind(_()(a)),a.handleProfileChange=a.handleProfileChange.bind(_()(a)),a.processAccountChange=a.processAccountChange.bind(_()(a)),a.processPropertyChange=a.processPropertyChange.bind(_()(a)),a.handleSubmit=a.handleSubmit.bind(_()(a)),a.handleRadioClick=a.handleRadioClick.bind(_()(a)),a.handleAMPClientIDSwitch=a.handleAMPClientIDSwitch.bind(_()(a)),a.handleRefetchAccount=a.handleRefetchAccount.bind(_()(a)),a.handleExclusionsChange=a.handleExclusionsChange.bind(_()(a)),a}return f()(t,e),d()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,i,o=this;return c.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,c.a.awrap(Object(P.k)("analytics"));case 6:if(!(n=s.sent)||!n.length){s.next=21;break}return s.prev=8,s.next=11,c.a.awrap(O.c.get(O.b,"analytics","tag-permission",{tag:n}));case 11:return i=s.sent,s.next=14,c.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,c.a.awrap(this.getAccounts());case 23:Object(M.addFilter)("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(M.removeFilter)("googlekit.SettingsConfirmed","googlekit.AnalyticsSettingsConfirmed")}},{key:"componentDidUpdate",value:function(){this.toggleConfirmChangesButton()}},{key:"toggleConfirmChangesButton",value:function(){if(this.props.isEditing){Object(P.y)("analytics",{selectedAccount:"accountID",selectedProperty:"propertyID",selectedProfile:"profileID",selectedinternalWebProperty:"internalWebPropertyID",useSnippet:"useSnippet",ampClientIDOptIn:"ampClientIDOptIn",trackingDisabled:"trackingDisabled"},this.state)}}},{key:"handleAccountChange",value:function(e,t){var a=this.state.selectedAccount,n=t.getAttribute("data-value");n!==a&&("0"!==n?(this.setState({propertiesLoading:!0,profilesLoading:!0,selectedAccount:n}),Object(P.v)("analytics_setup","account_change",n),this.processAccountChange(n)):this.setState({selectedAccount:n,selectedProperty:"-1",selectedProfile:"-1",properties:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}],profiles:[{id:"-1",name:Object(L.__)("Select an account","google-site-kit")}]}))}},{key:"handlePropertyChange",value:function(e,t){var a=this.state.selectedProperty,n=t.getAttribute("data-value");n!==a&&("0"!==n?(this.setState({profilesLoading:!0,selectedProperty:n}),Object(P.v)("analytics_setup","property_change",n),this.processPropertyChange(n)):this.setState({selectedProperty:n,selectedProfile:n,profiles:[{id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}]}))}},{key:"handleProfileChange",value:function(e,t){var a=t.getAttribute("data-value");this.setState({selectedProfile:a}),Object(P.v)("analytics_setup","profile_change",a)}},{key:"getAccounts",value:function(){var e,t,a,n,i,o,s,r,l,d,u,g,p,m,h,_,b=this,f=arguments;return c.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,r=s.isEditing,l=s.onSettingsPage,d=this.state.errorCode,u={},k.prev=5,g=e?{existingAccountID:e.accountId,existingPropertyID:e.propertyId}:{},k.next=9,c.a.awrap(O.c.get(O.b,"analytics","accounts-properties-profiles",g));case 9:0===(p=k.sent).accounts.length?(u=F({},u,{errorCode:"no_account",errorReason:"noAccount"}),O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles")):a?a&&!p.accounts.find((function(e){return e.id===a}))&&(O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),p.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")}),r&&(a="0",n="-1",i="-1"),u=F({},u,{errorCode:"insufficient_permissions",errorReason:"insufficientPermissions"})):(m=null,p.matchedProperty&&(m=p.matchedProperty),m?(a=m.accountId,n=m.id,(h=p.profiles.find((function(e){return e.accountId===a})))&&(i=h.id)):p.accounts.unshift({id:0,name:Object(L.__)("Select one...","google-site-kit")})),_={id:"-1",name:Object(L.__)("Select an account","google-site-kit")},this.state.existingTag||p.properties.push({id:0,name:Object(L.__)("Setup a New Property","google-site-kit")}),p.profiles.push({id:0,name:Object(L.__)("Setup a New Profile","google-site-kit")}),l||(o=!e),u=F({},u,{isLoading:!1,accounts:p.accounts,errorCode:d||u.errorCode,selectedAccount:a,selectedProperty:n,selectedProfile:i,properties:[_],profiles:[_],existingTag:!!e&&e.propertyID,useSnippet:o}),a&&"0"!==a&&(u=Object.assign(u,{properties:p.properties,profiles:p.profiles,selectedinternalWebProperty:p.properties[0]?p.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){b._isMounted?b.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 c.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,t={accountID:e},o.next=4,c.a.awrap(O.c.get(O.b,"analytics","properties-profiles",t));case 4:a=o.sent,n={id:0,name:Object(L.__)("Setup a New Property","google-site-kit")},a.properties.push(n),i={id:0,name:Object(L.__)("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 c.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,c.a.awrap(O.c.get(O.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,r,l,d,u,g,p,m,h,_,b,f;return c.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.selectedAccount,n=t.selectedProperty,i=t.selectedProfile,o=t.useSnippet,s=t.selectedinternalWebProperty,r=t.accounts,l=t.properties,d=t.profiles,u=t.ampClientIDOptIn,g=t.trackingDisabled,this.setState({isSaving:!0}),p=this.props.finishSetup,m=i||(d[0].id||0===d[0].id?d[0].id.toString():null),h=n||(l[0].id||0===l[0].id?l[0].id.toString():null),_="0"===h?"0":s||(l[0].internalWebPropertyId||0===l[0].internalWebPropertyId?l[0].internalWebPropertyId.toString():null),b={accountID:a||r[0].id||null,profileID:m,propertyID:h,internalWebPropertyID:_,useSnippet:o||!1,ampClientIDOptIn:u||!1,trackingDisabled:g},k.prev=10,k.next=13,c.a.awrap(O.c.set(O.b,"analytics","settings",b));case 13:return f=k.sent,O.c.invalidateCacheGroup(O.b,"analytics","accounts-properties-profiles"),k.next=17,c.a.awrap(this.getAccounts());case 17:googlesitekit.modules.analytics.settings=f,Object(P.v)("analytics_setup","analytics_configured"),p&&p(),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(P.v)("analytics_setup",t?"analytics_tag_enabled":"analytics_tag_disabled")}},{key:"handleAMPClientIDSwitch",value:function(){this.setState({ampClientIDOptIn:!this.state.ampClientIDOptIn})}},{key:"handleRefetchAccount",value:function(){this.setState({isLoading:!0,errorCode:!1,errorMsg:""}),this.getAccounts()}},{key:"handleExclusionsChange",value:function(e){var t=this.state.trackingDisabled,a=e.target,n=a.id,o=a.checked,c=Object.assign.apply(Object,[{}].concat(i()(t.map((function(e){return y()({},e,!0)}))),[y()({},n,o)]));this.setState({trackingDisabled:Object.keys(c).filter((function(e){return c[e]}))})}},{key:"renderAutoInsertSnippetForm",value:function(){var e=this.state,t=e.useSnippet,a=e.isSaving,n=e.ampClientIDOptIn,i=e.existingTag,o=this.props,c=o.isEditing,s=o.onSettingsPage,r=!c,l=window.googlesitekit.admin.ampEnabled,d=window.googlesitekit.modules.analytics.settings.useSnippet;return React.createElement("div",{className:"googlesitekit-setup-module__inputs googlesitekit-setup-module__inputs--multiline"},(c||a)&&React.createElement(v.Fragment,null,s&&React.createElement(v.Fragment,null,!d&&!i&&React.createElement(v.Fragment,null,React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("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"))),d&&React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(L.__)("Do you want to remove the Analytics snippet inserted by Site Kit?","google-site-kit"))),s&&!i&&!t&&d&&React.createElement("p",null,Object(L.__)("If the code snippet is removed, you will no longer be able to gather Analytics insights about your site.","google-site-kit"))),s&&React.createElement(v.Fragment,null,i&&React.createElement("p",null,Object(L.__)("Placing two tags at the same time is not recommended.","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetTrue",name:"useSnippet",value:"1",checked:t,disabled:r},d?Object(L.__)("Not at this time","google-site-kit"):Object(L.__)("Insert snippet","google-site-kit")),React.createElement(x,{onClick:this.handleRadioClick,id:"useSnippetFalse",name:"useSnippet",value:"0",checked:!t,disabled:r},d?Object(L.__)("Remove snippet","google-site-kit"):Object(L.__)("Not at this time","google-site-kit"))),t&&l&&React.createElement("div",{className:"googlesitekit-setup-module__input"},React.createElement(N.a,{id:"ampClientIDOptIn",label:Object(L.__)("Opt in AMP Client ID","google-site-kit"),onClick:this.handleAMPClientIDSwitch,checked:n,hideLabel:!1}),React.createElement("p",null,n?Object(L.__)("Sessions will be combined across AMP/non-AMP pages.","google-site-kit")+" ":Object(L.__)("Sessions will be tracked separately between AMP/non-AMP pages.","google-site-kit")+" ",React.createElement(w.a,{href:"https://support.google.com/analytics/answer/7486764",external:!0,inherit:!0},Object(L.__)("Learn more","google-site-kit")))))}},{key:"accountsDropdown",value:function(){var e=this.state,t=e.accounts,a=e.selectedAccount,n=e.existingTag,i=!this.props.isEditing;return n&&a&&(i=!0),React.createElement(D.k,{enhanced:!0,name:"accounts",value:a||"0",onEnhancedChange:this.handleAccountChange,label:Object(L.__)("Account","google-site-kit"),disabled:i,outlined:!0},t.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))}},{key:"hasAccessToExistingTagProperty",value:function(){var e=this.state,t=e.existingTag,a=e.selectedProfile;return t&&a}},{key:"renderForm",value:function(){var e=this.state,a=e.isLoading,n=e.propertiesLoading,i=e.profilesLoading,o=e.accounts,c=e.properties,s=e.profiles,r=e.selectedAccount,l=e.selectedProperty,d=e.selectedProfile,u=e.useSnippet,g=e.existingTag,p=e.errorCode,m=e.trackingDisabled,h=this.props,_=h.onSettingsPage,b=h.isEditing,f=!b,k=!b;g&&l&&(k=!0);var y=googlesitekit.modules.analytics.setupComplete;if(a)return React.createElement(j.a,null);if("google_analytics_existing_tag_permission"===p)return null;if(0>=o.length){if(!b)return Object(L.__)("No account found.","google-site-kit");if(!y||b)return React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(S.a,{onClick:t.createNewAccount},Object(L.__)("Create an account","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(w.a,{onClick:this.handleRefetchAccount},Object(L.__)("Re-fetch My Account","google-site-kit")))))}if(!b){var O=u?Object(L.__)("Snippet is inserted","google-site-kit"):Object(L.__)("Snippet is not inserted","google-site-kit");return g&&(O=Object(L.__)("Inserted by another plugin or theme","google-site-kit")),React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Account","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},r||o[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Property","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},l||c[0].name||!1)),React.createElement("div",{className:"googlesitekit-settings-module__meta-item"},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("View","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},d||s[0].name||!1))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Analytics Code Snippet","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},O))),React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item "},React.createElement("p",{className:"googlesitekit-settings-module__meta-item-type"},Object(L.__)("Excluded from Analytics","google-site-kit")),React.createElement("h5",{className:"googlesitekit-settings-module__meta-item-data"},!!m.length&&m.map((function(e){return T[e]})).join(Object(L._x)(", ","list separator","google-site-kit")),!m.length&&Object(L.__)("Analytics is currently enabled for all visitors.","google-site-kit")))))}return React.createElement(v.Fragment,null,!_&&0<o.length&&!g&&React.createElement("p",null,Object(L.__)("Please select the account information below. You can change this view later in your settings.","google-site-kit")),React.createElement("div",{className:"googlesitekit-setup-module__inputs"},this.accountsDropdown(),n?React.createElement(j.a,{small:!0}):React.createElement(D.k,{enhanced:!0,name:"properties",value:l||0===l?l.toString():"-1",onEnhancedChange:this.handlePropertyChange,label:Object(L.__)("Property","google-site-kit"),disabled:k,outlined:!0},c.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)}))),i?React.createElement(j.a,{small:!0}):React.createElement(D.k,{enhanced:!0,name:"profiles",value:d||0===d?d.toString():"-1",onEnhancedChange:this.handleProfileChange,label:Object(L.__)("View","google-site-kit"),disabled:f,outlined:!0},s.map((function(e,t){return React.createElement(D.j,{key:t,value:e.id},e.name)})))),this.renderAutoInsertSnippetForm(),_&&this.renderExclusionsForm(),!_&&React.createElement("div",{className:"googlesitekit-setup-module__action"},React.createElement(S.a,{disabled:!this.state.selectedAccount,onClick:this.handleSubmit},Object(L.__)("Configure Analytics","google-site-kit"))))}},{key:"renderExclusionsForm",value:function(){var e=this.state.trackingDisabled;return React.createElement("div",null,React.createElement("p",{className:"googlesitekit-setup-module__text"},Object(L.__)("Exclude from Analytics","google-site-kit")),React.createElement("div",{className:"mdc-form-field"},React.createElement(N.a,{id:"loggedinUsers",label:T.loggedinUsers,onClick:this.handleExclusionsChange,checked:e.includes("loggedinUsers"),hideLabel:!1})),React.createElement("p",null,e.includes("loggedinUsers")?Object(L.__)("Logged-in users will be excluded from Analytics tracking.","google-site-kit"):Object(L.__)("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,n=e.errorReason,i=e.accounts,o=this.props.onSettingsPage;if(!t)return null;var c=!0,s=a;switch(!0){case"google_analytics_existing_tag_permission"===t:c=!1;break;case o&&t&&"insufficientPermissions"===n:c=!1,s=Object(L.__)("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!o&&0===i.length:c=!1,s=Object(L.__)('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 0===s.length?null:React.createElement("div",{className:c?"googlesitekit-error-text":""},React.createElement("p",null,c?
10
  /* translators: %s: Error message */
11
+ Object(L.sprintf)(Object(L.__)("Error: %s","google-site-kit"),s):s))}},{key:"render",value:function(){var e=this.props.onSettingsPage,t=this.state.existingTag;return e||Object(P.v)("analytics_setup","configure_analytics_screen"),React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--analytics"},!e&&React.createElement(v.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(A.a,{id:"analytics",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(L._x)("Analytics","Service name","google-site-kit"))),this.hasAccessToExistingTagProperty()&&t!==googlesitekit.admin.trackingID&&React.createElement("p",null,Object(L.sprintf)(Object(L.__)("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(e){e.preventDefault(),Object(P.v)("analytics_setup","new_analytics_account"),window.open("https://analytics.google.com/analytics/web/?#/provision/SignUp","_blank")}}]),t}(v.Component);U.propTypes={onSettingsPage:E.a.bool,finishSetup:E.a.func,isEditing:E.a.bool},U.defaultProps={onSettingsPage:!0,isEditing:!1};t.default=U},,function(e,t,a){"use strict";a.r(t);var n=a(68),i=a.n(n),o=a(27),c=a.n(o),s=a(12),r=a.n(s),l=a(3),d=a.n(l),u=a(4),g=a.n(u),p=a(5),m=a.n(p),h=a(6),_=a.n(h),b=a(7),f=a.n(b),k=a(1),y=a(8),v=a.n(y),O=a(20),R=a(0),E=a(99),S=a(73),j=a(2),w=a(42);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}function C(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?D(a,!0).forEach((function(t){c()(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}var x=function(e){function t(e){var a;return d()(this,t),(a=m()(this,_()(t).call(this,e))).state={accountStatus:void 0,loadingMessage:Object(R.__)("Loading…","google-site-kit"),instructionProps:{}},a}return f()(t,e),g()(t,[{key:"componentDidMount",value:function(){return r.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.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.propsFromAccountStatus)(a);this.setState({instructionProps:n})}}},{key:"continueSetup",value:function(e){var t=this.state.instructionProps;e.existingState=C({},t),this.setState({instructionProps:e})}},{key:"goBack",value:function(){var e=C({},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 r.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.next=2,r.a.awrap(Object(j.k)("adsense"));case 2:return e=c.sent,t=function(e){o.setState({loadingMessage:e})},c.next=6,r.a.awrap(Object(w.getAdSenseAccountStatus)(e,t));case 6:a=c.sent,n=a.accountStatus,i=a.clientID,this.setState({accountStatus:n,clientID:i});case 10:case"end":return c.stop()}}),null,this)}},{key:"render",value:function(){var e=this.state,t=e.accountStatus,a=e.clientID,n=e.loadingMessage,o=e.instructionProps,c=!t||!googlesitekit.modules.adsense.setupComplete||["ads-display-pending","account-pending-review","account-required-action"].includes(t);return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},React.createElement("div",{className:"googlesitekit-setup-module__logo"},React.createElement(O.a,{id:"adsense",width:"33",height:"33"})),React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(R._x)("AdSense","Service name","google-site-kit"))),React.createElement("div",{className:"googlesitekit-setup-module__step"},!googlesitekit.canAdsRun&&!googlesitekit.modules.adsense.setupComplete&&React.createElement("div",{className:"googlesitekit-settings-module-warning"},React.createElement(O.a,{id:"error",height:"20",width:"23"}),Object(R.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit")),c&&"account-connected"!==t&&React.createElement(S.default,{ctaLink:o.ctaLink,ctaLinkText:o.ctaLinkText,header:o.statusHeadline,subHeader:o.statusMessage,incomplete:o.incomplete,required:o.required,loadingMessage:!t&&n}),googlesitekit.canAdsRun&&t&&(googlesitekit.modules.adsense.setupComplete||"account-connected"===t)&&React.createElement(E.default,i()({},o,{accountStatus:t,clientID:a,continueSetup:this.continueSetup,goBack:this.goBack}))))}}]),t}(k.Component);x.propTypes={status:v.a.string,module:v.a.string},t.default=x},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(20),h=a(14),_=a(29),b=a(74),f=a(9),k=a(62),y=a(18),v=a(2),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={isSaving:!1},a}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this,t=this.props,a=t.error,n=t.message,i=t.issue,o=t.notice,c=t.statusHeadline,s=t.statusMessage,r=t.profile,l=t.ctaLinkText,d=t.ctaLink,u=t.footerText,g=t.footerAppendedText,p=t.footerCTA,R=t.footerCTALink,E=t.continueAction,S=t.continueSetup,j=t.accountStatus,w=t.accountTagMatch,D=t.clientID,C=t.existingTag,x=t.switchLabel,N=t.tracking,A=t.switchOffMessage,P=t.switchOnMessage,L=t.goBack,M=t.existingState,I=this.state.isSaving,F=googlesitekit.admin.userData,T=F.email,U=void 0===T?"":T,z=F.picture,q=void 0===z?"":z;return React.createElement("div",{className:"googlesitekit-setup-module googlesitekit-setup-module--adsense"},React.createElement("div",{className:"googlesitekit-setup-module__step"},i&&React.createElement("p",{className:"googlesitekit-setup__notice"},React.createElement(m.a,{id:"error",height:"20",width:"23"}),React.createElement("span",{className:"googlesitekit-setup__notice-text"},i)),React.createElement("h2",{className:" googlesitekit-heading-4 googlesitekit-setup-module__title "},c),React.createElement("p",null,s),r&&React.createElement("p",{className:"googlesitekit-setup-module__user"},q&&React.createElement("img",{className:"googlesitekit-setup-module__user-image",src:q,alt:Object(O.__)("User Avatar","google-site-kit")}),React.createElement("span",{className:"googlesitekit-setup-module__user-email"},U)),"account-connected"===j&&React.createElement(b.default,{isEditing:!0,accountTagMatch:w,existingTag:C,saveOnChange:!0,switchLabel:x,switchOffMessage:A,switchOnMessage:P}),o&&React.createElement("div",{className:"googlesitekit-settings-notice"},React.createElement("div",{className:"googlesitekit-settings-notice__text"},o)),a&&0<n.length&&React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(O.__)("Error:","google-site-kit")," ",n)),React.createElement("div",{className:"googlesitekit-setup-module__action"},"account-connected"===j&&React.createElement(y.Fragment,null,React.createElement(_.a,{disabled:I,onClick:function(){N&&Object(v.v)(N.eventCategory,N.eventName),e.setState({isSaving:!0});var t=document.getElementById("enableAutoAds"),a=t&&t.checked;f.c.set(f.b,"adsense","setup-complete",{clientID:D,useSnippet:a}).then((function(){document.location=d})).catch((function(){e.setState({isSaving:!1})}))}},l),React.createElement(k.a,{isSaving:I})),"account-connected"!==j&&React.createElement(h.a,{className:"googlesitekit-setup-module__cta-link",external:!0,inherit:!0,href:d},l),E&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){S(E)}},E.continueText)),M&&React.createElement("div",{className:"googlesitekit-setup-module__sub-action"},React.createElement(h.a,{inherit:!0,onClick:function(){L()}},Object(O.__)("Back","google-site-kit")))),u&&React.createElement("p",{className:"googlesitekit-setup-module__footer-text"},u," ",p&&React.createElement(h.a,{href:R,inherit:!0,external:!0},p)," ",g)))}}]),t}(p.Component);t.default=R},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.AnalyticsAdSenseTopPagesTable")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(41),h=a(100),_=a(103),b=a(53),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(m.a,{title:Object(f.__)("Earnings","google-site-kit"),description:Object(f.__)("How much you’re earning from your content through AdSense.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")}),React.createElement(b.a,{slug:"adsense",context:"module-sitekit-dashboard"})),React.createElement(_.default,null),React.createElement(h.default,null))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(23),b=a(2),f=a(25),k=a(51),y=a(0),v=a(42),O=a(17),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={today:!1,period:!1,daily:!1},a}return g()(t,e),c()(t,[{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.period,n=e.daily;if(!(t&&a&&n&&a.totals))return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0})));var i=Object(v.reduceAdSenseData)(n.rows),o=Object(b.n)("googlesitekit-module-adsense",{}),c=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),s=!!c&&c.currency;return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-rpm",title:Object(y.__)("RPM","google-site-kit"),datapoint:Object(b.t)(a.totals[1],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,2),change:1,id:"adsense-rpm-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-earnings",title:Object(y.__)("Total Earnings","google-site-kit"),datapoint:Object(b.t)(a.totals[0],s),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},change:t.totals[0],changeDataUnit:"$",sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,1),change:1,id:"adsense-earnings-sparkline",loadSmall:!1}),context:"compact"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{className:"overview-adsense-impressions",title:Object(y.__)("Ad Impressions","google-site-kit"),datapoint:Object(b.t)(a.totals[2]),source:{name:Object(y._x)("AdSense","Service name","google-site-kit"),link:o},sparkline:n&&React.createElement(k.a,{data:Object(b.f)(i.dataMap,3),change:1,id:"adsense-impressions-sparkline",loadSmall:!1}),context:"compact"})))))))}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.period)return{period:a}}},{type:h.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month",dimensions:["DATE"]},priority:1,maxAge:Object(b.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.daily)return{daily:a}}}],React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(O.a,{className:"googlesitekit-dashboard-adsense-stats",fill:!0},React.createElement(_.a,{width:"100%",height:"276px",padding:!0}))),{inGrid:!0,createGrid:!0},v.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(23),_=a(2),b=a(19),f=a(9),k=a(42),y=a(0),v=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).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:""},a}return g()(t,e),c()(t,[{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,a=e.today,n=e.yesterday,i=e.sevenDays,o=e.month,c=e.twentyEightDays,s=e.sameDayLastWeek,r=e.prev7Days,l=e.monthLastYear,d=e.prev28Days;if(!(a&&n&&i&&o&&c&&s&&r&&l&&d))return null;var u=a.headers.find((function(e){return null!==e.currency&&0<e.currency.length})),g=!!u&&u.currency,p=a.totals?[{className:"googlesitekit-data-block--today",title:Object(y.__)("Today so far","google-site-kit"),datapoint:Object(_.t)(a.totals[0],g)},{className:"googlesitekit-data-block--yesterday",title:Object(y.__)("Yesterday","google-site-kit"),datapoint:Object(_.t)(n.totals[0],g),change:s.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--7days",title:Object(y.__)("Last 7 days","google-site-kit"),datapoint:Object(_.t)(i.totals[0],g),change:r.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--month",title:Object(y.__)("This month","google-site-kit"),datapoint:Object(_.t)(o.totals[0],g),change:l.totals[0],changeDataUnit:"%"},{className:"googlesitekit-data-block--28days",title:Object(y.__)("Last 28 days","google-site-kit"),datapoint:Object(_.t)(c.totals[0],g),change:d.totals[0],changeDataUnit:"%"}]:[];return t.renderLayout(p)}}],[{key:"renderLayout",value:function(e){return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(m.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}},{key:"renderPreviews",value:function(){for(var e=[],t=0;5>t;t++)e.push(React.createElement("div",{key:t,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 "},React.createElement(h.a,{width:"100%",height:"104px"})));return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},e))}}]),t}(p.Component);t.default=Object(b.a)(v,[{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"today"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.today)return{today:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"yesterday"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.yesterday)return{yesterday:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"same-day-last-week"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sameDayLastWeek)return{sameDayLastWeek:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-7-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.sevenDays)return{sevenDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-7-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev7Days)return{prev7Days:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.month)return{month:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"this-month-last-year"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.monthLastYear)return{monthLastYear:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:f.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(_.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],v.renderPreviews(),{createGrid:!0},k.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(9),h=a(25),_=a(23),b=a(2),f=a(42),k=a(19),y=a(0),v=a(11),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={twentyEightDays:!1,prev28Days:!1},a}return g()(t,e),c()(t,[{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.twentyEightDays,a=e.prev28Days,n=t.totals?[{className:"googlesitekit-data-block--page-rpm",title:Object(y.__)("Page RPM","google-site-kit"),datapoint:Object(b.t)(t.totals[1]),change:Object(v.isUndefined)(a.totals)?0:a.totals[1],changeDataUnit:"%"},{className:"googlesitekit-data-block--impression",title:Object(y.__)("Impressions","google-site-kit"),datapoint:Object(b.t)(t.totals[2]),change:Object(v.isUndefined)(a.totals)?0:a.totals[2],changeDataUnit:"%"}]:[];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},n.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(h.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))}))))}}]),t}(p.Component);t.default=Object(k.a)(O,[{type:m.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"last-28-days"},priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.twentyEightDays)return{twentyEightDays:a}}},{type:m.b,identifier:"adsense",datapoint:"earnings",data:{dateRange:"prev-28-days"},priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"],toState:function(e,t){var a=t.data;if(!e.prev28Days)return{prev28Days:a}}}],React.createElement(_.a,{width:"100%",height:"250px"}),{},f.isDataZeroAdSense)},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(13),m=a.n(p),h=a(7),_=a.n(h),b=a(1),f=a(44),k=a(47),y=a(17),v=a(0),O=a(104),R=a(105),E=a(72),S=a(101),j=a(55),w=a(45),D=a(31),C=a(75),x=a(42),N=a(53),A=a(73),P=a(43),L=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0,zeroData:!1,instructionProps:{}},a.handleDataError=a.handleDataError.bind(m()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(m()(a)),a.handleZeroData=a.handleZeroData.bind(m()(a)),a}return _()(t,e),r()(t,[{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(x.isAdsenseConnectedAnalytics)());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(x.propsFromAccountStatus)("account-connected-no-data");this.setState({zeroData:!0,loading:!1,instructionProps:e})}},{key:"render",value:function(){var e=this,t=this.state,a=t.receivingData,n=t.error,i=t.loading,o=t.isAdSenseConnected,c=t.zeroData,s=t.instructionProps,r=googlesitekit.modules.adsense.homepage,l=i||!a||c?"googlesitekit-nodata":"";return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement("div",{className:"".concat(l)},React.createElement(E.a,{module:"adsense"})),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},!n&&googlesitekit.modules.adsense.setupComplete?React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"connected",statusText:Object(v.__)("AdSense is connected","google-site-kit")}):React.createElement(k.a,{title:Object(v._x)("AdSense","Service name","google-site-kit"),icon:!0,iconWidth:"30",iconHeight:"26",iconID:"adsense",status:"not-connected",statusText:Object(v.__)("AdSense is not connected","google-site-kit")}),i&&React.createElement(D.a,null)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(y.a,{fill:!0},React.createElement("div",{className:"mdc-layout-grid mdc-layout-grid--fill"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(A.default,{ctaLink:s.ctaLink,ctaLinkText:s.ctaLinkText,header:s.statusHeadline,subHeader:s.statusMessage,incomplete:s.incomplete,required:s.required})))))),!a&&(n?Object(w.a)(Object(v._x)("AdSense","Service name","google-site-kit"),n,!0,!0,!0):Object(j.a)(Object(v._x)("AdSense","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(N.a,{slug:"adsense",context:"module-dashboard"}),React.createElement(y.a,{header:!0,title:Object(v.__)("Estimated earnings","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:r},React.createElement(O.default,{handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(y.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:r},React.createElement(R.default,{handleDataError:function(t){t||e.handleZeroData()}}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(l,"\n\t\t\t\t\t\t\t")},React.createElement(S.default,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(P.a,null))))),!o&&React.createElement(C.default,null))}}]),t}(b.Component);t.default=L},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(2),h=a(14),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.screenID,n=e.OriginalComponent,i=googlesitekit.modules.adsense.settings.accountStatus;return i&&"adsense"===t&&("account-pending-review"===i||"ads-display-pending"===i)?React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},Object(_.__)("Site Kit has placed the code on your site, ","google-site-kit"),React.createElement(h.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){var e=a||"googlesitekit-dashboard";window.location=Object(m.n)(e,{reAuth:!0,slug:t})},inherit:!0},Object(_.__)("check module page","google-site-kit"))):React.createElement(n,this.props)}}]),t}(p.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(20),h=a(0),_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.slug,a=e.context,n=e.OriginalComponent;if("adsense"!==t)return React.createElement(n,this.props);var i=googlesitekit.modules.adsense,o=i.active,c=i.setupComplete,s=Object(h.__)("Ad blocker detected, you need to disable it in order to setup AdSense.","google-site-kit");return o&&c&&(s=Object(h.__)("Ad blocker detected, You need to disable it to get the AdSense latest data.","google-site-kit")),googlesitekit.canAdsRun?React.createElement(n,this.props):React.createElement("div",{className:"googlesitekit-settings-module-warning googlesitekit-settings-module-warning--".concat(a)},React.createElement(m.a,{id:"error",height:"20",width:"23"})," ",s)}}]),t}(p.Component);t.default=_},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(29),b=a(0),f=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).renderAccountSetup=a.renderAccountSetup.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"renderAccountSetup",value:function(){if("no-account"===this.props.accountStatus)return React.createElement(_.a,{onClick:t.createNewAccount},Object(b.__)("Sign up for AdSense","google-site-kit"))}},{key:"render",value:function(){return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},this.renderAccountSetup()))}}],[{key:"createNewAccount",value:function(e){e.preventDefault();var t=googlesitekit.modules.adsense.signupURL;window.open(t,"_blank")}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(25),b=a(19),f=a(9),k=a(2),y=a(15),v=a(23),O=a(0);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}var E=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.totalSessions,i=t.totalUsersChange,o=t.totalSessionsChange;return React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-users",title:Object(O.__)("Total Users","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(_.a,{className:"overview-total-sessions",title:Object(O.__)("Total Sessions","google-site-kit"),datapoint:Object(k.t)(n),change:o,changeDataUnit:"%"})))}}]),t}(h.Component);t.default=Object(b.a)(E,[{type:f.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?R(a,!0).forEach((function(t){i()(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}({},y.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(k.p)("day"),context:"Adminbar"}],React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(v.a,{width:"auto",height:"59px"}))),{inGrid:!0},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(49),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(110),b=a(63),f=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:googlesitekit.modules.analytics.active?React.createElement(_.default,null):React.createElement(h.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-6-desktop "},React.createElement(b.a,null)))}}]),t}(h.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(41),h=a(17),_=a(0),b=a(76),f=a(66),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(m.a,{title:Object(_.__)("All Traffic","google-site-kit"),description:Object(_.__)("How people found your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-analytics-acquisition-sources",footer:!0,headerCtaLink:"https://analytics.google.com",headerCtaLabel:Object(_.__)("See full stats in Analytics","google-site-kit"),footerCtaLabel:Object(_._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"https://analytics.google.com"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(f.default,null)),React.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 "},React.createElement(b.default,null)))))))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(95),k=a(38),y=a(11),v=a(0),O=a(15),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=[{title:Object(v.__)("Source","google-site-kit"),primary:!0},{title:Object(v.__)("Percent","google-site-kit")}],a=e[0].data.totals[0].values[0],n=Object(y.map)(e[0].data.rows,(function(e,t){var n=e.metrics[0].values[0]/a*100;return!(1>n)&&[e.dimensions[0],React.createElement(p.Fragment,{key:"minichart-"+t},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")," ",React.createElement(f.a,{percent:n.toFixed(1),index:t})))]})),i=Object(b.b)(n,t,{hideHeader:!0,chartsEnabled:!0});return React.createElement("div",{className:"googlesitekit-alltraffic-widget"},React.createElement(b.a,null,i))}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.trafficSourcesReportDataDefaults,priority:1,maxAge:Object(_.p)("day"),context:"Dashboard"}],React.createElement(k.a,{rows:3,rowHeight:50}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(66),b=a(113),f=a(0),k=a(17),y=a(41),v=a(55),O=a(45),R=a(90),E=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={receivingData:!0,error:!1},a.handleDataError=a.handleDataError.bind(g()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(g()(a)),a}return m()(t,e),c()(t,[{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=googlesitekit.modules.analytics,t=e.active,a=e.setupComplete,n=this.state,i=n.error,o=n.receivingData;return t&&!a?Object(R.a)("analytics",!0,!0,!0):o?null:i?Object(O.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 e=this.state,t=e.error,a=e.receivingData,n=t||!a?"googlesitekit-nodata":"";return React.createElement(h.Fragment,null,React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t"},React.createElement(y.a,{timePeriod:Object(f.__)("Last 28 days","google-site-kit"),description:Object(f.__)("How people found your site.","google-site-kit"),title:Object(f.__)("All Traffic","google-site-kit")})),this.getErrorDataComponent(),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t".concat(n,"\n\t\t\t\t")},React.createElement(k.a,{className:"googlesitekit-dashboard-all-traffic"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(_.default,{source:!0,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess})),React.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 "},React.createElement(b.default,null)))))))}}]),t}(h.Component);t.default=E},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(17),k=a(38),y=a(11),v=a(0),O=a(15),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Page Title","google-site-kit"),tooltip:Object(v.__)("Page Title","google-site-kit"),primary:!0},{title:Object(v.__)("Earnings","google-site-kit"),tooltip:Object(v.__)("Earnings","google-site-kit")},{title:Object(v.__)("Page RPM","google-site-kit"),tooltip:Object(v.__)("Page RPM","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Impressions","google-site-kit")}],n=Object(y.map)(e[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(_.r)(e.metrics[0].values[2])]})),i=googlesitekit.modules.analytics.settings,o=i.accountID,c=i.internalWebPropertyID,s=i.profileID,r="https://analytics.google.com/analytics/web/?pli=1#/report/content-pages/a".concat(o,"w").concat(c,"p").concat(s,"/explorer-table.plotKeys=%5B%5D&_r.drilldown=analytics.pagePath:~2F"),l={hideHeader:!1,chartsEnabled:!1,links:Object(y.map)(e[0].data.rows,(function(e){var t=e.dimensions[1].replace(/\//g,"~2F");return r+t}))},d=Object(b.b)(n,a,l);return t.renderLayout(React.createElement(b.a,null,d))}}],[{key:"renderLayout",value:function(e){var t=googlesitekit.modules.adsense.accountURL;return React.createElement(f.a,{header:!0,title:Object(v.__)("Performance over previous 28 days","google-site-kit"),headerCtaLabel:Object(v.__)("Advanced Settings","google-site-kit"),headerCtaLink:t},e)}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"analytics",datapoint:"report",data:O.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(_.p)("day"),context:"Single"}],R.renderLayout(React.createElement(k.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&&googlesitekit.modules.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(v.__)("Unidentified error","google-site-kit"))}))},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(2),f=a(15),k=a(23),y=a(8),v=a.n(y),O=a(0),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(f.calculateOverviewData)(t);if(!i)return null;var o=i.totalUsers,c=i.totalSessions,s=i.averageBounceRate,r=i.averageSessionDuration,l=i.totalUsersChange,d=i.totalSessionsChange,u=i.averageBounceRateChange,g=i.averageSessionDurationChange,p=[{className:"googlesitekit-data-block--users googlesitekit-data-block--button-1",title:Object(O.__)("Users","google-site-kit"),datapoint:Object(b.t)(o),change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--sessions googlesitekit-data-block--button-2",title:Object(O.__)("Sessions","google-site-kit"),datapoint:Object(b.t)(c),change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--bounce googlesitekit-data-block--button-3",title:Object(O.__)("Bounce Rate","google-site-kit"),datapoint:Number(s).toFixed(2),change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n,datapointUnit:"%",reverseArrowDirection:!0},{className:"googlesitekit-data-block--duration googlesitekit-data-block--button-4",title:Object(O.__)("Session Duration","google-site-kit"),datapoint:Object(b.s)(r),change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},p.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(m.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection,datapointUnit:e.datapointUnit,reverseArrowDirection:e.reverseArrowDirection}))}))))}}]),t}(p.Component);R.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(R,[{type:_.b,identifier:"analytics",datapoint:"report",data:f.overviewReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:["Single","Dashboard"]}],React.createElement(k.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},f.isDataZeroForReporting,f.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(17),O=a(11),R=a(0),E=a(15),S=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,a=googlesitekit.admin.siteURL;if(!e||!e.length)return null;var n=[{title:Object(R.__)("Most popular content","google-site-kit"),primary:!0},{title:Object(R.__)("Views","google-site-kit")}],o=[],c=Object(O.map)(e[0].data.rows,(function(e,t){var n=i()(e.dimensions,2),c=n[0],s=n[1];return o[t]=a+s,[c,Object(f.r)(e.metrics[0].values[0])]})),s={hideHeader:!1,chartsEnabled:!1,links:o,showURLs:!0},r=Object(k.b)(c,n,s);return t.renderLayout(React.createElement(k.a,null,r))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(v.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(R._x)("Analytics","Service name","google-site-kit"),footerCtaLink:googlesitekit.modules.analytics.homepage,fill:!0},e))}}]),t}(h.Component);t.default=Object(_.a)(S,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(E.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],S.renderLayout(React.createElement(y.a,{padding:!0})),{inGrid:!0,createGrid:!0},E.isDataZeroForReporting)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(56),b=a(2),f=a(19),k=a(9),y=a(15),v=a(23),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.series,a=e.vAxes,n={chart:{title:""===googlesitekit.pageTitle?"":Object(O.__)("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 n.series=t,n.vAxes=a,n}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.dateRangeFrom;if(!t||!t.length)return null;var i=n?n.match(/\d+/).map(Number)[0]:28,o=Object(y.extractAnalyticsDashboardData)(t,a,i);if(!o)return null;var c=this.setOptions();return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{selectedStats:a,data:o,options:c}))))}}]),t}(h.Component);t.default=Object(f.a)(R,[{type:k.b,identifier:"analytics",datapoint:"report",data:y.siteAnalyticsReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:"Single"}],React.createElement(v.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(11),h=a(19),_=a(9),b=a(2),f=a(28),k=a(38),y=a(17),v=a(32),O=a(0),R=a(15),E=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(O.__)("Top Earning Pages","google-site-kit"),tooltip:Object(O.__)("Top Earning Pages","google-site-kit"),primary:!0},{title:Object(O.__)("Revenue","google-site-kit"),tooltip:Object(O.__)("Revenue","google-site-kit")}],n=[],i=Object(m.map)(e[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},c=Object(f.b)(i,a,o);return t.renderLayout(React.createElement(f.a,null,c))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",footer:!0,footerCtaLabel:Object(O._x)("Analytics","Service name","google-site-kit"),footerCtaLink:"http://analytics.google.com",fill:!0},e))}}]),t}(p.Component);t.default=Object(h.a)(E,[{type:_.b,identifier:"analytics",datapoint:"report",data:R.analyticsAdsenseReportDataDefaults,priority:1,maxAge:Object(b.p)("day"),context:"Dashboard"}],E.renderLayout(React.createElement(k.a,{rows:5,padding:!0})),{inGrid:!0,createGrid:!0},(function(){return!1}),(function(e){if(e&&e.error_data){var t=Object.values(e.error_data);if(t[0]&&"badRequest"===t[0].reason)return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(y.a,{className:"googlesitekit-top-earnings-pages",fill:!0},React.createElement(v.a,{title:Object(O.__)("Restricted metric(s)","google-site-kit"),description:Object(O.__)("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(e&&e.errors){var a=Object.values(e.errors);if(a[0]&&a[0][0])return a[0][0]}return!1}))},function(e,t,a){"use strict";a.r(t);var n=a(27),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(25),b=a(19),f=a(9),k=a(51),y=a(32),v=a(23),O=a(2),R=a(11),E=a(0),S=a(15);function j(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?j(a,!0).forEach((function(t){i()(e,t,a[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):j(a).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(a,t))}))}return e}var D=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={accounts:!1,goals:!1},a}return m()(t,e),r()(t,[{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.overview,a=e.extractedAnalytics,n=e.goals,i=googlesitekit.permaLink,o=Object(O.n)("googlesitekit-module-analytics",{}),c="",s="",r="",l="",d="",u="";return t&&(c=t.totalUsers,s=t.totalUsersChange,r=t.goalCompletions,l=t.goalCompletionsChange,d=t.averageBounceRate,u=t.averageBounceRateChange),React.createElement(h.Fragment,null,React.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 "},React.createElement(_.a,{className:"overview-total-users",title:Object(E.__)("Unique Visitors from Search","google-site-kit"),datapoint:Object(O.t)(c),change:s,changeDataUnit:"%",source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,1),change:s,id:"analytics-users-sparkline"})})),React.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 "},i&&React.createElement(_.a,{className:"overview-bounce-rate",title:Object(E.__)("Bounce Rate","google-site-kit"),datapoint:Number(d).toFixed(2),datapointUnit:Object(E.__)("%","google-site-kit"),change:u,changeDataUnit:"%",reverseArrowDirection:!0,source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,2),change:u,id:"analytics-sessions-sparkline"})}),!i&&n&&Object(R.isEmpty)(n.items)&&React.createElement(y.a,{title:Object(E.__)("Use goals to measure success.","google-site-kit"),description:Object(E.__)("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(E.__)("Create a new goal","google-site-kit")}),!i&&n&&!Object(R.isEmpty)(n.items)&&React.createElement(_.a,{className:"overview-goals-completed",title:Object(E.__)("Goals Completed","google-site-kit"),datapoint:Object(O.t)(r),change:l,changeDataUnit:"%",source:{name:Object(E._x)("Analytics","Service name","google-site-kit"),link:o},sparkline:a&&React.createElement(k.a,{data:Object(O.f)(a,3),change:l,id:"analytics-sessions-sparkline"})}),!i&&!n&&React.createElement(v.a,{width:"100%",height:"202px"})))}}]),t}(h.Component);t.default=Object(b.a)(D,[{type:f.b,identifier:"analytics",datapoint:"report",data:w({},S.overviewReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.overview)return{overview:Object(S.calculateOverviewData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"report",data:w({},S.siteAnalyticsReportDataDefaults,{url:googlesitekit.permaLink}),priority:1,maxAge:Object(O.p)("day"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.extractedAnalytics)return{extractedAnalytics:Object(S.extractAnalyticsDashboardSparklineData)(a)}}},{type:f.b,identifier:"analytics",datapoint:"goals",data:{url:googlesitekit.permaLink},priority:1,maxAge:Object(O.p)("hour"),context:"Dashboard",toState:function(e,t){var a=t.data;if(!e.goals)return{goals:a}}}],React.createElement(h.Fragment,null,React.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 "},React.createElement(v.a,{width:"100%",height:"202px"})),React.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 "},React.createElement(v.a,{width:"100%",height:"202px"}))),{inGrid:!0},(function(e,t){return"report"===t&&Object(S.isDataZeroForReporting)(e)}),S.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(11),O=a(8),R=a.n(O),E=a(0),S=a(15),j=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,a=e.data,n=e.colspan;if(!a||!a.length)return null;var o=[{title:Object(E.__)("Title","google-site-kit"),tooltip:Object(E.__)("Page Title","google-site-kit"),primary:!0},{title:Object(E.__)("Pageviews","google-site-kit"),tooltip:Object(E.__)("Pageviews","google-site-kit")},{title:Object(E.__)("Unique Pageviews","google-site-kit"),tooltip:Object(E.__)("Unique Pageviews","google-site-kit")},{title:Object(E.__)("Bounce Rate","google-site-kit"),tooltip:Object(E.__)("Bounce Rate","google-site-kit")}],c=[],s=Object(v.map)(a[0].data.rows,(function(e,a){var n=Number(e.metrics[0].values[2]),o=i()(e.dimensions,2),s=o[0],r=o[1];return c[a]=t.addDeepLink(r),[s,Object(f.r)(e.metrics[0].values[0]),Object(f.r)(e.metrics[0].values[1]),React.createElement(h.Fragment,{key:"minichart-"+a},React.createElement("div",{className:"googlesitekit-table__body-item-chart-wrap"},"".concat(n.toFixed(2),"%")))]})),r={hideHeader:!1,chartsEnabled:!1,links:c},l=Object(k.b)(s,o,r);return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-".concat(n)},React.createElement(k.a,null,l))}}],[{key:"addDeepLink",value:function(e){var t=googlesitekit.modules.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/"}}]),t}(h.Component);j.propTypes={data:R.a.array,colspan:R.a.number},j.defaultProps={data:null,colspan:12},t.default=Object(_.a)(j,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(S.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(y.a,{padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(13),m=a.n(p),h=a(7),_=a.n(h),b=a(1),f=a(44),k=a(0),y=a(118),v=a(121),O=a(116),R=a(76),E=a(17),S=a(47),j=a(66),w=a(72),D=a(31),C=a(55),x=a(45),N=a(75),A=a(42),P=a(2),L=a(43),M=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={selectedStats:[0],receivingData:!0,error:!1,loading:!0,isAdSenseConnected:!0},a.handleStatSelection=a.handleStatSelection.bind(m()(a)),a.buildSeries=a.buildSeries.bind(m()(a)),a.handleDataError=a.handleDataError.bind(m()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(m()(a)),a}return _()(t,e),r()(t,[{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.isAdsenseConnectedAnalytics)());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 e=this.state,t=e.selectedStats,a=e.error,n=e.receivingData,i=e.loading,o=e.isAdSenseConnected,c=this.buildSeries(),s=!i&&n?"":"googlesitekit-nodata",r=Object(P.i)();return React.createElement(b.Fragment,null,React.createElement(f.a,null),React.createElement(w.a,{module:"analytics"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--analytics"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(S.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")}),i&&React.createElement(D.a,null)),!n&&(a?Object(x.a)(Object(k._x)("Analytics","Service name","google-site-kit"),a,!0,!0,!0):Object(C.a)(Object(k._x)("Analytics","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,title:Object(k.sprintf)(Object(k.__)("Audience overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(k.__)("See full stats in Analytics","google-site-kit"),headerCtaLink:"http://analytics.google.com"},React.createElement(O.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(y.default,{selectedStats:t,series:c,vAxes:null,dateRangeFrom:r}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top content over the last %s","google-site-kit"),r),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"},React.createElement(v.default,null))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(E.a,{header:!0,footer:!0,title:Object(k.sprintf)(Object(k.__)("Top acquisition sources over the last %s","google-site-kit"),r),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"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(j.default,null)),React.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 "},React.createElement(R.default,null)))))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(L.a,null))))),!i&&!o&&React.createElement(N.default,null))}}]),t}(b.Component);t.default=M},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(91),h=a(25),_=a(32),b=a(19),f=a(9),k=a(2),y=a(15),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(y.calculateOverviewData)(e);if(!t)return null;var a=t.totalUsers,n=t.averageSessionDuration,i=t.totalUsersChange,o=t.averageSessionDurationChange;return React.createElement(p.Fragment,null,e.length?React.createElement(p.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-users",title:Object(v.__)("Total Unique Visitors","google-site-kit"),datapoint:Object(k.t)(a),change:i,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-average-session-duration",title:Object(v.__)("Avg. Time on Page","google-site-kit"),datapoint:Object(k.s)(n),change:o,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(_.a,{title:Object(v.__)("Analytics Gathering Data","google-site-kit"),description:Object(v.__)("Analytics data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(p.Component);t.default=Object(b.a)(O,[{type:f.b,identifier:"analytics",datapoint:"report",data:y.overviewReportDataDefaults,priority:1,maxAge:Object(k.p)("day"),context:["WPDashboard"]}],React.createElement(m.a,{width:"23%",height:"94px",count:2}),{},y.isDataZeroForReporting,y.getAnalyticsErrorMessageFromData)},function(e,t,a){"use strict";a.r(t);var n=a(61),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(2),k=a(28),y=a(38),v=a(11),O=a(0),R=a(15),E=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.data,t=googlesitekit.admin.siteURL;if(Object(R.isDataZeroForReporting)(e))return null;var a=[],n=Object(v.map)(e[0].data.rows,(function(e,n){var o=i()(e.dimensions,2),c=o[0],s=o[1];return a[n]=t+s,[c,Object(f.r)(e.metrics[0].values[0])]})),o=[{title:Object(O.__)("Title","google-site-kit"),tooltip:Object(O.__)("Page Title","google-site-kit"),primary:!0},{title:Object(O.__)("Pageviews","google-site-kit"),tooltip:Object(O.__)("Pageviews","google-site-kit")}],c={chartsEnabled:!0,links:a,cap:5,showURLs:!0},s=Object(k.b)(n,o,c);return React.createElement("div",{className:"googlesitekit-search-console-widget"},React.createElement("h2",{className:"googlesitekit-search-console-widget__title"},Object(O.__)("Top content over the last 28 days","google-site-kit")),React.createElement(k.a,null,s))}}]),t}(h.Component);t.default=Object(_.a)(E,[{type:b.b,identifier:"analytics",datapoint:"report",data:Object(R.getTopPagesReportDataDefaults)(),priority:1,maxAge:Object(f.p)("day"),context:"WPDashboard"}],React.createElement(y.a,{rows:6}))},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=(a(1),a(32)),c=a(9),s=a(54),r=a(2),l=a(0);t.default=function(){var e=googlesitekit.modules["pagespeed-insights"],t=e.active,a=e.setupComplete;if(!googlesitekit.permissions.canManageOptions&&!a)return null;return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(o.a,{title:!a&&t?Object(l.__)("Complete PageSpeed Insights activation.","google-site-kit"):Object(l.__)("Activate PageSpeed Insights.","google-site-kit"),description:Object(l.__)("Google PageSpeed Insights gives you metrics about performance, accessibility, SEO and PWA.","google-site-kit"),ctaLink:"#",ctaLabel:!a&&t?Object(l.__)("Complete activation","google-site-kit"):Object(l.__)("Activate PageSpeed Insights","google-site-kit"),onClick:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(r.a)(c.c,"pagespeed-insights",!0));case 3:window.location=Object(r.m)("pagespeed-insights"),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),Object(r.w)(s.a,{id:"pagespeed-insights-setup-error",title:Object(l.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 9:case"end":return e.stop()}}),null,null,[[0,6]])}}))}},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(60),b=a(31),f=a(45),k=a(0),y=a(93),v=a(64),O=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={loading:!0,error:!1},a.handleDataLoaded=a.handleDataLoaded.bind(g()(a)),a.handleDataError=a.handleDataError.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"handleDataLoaded",value:function(){this.setState({loading:!1})}},{key:"handleDataError",value:function(e){this.setState({error:e})}},{key:"render",value:function(){var e=this.state,t=e.loading,a=e.error,n={name:Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),link:Object(k.sprintf)("https://developers.google.com/speed/pagespeed/insights/?url=%s",googlesitekit.permaLink||googlesitekit.admin.siteURL)};return a?React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(f.a)(Object(k._x)("PageSpeed Insights","Service name","google-site-kit"),a,!0,!0,!1)):React.createElement(h.Fragment,null,t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-pagespeed-report__loading"},React.createElement(b.a,null),React.createElement("p",null,Object(k.__)("PageSpeed Insights is preparing data…","google-site-kit")))),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedMobile,{handleDataLoaded:this.handleDataLoaded,handleDataError:this.handleDataError,title:Object(k.__)("Mobile","google-site-kit")}),React.createElement(y.PageSpeedInsightsDashboardWidgetHomepageSpeedDesktop,{title:Object(k.__)("Desktop","google-site-kit")}),!t&&React.createElement(h.Fragment,null,React.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 "},React.createElement(_.a,{name:n.name,href:n.link,external:!0})),React.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 "},React.createElement(v.PageSpeedReportScale,null))))}}]),t}(h.Component);t.default=O},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.DashboardSpeed")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(127),h=a(17),_=a(41),b=a(0),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permaLink?Object(b.__)("How fast this page is.","google-site-kit"):Object(b.__)("How fast your home page is.","google-site-kit");return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(b.__)("Speed","google-site-kit"),description:e})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{className:"googlesitekit-pagespeed-report"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(m.default,null))))))}}]),t}(p.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(2),f=a(33),k=a(23),y=a(0),v=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||e.error)return null;var t=Object(f.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(m.a,{className:"overview-total-clicks",title:Object(y.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(m.a,{className:"overview-total-impressions",title:Object(y.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"})))}}]),t}(p.Component);t.default=Object(h.a)(v,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(b.p)("day"),context:"Adminbar"}],React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-3-desktop "},React.createElement(k.a,{width:"auto",height:"59px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(49),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(129),b=function(e){function t(){return c()(this,t),d()(this,g()(t).apply(this,arguments))}return m()(t,e),r()(t,[{key:"render",value:function(){return"undefined"!==i()(googlesitekit.permaLink)&&""===googlesitekit.permaLink?null:React.createElement(_.default,null)}}]),t}(h.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(41),h=a(17),_=a(0),b=a(77),f=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(m.a,{title:Object(_.__)("Top Queries","google-site-kit"),description:Object(_.__)("What people searched for to find your page.","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{footer:!0,footerCtaLabel:Object(_._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(_.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL)},React.createElement(b.default,null))))}}]),t}(p.Component);t.default=f},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(63),h=a(41),_=a(17),b=a(0),f=a(78),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{description:Object(b.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),title:Object(b.__)("Search Funnel","google-site-kit")})),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(_.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(f.default,null),!googlesitekit.modules.analytics.active&&React.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 "},React.createElement(m.a,null)))))))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(23),f=a(2),k=a(33),y=a(8),v=a.n(y),O=a(0),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats,n=e.handleStatSelection;if(!t||!t.length)return null;var i=Object(k.extractSearchConsoleDashboardData)(t),o=i.totalClicks,c=i.totalImpressions,s=i.averageCTR,r=i.averagePosition,l=i.totalClicksChange,d=i.totalImpressionsChange,u=i.averageCTRChange,g=i.averagePositionChange,h=[{className:"googlesitekit-data-block--clicks googlesitekit-data-block--button-1",title:Object(O.__)("Total Clicks","google-site-kit"),datapoint:o,change:l,changeDataUnit:"%",context:"button",selected:a.includes(0),handleStatSelection:n},{className:"googlesitekit-data-block--impressions googlesitekit-data-block--button-2",title:Object(O.__)("Total Impressions","google-site-kit"),datapoint:c,change:d,changeDataUnit:"%",context:"button",selected:a.includes(1),handleStatSelection:n},{className:"googlesitekit-data-block--ctr googlesitekit-data-block--button-3",title:Object(O.__)("Average CTR","google-site-kit"),datapoint:s+"%",change:u,changeDataUnit:"%",context:"button",selected:a.includes(2),handleStatSelection:n},{className:"googlesitekit-data-block--position googlesitekit-data-block--button-4",title:Object(O.__)("Average Position","google-site-kit"),datapoint:r,change:g,changeDataUnit:"%",context:"button",selected:a.includes(3),handleStatSelection:n}];return React.createElement(p.Fragment,null,React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner",role:"toolbar","aria-label":"Line Chart Options"},h.map((function(e,t){return React.createElement("div",{key:t,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 "},React.createElement(m.a,{stat:t,className:e.className,title:e.title,datapoint:e.datapoint,change:e.change,changeDataUnit:e.changeDataUnit,context:e.context,selected:e.selected,handleStatSelection:e.handleStatSelection}))})))))}}]),t}(p.Component);R.propTypes={handleDataError:v.a.func.isRequired},t.default=Object(h.a)(R,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.p)("day"),context:["Single","Dashboard"]}],React.createElement(b.a,{width:"100%",height:"190px",padding:!0}),{createGrid:!0},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(19),h=a(9),_=a(2),b=a(28),f=a(38),k=a(17),y=a(11),v=a(0),O=a(33),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var a=[{title:Object(v.__)("Top search queries for your site","google-site-kit"),tooltip:Object(v.__)("Most searched for keywords related to your content","google-site-kit"),primary:!0},{title:Object(v.__)("Clicks","google-site-kit"),tooltip:Object(v.__)("Number of times users clicked on your content in search results","google-site-kit")},{title:Object(v.__)("Impressions","google-site-kit"),tooltip:Object(v.__)("Counted each time your content appears in search results","google-site-kit")}],n=googlesitekit.admin.siteURL,i=[],o=Object(y.map)(e,(function(e,t){var a=e.keys[0];return i[t]=Object(v.sprintf)("https://search.google.com/search-console/performance/search-analytics?resource_id=%s&query=!%s&num_of_days=28",n,a),[a,Object(_.r)(e.clicks),Object(_.r)(e.impressions)]})),c={hideHeader:!1,chartsEnabled:!1,links:i},s=Object(b.b)(o,a,c);return t.renderLayout(React.createElement(b.a,null,s))}}],[{key:"renderLayout",value:function(e){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet "},React.createElement(k.a,{className:"googlesitekit-popular-content",footer:!0,footerCtaLabel:Object(v._x)("Search Console","Service name","google-site-kit"),footerCtaLink:Object(v.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL),fill:!0},e))}}]),t}(p.Component);t.default=Object(m.a)(R,[{type:h.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"query",limit:10},priority:1,maxAge:Object(_.p)("day"),context:["Dashboard"]}],R.renderLayout(React.createElement(f.a,{padding:!0})),{inGrid:!0,createGrid:!0},O.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(21),m=a(1),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.default=Object(p.a)("googlesitekit.DashboardPopularity")(h)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(135),h=a(41),_=a(0),b=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(h.a,{title:Object(_.__)("Popularity","google-site-kit"),description:Object(_.__)("Your most popular pages and how people found them from Search.","google-site-kit"),timePeriod:Object(_.__)("Last 28 days","google-site-kit")})),React.createElement(m.default,null))}}]),t}(p.Component);t.default=b},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(78),h=a(17),_=a(41),b=a(63),f=a(0),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=googlesitekit.permissions.canManageOptions,t=googlesitekit.modules.analytics.active||e?12:6;return React.createElement(p.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(_.a,{title:Object(f.__)("Search Funnel","google-site-kit"),description:Object(f.__)("How your site appeared in Search results and how many visitors you got from Search.","google-site-kit"),timePeriod:Object(f.__)("Last 28 days","google-site-kit")})),React.createElement("div",{className:"\n\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\tmdc-layout-grid__cell--span-".concat(t,"\n\t\t\t\t")},React.createElement(h.a,{className:"googlesitekit-analytics-search-funnel"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement(m.default,null),!googlesitekit.modules.analytics.active&&React.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 "},React.createElement(b.a,null)))))))}}]),t}(p.Component);t.default=k},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(19),b=a(9),f=a(56),k=a(23),y=a(2),v=a(33),O=a(0),R=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).setOptions=a.setOptions.bind(g()(a)),a}return m()(t,e),c()(t,[{key:"setOptions",value:function(){var e=this.props,t=e.selectedStats,a=e.series,n=e.vAxes,i={chart:{title:googlesitekit.pageTitle&&googlesitekit.pageTitle.length?Object(O.sprintf)(Object(O.__)("Search Traffic Summary for %s","google-site-kit"),Object(y.e)(googlesitekit.pageTitle)):Object(O.__)("Search 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,3<=t.length&&(i.vAxis.textPosition="none",i.vAxis.gridlines.color="#fff",i.vAxis.minorGridlines.color="#fff",i.vAxes={},i.chartArea.width="98%"),i}},{key:"render",value:function(){var e=this.props,t=e.data,a=e.selectedStats;if(!t||!t.length)return null;var n=this.setOptions(),i=Object(v.extractSearchConsoleDashboardData)(t);return React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(f.a,{selectedStats:a,data:i.dataMap,options:n,singleStat:!1}))))}}]),t}(h.Component);t.default=Object(_.a)(R,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(y.p)("day"),context:"Single"}],React.createElement(k.a,{width:"100%",height:"270px",padding:!0}),{createGrid:!0})},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(25),h=a(19),_=a(9),b=a(0),f=a(33),k=a(51),y=a(23),v=a(2),O=a(32),R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data,t=e.error;if(t)return Object(v.v)("plugin_setup","search_console_error",t.message),React.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 "},React.createElement(O.a,{title:Object(b.__)("Something went wrong","google-site-kit"),description:t.message,error:!0}));if(!e)return null;if(!e.length)return React.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 "},React.createElement(O.a,{title:Object(b.__)("Search Console Data Empty","google-site-kit"),description:Object(b.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""}));var a=Object(f.extractSearchConsoleDashboardData)(e),n=Object(v.n)("googlesitekit-module-search-console",{}),i=a.totalClicks,o=a.totalImpressions,c=a.totalClicksChange,s=a.totalImpressionsChange;return React.createElement(p.Fragment,null,React.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 "},React.createElement(m.a,{className:"overview-total-impressions",title:Object(b.__)("Impressions","google-site-kit"),datapoint:o,change:c,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:React.createElement(k.a,{data:Object(v.f)(a.dataMap,1),change:c,id:"search-console-impressions-sparkline"})})),React.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 "},React.createElement(m.a,{className:"overview-total-clicks",title:Object(b.__)("Clicks","google-site-kit"),datapoint:i,change:s,changeDataUnit:"%",source:{name:Object(b._x)("Search Console","Service name","google-site-kit"),link:n},sparkline:React.createElement(k.a,{data:Object(v.f)(a.dataMap,2),change:s,id:"search-console-clicks-sparkline"})})))}}]),t}(p.Component);t.default=Object(h.a)(R,[{type:_.b,identifier:"search-console",datapoint:"searchanalytics",data:{url:googlesitekit.permaLink,dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(v.p)("day"),context:["Single","Dashboard"]}],React.createElement(p.Fragment,null,React.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 "},React.createElement(y.a,{width:"100%",height:"202px"})),React.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 "},React.createElement(y.a,{width:"100%",height:"202px"}))),{inGrid:!0},f.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(13),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(44),b=a(0),f=a(138),k=a(77),y=a(133),v=a(47),O=a(17),R=a(72),E=a(31),S=a(55),j=a(45),w=a(2),D=a(43),C=function(e){function t(e){var a;return i()(this,t),(a=r()(this,d()(t).call(this,e))).state={selectedStats:[0,1],receivingData:!0,error:!1,loading:!0},a.handleStatSelection=a.handleStatSelection.bind(g()(a)),a.buildSeries=a.buildSeries.bind(g()(a)),a.buildVAxes=a.buildVAxes.bind(g()(a)),a.handleDataError=a.handleDataError.bind(g()(a)),a.handleDataSuccess=a.handleDataSuccess.bind(g()(a)),a}return m()(t,e),c()(t,[{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:"Clicks",1:"Impressions",2:"Average CTR",3:"Average Position"};return e.map((function(e){return{title:t[e]}}))}},{key:"render",value:function(){var e=this.state,t=e.selectedStats,a=e.receivingData,n=e.error,i=e.loading,o=this.buildSeries(),c=this.buildVAxes(),s=!i&&a?"":"googlesitekit-nodata",r=Object(w.i)(),l=Object(b.sprintf)("https://search.google.com/u/1/search-console?resource_id=%s",googlesitekit.admin.siteURL);return React.createElement(h.Fragment,null,React.createElement(_.a,null),React.createElement(R.a,{module:"search-console"}),React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--search-console"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(v.a,{title:Object(b._x)("Search Console","Service name","google-site-kit"),icon:!0,iconWidth:"23",iconHeight:"21",iconID:"search-console",status:"connected",statusText:Object(b.__)("Search Console is connected","google-site-kit")}),i&&React.createElement(E.a,null)),!a&&(n?Object(j.a)(Object(b._x)("Search Console","Service name","google-site-kit"),n,!0,!0,!0):Object(S.a)(Object(b._x)("Search Console","Service name","google-site-kit"),!0,!0,!0)),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(O.a,{header:!0,title:Object(b.sprintf)(Object(b.__)("Overview for the last %s","google-site-kit"),r),headerCtaLabel:Object(b.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l},React.createElement(y.default,{selectedStats:t,handleStatSelection:this.handleStatSelection,handleDataError:this.handleDataError,handleDataSuccess:this.handleDataSuccess}),React.createElement(f.default,{selectedStats:t,series:o,vAxes:c}))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-12\n\t\t\t\t\t\t\t\t".concat(s,"\n\t\t\t\t\t\t\t")},React.createElement(O.a,{title:Object(b.sprintf)(Object(b.__)("Top search queries over the last %s","google-site-kit"),r),header:!0,footer:!0,headerCtaLabel:Object(b.__)("See full stats in Search Console","google-site-kit"),headerCtaLink:l,footerCtaLabel:Object(b._x)("Search Console","Service name","google-site-kit"),footerCtaLink:l},React.createElement(k.default,null))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(D.a,null))))))}}]),t}(h.Component);t.default=C},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(142),h=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement(m.default,null))}}]),t}(p.Component);t.default=h},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(91),h=a(25),_=a(19),b=a(9),f=a(2),k=a(33),y=a(32),v=a(0),O=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.data;if(!e||!e.length)return null;var t=Object(k.extractSearchConsoleDashboardData)(e),a=t.totalClicks,n=t.totalImpressions,i=t.totalClicksChange,o=t.totalImpressionsChange;return React.createElement(p.Fragment,null,e.length?React.createElement(p.Fragment,null,React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-impressions",title:Object(v.__)("Total Impressions","google-site-kit"),datapoint:n,change:o,changeDataUnit:"%"}),React.createElement(h.a,{className:"googlesitekit-wp-dashboard-stats__data-table overview-total-clicks",title:Object(v.__)("Total Clicks","google-site-kit"),datapoint:a,change:i,changeDataUnit:"%"})):React.createElement("div",{className:"googlesitekit-wp-dashboard-stats__cta"},React.createElement(y.a,{title:Object(v.__)("Search Console Data Empty","google-site-kit"),description:Object(v.__)("Search Console data is not yet available, please check back later.","google-site-kit"),ctaLink:"",ctaLabel:""})))}}]),t}(p.Component);t.default=Object(_.a)(O,[{type:b.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(f.p)("day"),context:["WPDashboard"]}],React.createElement(m.a,{width:"23%",height:"94px",count:2}),{},k.isDataZeroSearchConsole)},function(e,t,a){"use strict";a.r(t);var n=a(3),i=a.n(n),o=a(4),c=a.n(o),s=a(5),r=a.n(s),l=a(6),d=a.n(l),u=a(7),g=a.n(u),p=a(1),m=a(0),h=googlesitekit.admin.siteURL,_=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return g()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-item-type"},Object(m.__)("Connected URL","google-site-kit")),React.createElement("div",{className:"googlesitekit-settings-module__meta-item-data"},h))}}]),t}(p.Component);t.default=_},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(e,t,a){a(73),a(98),a(100),a(101),a(102),a(75),a(104),a(103),a(105),a(106),a(191),a(107),a(108),a(74),a(99),a(192),a(109),a(42),a(110),a(111),a(112),a(113),a(66),a(114),a(115),a(116),a(117),a(118),a(76),a(119),a(120),a(121),a(122),a(193),a(96),a(15),a(123),a(124),a(197),a(92),a(125),a(93),a(126),a(127),a(128),a(64),a(198),a(129),a(130),a(131),a(132),a(77),a(133),a(134),a(135),a(136),a(78),a(137),a(138),a(139),a(140),a(33),a(207),a(143),a(142),a(141),a(200),e.exports=a(94)},,,,function(e,t,a){"use strict";a.r(t);a(1);var n=a(24),i=a(2),o=a(106),c=a(102),s=a(74),r=a(98),l=a(107),d=a(108),u=a(10),g="adsense";if(Object(u.addFilter)("googlesitekit.ModuleSettingsWarning","googlesitekit.adsenseSettingsWarning",Object(i.g)(d.default,{})),Object(u.addFilter)("googlesitekit.SetupModuleShowLink","googlesitekit.adsenseSetupModuleShowLink",(function(e,t){return!("adsense"===t&&!googlesitekit.canAdsRun)&&e})),googlesitekit.modules.adsense.active){var p=Object(n.a)(React.createElement(o.default,null)),m=Object(n.a)(React.createElement(c.default,null));if(googlesitekit.modules[g].setupComplete)Object(u.addFilter)("googlesitekit.ModuleApp-".concat(g),"googlesitekit.ModuleApp",p),Object(u.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardEarningModule",m,50);else{var h=googlesitekit.admin,_=h.reAuth,b=h.currentScreen,f=b?b.id:null;_||"site-kit_page_googlesitekit-module-adsense"!==f||(window.location=Object(i.n)("googlesitekit-module-".concat(g),{reAuth:!0,slug:g})),Object(u.addFilter)("googlesitekit.Connected-".concat(g),"googlesitekit.AdSenseModuleConnected",(function(e){var t=googlesitekit.modules[g].settings;return!(e||void 0===t||"account-pending-review"!==t.accountStatus&&"ads-display-pending"!==t.accountStatus)||e}))}Object(u.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(g),"googlesitekit.AdSenseModuleSettingsDetails",Object(i.g)(s.default,{onSettingsPage:!0})),Object(u.addFilter)("googlesitekit.ModuleSetup-".concat(g),"googlesitekit.TagmanagerModuleSetupWizard",Object(i.g)(r.default,{onSettingsPage:!1})),Object(u.addFilter)("googlesitekit.autoRefreshModules","googlesitekit.AdSenseAutoRefresh",(function(e){return e.push({identifier:"adsense",toRefresh:function(){var e="";return googlesitekit.modules.adsense&&googlesitekit.modules.adsense["account-status"]&&(e=googlesitekit.modules.adsense["account-status"].accountStatus),!(e&&-1<e.indexOf("account-connected"))}}),e})),Object(u.addFilter)("googlesitekit.ModulesNotificationsRequest","googlesitekit.adsenseNotifications",(function(e){return e.push({identifier:"adsense"}),e})),Object(u.addFilter)("googlesitekit.ModuleSetupIncomplete","googlesitekit.adsenseSettingStatus",Object(i.g)(l.default,{}))}},function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),o=a(3),c=a.n(o),s=a(4),r=a.n(s),l=a(5),d=a.n(l),u=a(6),g=a.n(u),p=a(7),m=a.n(p),h=a(1),_=a(9),b=a(109),f=a(62),k=a(0),y=function(e){function t(e){var a;return c()(this,t),(a=d()(this,g()(t).call(this,e))).state={isLoading:!0,error:!1,message:"",accounts:[],accountStatus:""},a}return m()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isOpen;e.onSettingsPage&&!t||this.getAccounts()}},{key:"getAccounts",value:function(){var e,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(_.c.get(_.b,"adsense","accounts"));case 3:e=n.sent,t="",e&&e.length||(t="no-account"),a=e,this.setState({isLoading:!1,accountStatus:t,accounts:a,error:!1}),n.next=13;break;case 10:n.prev=10,n.t0=n.catch(0),this.setState({isLoading:!1,error:n.t0.code,message:n.t0.message});case 13:case"end":return n.stop()}}),null,this,[[0,10]])}},{key:"renderErrorMessage",value:function(){var e=this.state,t=e.error,a=e.message;return t&&0<a.length?React.createElement("div",{className:"googlesitekit-error-text"},React.createElement("p",null,Object(k.__)("Error:","google-site-kit")," ",a)):null}},{key:"render",value:function(){var e=this.state,t=e.isLoading,a=e.accounts,n=e.accountStatus;return React.createElement(h.Fragment,null,React.createElement("div",{className:"googlesitekit-module-page googlesitekit-module-page--adsense"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t?React.createElement(f.a,{isSaving:t}):React.createElement(b.default,{accountStatus:n,accounts:a}),t?null:this.renderErrorMessage()))))}}]),t}(h.Component);t.default=y},function(e,t,a){"use strict";a.r(t);a(1);var n=a(2),i=a(24),o=a(122),c=a(111),s=a(114),r=a(120),l=a(123),d=a(112),u=a(124),g=a(115),p=a(117),m=a(119),h=a(96),_=a(10),b="analytics",f=Object(i.a)(React.createElement(c.default,null));if(Object(_.addFilter)("googlesitekit.AdminbarModules","googlesitekit.Analytics",f,11),!googlesitekit.modules[b].setupComplete){var k=googlesitekit.admin,y=k.reAuth,v=k.currentScreen,O=v?v.id:null;y||"site-kit_page_googlesitekit-module-analytics"!==O||(window.location=Object(n.n)("googlesitekit-module-".concat(b),{reAuth:!0,slug:b}))}if(googlesitekit.modules.analytics.active){var R=Object(i.a)(React.createElement(o.default,null)),E=Object(i.a)(React.createElement(s.default,null)),S=Object(i.a)(React.createElement(l.default,null)),j=Object(i.a)(React.createElement(u.default,null)),w=Object(i.a)(React.createElement(r.default,null)),D=Object(i.a)(React.createElement(d.default,null)),C=Object(i.a)(React.createElement(g.default,null)),x=Object(i.a)(React.createElement(p.default,null)),N=Object(i.a)(React.createElement(m.default,null));Object(_.addFilter)("googlesitekit.DashboardModule","googlesitekit.Analytics",E,9),Object(_.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.Analytics",w,11),Object(_.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.Analytics",x,20),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTableSmall","googlesitekit.Analytics",N,20),Object(_.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.Analytics",D,20),Object(_.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.Analytics",S),Object(_.addFilter)("googlesitekit.WPDashboardModule","googlesitekit.Analytics",j),Object(_.addFilter)("googlesitekit.ModuleApp-"+b,"googlesitekit.Analytics",R),Object(_.addFilter)("googlesitekit.AnalyticsAdSenseTopPagesTable","googlesitekit.Analytics",C,11),Object(_.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(b),"googlesitekit.AnalyticsModuleSettingsDetails",Object(n.g)(h.default,{onSettingsPage:!0})),Object(_.addFilter)("googlesitekit.showDateRangeSelector-".concat(b),"googlesitekit.analyticsShowDateRangeSelector",(function(){return!0})),Object(_.addFilter)("googlesitekit.ModuleSetup-".concat(b),"googlesitekit.AnalyticsModuleSetupWizard",Object(n.g)(h.default,{onSettingsPage:!1}))}},,,,function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(92),o=a(10),c=a(0),s="optimize";googlesitekit.modules.optimize.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(s),"googlesitekit.OptimizeModuleSettingsDetails",Object(n.g)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat(s),"googlesitekit.OptimizeModuleSetupWizard",Object(n.g)(i.default,{onSettingsPage:!1})),Object(o.addFilter)("googlesitekit.SetupWinNotification-".concat(s),"googlesitekit.OptimizeSetupWinNotification",(function(e){return e.description=Object(c.__)("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})))},function(e,t,a){"use strict";a.r(t);a(1);var n=a(24),i=a(128),o=a(126),c=a(125),s=a(10),r=googlesitekit.modules["pagespeed-insights"],l=r.active,d=r.setupComplete;if(l&&d){var u=Object(n.a)(React.createElement(i.default,null)),g=Object(n.a)(React.createElement(o.default,null));Object(s.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",u,45),Object(s.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.PageSpeedInsights",u,45),Object(s.addFilter)("googlesitekit.DashboardSpeed","googlesitekit.PageSpeedInsightsHomepageSpeed",g)}else{var p=Object(n.a)(React.createElement(c.default,null));Object(s.addFilter)("googlesitekit.DashboardModule","googlesitekit.PageSpeedInsights",p,45)}},,function(e,t,a){"use strict";a.r(t);var n=a(2),i=a(94),o=a(10);googlesitekit.modules.tagmanager.active&&(Object(o.addFilter)("googlesitekit.ModuleSettingsDetails-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSettingsDetails",Object(n.g)(i.default,{onSettingsPage:!0})),Object(o.addFilter)("googlesitekit.ModuleSetup-".concat("tagmanager"),"googlesitekit.TagmanagerModuleSetupWizard",Object(n.g)(i.default,{onSettingsPage:!1})))},,,,,,,function(e,t,a){"use strict";a.r(t);var n=a(1),i=a(140),o=a(130),c=a(141),s=a(137),r=a(139),l=a(131),d=a(134),u=a(132),g=a(136),p=a(12),m=a.n(p),h=a(3),_=a.n(h),b=a(4),f=a.n(b),k=a(5),y=a.n(k),v=a(6),O=a.n(v),R=a(13),E=a.n(R),S=a(7),j=a.n(S),w=a(11),D=a(170),C=a.n(D),x=a(9),N=a(29),A=a(17),P=a(2),L=a(0),M=function(e){function t(e){var a;return _()(this,t),(a=y()(this,O()(t).call(this,e))).state={isSearching:!1,results:[],error:!1,message:""},a.postSearch=a.postSearch.bind(E()(a)),a.onClick=a.onClick.bind(E()(a)),a.onConfirm=a.onConfirm.bind(E()(a)),a}return j()(t,e),f()(t,[{key:"postSearch",value:function(e,t){var a;return m.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return t([Object(L.__)("Loading...","google-site-kit")]),n.prev=1,n.next=4,m.a.awrap(x.c.get(x.a,"search","post-search",{query:encodeURIComponent(e)}));case 4:0<(a=n.sent).length?t(Object(w.map)(a,(function(e){return e.post_title}))):t([Object(L.__)("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(L.__)("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(w.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(w.find)(t,(function(e){return e.post_title===a}));document.location=Object(P.n)("googlesitekit-dashboard",{id:n.id,permaLink:n.permalink,pageTitle:a})}},{key:"render",value:function(){var e=googlesitekit.modules,t=e.analytics&&e.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 React.createElement("div",{className:t},React.createElement(A.a,{title:Object(L.__)("Search for individual page or post information","google-site-kit"),header:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement("div",{className:"googlesitekit-post-searcher"},React.createElement("label",{className:"googlesitekit-post-searcher__label",htmlFor:"autocomplete"},Object(L.__)("Title or URL","google-site-kit")),React.createElement(C.a,{id:"autocomplete",source:Object(w.debounce)(this.postSearch,200),minLength:2,onConfirm:this.onConfirm,showNoOptionsFound:!1}),React.createElement("div",{className:"googlesitekit-post-searcher__button-wrapper"},React.createElement(N.a,{onClick:this.onClick,className:"googlesitekit-post-searcher__button"},Object(L.__)("View Data","google-site-kit")))))))))}}]),t}(n.Component),I=a(143),F=a(24),T=a(10),U="search-console",z=Object(F.a)(React.createElement(i.default,null)),q=Object(F.a)(React.createElement(o.default,null)),W=Object(F.a)(React.createElement(c.default,null)),G=Object(F.a)(React.createElement(s.default,null)),H=Object(F.a)(React.createElement(r.default,null)),B=Object(F.a)(React.createElement(u.default,null)),K=Object(F.a)(React.createElement(l.default,null)),Y=Object(F.a)(React.createElement(d.default,null)),V=Object(F.a)(React.createElement(g.default,null)),Z=Object(F.a)(React.createElement(M,null));Object(T.addFilter)("googlesitekit.ModuleSettingsDetails-".concat(U),"googlesitekit.SearchConsoleModuleSettingsDetails",Object(P.g)(I.default,{onSettingsPage:!0})),Object(T.addFilter)("googlesitekit.DashboardModule","googlesitekit.SearchConsole",G,11),Object(T.addFilter)("googlesitekit.DashboardModule","googlesitekit.DashboardPopularityModule",V,40),Object(T.addFilter)("googlesitekit.DashboardSearchFunnel","googlesitekit.SearchConsoleSearchFunnel",H),Object(T.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",B),Object(T.addFilter)("googlesitekit.DashboardDetailsModule","googlesitekit.SearchConsole",K,40),Object(T.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.SearchConsoleDashboardPopularity",Y),Object(T.addFilter)("googlesitekit.DashboardPopularity","googlesitekit.DashboardPPostSearcherModule",Z,30),Object(T.addFilter)("googlesitekit.WPDashboardHeader","googlesitekit.SearchConsole",W,11),Object(T.addFilter)("googlesitekit.ModuleApp-"+U,"googlesitekit.ModuleApp",z),Object(T.addFilter)("googlesitekit.showDateRangeSelector-".concat(U),"googlesitekit.searchConsoleShowDateRangeSelector",(function(){return!0})),Object(T.addFilter)("googlesitekit.AdminbarModules","googlesitekit.SearchConsole",q)}]);
dist/assets/js/chunk-googlesitekit-setup-wizard-proxy.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{144:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(13),m=n.n(u),g=n(7),h=n.n(g),p=n(1),f=n(22),k=n(8),_=n.n(k),v=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).formFieldRef=Object(p.createRef)(),n.checkboxRef=Object(p.createRef)(),n}return h()(t,e),l()(t,[{key:"componentDidMount",value:function(){new f.e(this.formFieldRef.current).input=new f.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,n=e.id,a=e.name,i=e.value,o=e.checked,l=e.disabled,c=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(l?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:n,name:a,value:i,checked:o,disabled:l,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:n},c))}}]),t}(p.Component);v.propTypes={onChange:_.a.func.isRequired,id:_.a.string.isRequired,name:_.a.string.isRequired,value:_.a.string.isRequired,checked:_.a.bool,disabled:_.a.bool,children:_.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var y=v,b=n(35),R=n.n(b),E=n(0),C=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},n.handleOptIn=n.handleOptIn.bind(m()(n)),n}return h()(t,e),l()(t,[{key:"handleOptIn",value:function(e){var t=this,n=e.target.checked,a={googlesitekit_tracking_optin:n};R()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(a),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!n,n&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!n,error:!1,scriptOnPage:!0})})).catch((function(n){t.setState({optIn:!e.target.checked,error:{errorCode:n.code,errorMsg:n.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,n=e.error,a=this.props,i=a.id,o=a.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(y,{id:i,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),n&&React.createElement("div",{className:"googlesitekit-error-text"},n.errorMsg))}}]),t}(p.Component);C.propTypes={id:_.a.string,name:_.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C},146:function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var a=n(12),i=n.n(a),o=n(3),l=n.n(o),c=n(4),r=n.n(c),s=n(5),d=n.n(s),u=n(6),m=n.n(u),g=n(13),h=n.n(g),p=n(7),f=n.n(p),k=n(1),_=n(9),v=n(2),y=n(67),b=n(0),R=n(14),E=n(80),C=function(e){function t(e){var n;return l()(this,t),(n=d()(this,m()(t).call(this,e))).state={dialogActive:!1},n.handleDialog=n.handleDialog.bind(h()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(h()(n)),n.handleCloseModal=n.handleCloseModal.bind(h()(n)),n}return f()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(_.c.set(_.a,"site","reset"));case 2:Object(v.d)(),this.handleDialog(),document.location=Object(v.n)("googlesitekit-splash",{notification:"reset_success"});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 React.createElement(k.Fragment,null,React.createElement(R.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(b.__)("Reset Site Kit","google-site-kit")),React.createElement(E.a,null,React.createElement(y.a,{dialogActive:n,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:[]})))}}]),t}(k.Component)},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(14),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.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 "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(g.Component);k.propTypes={title:p.a.string,ctaLabel:p.a.string,ctaLink:p.a.string},k.defaultProps={title:"",ctaLabel:"",ctaLink:""};var _=k,v=n(60),y=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(g.Component);y.propTypes={ctaLabel:p.a.string,ctaLink:p.a.string};var b=y,R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,l=e.headerCtaLink,c=e.footerCtaLabel,r=e.footerCtaLink,s=e.footerContent,d=e.className,u=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(d&&d,"\n\t\t\t\t").concat(u?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(_,{title:i,ctaLabel:o,ctaLink:l}),a,n&&React.createElement(b,{ctaLabel:c,ctaLink:r,footerContent:s}))}}]),t}(g.Component);R.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},R.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=R},209:function(e,t,n){"use strict";n.r(t);var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(43),p=n(29),f=n(146),k=n(17),_=n(26),v=n(144),y=n(2),b=n(11),R=n(0),E=n(36),C=function(e){function t(e){var n;i()(this,t),n=r()(this,d()(t).call(this,e));var a=googlesitekit.admin,o=a.proxySetupURL,l=a.siteURL,c=googlesitekit.setup,s=c.isSiteKitConnected,u=c.isResettable,m=c.errorMessage,g=googlesitekit.permissions.canSetup;return n.state={canSetup:g,errorMessage:m,isSiteKitConnected:s,isResettable:u,completeSetup:!1,proxySetupURL:o,resetSuccess:"reset_success"===Object(E.getQueryArg)(location.href,"notification"),context:Object(E.getQueryArg)(location.href,"googlesitekit_context"),siteHostname:new URL(l).hostname},n}return m()(t,e),l()(t,[{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 e=Object(y.n)("googlesitekit-dashboard",{notification:"authentication_success"});Object(b.delay)((function(){window.location.replace(e)}),500,"later")}var t=this.state,n=t.context,a=t.errorMessage,i=t.isResettable,o=t.proxySetupURL,l=t.resetSuccess,c=t.siteHostname,r="revoked"===n;return React.createElement(g.Fragment,null,React.createElement(h.a,null),a&&React.createElement(_.a,{id:"setup_error",type:"win-error",title:Object(R.__)("Oops! There was a problem during set up. Please try again.","google-site-kit"),description:a,isDismissable:!1}),l&&React.createElement(_.a,{id:"reset_success",title:Object(R.__)("Site Kit by Google was successfully reset.","google-site-kit"),isDismissable:!1}),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},r?React.createElement(g.Fragment,null,React.createElement("h1",{className:"googlesitekit-setup__title"},Object(R.sprintf)(
2
  /* translators: %s is the site's hostname. (e.g. example.com) */
3
- Object(R.__)("You revoked access to Site Kit for %s","google-site-kit"),c)),React.createElement("p",{className:"googlesitekit-setup__description"},Object(R.__)('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"))):React.createElement(g.Fragment,null,React.createElement("h1",{className:"googlesitekit-setup__title"},Object(R.__)("The Site Kit plugin is active but requires setup","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup__description"},Object(R.__)("Site Kit Service will guide you through 3 simple setup steps.","google-site-kit"))),React.createElement(v.a,null),React.createElement(p.a,{className:"googlesitekit-start-setup",href:o,onClick:function(){Object(y.v)("plugin_setup","proxy_start_setup_landing_page")}},Object(R.__)("Start setup","google-site-kit")),i&&React.createElement(f.a,null))))))))))))}}]),t}(g.Component);t.default=C},43:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(21),p=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),k=n(81),_=n(12),v=n.n(_),y=n(13),b=n.n(y),R=n(67),E=n(29),C=n(22),w=n(8),N=n.n(w),O=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.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 e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);O.propTypes={menuOpen:N.a.bool.isRequired,menuItems:N.a.array.isRequired,id:N.a.string.isRequired};var j=O,S=n(80),L=n(2),D=n(0),M=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(b()(n)),n.handleMenuClose=n.handleMenuClose.bind(b()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(b()(n)),n.handleDialog=n.handleDialog.bind(b()(n)),n.handleDialogClose=n.handleDialogClose.bind(b()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(b()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),l()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);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 v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.d)(),document.location=Object(L.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,l=e.proxyPermissionsURL,c=this.state,r=c.dialogActive,s=c.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(D.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:s,ariaControls:"user-menu"},a),React.createElement(j,{ref:this.menuRef,menuOpen:s,menuItems:[Object(D.__)("Disconnect","google-site-kit")].concat(l?[Object(D.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(S.a,null,React.createElement(R.a,{dialogActive:r,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(D.__)("Disconnect","google-site-kit"),subtitle:Object(D.__)("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(D.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),x=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(k.a,null)),React.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 "},e&&React.createElement(M,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=x},67:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(29),k=n(14),_=n(22),v=n(145),y=n.n(v),b=n(0),R=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).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.createRef)(),e}return m()(t,e),l()(t,[{key:"componentDidMount",value:function(){new _.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,l=e.subtitle,c=e.confirmButton,r=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(y.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),l&&React.createElement("p",{className:"mdc-dialog__lead"},l),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),r&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(b.__)("Note: ","google-site-kit")),r),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},c||Object(b.__)("Disconnect","google-site-kit")),React.createElement(k.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(b.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);R.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},R.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=R},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),l()(t,[{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)}}]),t}(g.Component)}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[6],{144:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(13),m=n.n(u),g=n(7),h=n.n(g),p=n(1),f=n(22),k=n(8),_=n.n(k),v=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).formFieldRef=Object(p.createRef)(),n.checkboxRef=Object(p.createRef)(),n}return h()(t,e),l()(t,[{key:"componentDidMount",value:function(){new f.e(this.formFieldRef.current).input=new f.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,n=e.id,a=e.name,i=e.value,o=e.checked,l=e.disabled,c=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(l?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:n,name:a,value:i,checked:o,disabled:l,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:n},c))}}]),t}(p.Component);v.propTypes={onChange:_.a.func.isRequired,id:_.a.string.isRequired,name:_.a.string.isRequired,value:_.a.string.isRequired,checked:_.a.bool,disabled:_.a.bool,children:_.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var y=v,b=n(35),R=n.n(b),E=n(0),C=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},n.handleOptIn=n.handleOptIn.bind(m()(n)),n}return h()(t,e),l()(t,[{key:"handleOptIn",value:function(e){var t=this,n=e.target.checked,a={googlesitekit_tracking_optin:n};R()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(a),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!n,n&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!n,error:!1,scriptOnPage:!0})})).catch((function(n){t.setState({optIn:!e.target.checked,error:{errorCode:n.code,errorMsg:n.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,n=e.error,a=this.props,i=a.id,o=a.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(y,{id:i,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),n&&React.createElement("div",{className:"googlesitekit-error-text"},n.errorMsg))}}]),t}(p.Component);C.propTypes={id:_.a.string,name:_.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C},146:function(e,t,n){"use strict";n.d(t,"a",(function(){return C}));var a=n(12),i=n.n(a),o=n(3),l=n.n(o),c=n(4),r=n.n(c),s=n(5),d=n.n(s),u=n(6),m=n.n(u),g=n(13),h=n.n(g),p=n(7),f=n.n(p),k=n(1),_=n(9),v=n(2),y=n(67),b=n(0),R=n(14),E=n(80),C=function(e){function t(e){var n;return l()(this,t),(n=d()(this,m()(t).call(this,e))).state={dialogActive:!1},n.handleDialog=n.handleDialog.bind(h()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(h()(n)),n.handleCloseModal=n.handleCloseModal.bind(h()(n)),n}return f()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(_.c.set(_.a,"site","reset"));case 2:Object(v.d)(),this.handleDialog(),document.location=Object(v.n)("googlesitekit-splash",{notification:"reset_success"});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 React.createElement(k.Fragment,null,React.createElement(R.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(b.__)("Reset Site Kit","google-site-kit")),React.createElement(E.a,null,React.createElement(y.a,{dialogActive:n,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:[]})))}}]),t}(k.Component)},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(14),k=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.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 "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(g.Component);k.propTypes={title:p.a.string,ctaLabel:p.a.string,ctaLink:p.a.string},k.defaultProps={title:"",ctaLabel:"",ctaLink:""};var _=k,v=n(60),y=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(g.Component);y.propTypes={ctaLabel:p.a.string,ctaLink:p.a.string};var b=y,R=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,l=e.headerCtaLink,c=e.footerCtaLabel,r=e.footerCtaLink,s=e.footerContent,d=e.className,u=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(d&&d,"\n\t\t\t\t").concat(u?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(_,{title:i,ctaLabel:o,ctaLink:l}),a,n&&React.createElement(b,{ctaLabel:c,ctaLink:r,footerContent:s}))}}]),t}(g.Component);R.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},R.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=R},209:function(e,t,n){"use strict";n.r(t);var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(44),p=n(29),f=n(146),k=n(17),_=n(26),v=n(144),y=n(2),b=n(11),R=n(0),E=n(36),C=function(e){function t(e){var n;i()(this,t),n=r()(this,d()(t).call(this,e));var a=googlesitekit.admin,o=a.proxySetupURL,l=a.siteURL,c=googlesitekit.setup,s=c.isSiteKitConnected,u=c.isResettable,m=c.errorMessage,g=googlesitekit.permissions.canSetup;return n.state={canSetup:g,errorMessage:m,isSiteKitConnected:s,isResettable:u,completeSetup:!1,proxySetupURL:o,resetSuccess:"reset_success"===Object(E.getQueryArg)(location.href,"notification"),context:Object(E.getQueryArg)(location.href,"googlesitekit_context"),siteHostname:new URL(l).hostname},n}return m()(t,e),l()(t,[{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 e=Object(y.n)("googlesitekit-dashboard",{notification:"authentication_success"});Object(b.delay)((function(){window.location.replace(e)}),500,"later")}var t=this.state,n=t.context,a=t.errorMessage,i=t.isResettable,o=t.proxySetupURL,l=t.resetSuccess,c=t.siteHostname,r="revoked"===n;return React.createElement(g.Fragment,null,React.createElement(h.a,null),a&&React.createElement(_.a,{id:"setup_error",type:"win-error",title:Object(R.__)("Oops! There was a problem during set up. Please try again.","google-site-kit"),description:a,isDismissable:!1}),l&&React.createElement(_.a,{id:"reset_success",title:Object(R.__)("Site Kit by Google was successfully reset.","google-site-kit"),isDismissable:!1}),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},r?React.createElement(g.Fragment,null,React.createElement("h1",{className:"googlesitekit-setup__title"},Object(R.sprintf)(
2
  /* translators: %s is the site's hostname. (e.g. example.com) */
3
+ Object(R.__)("You revoked access to Site Kit for %s","google-site-kit"),c)),React.createElement("p",{className:"googlesitekit-setup__description"},Object(R.__)('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"))):React.createElement(g.Fragment,null,React.createElement("h1",{className:"googlesitekit-setup__title"},Object(R.__)("The Site Kit plugin is active but requires setup","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup__description"},Object(R.__)("Site Kit Service will guide you through 3 simple setup steps.","google-site-kit"))),React.createElement(v.a,null),React.createElement(p.a,{className:"googlesitekit-start-setup",href:o,onClick:function(){Object(y.v)("plugin_setup","proxy_start_setup_landing_page")}},Object(R.__)("Start setup","google-site-kit")),i&&React.createElement(f.a,null))))))))))))}}]),t}(g.Component);t.default=C},44:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(21),p=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),k=n(81),_=n(12),v=n.n(_),y=n(13),b=n.n(y),R=n(67),E=n(29),C=n(22),w=n(8),N=n.n(w),O=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),l()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.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 e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);O.propTypes={menuOpen:N.a.bool.isRequired,menuItems:N.a.array.isRequired,id:N.a.string.isRequired};var j=O,S=n(80),L=n(2),D=n(0),M=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(b()(n)),n.handleMenuClose=n.handleMenuClose.bind(b()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(b()(n)),n.handleDialog=n.handleDialog.bind(b()(n)),n.handleDialogClose=n.handleDialogClose.bind(b()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(b()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),l()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);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 v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.d)(),document.location=Object(L.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,l=e.proxyPermissionsURL,c=this.state,r=c.dialogActive,s=c.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(D.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:s,ariaControls:"user-menu"},a),React.createElement(j,{ref:this.menuRef,menuOpen:s,menuItems:[Object(D.__)("Disconnect","google-site-kit")].concat(l?[Object(D.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(S.a,null,React.createElement(R.a,{dialogActive:r,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(D.__)("Disconnect","google-site-kit"),subtitle:Object(D.__)("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(D.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),x=function(e){function t(){return i()(this,t),r()(this,d()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(k.a,null)),React.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 "},e&&React.createElement(M,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=x},67:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=n(8),p=n.n(h),f=n(29),k=n(14),_=n(22),v=n(145),y=n.n(v),b=n(0),R=function(e){function t(){var e;return i()(this,t),(e=r()(this,d()(t).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.createRef)(),e}return m()(t,e),l()(t,[{key:"componentDidMount",value:function(){new _.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,l=e.subtitle,c=e.confirmButton,r=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(y.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),l&&React.createElement("p",{className:"mdc-dialog__lead"},l),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),r&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(b.__)("Note: ","google-site-kit")),r),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},c||Object(b.__)("Disconnect","google-site-kit")),React.createElement(k.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(b.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);R.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},R.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=R},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var a=n(3),i=n.n(a),o=n(4),l=n.n(o),c=n(5),r=n.n(c),s=n(6),d=n.n(s),u=n(7),m=n.n(u),g=n(1),h=function(e){function t(e){var n;return i()(this,t),(n=r()(this,d()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),l()(t,[{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)}}]),t}(g.Component)}}]);
dist/assets/js/chunk-googlesitekit-setup-wizard.js CHANGED
@@ -1,3 +1,3 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{144:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(13),m=a.n(d),g=a(7),p=a.n(g),h=a(1),_=a(22),f=a(8),k=a.n(f),v=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).formFieldRef=Object(h.createRef)(),a.checkboxRef=Object(h.createRef)(),a}return p()(t,e),s()(t,[{key:"componentDidMount",value:function(){new _.e(this.formFieldRef.current).input=new _.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.id,n=e.name,i=e.value,r=e.checked,s=e.disabled,o=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(s?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:n,value:i,checked:r,disabled:s,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:a},o))}}]),t}(h.Component);v.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var R=v,y=a(35),b=a.n(y),E=a(0),C=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},a.handleOptIn=a.handleOptIn.bind(m()(a)),a}return p()(t,e),s()(t,[{key:"handleOptIn",value:function(e){var t=this,a=e.target.checked,n={googlesitekit_tracking_optin:a};b()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(n),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!a,a&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!a,error:!1,scriptOnPage:!0})})).catch((function(a){t.setState({optIn:!e.target.checked,error:{errorCode:a.code,errorMsg:a.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,a=e.error,n=this.props,i=n.id,r=n.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(R,{id:i,name:r,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),a&&React.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),t}(h.Component);C.propTypes={id:k.a.string,name:k.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C},17:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(14),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.ctaLabel,n=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(n?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(n?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),n&&React.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 "},React.createElement(_.a,{href:n,external:!0,inherit:!0},a)))))}}]),t}(g.Component);f.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},f.defaultProps={title:"",ctaLabel:"",ctaLink:""};var k=f,v=a(60),R=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,a=e.ctaLink,n=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},a&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:a,external:!0}),n))))}}]),t}(g.Component);R.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var y=R,b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.header,a=e.footer,n=e.children,i=e.title,r=e.headerCtaLabel,s=e.headerCtaLink,o=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(k,{title:i,ctaLabel:r,ctaLink:s}),n,a&&React.createElement(y,{ctaLabel:o,ctaLink:c,footerContent:l}))}}]),t}(g.Component);b.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},b.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=b},210:function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),r=a(3),s=a.n(r),o=a(4),c=a.n(o),l=a(5),u=a.n(l),d=a(6),m=a.n(d),g=a(13),p=a.n(g),h=a(7),_=a.n(h),f=a(1),k=a(11),v=a(0),R=a(43),y=a(29),b=a(17),E=a(9),C=a(2),S=a(8),w=a.n(S),N=a(14),O=a(144),j=a(42),L=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.connectURL,a=e.needReauthenticate,n=e.resetAndRestart;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--two"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Authenticate with Google","google-site-kit")),React.createElement("p",null,Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),a&&React.createElement("p",{className:"googlesitekit-error-text"},Object(v.__)("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")),React.createElement("p",null,React.createElement(y.a,{onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=t}},Object(v.__)("Sign in with Google","google-site-kit")),n&&React.createElement(N.a,{className:"googlesitekit-wizard-step__back",onClick:n},Object(v.__)("Back","google-site-kit"))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(O.a,null),React.createElement(j.a,null))))))}}]),t}(f.Component);L.propTypes={connectURL:w.a.string.isRequired,resetAndRestart:w.a.func};var x=L,M=a(68),A=a.n(M),U=a(31),P=a(22),z=function(e){function t(e){var a;s()(this,t);var n=(a=u()(this,m()(t).call(this,e))).props,i=n.isAuthenticated,r=n.shouldSetup;return a.state={loading:i&&r,loadingMsg:Object(v.__)("Getting your verified sites...","google-site-kit"),siteURL:" ",selectedURL:"",errorCode:!1,errorMsg:""},a.onProceed=a.onProceed.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isAuthenticated,a=e.shouldSetup;t&&a&&this.requestSitePropertyList()}},{key:"requestSitePropertyList",value:function(){var e,t,a,n,r,s=this,o=this.props.setErrorMessage;i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,i.a.awrap(E.c.get(E.b,"site-verification","verification"));case 3:if(e=c.sent,t=e.verified,a=e.identifier,!t){c.next=16;break}return Object(C.v)("verification_setup","verification_check_true"),c.next=10,i.a.awrap(s.insertSiteVerification(a));case 10:if(!0!==c.sent.verified){c.next=14;break}return s.props.siteVerificationSetup(!0),c.abrupt("return",!0);case 14:c.next=17;break;case 16:Object(C.v)("verification_setup","verification_check_false");case 17:s.setState({loading:!1,siteURL:a}),c.next=26;break;case 20:c.prev=20,c.t0=c.catch(0),n=c.t0.message,Object(C.z)(c.t0.message)&&(r=JSON.parse(c.t0.message),n=r.error.message||c.t0.message),o(n),s.setState({loading:!1,errorCode:c.t0.code,errorMsg:n,siteURL:googlesitekit.admin.siteURL});case 26:case"end":return c.stop()}}),null,null,[[0,20]])}},{key:"insertSiteVerification",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.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 e,t,a,n;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e=this.props.setErrorMessage,t=this.state.siteURL?this.state.siteURL:googlesitekit.admin.siteURL,e(""),this.setState({loading:!0,loadingMsg:Object(v.__)("Verifying...","google-site-kit"),errorCode:!1,errorMsg:""}),r.prev=4,r.next=7,i.a.awrap(this.insertSiteVerification(t));case 7:!0===r.sent.verified&&(Object(C.v)("verification_setup","verification_insert_tag"),this.props.siteVerificationSetup(!0)),r.next=17;break;case 11:r.prev=11,r.t0=r.catch(4),a=r.t0.message,Object(C.z)(r.t0.message)&&(n=JSON.parse(r.t0.message),a=n.error.message||r.t0.message),e(a),this.setState({loading:!1,errorCode:r.t0.code,errorMsg:a});case 17:case"end":return r.stop()}}),null,this,[[4,11]])}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.loadingMsg,n=e.siteURL,i=React.createElement(f.Fragment,null,a&&React.createElement("p",null,a),React.createElement(U.a,null));return t?i:React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-wizard-step__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:n}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.onProceed},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state.errorMsg;return n?React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("We will need to verify your URL for Site Kit.","google-site-kit")),i&&0<i.length&&React.createElement("p",{className:"googlesitekit-error-text"},i),a&&this.renderForm()):t.renderSetupDone()}}],[{key:"renderSetupDone",value:function(){return React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("Congratulations, your site has been verified!","google-site-kit")))}}]),t}(f.Component);z.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,siteVerificationSetup:w.a.func.isRequired,completeSetup:w.a.func,setErrorMessage:w.a.func.isRequired};var D=z,q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=!this.props.isVerified;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--three"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(D,A()({shouldSetup:e},this.props))))))}}]),t}(f.Component);q.propTypes={siteVerificationSetup:w.a.func.isRequired};var F=q,T=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.siteURL;return a.state={loading:!0,sites:!1,selectedURL:n,siteURL:n,connected:!1,errorCode:!1,errorMsg:""},a.handleURLSelect=a.handleURLSelect.bind(p()(a)),a.insertPropertyToSearchConsole=a.insertPropertyToSearchConsole.bind(p()(a)),a.submitPropertyEventHandler=a.submitPropertyEventHandler.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,r,s;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=this.props,t=e.isAuthenticated,a=e.shouldSetup,t&&a){o.next=3;break}return o.abrupt("return");case 3:return o.prev=3,n=["siteRestrictedUser","siteOwner","siteFullUser"],o.next=7,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 7:if(r=o.sent,!(s=r.exactMatch)||!n.includes(s.permissionLevel)){o.next=13;break}return o.next=12,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:s.siteURL}));case 12:return o.abrupt("return",this.props.searchConsoleSetup(s.siteURL));case 13:o.next=17;break;case 15:o.prev=15,o.t0=o.catch(3);case 17:this.requestSearchConsoleSiteList();case 18:case"end":return o.stop()}}),null,this,[[3,15]])}},{key:"requestSearchConsoleSiteList",value:function(){var e=this;if(!this.state.errorCode){var t,a,n,r,s=this.props.setErrorMessage;i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 3:if(t=o.sent,a=t.exactMatch,n=t.propertyMatches,!a){o.next=11;break}return o.next=9,i.a.awrap(e.insertPropertyToSearchConsole(a.siteURL));case 9:return e.props.searchConsoleSetup(a.siteURL),o.abrupt("return");case 11:r="",r=1<n.length?Object(v.sprintf)(
2
  /* translators: %d: the number of matching properties. %s: URL of recommended site. */
3
- Object(v.__)("We found %d existing accounts. We recommend using the account “%s”. Please confirm or change below to use.","google-site-kit"),n.length,n[0].siteURL):Object(v.__)("Your site has not been added to Search Console yet. Would you like to add it now?","google-site-kit"),s(r),e.setState({loading:!1,sites:n,errorCode:"no_property_matched",errorMsg:r}),o.next=21;break;case 17:o.prev=17,o.t0=o.catch(0),s(o.t0.message),e.setState({loading:!1,errorCode:o.t0.code,errorMsg:o.t0.message});case 21:case"end":return o.stop()}}),null,null,[[0,17]])}}},{key:"insertPropertyToSearchConsole",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:e}));case 2:Object(C.v)("search_console_setup","add_new_sc_property"),this.setState({loading:!1,connected:!0});case 4:case"end":return t.stop()}}),null,this)}},{key:"submitPropertyEventHandler",value:function(){var e=this,t=this.state.selectedURL,a=this.props.setErrorMessage;i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(e.insertPropertyToSearchConsole(t));case 3:a(""),e.props.searchConsoleSetup(t),n.next=11;break;case 7:n.prev=7,n.t0=n.catch(0),a(n.t0.message[0].message),e.setState({loading:!1,errorCode:n.t0.code,errorMsg:n.t0.message[0].message});case 11:case"end":return n.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,a=e.selectedURL,n=[{label:"",value:"",disabled:!0}];return t?(t.forEach((function(e){n.push({label:e,value:e})})),React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.k,{enhanced:!0,name:"siteProperty",label:Object(v.__)("Choose URL","google-site-kit"),outlined:!0,onEnhancedChange:this.handleURLSelect,options:n,value:a})),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))):null}},{key:"noSiteForm",value:function(){var e=this.state.siteURL;return React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:e}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.sites;return t?React.createElement(f.Fragment,null,React.createElement("p",null,Object(v.__)("We’re locating your Search Console account.","google-site-kit")),React.createElement(U.a,null)):0===a.length?this.noSiteForm():this.matchedForm()}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state,r=i.errorMsg,s=i.connected;return!n||s?t.connected():React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),r&&0<r.length&&React.createElement("p",{className:"googlesitekit-error-text"},r),a&&n&&this.renderForm())}}],[{key:"connected",value:function(){return React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(v.__)("Your Search Console is set up with Site Kit.","google-site-kit")))}}]),t}(f.Component);T.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,searchConsoleSetup:w.a.func.isRequired,setErrorMessage:w.a.func.isRequired};var V=T,I=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.isVerified,a=e.hasSearchConsoleProperty,n=t&&!a;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--four"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n?React.createElement(V,A()({shouldSetup:n},this.props)):V.connected()))))}}]),t}(f.Component);I.propTypes={searchConsoleSetup:w.a.func.isRequired};var K=I,B=function(e){function t(e){var a;return s()(this,t),a=u()(this,m()(t).call(this,e)),googlesitekit.setup.hasSearchConsoleProperty?Object(C.v)("plugin_setup","user_verified"):Object(C.v)("plugin_setup","site_verified"),a}return _()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--five"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Congratulations!","google-site-kit")),React.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")),React.createElement("div",{className:"googlesitekit-wizard-step__action"},React.createElement(y.a,{id:"wizard-step-five-proceed",onClick:this.props.completeSetup},Object(v.__)("Go to Dashboard","google-site-kit")))),React.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 "},React.createElement("div",{className:"googlesitekit-rocket"},React.createElement("img",{className:"googlesitekit-rocket__body",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-body.png"}),React.createElement("img",{className:"googlesitekit-rocket__clouds",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-clouds.png"}),React.createElement("img",{className:"googlesitekit-rocket__dust",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-dust.png"}))))))}}]),t}(f.Component);B.propTypes={completeSetup:w.a.func.isRequired};var G=B,H={authentication:{title:Object(v.__)("Authenticate","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&!e.needReauthenticate},Component:x},verification:{title:Object(v.__)("Verify URL","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified},Component:F},seachConsoleProperty:{title:Object(v.__)("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:K},completeSetup:{title:Object(v.__)("Finish","google-site-kit"),required:!1,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:G}},W=a(20),J=a(18),Y=a.n(J),Q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.currentStep,a=e.step,n=e.title,i=e.status,r=e.warning,s=e.error,o=e.stepKey,c=i;r?c="warning":s&&(c="error");var l=!1;switch(c){case"warning":case"error":l=Y.a.createElement(W.a,{id:"exclamation",height:"12",width:"2"});break;case"completed":l=Y.a.createElement(W.a,{id:"check",height:"12",width:"16"})}return Y.a.createElement("div",{className:"\n\t\t\t\tgooglesitekit-wizard-progress-step\n\t\t\t\tgooglesitekit-wizard-progress-step--".concat(a,"\n\t\t\t\t").concat(t?"googlesitekit-wizard-progress-step--current":"","\n\t\t\t\tgooglesitekit-wizard-progress-step--").concat(o,"\n\t\t\t")},Y.a.createElement("div",{className:"googlesitekit-wizard-progress-step__number-wrapper"},Y.a.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number--".concat(c,"\n\t\t\t\t\t")},Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text--".concat(c,"\n\t\t\t\t\t\t")},a),l&&Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon--".concat(c,"\n\t\t\t\t\t\t\t")},l))),Y.a.createElement("p",{className:"googlesitekit-wizard-progress-step__text"},n))}}]),t}(f.Component);Q.propTypes={currentStep:w.a.bool.isRequired,step:w.a.number.isRequired,title:w.a.string,status:w.a.string,warning:w.a.bool,error:w.a.bool},Q.defaultProps={title:"",status:"",warning:!1,error:!1,removeFirstStep:!1};var X=Q,Z=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.connectURL,i=googlesitekit.setup,r=i.isAuthenticated,o=i.hasSearchConsoleProperty,c=i.isSiteKitConnected,l=i.isVerified,d=i.needReauthenticate,g=googlesitekit.permissions.canSetup;return a.state={canSetup:g,isAuthenticated:r,isVerified:l,needReauthenticate:d,hasSearchConsoleProperty:o,hasSearchConsolePropertyFromTheStart:o,connectURL:n,errorMsg:"",isSiteKitConnected:c,completeSetup:!1},a.siteConnectedSetup=a.siteConnectedSetup.bind(p()(a)),a.siteVerificationSetup=a.siteVerificationSetup.bind(p()(a)),a.searchConsoleSetup=a.searchConsoleSetup.bind(p()(a)),a.resetAndRestart=a.resetAndRestart.bind(p()(a)),a.completeSetup=a.completeSetup.bind(p()(a)),a.setErrorMessage=a.setErrorMessage.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"resetAndRestart",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(E.c.set(E.a,"site","reset"));case 2:Object(C.d)(),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,a=e.isAuthenticated,n=e.isVerified,i=e.hasSearchConsoleProperty,r=e.completeSetup;return t&&a&&n&&i&&r}},{key:"setErrorMessage",value:function(e){this.setState({errorMsg:e})}},{key:"getApplicableSteps",value:function(){var e,t=H,a=Object.keys(t);for(e=0;e<a.length;e++)t[a[e]].isApplicable(this.state)||delete t[a[e]];return t}},{key:"currentStep",value:function(e){var t,a=Object.keys(e);for(t=0;t<a.length-1;t++)if(!e[a[t]].isCompleted(this.state))return a[t];return a[t]}},{key:"stepStatus",value:function(e,t){return e[t].isCompleted(this.state)?"completed":t===this.currentStep(e)?"inprogress":""}},{key:"render",value:function(){var e=this,t=this.state,a=t.canSetup,n=t.isAuthenticated,i=t.isVerified,r=t.needReauthenticate,s=t.hasSearchConsoleProperty,o=t.connectURL,c=t.isSiteKitConnected;if(this.isSetupFinished()){var l=Object(C.n)("googlesitekit-dashboard",{notification:"authentication_success"});Object(k.delay)((function(){window.location.replace(l)}),500,"later")}var u=this.getApplicableSteps(),d=this.currentStep(u),m=u[d].Component,g=React.createElement(m,{siteConnectedSetup:this.siteConnectedSetup,connectURL:o,siteVerificationSetup:this.siteVerificationSetup,searchConsoleSetup:this.searchConsoleSetup,completeSetup:this.completeSetup,isSiteKitConnected:c,isAuthenticated:n,isVerified:i,needReauthenticate:r,hasSearchConsoleProperty:s,setErrorMessage:this.setErrorMessage,resetAndRestart:u.clientCredentials?this.resetAndRestart:void 0}),p=a,h=!p&&!n;return React.createElement(f.Fragment,null,React.createElement(R.a,null),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(b.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},p&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-wizard-progress__steps"},Object.keys(u).map((function(t,a){return React.createElement(X,{key:u[t].title,currentStep:d===t,title:u[t].title,step:a+1,status:e.stepStatus(u,t),warning:u[t].warning,error:u[t].error,stepKey:t})})))))),h&&React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h1",{className:"googlesitekit-setup__title"},Object(v.__)("Authenticate Site Kit","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup__description"},Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),React.createElement(y.a,{href:"#",onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=o}},Object(v.__)("Sign in with Google","google-site-kit"))))))),p&&g))))))}}]),t}(f.Component);t.default=Z},42:function(e,t,a){"use strict";a(1);var n=a(0),i=a(14);t.a=function(){var e=Object(n.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},43:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),_=Object(p.a)("googlesitekit.ErrorNotification")(h),f=a(81),k=a(12),v=a.n(k),R=a(13),y=a.n(R),b=a(67),E=a(29),C=a(22),S=a(8),w=a.n(S),N=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.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 e=this.props,t=e.menuOpen,a=e.menuItems,n=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},a.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:n.bind(null,t),onKeyDown:n.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);N.propTypes={menuOpen:w.a.bool.isRequired,menuItems:w.a.array.isRequired,id:w.a.string.isRequired};var O=N,j=a(80),L=a(2),x=a(0),M=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},a.handleMenu=a.handleMenu.bind(y()(a)),a.handleMenuClose=a.handleMenuClose.bind(y()(a)),a.handleMenuItemSelect=a.handleMenuItemSelect.bind(y()(a)),a.handleDialog=a.handleDialog.bind(y()(a)),a.handleDialogClose=a.handleDialogClose.bind(y()(a)),a.handleUnlinkConfirm=a.handleUnlinkConfirm.bind(y()(a)),a.menuButtonRef=Object(g.createRef)(),a.menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var a=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.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 v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.d)(),document.location=Object(L.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,a=t.email,n=void 0===a?"":a,i=t.picture,r=void 0===i?"":i,s=e.proxyPermissionsURL,o=this.state,c=o.dialogActive,l=o.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:r?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:r,alt:Object(x.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},n),React.createElement(O,{ref:this.menuRef,menuOpen:l,menuItems:[Object(x.__)("Disconnect","google-site-kit")].concat(s?[Object(x.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(j.a,null,React.createElement(b.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(x.__)("Disconnect","google-site-kit"),subtitle:Object(x.__)("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(x.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(f.a,null)),React.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 "},e&&React.createElement(M,null))))),React.createElement(_,null))}}]),t}(g.Component);t.a=A},67:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(29),f=a(14),k=a(22),v=a(145),R=a.n(v),y=a(0),b=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){new k.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,a=e.handleDialog,n=e.title,i=e.provides,r=e.handleConfirm,s=e.subtitle,o=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},n&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},n),s&&React.createElement("p",{className:"mdc-dialog__lead"},s),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(_.a,{onClick:r,danger:!0},o||Object(y.__)("Disconnect","google-site-kit")),React.createElement(f.a,{className:"mdc-dialog__cancel-button",onClick:function(){return a()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);b.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},b.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=b},80:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).el=document.createElement("div"),a.root=document.querySelector(".googlesitekit-plugin")||document.body,a}return m()(t,e),s()(t,[{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)}}]),t}(g.Component)}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[5],{144:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(13),m=a.n(d),g=a(7),p=a.n(g),h=a(1),_=a(22),f=a(8),k=a.n(f),v=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).formFieldRef=Object(h.createRef)(),a.checkboxRef=Object(h.createRef)(),a}return p()(t,e),s()(t,[{key:"componentDidMount",value:function(){new _.e(this.formFieldRef.current).input=new _.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.id,n=e.name,i=e.value,r=e.checked,s=e.disabled,o=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(s?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:n,value:i,checked:r,disabled:s,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:a},o))}}]),t}(h.Component);v.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},v.defaultProps={checked:!1,disabled:!1};var R=v,y=a(35),b=a.n(y),E=a(0),C=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},a.handleOptIn=a.handleOptIn.bind(m()(a)),a}return p()(t,e),s()(t,[{key:"handleOptIn",value:function(e){var t=this,a=e.target.checked,n={googlesitekit_tracking_optin:a};b()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(n),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!a,a&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!a,error:!1,scriptOnPage:!0})})).catch((function(a){t.setState({optIn:!e.target.checked,error:{errorCode:a.code,errorMsg:a.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,a=e.error,n=this.props,i=n.id,r=n.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(R,{id:i,name:r,value:"1",checked:t,onChange:this.handleOptIn},Object(E.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(E.__)("Google Privacy Policy","google-site-kit")),"."),a&&React.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),t}(h.Component);C.propTypes={id:k.a.string,name:k.a.string},C.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=C},17:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(14),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.title,a=e.ctaLabel,n=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(n?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(n?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),n&&React.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 "},React.createElement(_.a,{href:n,external:!0,inherit:!0},a)))))}}]),t}(g.Component);f.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},f.defaultProps={title:"",ctaLabel:"",ctaLink:""};var k=f,v=a(60),R=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,a=e.ctaLink,n=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},a&&t&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:t,href:a,external:!0}),n))))}}]),t}(g.Component);R.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var y=R,b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=this.props,t=e.header,a=e.footer,n=e.children,i=e.title,r=e.headerCtaLabel,s=e.headerCtaLink,o=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,m=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(m?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(k,{title:i,ctaLabel:r,ctaLink:s}),n,a&&React.createElement(y,{ctaLabel:o,ctaLink:c,footerContent:l}))}}]),t}(g.Component);b.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},b.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=b},210:function(e,t,a){"use strict";a.r(t);var n=a(12),i=a.n(n),r=a(3),s=a.n(r),o=a(4),c=a.n(o),l=a(5),u=a.n(l),d=a(6),m=a.n(d),g=a(13),p=a.n(g),h=a(7),_=a.n(h),f=a(1),k=a(11),v=a(0),R=a(44),y=a(29),b=a(17),E=a(9),C=a(2),S=a(8),w=a.n(S),N=a(14),O=a(144),j=a(43),L=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.connectURL,a=e.needReauthenticate,n=e.resetAndRestart;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--two"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Authenticate with Google","google-site-kit")),React.createElement("p",null,Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),a&&React.createElement("p",{className:"googlesitekit-error-text"},Object(v.__)("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")),React.createElement("p",null,React.createElement(y.a,{onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=t}},Object(v.__)("Sign in with Google","google-site-kit")),n&&React.createElement(N.a,{className:"googlesitekit-wizard-step__back",onClick:n},Object(v.__)("Back","google-site-kit"))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(O.a,null),React.createElement(j.a,null))))))}}]),t}(f.Component);L.propTypes={connectURL:w.a.string.isRequired,resetAndRestart:w.a.func};var x=L,M=a(68),A=a.n(M),U=a(31),P=a(22),z=function(e){function t(e){var a;s()(this,t);var n=(a=u()(this,m()(t).call(this,e))).props,i=n.isAuthenticated,r=n.shouldSetup;return a.state={loading:i&&r,loadingMsg:Object(v.__)("Getting your verified sites...","google-site-kit"),siteURL:" ",selectedURL:"",errorCode:!1,errorMsg:""},a.onProceed=a.onProceed.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e=this.props,t=e.isAuthenticated,a=e.shouldSetup;t&&a&&this.requestSitePropertyList()}},{key:"requestSitePropertyList",value:function(){var e,t,a,n,r,s=this,o=this.props.setErrorMessage;i.a.async((function(c){for(;;)switch(c.prev=c.next){case 0:return c.prev=0,c.next=3,i.a.awrap(E.c.get(E.b,"site-verification","verification"));case 3:if(e=c.sent,t=e.verified,a=e.identifier,!t){c.next=16;break}return Object(C.v)("verification_setup","verification_check_true"),c.next=10,i.a.awrap(s.insertSiteVerification(a));case 10:if(!0!==c.sent.verified){c.next=14;break}return s.props.siteVerificationSetup(!0),c.abrupt("return",!0);case 14:c.next=17;break;case 16:Object(C.v)("verification_setup","verification_check_false");case 17:s.setState({loading:!1,siteURL:a}),c.next=26;break;case 20:c.prev=20,c.t0=c.catch(0),n=c.t0.message,Object(C.z)(c.t0.message)&&(r=JSON.parse(c.t0.message),n=r.error.message||c.t0.message),o(n),s.setState({loading:!1,errorCode:c.t0.code,errorMsg:n,siteURL:googlesitekit.admin.siteURL});case 26:case"end":return c.stop()}}),null,null,[[0,20]])}},{key:"insertSiteVerification",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.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 e,t,a,n;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e=this.props.setErrorMessage,t=this.state.siteURL?this.state.siteURL:googlesitekit.admin.siteURL,e(""),this.setState({loading:!0,loadingMsg:Object(v.__)("Verifying...","google-site-kit"),errorCode:!1,errorMsg:""}),r.prev=4,r.next=7,i.a.awrap(this.insertSiteVerification(t));case 7:!0===r.sent.verified&&(Object(C.v)("verification_setup","verification_insert_tag"),this.props.siteVerificationSetup(!0)),r.next=17;break;case 11:r.prev=11,r.t0=r.catch(4),a=r.t0.message,Object(C.z)(r.t0.message)&&(n=JSON.parse(r.t0.message),a=n.error.message||r.t0.message),e(a),this.setState({loading:!1,errorCode:r.t0.code,errorMsg:a});case 17:case"end":return r.stop()}}),null,this,[[4,11]])}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.loadingMsg,n=e.siteURL,i=React.createElement(f.Fragment,null,a&&React.createElement("p",null,a),React.createElement(U.a,null));return t?i:React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-wizard-step__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:n}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.onProceed},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state.errorMsg;return n?React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("We will need to verify your URL for Site Kit.","google-site-kit")),i&&0<i.length&&React.createElement("p",{className:"googlesitekit-error-text"},i),a&&this.renderForm()):t.renderSetupDone()}}],[{key:"renderSetupDone",value:function(){return React.createElement(f.Fragment,null,React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Verify URL","google-site-kit")),React.createElement("p",{className:"googlesitekit-wizard-step__text"},Object(v.__)("Congratulations, your site has been verified!","google-site-kit")))}}]),t}(f.Component);z.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,siteVerificationSetup:w.a.func.isRequired,completeSetup:w.a.func,setErrorMessage:w.a.func.isRequired};var D=z,q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=!this.props.isVerified;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--three"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(D,A()({shouldSetup:e},this.props))))))}}]),t}(f.Component);q.propTypes={siteVerificationSetup:w.a.func.isRequired};var F=q,T=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.siteURL;return a.state={loading:!0,sites:!1,selectedURL:n,siteURL:n,connected:!1,errorCode:!1,errorMsg:""},a.handleURLSelect=a.handleURLSelect.bind(p()(a)),a.insertPropertyToSearchConsole=a.insertPropertyToSearchConsole.bind(p()(a)),a.submitPropertyEventHandler=a.submitPropertyEventHandler.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){var e,t,a,n,r,s;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if(e=this.props,t=e.isAuthenticated,a=e.shouldSetup,t&&a){o.next=3;break}return o.abrupt("return");case 3:return o.prev=3,n=["siteRestrictedUser","siteOwner","siteFullUser"],o.next=7,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 7:if(r=o.sent,!(s=r.exactMatch)||!n.includes(s.permissionLevel)){o.next=13;break}return o.next=12,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:s.siteURL}));case 12:return o.abrupt("return",this.props.searchConsoleSetup(s.siteURL));case 13:o.next=17;break;case 15:o.prev=15,o.t0=o.catch(3);case 17:this.requestSearchConsoleSiteList();case 18:case"end":return o.stop()}}),null,this,[[3,15]])}},{key:"requestSearchConsoleSiteList",value:function(){var e=this;if(!this.state.errorCode){var t,a,n,r,s=this.props.setErrorMessage;i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:return o.prev=0,o.next=3,i.a.awrap(E.c.get(E.b,"search-console","matched-sites"));case 3:if(t=o.sent,a=t.exactMatch,n=t.propertyMatches,!a){o.next=11;break}return o.next=9,i.a.awrap(e.insertPropertyToSearchConsole(a.siteURL));case 9:return e.props.searchConsoleSetup(a.siteURL),o.abrupt("return");case 11:r="",r=1<n.length?Object(v.sprintf)(
2
  /* translators: %d: the number of matching properties. %s: URL of recommended site. */
3
+ Object(v.__)("We found %d existing accounts. We recommend using the account “%s”. Please confirm or change below to use.","google-site-kit"),n.length,n[0].siteURL):Object(v.__)("Your site has not been added to Search Console yet. Would you like to add it now?","google-site-kit"),s(r),e.setState({loading:!1,sites:n,errorCode:"no_property_matched",errorMsg:r}),o.next=21;break;case 17:o.prev=17,o.t0=o.catch(0),s(o.t0.message),e.setState({loading:!1,errorCode:o.t0.code,errorMsg:o.t0.message});case 21:case"end":return o.stop()}}),null,null,[[0,17]])}}},{key:"insertPropertyToSearchConsole",value:function(e){return i.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i.a.awrap(E.c.set(E.b,"search-console","site",{siteURL:e}));case 2:Object(C.v)("search_console_setup","add_new_sc_property"),this.setState({loading:!1,connected:!0});case 4:case"end":return t.stop()}}),null,this)}},{key:"submitPropertyEventHandler",value:function(){var e=this,t=this.state.selectedURL,a=this.props.setErrorMessage;i.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,i.a.awrap(e.insertPropertyToSearchConsole(t));case 3:a(""),e.props.searchConsoleSetup(t),n.next=11;break;case 7:n.prev=7,n.t0=n.catch(0),a(n.t0.message[0].message),e.setState({loading:!1,errorCode:n.t0.code,errorMsg:n.t0.message[0].message});case 11:case"end":return n.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,a=e.selectedURL,n=[{label:"",value:"",disabled:!0}];return t?(t.forEach((function(e){n.push({label:e,value:e})})),React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.k,{enhanced:!0,name:"siteProperty",label:Object(v.__)("Choose URL","google-site-kit"),outlined:!0,onEnhancedChange:this.handleURLSelect,options:n,value:a})),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))):null}},{key:"noSiteForm",value:function(){var e=this.state.siteURL;return React.createElement(f.Fragment,null,React.createElement("div",{className:"googlesitekit-setup-module__inputs"},React.createElement(P.l,{label:Object(v.__)("Website Address","google-site-kit"),name:"siteProperty",floatingLabelClassName:"mdc-floating-label--float-above",outlined:!0,disabled:!0},React.createElement(P.b,{value:e}))),React.createElement("div",{className:"googlesitekit-wizard-step__action googlesitekit-wizard-step__action--justify"},React.createElement(y.a,{onClick:this.submitPropertyEventHandler},Object(v.__)("Continue","google-site-kit")),React.createElement(j.a,null)))}},{key:"renderForm",value:function(){var e=this.state,t=e.loading,a=e.sites;return t?React.createElement(f.Fragment,null,React.createElement("p",null,Object(v.__)("We’re locating your Search Console account.","google-site-kit")),React.createElement(U.a,null)):0===a.length?this.noSiteForm():this.matchedForm()}},{key:"render",value:function(){var e=this.props,a=e.isAuthenticated,n=e.shouldSetup,i=this.state,r=i.errorMsg,s=i.connected;return!n||s?t.connected():React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),r&&0<r.length&&React.createElement("p",{className:"googlesitekit-error-text"},r),a&&n&&this.renderForm())}}],[{key:"connected",value:function(){return React.createElement("section",{className:"googlesitekit-setup-module googlesitekit-setup-module--search-console"},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-setup-module__title "},Object(v._x)("Search Console","Service name","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup-module__text--no-margin"},Object(v.__)("Your Search Console is set up with Site Kit.","google-site-kit")))}}]),t}(f.Component);T.propTypes={isAuthenticated:w.a.bool.isRequired,shouldSetup:w.a.bool.isRequired,searchConsoleSetup:w.a.func.isRequired,setErrorMessage:w.a.func.isRequired};var V=T,I=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.isVerified,a=e.hasSearchConsoleProperty,n=t&&!a;return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--four"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},n?React.createElement(V,A()({shouldSetup:n},this.props)):V.connected()))))}}]),t}(f.Component);I.propTypes={searchConsoleSetup:w.a.func.isRequired};var K=I,B=function(e){function t(e){var a;return s()(this,t),a=u()(this,m()(t).call(this,e)),googlesitekit.setup.hasSearchConsoleProperty?Object(C.v)("plugin_setup","user_verified"):Object(C.v)("plugin_setup","site_verified"),a}return _()(t,e),c()(t,[{key:"render",value:function(){return React.createElement("section",{className:"googlesitekit-wizard-step googlesitekit-wizard-step--five"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement("h2",{className:" googlesitekit-heading-3 googlesitekit-wizard-step__title "},Object(v.__)("Congratulations!","google-site-kit")),React.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")),React.createElement("div",{className:"googlesitekit-wizard-step__action"},React.createElement(y.a,{id:"wizard-step-five-proceed",onClick:this.props.completeSetup},Object(v.__)("Go to Dashboard","google-site-kit")))),React.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 "},React.createElement("div",{className:"googlesitekit-rocket"},React.createElement("img",{className:"googlesitekit-rocket__body",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-body.png"}),React.createElement("img",{className:"googlesitekit-rocket__clouds",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-clouds.png"}),React.createElement("img",{className:"googlesitekit-rocket__dust",alt:"",src:googlesitekit.admin.assetsRoot+"images/rocket-dust.png"}))))))}}]),t}(f.Component);B.propTypes={completeSetup:w.a.func.isRequired};var G=B,H={authentication:{title:Object(v.__)("Authenticate","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&!e.needReauthenticate},Component:x},verification:{title:Object(v.__)("Verify URL","google-site-kit"),required:!0,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified},Component:F},seachConsoleProperty:{title:Object(v.__)("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:K},completeSetup:{title:Object(v.__)("Finish","google-site-kit"),required:!1,isApplicable:function(){return!0},isCompleted:function(e){return e.isSiteKitConnected&&e.isAuthenticated&&e.isVerified&&e.hasSearchConsoleProperty},Component:G}},W=a(20),J=a(18),Y=a.n(J),Q=function(e){function t(){return s()(this,t),u()(this,m()(t).apply(this,arguments))}return _()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,t=e.currentStep,a=e.step,n=e.title,i=e.status,r=e.warning,s=e.error,o=e.stepKey,c=i;r?c="warning":s&&(c="error");var l=!1;switch(c){case"warning":case"error":l=Y.a.createElement(W.a,{id:"exclamation",height:"12",width:"2"});break;case"completed":l=Y.a.createElement(W.a,{id:"check",height:"12",width:"16"})}return Y.a.createElement("div",{className:"\n\t\t\t\tgooglesitekit-wizard-progress-step\n\t\t\t\tgooglesitekit-wizard-progress-step--".concat(a,"\n\t\t\t\t").concat(t?"googlesitekit-wizard-progress-step--current":"","\n\t\t\t\tgooglesitekit-wizard-progress-step--").concat(o,"\n\t\t\t")},Y.a.createElement("div",{className:"googlesitekit-wizard-progress-step__number-wrapper"},Y.a.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number\n\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number--".concat(c,"\n\t\t\t\t\t")},Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text\n\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-text--".concat(c,"\n\t\t\t\t\t\t")},a),l&&Y.a.createElement("span",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon\n\t\t\t\t\t\t\t\tgooglesitekit-wizard-progress-step__number-icon--".concat(c,"\n\t\t\t\t\t\t\t")},l))),Y.a.createElement("p",{className:"googlesitekit-wizard-progress-step__text"},n))}}]),t}(f.Component);Q.propTypes={currentStep:w.a.bool.isRequired,step:w.a.number.isRequired,title:w.a.string,status:w.a.string,warning:w.a.bool,error:w.a.bool},Q.defaultProps={title:"",status:"",warning:!1,error:!1,removeFirstStep:!1};var X=Q,Z=function(e){function t(e){var a;s()(this,t),a=u()(this,m()(t).call(this,e));var n=googlesitekit.admin.connectURL,i=googlesitekit.setup,r=i.isAuthenticated,o=i.hasSearchConsoleProperty,c=i.isSiteKitConnected,l=i.isVerified,d=i.needReauthenticate,g=googlesitekit.permissions.canSetup;return a.state={canSetup:g,isAuthenticated:r,isVerified:l,needReauthenticate:d,hasSearchConsoleProperty:o,hasSearchConsolePropertyFromTheStart:o,connectURL:n,errorMsg:"",isSiteKitConnected:c,completeSetup:!1},a.siteConnectedSetup=a.siteConnectedSetup.bind(p()(a)),a.siteVerificationSetup=a.siteVerificationSetup.bind(p()(a)),a.searchConsoleSetup=a.searchConsoleSetup.bind(p()(a)),a.resetAndRestart=a.resetAndRestart.bind(p()(a)),a.completeSetup=a.completeSetup.bind(p()(a)),a.setErrorMessage=a.setErrorMessage.bind(p()(a)),a}return _()(t,e),c()(t,[{key:"resetAndRestart",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.a.awrap(E.c.set(E.a,"site","reset"));case 2:Object(C.d)(),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,a=e.isAuthenticated,n=e.isVerified,i=e.hasSearchConsoleProperty,r=e.completeSetup;return t&&a&&n&&i&&r}},{key:"setErrorMessage",value:function(e){this.setState({errorMsg:e})}},{key:"getApplicableSteps",value:function(){var e,t=H,a=Object.keys(t);for(e=0;e<a.length;e++)t[a[e]].isApplicable(this.state)||delete t[a[e]];return t}},{key:"currentStep",value:function(e){var t,a=Object.keys(e);for(t=0;t<a.length-1;t++)if(!e[a[t]].isCompleted(this.state))return a[t];return a[t]}},{key:"stepStatus",value:function(e,t){return e[t].isCompleted(this.state)?"completed":t===this.currentStep(e)?"inprogress":""}},{key:"render",value:function(){var e=this,t=this.state,a=t.canSetup,n=t.isAuthenticated,i=t.isVerified,r=t.needReauthenticate,s=t.hasSearchConsoleProperty,o=t.connectURL,c=t.isSiteKitConnected;if(this.isSetupFinished()){var l=Object(C.n)("googlesitekit-dashboard",{notification:"authentication_success"});Object(k.delay)((function(){window.location.replace(l)}),500,"later")}var u=this.getApplicableSteps(),d=this.currentStep(u),m=u[d].Component,g=React.createElement(m,{siteConnectedSetup:this.siteConnectedSetup,connectURL:o,siteVerificationSetup:this.siteVerificationSetup,searchConsoleSetup:this.searchConsoleSetup,completeSetup:this.completeSetup,isSiteKitConnected:c,isAuthenticated:n,isVerified:i,needReauthenticate:r,hasSearchConsoleProperty:s,setErrorMessage:this.setErrorMessage,resetAndRestart:u.clientCredentials?this.resetAndRestart:void 0}),p=a,h=!p&&!n;return React.createElement(f.Fragment,null,React.createElement(R.a,null),React.createElement("div",{className:"googlesitekit-wizard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(b.a,null,React.createElement("section",{className:"googlesitekit-wizard-progress"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},p&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-wizard-progress__steps"},Object.keys(u).map((function(t,a){return React.createElement(X,{key:u[t].title,currentStep:d===t,title:u[t].title,step:a+1,status:e.stepStatus(u,t),warning:u[t].warning,error:u[t].error,stepKey:t})})))))),h&&React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h1",{className:"googlesitekit-setup__title"},Object(v.__)("Authenticate Site Kit","google-site-kit")),React.createElement("p",{className:"googlesitekit-setup__description"},Object(v.__)("Please sign into your Google account to begin.","google-site-kit")),React.createElement(y.a,{href:"#",onClick:function(){Object(C.v)("plugin_setup","signin_with_google"),document.location=o}},Object(v.__)("Sign in with Google","google-site-kit"))))))),p&&g))))))}}]),t}(f.Component);t.default=Z},43:function(e,t,a){"use strict";a(1);var n=a(0),i=a(14);t.a=function(){var e=Object(n.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),_=Object(p.a)("googlesitekit.ErrorNotification")(h),f=a(81),k=a(12),v=a.n(k),R=a(13),y=a.n(R),b=a(67),E=a(29),C=a(22),S=a(8),w=a.n(S),N=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new C.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 e=this.props,t=e.menuOpen,a=e.menuItems,n=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},a.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:n.bind(null,t),onKeyDown:n.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);N.propTypes={menuOpen:w.a.bool.isRequired,menuItems:w.a.array.isRequired,id:w.a.string.isRequired};var O=N,j=a(80),L=a(2),x=a(0),M=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},a.handleMenu=a.handleMenu.bind(y()(a)),a.handleMenuClose=a.handleMenuClose.bind(y()(a)),a.handleMenuItemSelect=a.handleMenuItemSelect.bind(y()(a)),a.handleDialog=a.handleDialog.bind(y()(a)),a.handleDialogClose=a.handleDialogClose.bind(y()(a)),a.handleUnlinkConfirm=a.handleUnlinkConfirm.bind(y()(a)),a.menuButtonRef=Object(g.createRef)(),a.menuRef=Object(g.createRef)(),a}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var a=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.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 v.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(L.d)(),document.location=Object(L.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,a=t.email,n=void 0===a?"":a,i=t.picture,r=void 0===i?"":i,s=e.proxyPermissionsURL,o=this.state,c=o.dialogActive,l=o.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(E.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:r?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:r,alt:Object(x.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},n),React.createElement(O,{ref:this.menuRef,menuOpen:l,menuItems:[Object(x.__)("Disconnect","google-site-kit")].concat(s?[Object(x.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(j.a,null,React.createElement(b.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(x.__)("Disconnect","google-site-kit"),subtitle:Object(x.__)("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(x.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(f.a,null)),React.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 "},e&&React.createElement(M,null))))),React.createElement(_,null))}}]),t}(g.Component);t.a=A},67:function(e,t,a){"use strict";var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=a(8),h=a.n(p),_=a(29),f=a(14),k=a(22),v=a(145),R=a.n(v),y=a(0),b=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){new k.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,a=e.handleDialog,n=e.title,i=e.provides,r=e.handleConfirm,s=e.subtitle,o=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},n&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},n),s&&React.createElement("p",{className:"mdc-dialog__lead"},s),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(_.a,{onClick:r,danger:!0},o||Object(y.__)("Disconnect","google-site-kit")),React.createElement(f.a,{className:"mdc-dialog__cancel-button",onClick:function(){return a()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);b.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},b.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=b},80:function(e,t,a){"use strict";a.d(t,"a",(function(){return p}));var n=a(3),i=a.n(n),r=a(4),s=a.n(r),o=a(5),c=a.n(o),l=a(6),u=a.n(l),d=a(7),m=a.n(d),g=a(1),p=function(e){function t(e){var a;return i()(this,t),(a=c()(this,u()(t).call(this,e))).el=document.createElement("div"),a.root=document.querySelector(".googlesitekit-plugin")||document.body,a}return m()(t,e),s()(t,[{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)}}]),t}(g.Component)}}]);
dist/assets/js/chunk-googlesitekit-setup-wrapper.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{156:function(e,t,n){"use strict";n.r(t);var i=n(13),a=n.n(i),l=n(3),o=n.n(l),c=n(4),s=n.n(c),r=n(5),u=n.n(r),d=n(6),m=n.n(d),g=n(7),h=n.n(g),p=n(1),f=n(11),v=n(43),_=n(14),k=n(42),R=n(2),y=n(21),E=n(0),b=n(10),w=function(e){function t(){return o()(this,t),u()(this,m()(t).apply(this,arguments))}return h()(t,e),s()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(p.Fragment,null,e)}}]),t}(p.Component),N=function(e){function t(e){var n;o()(this,t),n=u()(this,m()(t).call(this,e));var i=googlesitekit.setup.moduleToSetup;return n.state={currentModule:i,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(b.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return h()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.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=window.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}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),i=Object(R.n)("googlesitekit-settings",{});return React.createElement(p.Fragment,null,React.createElement(v.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(E.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(_.a,{id:"setup-".concat(e,"-cancel"),href:i},Object(E.__)("Cancel","google-site-kit"))),React.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 "},React.createElement(k.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(y.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(R.n)("googlesitekit-dashboard",e);Object(f.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(p.Component);t.default=N},42:function(e,t,n){"use strict";n(1);var i=n(0),a=n(14);t.a=function(){var e=Object(i.__)("Need help?","google-site-kit");return React.createElement(a.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},43:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(21),p=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),v=n(81),_=n(12),k=n.n(_),R=n(13),y=n.n(R),E=n(67),b=n(29),w=n(22),N=n(8),O=n.n(N),C=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new w.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 e=this.props,t=e.menuOpen,n=e.menuItems,i=e.onSelected,a=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:a,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,t),onKeyDown:i.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);C.propTypes={menuOpen:O.a.bool.isRequired,menuItems:O.a.array.isRequired,id:O.a.string.isRequired};var D=C,S=n(80),M=n(2),j=n(0),T=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(y()(n)),n.handleMenuClose=n.handleMenuClose.bind(y()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(y()(n)),n.handleDialog=n.handleDialog.bind(y()(n)),n.handleDialogClose=n.handleDialogClose.bind(y()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(y()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);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 k.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(M.d)(),document.location=Object(M.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,i=void 0===n?"":n,a=t.picture,l=void 0===a?"":a,o=e.proxyPermissionsURL,c=this.state,s=c.dialogActive,r=c.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(b.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:l?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:l,alt:Object(j.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:r,ariaControls:"user-menu"},i),React.createElement(D,{ref:this.menuRef,menuOpen:r,menuItems:[Object(j.__)("Disconnect","google-site-kit")].concat(o?[Object(j.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(S.a,null,React.createElement(E.a,{dialogActive:s,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(j.__)("Disconnect","google-site-kit"),subtitle:Object(j.__)("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(j.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(v.a,null)),React.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 "},e&&React.createElement(T,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=A},67:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(8),p=n.n(h),f=n(29),v=n(14),_=n(22),k=n(145),R=n.n(k),y=n(0),E=function(e){function t(){var e;return a()(this,t),(e=s()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){new _.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,i=e.title,a=e.provides,l=e.handleConfirm,o=e.subtitle,c=e.confirmButton,s=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},i&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},i),o&&React.createElement("p",{className:"mdc-dialog__lead"},o),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},a&&a.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),s&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),s),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:l,danger:!0},c||Object(y.__)("Disconnect","google-site-kit")),React.createElement(v.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);E.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},E.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=E},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),o()(t,[{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)}}]),t}(g.Component)},81:function(e,t,n){"use strict";n(1);var i=n(20),a=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(i.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(a.__)("Site Kit by Google Logo","google-site-kit")))}}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[7],{156:function(e,t,n){"use strict";n.r(t);var i=n(13),a=n.n(i),l=n(3),o=n.n(l),c=n(4),s=n.n(c),r=n(5),u=n.n(r),d=n(6),m=n.n(d),g=n(7),h=n.n(g),p=n(1),f=n(11),v=n(44),_=n(14),k=n(43),R=n(2),y=n(21),E=n(0),b=n(10),w=function(e){function t(){return o()(this,t),u()(this,m()(t).apply(this,arguments))}return h()(t,e),s()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(p.Fragment,null,e)}}]),t}(p.Component),N=function(e){function t(e){var n;o()(this,t),n=u()(this,m()(t).call(this,e));var i=googlesitekit.setup.moduleToSetup;return n.state={currentModule:i,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(b.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return h()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.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=window.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}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),i=Object(R.n)("googlesitekit-settings",{});return React.createElement(p.Fragment,null,React.createElement(v.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(E.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(_.a,{id:"setup-".concat(e,"-cancel"),href:i},Object(E.__)("Cancel","google-site-kit"))),React.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 "},React.createElement(k.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(y.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(R.n)("googlesitekit-dashboard",e);Object(f.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(p.Component);t.default=N},43:function(e,t,n){"use strict";n(1);var i=n(0),a=n(14);t.a=function(){var e=Object(i.__)("Need help?","google-site-kit");return React.createElement(a.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(21),p=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){return null}}]),t}(g.Component),f=Object(h.a)("googlesitekit.ErrorNotification")(p),v=n(81),_=n(12),k=n.n(_),R=n(13),y=n.n(R),E=n(67),b=n(29),w=n(22),N=n(8),O=n.n(N),C=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new w.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 e=this.props,t=e.menuOpen,n=e.menuItems,i=e.onSelected,a=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:a,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:i.bind(null,t),onKeyDown:i.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(g.Component);C.propTypes={menuOpen:O.a.bool.isRequired,menuItems:O.a.array.isRequired,id:O.a.string.isRequired};var D=C,S=n(80),M=n(2),j=n(0),T=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(y()(n)),n.handleMenuClose=n.handleMenuClose.bind(y()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(y()(n)),n.handleDialog=n.handleDialog.bind(y()(n)),n.handleDialogClose=n.handleDialogClose.bind(y()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(y()(n)),n.menuButtonRef=Object(g.createRef)(),n.menuRef=Object(g.createRef)(),n}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);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 k.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(M.d)(),document.location=Object(M.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,i=void 0===n?"":n,a=t.picture,l=void 0===a?"":a,o=e.proxyPermissionsURL,c=this.state,s=c.dialogActive,r=c.menuOpen;return React.createElement(g.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(b.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:l?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:l,alt:Object(j.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:r,ariaControls:"user-menu"},i),React.createElement(D,{ref:this.menuRef,menuOpen:r,menuItems:[Object(j.__)("Disconnect","google-site-kit")].concat(o?[Object(j.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(S.a,null,React.createElement(E.a,{dialogActive:s,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(j.__)("Disconnect","google-site-kit"),subtitle:Object(j.__)("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(j.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(g.Component),A=function(e){function t(){return a()(this,t),s()(this,u()(t).apply(this,arguments))}return m()(t,e),o()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(g.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(v.a,null)),React.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 "},e&&React.createElement(T,null))))),React.createElement(f,null))}}]),t}(g.Component);t.a=A},67:function(e,t,n){"use strict";var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=n(8),p=n.n(h),f=n(29),v=n(14),_=n(22),k=n(145),R=n.n(k),y=n(0),E=function(e){function t(){var e;return a()(this,t),(e=s()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(g.createRef)(),e}return m()(t,e),o()(t,[{key:"componentDidMount",value:function(){new _.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,i=e.title,a=e.provides,l=e.handleConfirm,o=e.subtitle,c=e.confirmButton,s=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(R.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},i&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},i),o&&React.createElement("p",{className:"mdc-dialog__lead"},o),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},a&&a.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),s&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),s),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:l,danger:!0},c||Object(y.__)("Disconnect","google-site-kit")),React.createElement(v.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(g.Component);E.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},E.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=E},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return h}));var i=n(3),a=n.n(i),l=n(4),o=n.n(l),c=n(5),s=n.n(c),r=n(6),u=n.n(r),d=n(7),m=n.n(d),g=n(1),h=function(e){function t(e){var n;return a()(this,t),(n=s()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return m()(t,e),o()(t,[{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)}}]),t}(g.Component)},81:function(e,t,n){"use strict";n(1);var i=n(20),a=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(i.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(i.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(a.__)("Site Kit by Google Logo","google-site-kit")))}}}]);
dist/assets/js/commons.js CHANGED
@@ -1 +1 @@
1
- (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{14:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.href,a=e.children,i=e.className,o=e.arrow,r=e.external,s=e.inverse,c=e.back,l=e.small,u=e.inherit,d=e.caps,g=e.danger,m=e.disabled,p=e.id,h=n&&!m,f=h?"a":"button";return React.createElement(f,{className:"\n\t\t\t\t\tgooglesitekit-cta-link\n\t\t\t\t\t".concat(i||"","\n\t\t\t\t\t").concat(o?"googlesitekit-cta-link--arrow":"","\n\t\t\t\t\t").concat(r?"googlesitekit-cta-link--external":"","\n\t\t\t\t\t").concat(s?"googlesitekit-cta-link--inverse":"","\n\t\t\t\t\t").concat(c?"googlesitekit-cta-link--back":"","\n\t\t\t\t\t").concat(l?"googlesitekit-cta-link--small":"","\n\t\t\t\t\t").concat(u?"googlesitekit-cta-link--inherit":"","\n\t\t\t\t\t").concat(d?"googlesitekit-cta-link--caps":"","\n\t\t\t\t\t").concat(g?"googlesitekit-cta-link--danger":"","\n\t\t\t\t\t").concat(m?"googlesitekit-cta-link--disabled":"","\n\t\t\t\t"),onClick:t,id:p,href:h?n:void 0,target:h&&r?"_blank":void 0,rel:r?"noopener noreferrer":void 0,disabled:m},a)}}]),t}(m.Component);f.propTypes={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={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},15:function(e,t,n){"use strict";n.r(t),n.d(t,"extractAnalyticsDataForTrafficChart",(function(){return r})),n.d(t,"extractAnalyticsDashboardData",(function(){return c})),n.d(t,"extractAnalyticsDashboardSparklineData",(function(){return l})),n.d(t,"calculateOverviewData",(function(){return u})),n.d(t,"translateAnalyticsError",(function(){return d})),n.d(t,"getAnalyticsErrorMessageFromData",(function(){return g})),n.d(t,"isDataZeroForReporting",(function(){return m})),n.d(t,"analyticsAdsenseReportDataDefaults",(function(){return p})),n.d(t,"siteAnalyticsReportDataDefaults",(function(){return h})),n.d(t,"overviewReportDataDefaults",(function(){return f})),n.d(t,"trafficSourcesReportDataDefaults",(function(){return b})),n.d(t,"getTopPagesReportDataDefaults",(function(){return v}));var a=n(2),i=n(11),o=n(0),r=function(e){if(!e||!e.length)return null;var t=e[0].data,n=t.rows,a=t.totals[0].values[0],o=[["Source","Percent"]];return Object(i.each)(n,(function(e){var t=e.metrics[0].values[0]/a;if(1>100*t)return!1;var n=e.dimensions[0].replace(/\(none\)/gi,"direct");o.push([n,t])})),o};function s(e,t){var n=[];return Object(i.each)(e,(function(e){if(e.metrics){var a=e.metrics[0].values,i=e.dimensions[0],o=i.slice(0,4)+"-"+i.slice(4,6)+"-"+i.slice(6,8),r=new Date(o);n.push([r,a[t]])}})),n}var c=function(e,t,n){if(!e||!e.length)return null;var a=e[0].data.rows;if(!a)return!1;var r=a.length;if(2*n>r){for(var c=new Date,l=0;n>l;l++){var u=(c.getMonth()+1).toString(),d=c.getDate().toString(),g=c.getFullYear().toString()+(2>u.length?"0":"")+u+(2>d.length?"0":"")+d;if(l>r){var m={dimensions:[g],metrics:[{values:[0,0,0,0,0]}]};a.unshift(m)}c.setDate(c.getDate()-1)}a.push([0,0])}var p=[Object(o.__)("Users","google-site-kit"),Object(o.__)("Sessions","google-site-kit"),Object(o.__)("Bounce Rate","google-site-kit"),Object(o.__)("Session Duration","google-site-kit")],h=[[{type:"date",label:Object(o.__)("Day","google-site-kit")},{type:"number",label:p[t]},{type:"number",label:Object(o.__)("Previous month","google-site-kit")}]],f=a.slice(a.length-n,a.length),b=a.slice(0,a.length-n),v=s(f,t),k=s(b,t);return Object(i.each)(v,(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,n=[[{type:"date",label:"Day"},{type:"number",label:"Users"},{type:"number",label:"Sessions"},{type:"number",label:"Goals Completed"}]];return Object(i.each)(t,(function(e){var t=e.metrics[0].values,a=e.dimensions[0],i=a.slice(0,4)+"-"+a.slice(4,6)+"-"+a.slice(6,8),o=new Date(i);n.push([o,t[0],t[1],t[4]])})),n},u=function(e){if(!e||!e.length)return!1;var t=e[0].data.totals,n=t[0].values,i=t[1].values,o=n[0],r=n[1],s=n[2],c=n[3],l=n[4],u=n[5];return{totalUsers:o,totalSessions:r,averageBounceRate:s,averageSessionDuration:c,totalUsersChange:Object(a.c)(i[0],n[0]),totalSessionsChange:Object(a.c)(i[1],n[1]),averageBounceRateChange:Object(a.c)(i[2],n[2]),averageSessionDurationChange:Object(a.c)(i[3],n[3]),goalCompletions:l,goalCompletionsChange:Object(a.c)(i[4],n[4]),totalPageViews:u,totalPageViewsChange:Object(a.c)(i[5],n[5])}},d=function(e,t){var n="";switch(e){case"INVALID_ARGUMENT":n=Object(o.__)("Analytics module needs to be configured.","google-site-kit");break;case"UNAUTHENTICATED":n=Object(o.__)("You need to be authenticated to get this data.","google-site-kit");break;case"PERMISSION_DENIED":n=Object(o.__)("Your account does not have sufficient permission to access this data, please consult to your web administrator.","google-site-kit");break;case"RESOURCE_EXHAUSTED":n=Object(o.__)("Your account exceeded the maximum quota. Please try again later.","google-site-kit");break;case"INTERNAL":n=Object(o.__)("Unexpected internal server error occurred.","google-site-kit");break;case"BACKEND_ERROR":n=Object(o.__)("Analytics server returned unknown error. Please try again later.","google-site-kit");break;case"UNAVAILABLE":n=Object(o.__)("The service was unable to process the request. Please try again later.","google-site-kit");break;default:n=t}return n},g=function(e){return!(!e.error||!e.error.status)&&d(e.error.status,e.error.message)},m=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,n=!0;return Object(i.each)(t,(function(e){0!==parseInt(e)&&(n=!1)})),n}return!1},p={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},h={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},f={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={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},v=function(){var e=[{expression:"ga:pageviews",alias:"Pageviews"},{expression:"ga:uniquePageviews",alias:"Unique Pageviews"},{expression:"ga:bounceRate",alias:"Bounce rate"}];return window.googlesitekit.modules.analytics.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}}},158:function(e,t,n){"use strict";var a={};n.r(a),n.d(a,"totalStats",(function(){return u})),n.d(a,"firstPostWin",(function(){return d})),n.d(a,"pageviewIncrease",(function(){return m})),n.d(a,"publishingWin",(function(){return p})),n.d(a,"trafficIncrease",(function(){return h}));var i=n(27),o=n.n(i),r=n(2),s=n(9),c=n(33),l=n(0),u=function(e,t){if(5>=parseInt(googlesitekit.admin.newSitePosts,10))return!1;if(!e||!e.rows)return!1;var n=[],a=Object(l.__)("Here are some high level stats","google-site-kit");if(e&&e.rows){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalClicksChange,u=i.totalImpressions,d=i.totalImpressionsChange,g=i.averageCTR,m=i.averageCTRChange;0<s&&0<d&&0<m&&(a="".concat(Object(l.__)("Last month was great!","google-site-kit"),". ").concat(a)),n=[{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:o,datapointUnit:"",change:s,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:u,datapointUnit:"",change:d,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:g,datapointUnit:"%",change:m,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")}]}var p=new Date,h=new Date(p.getFullYear(),p.getMonth()+1,0),f=Object(r.j)(p,h)+1;return{id:t,title:Object(l.__)("Welcome Back!","google-site-kit"),description:a,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/g-win.png"),blockData:n,type:"win-stats",dismissExpires:Object(r.p)("day")*f,showOnce:!0}},d=function(e){return!(1!==parseInt(googlesitekit.admin.newSitePosts,10))&&{id:e,title:Object(l.__)("Congrats on your first post!","google-site-kit"),format:"small",smallImage:"".concat(googlesitekit.admin.assetsRoot,"images/thumbs-up.png"),type:"win-success",showOnce:!0}},g=n(15),m=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e.reports)return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalPageViewsChange,i=n.totalPageViews;return!(10>a)&&{id:t,title:Object(l.__)("Increased page views!","google-site-kit"),description:Object(l.__)("Over the past 4 weeks","google-site-kit"),format:"large",logo:!1,winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun-small.png"),blockData:[{title:Object(l.__)("Total Page Views","google-site-kit"),datapoint:Object(r.r)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats-increase",dismissExpires:Object(r.p)("month"),showOnce:!0}},p=function(e,t){if(!(5===parseInt(googlesitekit.admin.newSitePosts,10)))return!1;var n=Object(l.__)("That’s out of this world.","google-site-kit"),a=[];if(googlesitekit.modules["search-console"]&&googlesitekit.modules["search-console"].active&&e){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalImpressions,u=i.averageCTR;a=[{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:Object(r.t)(s),datapointUnit:""},{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:Object(r.t)(o),datapointUnit:""},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:u,datapointUnit:"%"}],n=Object(l.__)("That’s out of this world. Here are the combined stats for your posts","google-site-kit")}return{id:t,title:Object(l.__)("Congrats on five published posts","google-site-kit"),description:n,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/rocket.png"),blockData:a,type:"win-stats",showOnce:!0}},h=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e[0])return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalUsersChange,i=n.totalUsers;return!(10>a||100<a)&&{id:t,title:Object(l.__)("Congrats on more website visitors!","google-site-kit"),description:Object(l.__)("You had a record-high amount of visitors to your website yesterday.","google-site-kit"),dismiss:Object(l.__)("OK, Got it!","google-site-kit"),format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun.png"),blockData:[{title:Object(l.__)("Site Visitors","google-site-kit"),datapoint:Object(r.t)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats",dismissExpires:Object(r.p)("week"),showOnce:!0}},f=n(10);function b(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 v=Object(r.l)("notification");"authentication_success"!==v&&"authentication_failure"!==v&&(Object(f.addFilter)("googlesitekit.winCallbacks","googlesitekit.publisherwinCallbacks",(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{},a)})),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){return e.push({identifier:"first-post-win"}),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"publishing-win",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"total-stats",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2),googlesitekit.modules.analytics.active&&(Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"pageview-increase",withData:{type:s.b,identifier:"analytics",datapoint:"reports",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"traffic-increase",withData:{type:s.b,identifier:"analytics",datapoint:"report",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2)))},161:function(e,t,n){"use strict";var a=n(1),i=n(3),o=n.n(i),r=n(4),s=n.n(r),c=n(5),l=n.n(c),u=n(6),d=n.n(u),g=n(7),m=n.n(g),p=n(2),h=n(26),f=n(12),b=n.n(f),v=n(13),k=n.n(v),_=n(11),y=n(9),O=n(54),w=n(53),R=n(0),j=n(14),E=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).setupModuleClick=n.setupModuleClick.bind(k()(n)),n}return m()(t,e),s()(t,[{key:"setupModuleClick",value:function(e){return b.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.setState({isSaving:!0}),t.next=4,b.a.awrap(Object(p.a)(y.c,e,!0));case 4:return t.next=6,b.a.awrap(Object(p.u)());case 6:window.location=Object(p.m)(e,!0),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(0),Object(p.w)(O.a,{id:"setup-module-error",title:Object(R.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 13:case"end":return t.stop()}}),null,this,[[0,9]])}},{key:"render",value:function(){var e=this,t=Object.values(window.googlesitekit.modules||{}).filter((function(e){return!e.internal})),n=t.filter((function(e){return e.active&&e.setupComplete})).reduce((function(e,t){return e[t.slug]=t.name,e}),{}),a=t.filter((function(e){return 0===e.required.length})).sort((function(e,t){return e.sort-t.sort}));return React.createElement("div",{className:"googlesitekit-modules-list"},Object(_.map)(a,(function(t){var a=!1,i="",o=t.slug,r=t.name,s=t.setupComplete,c=t.required;return 0<c.length&&c.forEach((function(e){n[e]&&(a=!0,i=n[e])})),React.createElement("div",{key:o,className:"\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module--".concat(o,"\n\t\t\t\t\t\t\t").concat(a?"googlesitekit-modules-list__module--disabled":"","\n\t\t\t\t\t\t")},React.createElement("div",{className:"googlesitekit-settings-connect-module__wrapper"},React.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},Object(p.q)(o,a)),React.createElement("h3",{className:"googlesitekit-settings-connect-module__title"},r)),React.createElement(w.a,{slug:o,context:"modules-list"}),s&&React.createElement("span",{className:"googlesitekit-settings-module__status"},React.createElement("span",{className:"googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected"},React.createElement("span",{className:"screen-reader-text"},Object(R.__)("Connected","google-site-kit"))),Object(R.__)("Connected","google-site-kit")),!s&&!a&&React.createElement(j.a,{arrow:!0,small:!0,inherit:!0,onClick:function(){e.setupModuleClick(o)}}," ",Object(R.__)("Connect Service","google-site-kit")),!s&&a&&React.createElement(j.a,{disabled:!0,small:!0,inherit:!0},Object(R.sprintf)(Object(R.__)("Enable %s to start setup","google-site-kit"),i)))})))}}]),t}(a.Component),C=n(10),D=function(e){function t(){return o()(this,t),l()(this,d()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=Object(p.l)("notification");if(!e||""===e)return null;var t={id:"connected-successfully",setupTitle:Object(R.__)("Site Kit","google-site-kit"),description:Object(R.__)("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:""}},n=googlesitekit.permissions.canManageOptions;switch(e){case"authentication_success":if(!n)return null;var i=Object(p.l)("slug");return i&&googlesitekit.modules[i]&&!googlesitekit.modules[i].active?null:(i&&googlesitekit.modules[i]&&(t.id="".concat(t.id,"-").concat(i),t.setupTitle=googlesitekit.modules[i].name,t.description=Object(R.__)("Here are some other services you can connect to see even more stats:","google-site-kit"),t=Object(C.applyFilters)("googlesitekit.SetupWinNotification-".concat(i),t)),React.createElement(a.Fragment,null,React.createElement(h.a,{id:t.id,title:Object(R.sprintf)(Object(R.__)("Congrats on completing the setup for %s!","google-site-kit"),t.setupTitle),description:t.description,handleDismiss:function(){},winImage:googlesitekit.admin.assetsRoot+"images/rocket.png",dismiss:Object(R.__)("OK, Got it!","google-site-kit"),format:"large",type:"win-success",learnMoreLabel:t.learnMore.label,learnMoreDescription:t.learnMore.description,learnMoreURL:t.learnMore.url},React.createElement(E,null))));case"authentication_failure":return React.createElement(a.Fragment,null,React.createElement(h.a,{id:"connection error",title:Object(R.__)("There was a problem connecting to Google!","google-site-kit"),description:"",handleDismiss:function(){},format:"small",type:"win-error"}))}}}]),t}(a.Component),N=n(58),x=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this,t=Object(N.f)();t&&Object(N.b)(t).then((function(t){e.setState({data:t.results})}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(_.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage?"".concat(googlesitekit.admin.assetsRoot,"images/").concat(e.winImage):"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaURL||"",ctaLabel:e.ctaLabel||"",ctaTarget:e.ctaTarget||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!0,module:n,moduleName:googlesitekit.modules[n].name,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),S=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentWillMount",value:function(){var e=this;Object(C.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(C.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications");var t=Object(N.g)();t&&Object(N.d)(t).then((function(t){e.setState({data:t.results})}))}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(_.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage||"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaLink||"",ctaLabel:e.ctaLabel||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!1,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),A=n(87),L=n(24),I=window.googlesitekit.setup,P=Object(p.l)("notification"),M=Object(L.a)(React.createElement(D,null)),T=Object(L.a)(React.createElement(x,null)),U=Object(L.a)(React.createElement(S,null)),F=Object(L.a)(React.createElement(A.a,null));I.needReauthenticate&&Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",F,1),"authentication_success"===P||"authentication_failure"===P?Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",M,1):I.isAuthenticated&&I.isVerified&&(Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.ModulesNotification",T,1),Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.WinsNotification",U,1))},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.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 "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(m.Component);b.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},b.defaultProps={title:"",ctaLabel:"",ctaLink:""};var v=b,k=n(60),_=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(k.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(m.Component);_.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var y=_,O=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,r=e.headerCtaLink,s=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,g=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(g?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(v,{title:i,ctaLabel:o,ctaLink:r}),a,n&&React.createElement(y,{ctaLabel:s,ctaLink:c,footerContent:l}))}}]),t}(m.Component);O.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},O.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=O},2:function(e,t,n){"use strict";var a,i=n(49),o=n.n(i),r=n(68),s=n.n(r),c=n(27),l=n.n(c),u=n(12),d=n.n(u),g=n(61),m=n.n(g),p=(n(1),n(11)),h=n(9),f=n(20),b=n(18),v=n.n(b),k=n(35),_=n.n(k),y=n(10),O=n(0),w=n(36),R=n(3),j=n.n(R),E=n(4),C=n.n(E),D=function(e){var t=window[e];if(!t)return!1;try{var n="__storage_test__";return t.setItem(n,n),t.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!==t.length}},N=function(){function e(){j()(this,e)}return C()(e,[{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}}]),e}(),x=function(){return a||(a=D("sessionStorage")?window.sessionStorage:D("localStorage")?window.localStorage:new N),a};function S(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(n,!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"t",(function(){return L})),n.d(t,"r",(function(){return I})),n.d(t,"p",(function(){return P})),n.d(t,"s",(function(){return M})),n.d(t,"j",(function(){return T})),n.d(t,"c",(function(){return U})),n.d(t,"l",(function(){return q})),n.d(t,"f",(function(){return H})),n.d(t,"u",(function(){return W})),n.d(t,"m",(function(){return G})),n.d(t,"g",(function(){return K})),n.d(t,"n",(function(){return B})),n.d(t,"z",(function(){return z})),n.d(t,"A",(function(){return V})),n.d(t,"b",(function(){return Q})),n.d(t,"v",(function(){return Y})),n.d(t,"k",(function(){return J})),n.d(t,"a",(function(){return $})),n.d(t,"y",(function(){return ee})),n.d(t,"w",(function(){return te})),n.d(t,"e",(function(){return ne})),n.d(t,"i",(function(){return ie})),n.d(t,"h",(function(){return oe})),n.d(t,"q",(function(){return re})),n.d(t,"d",(function(){return se})),n.d(t,"x",(function(){return ce})),n.d(t,"o",(function(){return x}));var L=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t=Object(p.isUndefined)(e)?0:1e6<e?(e/=1e6).toFixed(1)+"M":1e3<e?99<(e/=1e3)?Math.round(e)+"K":e.toFixed(1)+"K":e,(Object(p.isNull)(e)||Object(p.isUndefined)(e)||isNaN(e))&&(t="",e=0),0===e)return t="0.00",n?new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).format(e):e;if(!1!==n&&""!==t){var a=new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).formatToParts(e),i=a.find((function(e){return"decimal"===e.type}));!Object(p.isUndefined)(i)&&!Object(p.isUndefined)(i.value)&&1e3>e&&(t=Number.isInteger(e)?e:e.replace(".",i.value));var o=a.find((function(e){return"currency"===e.type})),r=o?o.value:"";return"".concat(r).concat(t)}return t.toString()},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t||(t=navigator.language),t=t.replace("_","-").toLocaleLowerCase(),new Intl.NumberFormat(t).format(e)},P=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}},M=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()},T=function(e,t){var n=1e3*P("day"),a=e.getTime(),i=t.getTime();return Math.round(Math.abs(a-i)/n)},U=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},F=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},q=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):F(e);var a={},i=!0,o=!1,r=void 0;try{for(var s,c=n.searchParams.entries()[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var l=m()(s.value,2),u=l[0],d=l[1];a[u]=d}}catch(e){o=!0,r=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw r}}return a},H=function(e,t){return Object(p.map)(e,(function(e,n){return[e[0],e[t]||(0===n?"":0)]}))},W=function(){var e,t;return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,d.a.awrap(h.c.get(h.a,"user","authentication"));case 3:e=n.sent,t=e.grantedScopes.filter((function(t){return-1!==e.requiredScopes.indexOf(t)})),window.googlesitekit.setup=window.googlesitekit.setup||{},window.googlesitekit.setup.isAuthenticated=e.isAuthenticated,window.googlesitekit.setup.requiredScopes=e.requiredScopes,window.googlesitekit.setup.grantedScopes=e.grantedScopes,window.googlesitekit.setup.needReauthenticate=t.length<e.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]])},G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:googlesitekit,a=n.admin,i=a.connectURL,o=a.adminRoot,r=n.setup.needReauthenticate,s=n.modules[e].screenID,c="pagespeed-insights"===e?{notification:"authentication_success",reAuth:void 0}:{},l=Object(w.addQueryArgs)(o,A({page:e&&t&&s?s:"googlesitekit-dashboard",slug:e,reAuth:t},c));if(!r)return l;var u=encodeURIComponent(Object(w.getQueryString)(l));return l=o+"?"+u,Object(w.addQueryArgs)(i,{redirect:l,status:t})},K=function(e,t){return function(n){return function(a){return v.a.createElement(e,s()({},a,t,{OriginalComponent:n}))}}},B=function(e,t){var n=googlesitekit.admin.adminRoot;return e||(e="googlesitekit-dashboard"),t=A({page:e},t),Object(w.addQueryArgs)(n,t)},z=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},V=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}$/)},Q=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)),o.setAttribute("id","googlesitekit-notifications-counter");var r=document.createElement("span");r.setAttribute("class","plugin-count"),r.setAttribute("aria-hidden","true"),r.textContent=e;var s=document.createElement("span");return s.setAttribute("class","screen-reader-text"),s.textContent=Object(O.sprintf)(Object(O._n)("%d notification","%d notifications",e,"google-site-kit"),e),o.appendChild(r),o.appendChild(s),t&&null===a&&t.appendChild(o),n&&null===i&&n.appendChild(o),o},Y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if("undefined"!=typeof gtag&&window.googlesitekitTrackingEnabled){var i=googlesitekit.admin,o=i.siteURL,r=i.siteUserID,s=googlesitekit.setup.isFirstAdmin;return gtag("event",t,{send_to:googlesitekit.admin.trackingID,event_category:e,event_label:n,event_value:a,dimension1:Object(p.trimEnd)(o,"/"),dimension2:s?"true":"false",dimension3:r})}},J=function(e){var t,n,a,i,o;return d.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=googlesitekit.admin,n=t.homeURL,a=t.ampMode,i={tagverify:1,timestamp:Date.now()},r.next=4,d.a.awrap(Z(Object(w.addQueryArgs)(n,i),e));case 4:if((o=r.sent)||"secondary"!==a){r.next=9;break}return r.next=8,d.a.awrap(_()({path:"/wp/v2/posts?per_page=1"}).then((function(t){return t.slice(0,1).map((function(t){return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.a.awrap(Z(Object(w.addQueryArgs)(t.link,A({},i,{amp:1})),e));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))})).pop()})));case 8:o=r.sent;case 9:return r.abrupt("return",Promise.resolve(o||null));case 10:case"end":return r.stop()}}))},Z=function(e,t){var n;return d.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,d.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=!1;switch(t){case"analytics":(n=!!(n=new RegExp(/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/gm).exec(e))&&n[1])||(n=!!(n=new RegExp(/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/gm).exec(e))&&n[1]);break;case"adsense":(n=!!(n=new RegExp(/google_ad_client: ?["|'](.*?)["|']/gm).exec(e))&&n[1])||(n=!!(n=new RegExp(/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/gm).exec(e))&&n[1])}return n},$=function(e,t,n){return e.setModuleActive(t,n).then((function(e){return window.googlesitekit.modules&&window.googlesitekit.modules[t]&&(window.googlesitekit.modules[t].active=e.active),Y("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},ee=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:googlesitekit,o=i.modules[e],r=o.settings,s=o.setupComplete,c=a||document.getElementById("confirm-changes-".concat(e));if(s&&c){var l=[];Object.keys(n).forEach((function(e){-1<Object.keys(t).indexOf(e)&&(l[t[e]]=n[e])}));var u=[];Object.keys(r).forEach((function(e){-1<Object.values(t).indexOf(e)&&(u[e]=r[e])}));var d=Object.keys(u).filter((function(e){return u[e]!==l[e]}));if(0<d.length){if(a)return!0;c.removeAttribute("disabled")}else{if(a)return!1;c.setAttribute("disabled","disabled")}}},te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(y.addFilter)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",K(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(p.unescape)(t)};function ae(){return Object(y.applyFilters)("googlesitekit.dateRange",Object(O.__)("Last 28 days","google-site-kit"))}function ie(){return ae().replace("Last ","")}function oe(){return e=ae(),Object(p.toLower)(Object(p.deburr)(Object(p.trim)(e.replace(/[\s./_]+/g,"-"),"-")));var e}function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(googlesitekit){var o=v.a.createElement(f.a,{id:e,width:n,height:a,className:i});return t?o=v.a.createElement(f.a,{id:"".concat(e,"-disabled"),width:n,height:a,className:i}):"pagespeed-insights"===e&&(o=v.a.createElement("img",{src:googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:n,alt:"",className:i})),o}}function se(){window.localStorage&&window.localStorage.clear(),window.sessionStorage&&window.sessionStorage.clear()}function ce(e){var t={};return Object.keys(e).sort().forEach((function(n){var a=e[n];a&&"object"===o()(a)&&!Array.isArray(a)&&(a=ce(a)),t[n]=a})),t}},20:function(e,t,n){"use strict";n(1);var a=n(8),i=n.n(a),o=function(e){var t=e.id,n=e.className,a=e.height,i=e.width,o="".concat(googlesitekit.admin.assetsRoot,"svg/svg.svg");return React.createElement("svg",{className:"svg".concat(" ",n),height:a,width:i},React.createElement("use",{xlinkHref:"".concat(o,"#").concat(t)}))};o.propTypes={id:i.a.string.isRequired,className:i.a.string,height:i.a.string,width:i.a.string},o.defaultProps={className:"",height:20,width:20},t.a=o},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(11),h=n(10),f=n(59),b=16;function v(e){return Object(f.createHigherOrderComponent)((function(t){var n,a="core/with-filters/"+e;var o=function(o){function s(){var a;return i()(this,s),a=c()(this,u()(s).apply(this,arguments)),void 0===n&&(n=Object(h.applyFilters)(e,t)),a}return g()(s,o),r()(s,[{key:"componentDidMount",value:function(){s.instances.push(this),1===s.instances.length&&(Object(h.addAction)("hookRemoved",a,l),Object(h.addAction)("hookAdded",a,l))}},{key:"componentWillUnmount",value:function(){s.instances=Object(p.without)(s.instances,this),0===s.instances.length&&(Object(h.removeAction)("hookRemoved",a),Object(h.removeAction)("hookAdded",a))}},{key:"render",value:function(){return React.createElement(n,this.props)}}]),s}(m.Component);o.instances=[];var s=Object(p.debounce)((function(){n=Object(h.applyFilters)(e,t),o.instances.forEach((function(e){e.forceUpdate()}))}),b);function l(t){t===e&&s()}return o}),"withFilters")}},22:function(e,t,n){"use strict";var a=n(82),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 o=n(151);n.d(t,"h",(function(){return o.a}));var r=n(162);n.d(t,"e",(function(){return r.a}));var s=n(163);n.d(t,"g",(function(){return s.a}));var c=n(97),l=n.n(c);n.d(t,"k",(function(){return l.a})),n.d(t,"j",(function(){return c.Option}));var u=n(164);n.d(t,"i",(function(){return u.a}));var d=n(160);n.d(t,"d",(function(){return d.a}));var g=n(159);n.d(t,"c",(function(){return g.a}));var m=n(157);n.d(t,"f",(function(){return m.a}))},24: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(n){return Object(a.createElement)(a.Fragment,{},"",Object(a.createElement)(t,n),e)}}}},25:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(60),k=n(20),_=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).handleClick=n.handleClick.bind(g()(n)),n.handleKeyPress=n.handleKeyPress.bind(g()(n)),n}return p()(t,e),r()(t,[{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 e=this.props,t=e.className,n=e.title,a=e.datapoint,i=e.datapointUnit,o=e.change,r=e.changeDataUnit,s=e.context,c=e.period,l=e.selected,u=e.handleStatSelection,d=e.source,g=e.sparkline,m=e.reverseArrowDirection,p="button"===s?"button":"",f=0<=o?"-positive":"-negative";return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-data-block\n\t\t\t\t\tgooglesitekit-data-block--".concat(s,"\n\t\t\t\t\t").concat(l?"googlesitekit-data-block--selected":"","\n\t\t\t\t\t").concat(t,"\n\t\t\t\t"),tabIndex:"button"===s?"0":"-1",role:u&&p,onClick:u&&this.handleClick,onKeyPress:u&&this.handleKeyPress,"aria-label":u&&n,"aria-pressed":u&&l},React.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},n),React.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(a).concat(i))),g&&React.createElement("div",{className:"googlesitekit-data-block__sparkline"},g),React.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},React.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-data-block__change\n\t\t\t\t\t\tgooglesitekit-data-block__change--".concat(0<=o?"positive":"negative","\n\t\t\t\t\t")},""===o&&React.createElement(h.Fragment,null," "),o&&[React.createElement("span",{key:"arrow",className:"googlesitekit-data-block__arrow ".concat(m?"googlesitekit-data-block__arrow--reverse":"")},React.createElement(k.a,{id:"arrow".concat(f),height:"9",width:"9"})),React.createElement("span",{key:"values",className:"googlesitekit-data-block__value"},"".concat(Math.abs(o)).concat(r," ").concat(c))]),d&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:d.name,href:d.link})))}}]),t}(h.Component);_.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,reverseArrowDirection:b.a.bool},_.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,reverseArrowDirection:!1},t.a=_},26:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(9),k=n(25),_=n(29);var y=function(){return React.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"},React.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),React.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"}))},O=n(88),w=n(14),R=n(20),j=n(11),E=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={isClosed:!1},n.cardRef=Object(h.createRef)(),n.handleDismiss=n.handleDismiss.bind(g()(n)),0<n.props.dismissExpires&&n.expireDismiss(),n.props.showOnce&&v.c.setCache("notification::displayed::".concat(n.props.id),new Date),n}return p()(t,e),r()(t,[{key:"handleDismiss",value:function(e){var t=this,n=this.state.isClosed,a=this.cardRef.current;e.preventDefault(),this.setState({isClosed:!n}),setTimeout((function(){v.c.setCache("notification::dismissed::".concat(t.props.id),new Date),a.style.display="none";var e=new Event("notificationDismissed");document.dispatchEvent(e)}),350)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,n=e.dismissExpires,a=v.c.getCache("notification::dismissed::".concat(t));if(a){var i=new Date(a);i.setSeconds(i.getSeconds()+parseInt(n,10)),i<new Date&&v.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var e=this.state.isClosed,t=this.props,n=t.children,a=t.id,i=t.title,o=t.description,r=t.blockData,s=t.winImage,c=t.smallImage,l=t.format,u=t.learnMoreURL,d=t.learnMoreDescription,g=t.learnMoreLabel,m=t.ctaLink,p=t.ctaLabel,f=t.ctaTarget,b=t.type,E=t.dismiss,C=t.isDismissable,D=t.logo,N=t.module,x=t.moduleName,S=t.pageIndex;if(v.c.getCache("notification::dismissed::".concat(a)))return null;var A,L=e?"is-closed":"is-open",I="large"===l&&"win-stats-increase"===b,P="mdc-layout-grid__cell--span-12";"large"===l?(P="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 ",I&&(P="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"===l&&(P="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),A="win-warning"===b?React.createElement(y,null):"win-error"===b?React.createElement(O.a,null):"";var M=React.createElement(h.Fragment,null,r&&React.createElement("div",{className:"mdc-layout-grid__inner"},Object(j.map)(r,(function(e,t){return React.createElement("div",{key:t,className:"mdc-layout-grid__cell ".concat(I?"mdc-layout-grid__cell--span-5-desktop":"mdc-layout-grid__cell--span-4-desktop")},React.createElement("div",{className:"googlesitekit-publisher-win__stats"},React.createElement(k.a,e)))})))),T=React.createElement(h.Fragment,null,React.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},i),o&&React.createElement("div",{className:"googlesitekit-publisher-win__desc"},React.createElement("p",null,o,g&&React.createElement(h.Fragment,null," ",React.createElement(w.a,{href:u,external:!0,inherit:!0},g),d),S&&React.createElement("span",{className:"googlesitekit-publisher-win__detect"},S))),n),U=N?React.createElement(R.a,{id:N,height:"19",width:"19"}):React.createElement(R.a,{id:"logo-g",height:"34",width:"32"});return React.createElement("section",{ref:this.cardRef,className:"\n\t\t\t\tgooglesitekit-publisher-win\n\t\t\t\t".concat(l?"googlesitekit-publisher-win--".concat(l):"","\n\t\t\t\t").concat(b?"googlesitekit-publisher-win--".concat(b):"","\n\t\t\t\t").concat(L?"googlesitekit-publisher-win--".concat(L):"","\n\t\t\t")},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},D&&React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12 ".concat(I?"mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet":"")},React.createElement("div",{className:"googlesitekit-publisher-win__logo"},U),x&&React.createElement("div",{className:"googlesitekit-publisher-win__module-name"},x)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:c})),React.createElement("div",{className:"mdc-layout-grid__cell ".concat(P)},I?React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},T),React.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"},M)):React.createElement(h.Fragment,null,T,M),m&&React.createElement(_.a,{href:m,target:f},p),C&&E&&React.createElement(w.a,{onClick:this.handleDismiss},E)),s&&React.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 "},React.createElement("div",{className:"googlesitekit-publisher-win__image-large"},React.createElement("img",{alt:"",src:s}))),("win-error"===b||"win-warning"===b)&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("div",{className:"googlesitekit-publisher-win__icons"},A)))))}}]),t}(h.Component);E.propTypes={id:b.a.string.isRequired,title:b.a.string.isRequired,description:b.a.string,learnMoreURL:b.a.string,learnMoreDescription:b.a.string,learnMoreLabel:b.a.string,blockData:b.a.array,winImage:b.a.string,smallImage:b.a.string,format:b.a.string,ctaLink:b.a.string,ctaLabel:b.a.string,type:b.a.string,dismiss:b.a.string,isDismissable:b.a.bool,logo:b.a.bool,module:b.a.string,moduleName:b.a.string,pageIndex:b.a.string,dismissExpires:b.a.number,showOnce:b.a.bool},E.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1};t.a=E},29:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(22),h=n(8),f=n.n(h),b=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).buttonRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new p.h(this.buttonRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.children,a=e.href,i=e.text,o=e.className,r=e.danger,s=e.disabled,c=e.target,l=e.id,u=e.icon,d=e.trailingIcon,g=e.ariaHaspopup,m=e.ariaExpanded,p=e.ariaControls,h=a?"a":"button";return React.createElement(h,{className:"\n\t\t\t\t\tmdc-button\n\t\t\t\t\t".concat(!i&&"mdc-button--raised","\n\t\t\t\t\t").concat(o&&o,"\n\t\t\t\t\t").concat(r?"mdc-button--danger":"","\n\t\t\t\t"),onClick:t,href:a,ref:this.buttonRef,disabled:s?"disabled":"",target:c||"_self",id:l,"aria-haspopup":g,"aria-expanded":m,"aria-controls":p},u&&u,React.createElement("span",{className:"mdc-button__label"},n),d&&d)}}]),t}(m.Component);b.propTypes={onClick:f.a.func,children:f.a.string.isRequired,href:f.a.string,text:f.a.bool,className:f.a.string,danger:f.a.bool,disabled:f.a.bool,icon:f.a.element,trailingIcon:f.a.element,ariaHaspopup:f.a.string,ariaExpanded:f.a.bool,ariaControls:f.a.string},b.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=b},31:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.small,a=e.compress,i=e.height,o=i?Math.round(i/2):null;return React.createElement("div",{role:"progressbar",className:"\n\t\t\t\t\tmdc-linear-progress\n\t\t\t\t\tmdc-linear-progress--indeterminate\n\t\t\t\t\t".concat(t||"","\n\t\t\t\t\t").concat(n?"mdc-linear-progress--small":"","\n\t\t\t\t\t").concat(a?"mdc-linear-progress--compress":"","\n\t\t\t\t"),style:{marginTop:o,marginBottom:o}},React.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),React.createElement("div",{className:"mdc-linear-progress__buffer"}),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),t}(m.Component);f.propTypes={className:h.a.string,small:h.a.bool,compress:h.a.bool},f.defaultProps={className:"",small:!1,compress:!1},t.a=f},32:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.description,a=e.ctaLink,i=e.ctaLabel,o=e.error,r=e.onClick;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-cta\n\t\t\t\t".concat(o?"googlesitekit-cta--error":"","\n\t\t\t")},t&&React.createElement("h3",{className:"googlesitekit-cta__title"},t),n&&React.createElement("p",{className:"googlesitekit-cta__description"},n),i&&React.createElement(f.a,{href:a,onClick:r,inverse:!o,caps:!0,arrow:!0},i))}}]),t}(m.Component);b.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},b.defaultProps={title:"",description:"",ctaLink:"",ctaLabel:"",error:!1,onClick:function(){}},t.a=b},33:function(e,t,n){"use strict";n.r(t),n.d(t,"extractSearchConsoleDashboardData",(function(){return r})),n.d(t,"isDataZeroSearchConsole",(function(){return s}));var a=n(2),i=n(11);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"}]],n=0,o=0,r=0,s=0,c=e.length;Object(i.each)(e,(function(e){var a=new Date(e.keys[0]);t.push([a.getMonth()+1+"/"+a.getUTCDate(),e.clicks,e.impressions,e.ctr,e.position]),n+=e.clicks,o+=e.impressions,r+=e.ctr,s+=e.position}));var l=n,u=o;n=Object(a.t)(n),o=Object(a.t)(o);var d=(r/c*100).toFixed(1),g=r/c,m=(s/c).toFixed(1);return{dataMap:t,totalClicks:n,totalClicksRaw:l,totalImpressions:o,totalImpressionsRaw:u,averageCTR:d,averageCTRRaw:g,averagePosition:m}}var r=function(e){var t=Math.floor(e.length/2),n=e.slice(e.length-t,e.length),i=e.slice(0,e.length-t),r=o(n),s=o(i),c=Object(a.c)(s.totalClicksRaw,r.totalClicksRaw),l=Object(a.c)(s.totalImpressionsRaw,r.totalImpressionsRaw),u=Object(a.c)(s.averageCTRRaw,r.averageCTRRaw),d=Object(a.c)(s.averagePosition,r.averagePosition);return{dataMap:r.dataMap,totalClicks:r.totalClicks,totalImpressions:r.totalImpressions,averageCTR:r.averageCTR,averagePosition:r.averagePosition,totalClicksChange:c,totalImpressionsChange:l,averageCTRChange:u,averagePositionChange:d}},s=function(e){if(!e.length)return!0;var t=r(e),n=t.totalClicks,a=t.totalImpressions,i=t.averageCTR,o=t.averagePosition;return 0===parseInt(n)&&0===parseInt(a)&&0===parseInt(i)&&0===parseInt(o)}},42:function(e,t,n){"use strict";n(1);var a=n(0),i=n(14);t.a=function(){var e=Object(a.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},43:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component),f=Object(p.a)("googlesitekit.ErrorNotification")(h),b=n(81),v=n(12),k=n.n(v),_=n(13),y=n.n(_),O=n(67),w=n(29),R=n(22),j=n(8),E=n.n(j),C=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new R.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 e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(m.Component);C.propTypes={menuOpen:E.a.bool.isRequired,menuItems:E.a.array.isRequired,id:E.a.string.isRequired};var D=C,N=n(80),x=n(2),S=n(0),A=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(y()(n)),n.handleMenuClose=n.handleMenuClose.bind(y()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(y()(n)),n.handleDialog=n.handleDialog.bind(y()(n)),n.handleDialogClose=n.handleDialogClose.bind(y()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(y()(n)),n.menuButtonRef=Object(m.createRef)(),n.menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);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 k.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(x.d)(),document.location=Object(x.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,r=e.proxyPermissionsURL,s=this.state,c=s.dialogActive,l=s.menuOpen;return React.createElement(m.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(w.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(S.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},a),React.createElement(D,{ref:this.menuRef,menuOpen:l,menuItems:[Object(S.__)("Disconnect","google-site-kit")].concat(r?[Object(S.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(N.a,null,React.createElement(O.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(S.__)("Disconnect","google-site-kit"),subtitle:Object(S.__)("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(S.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(m.Component),L=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(m.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(b.a,null)),React.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 "},e&&React.createElement(A,null))))),React.createElement(f,null))}}]),t}(m.Component);t.a=L},47:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(69),h=n(8),f=n.n(h),b=n(20),v=n(10),k=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.icon,a=e.iconWidth,i=e.iconHeight,o=e.iconID,r=e.className,s=e.status,c=e.statusText,l=e.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(v.applyFilters)("googlesitekit.showDateRangeSelector-".concat(o),!1),d=!(""===s&&!u);return React.createElement("header",{className:"googlesitekit-page-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:l},n&&React.createElement(b.a,{id:o,height:i,width:a,className:"googlesitekit-page-header__icon"}),React.createElement("h1",{className:"googlesitekit-page-header__title ".concat(r)},t)),d&&React.createElement("div",{className:"\n\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-bottom\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-right-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t\t\t\t"},React.createElement("div",{className:"googlesitekit-page-header__details"},s&&React.createElement("span",{className:"\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status--".concat(s,"\n\t\t\t\t\t\t\t\t\t")},c),u&&React.createElement("span",{className:"googlesitekit-page-header__range"},React.createElement(p.a,null))))))}}]),t}(m.Component);k.propTypes={title:f.a.string,icon:f.a.bool,iconID:f.a.string,iconWidth:f.a.string,iconHeight:f.a.string,className:f.a.string,status:f.a.string,statusText:f.a.string,fullWidth:f.a.bool},k.defaultProps={title:"",icon:!1,iconID:"",iconWidth:"",iconHeight:"",className:"googlesitekit-heading-3",status:"",statusText:"",fullWidth:!1},t.a=k},53:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.a=Object(p.a)("googlesitekit.ModuleSettingsWarning")(h)},54:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(26),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return React.createElement(p.a,this.props)}}]),t}(m.Component);t.a=h},58:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(9),r=n(2),s=n(3),c=n.n(s),l=n(4),u=n.n(l),d=n(11),g=function(){function e(t){c()(this,e),this.wins=t,this.response=[]}return u()(e,[{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(d.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(o.c.combinedGetFromCache(e));case 3:return n.abrupt("return",this.response);case 4:case"end":return n.stop()}}),null,this)}}]),e}(),m=n(10);n.d(t,"g",(function(){return h})),n.d(t,"f",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"b",(function(){return _})),n.d(t,"d",(function(){return y})),n.d(t,"e",(function(){return O})),n.d(t,"a",(function(){return w}));var p=Object(m.applyFilters)("googlesitekit.winCallbacks",{}),h=function(){return Object(m.applyFilters)("googlesitekit.WinsNotificationsRequest",[])},f=function(){return Object(m.applyFilters)("googlesitekit.ModulesNotificationsRequest",[])};function b(){var e,t,n,a;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if((e=window.googlesitekit.setup).isSiteKitConnected&&(e.isAuthenticated||e.isVerified)){o.next=3;break}return o.abrupt("return",0);case 3:return t=0,o.next=6,i.a.awrap(_());case 6:return(n=o.sent)&&n.total&&(t+=n.total),o.next=10,i.a.awrap(y());case 10:return(a=o.sent)&&a.total&&(t+=a.total),t=Object(m.applyFilters)("googlesitekit.TotalNotifications",t),t=Math.max(0,Math.abs(t)),window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),o.abrupt("return",t);case 16:case"end":return o.stop()}}))}var v=function(e){return e?e.length?e.filter((function(e){return!o.c.getCache("notification::dismissed::".concat(e.id))})):e:[]},k=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=o.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(r.j)(n,i)&&o.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 _(){var e,t,n,a;return i.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return e={},t=0,s.next=4,i.a.awrap(f());case 4:return n=s.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(s){for(;;)switch(s.prev=s.next){case 0:return n=e.identifier,s.t0=v,s.next=4,i.a.awrap(o.c.getNotifications(n,Object(r.p)("day")));case 4:s.t1=s.sent,a=(0,s.t0)(s.t1),t({identifier:n,notifications:a});case 7:case"end":return s.stop()}}))})),a.push(t);case 2:case"end":return n.stop()}}))})),s.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 s.abrupt("return",{results:e,total:t});case 10:case"end":return s.stop()}}))}function y(){var e,t,n,a,o;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e={},t=0,r.next=4,i.a.awrap(h());case 4:return n=r.sent,r.next=7,i.a.awrap(new g(n).get());case 7:return a=r.sent,o=[],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,o,r,s,c;return i.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=e.identifier,o=e.callback||Object(d.camelCase)(n),r=null,s=[],e.withData?(c=a[n]||null,r=p[o](c,n)):r=p[o](n),s=v(s=r?[r]:[]),t({identifier:n,notifications:s});case 8:case"end":return i.stop()}}))})),o.push(t);case 2:case"end":return n.stop()}}))})),r.next=12,i.a.awrap(Promise.all(o).then((function(t){t.forEach((function(t){t.notifications.length&&(e[t.identifier]=t.notifications)}))})));case 12:return e=k(e),t=e.length||Object.keys(e).length||0,r.abrupt("return",{results:e,total:t});case 15:case"end":return r.stop()}}))}var O=function(e){var t=Math.abs(e.count)+1;return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}},w=function(e){var t=Math.max(0,Math.abs(e.count)-1);return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}}},60:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=n(0),v=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.href,a=e.className,i=e.external;return React.createElement("div",{className:"googlesitekit-source-link ".concat(a)},[Object(b.__)("Source:","google-site-kit")," ",React.createElement(f.a,{key:"link",href:n,external:i,inherit:!0},t)])}}]),t}(m.Component);v.propTypes={name:h.a.string,href:h.a.string,className:h.a.string,external:h.a.bool},v.defaultProps={name:"",href:"",className:"",external:!1},t.a=v},62:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.isSaving;return React.createElement("span",{className:"spinner",style:{display:e?"inline-block":"none",float:"none",marginTop:"0",visibility:"visible"}})}}]),t}(m.Component);t.a=p},63:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(3),r=n.n(o),s=n(4),c=n.n(s),l=n(5),u=n.n(l),d=n(6),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(2),b=n(9),v=n(32),k=n(8),_=n.n(k),y=n(54),O=n(0),w=function(e){function t(){return r()(this,t),u()(this,g()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,n=e.title,a=e.description,i=e.ctaLabel;return googlesitekit.permissions.canManageOptions?React.createElement(v.a,{title:n,description:a,onClick:t.setupAnalyticsClick,ctaLabel:i}):null}}],[{key:"setupAnalyticsClick",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(f.a)(b.c,"analytics",!0));case 3:return e.next=5,i.a.awrap(Object(f.u)());case 5:window.location=Object(f.m)("analytics",!0),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),Object(f.w)(y.a,{id:"analytics-setup-error",title:Object(O.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 11:case"end":return e.stop()}}),null,null,[[0,8]])}}]),t}(h.Component);w.propTypes={title:_.a.string,description:_.a.string,ctaLabel:_.a.string},w.defaultProps={title:Object(O.__)("Learn more about what visitors do on your site.","google-site-kit"),description:Object(O.__)("Connecting with Google Analytics to see unique vistors, goal completions, top pages and more.","google-site-kit"),ctaLabel:Object(O.__)("Set up Analytics","google-site-kit")},t.a=w},65:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));var a=n(18),i=n(1),o=i.Suspense?i.Suspense:a.Suspense,r=i.lazy?i.lazy:a.lazy},67:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(29),b=n(14),v=n(22),k=n(145),_=n.n(k),y=n(0),O=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(m.createRef)(),e}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new v.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,r=e.subtitle,s=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(_.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),r&&React.createElement("p",{className:"mdc-dialog__lead"},r),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},s||Object(y.__)("Disconnect","google-site-kit")),React.createElement(b.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(m.Component);O.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},O.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=O},69:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(22),b=n(0),v=n(10),k=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={context:"Dashboard"},n.dateRangeHook="googlesitekit.dateRange",n.dateRangeHandlerHook="googlesitekit.dateRageHandler",n.dateRangeHookAddedHook="googlesitekit.dateRageHookAddedHandler",Object(v.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector",(function(e){n.setState({context:e}),Object(v.removeAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector")})),n.handleSelection=n.handleSelection.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(v.addAction)("hookAdded",this.dateRangeHookAddedHook,(function(t){e.dateRangeHook===t&&e.forceUpdate()}))}},{key:"componentWillUnmount",value:function(){Object(v.removeAction)("hookAdded",this.dateRangeHookAddedHook)}},{key:"handleSelection",value:function(e,t){var n=this.state.context,a=t.getAttribute("data-value");return Object(v.removeFilter)(this.dateRangeHook,this.dateRangeHandlerHook),Object(v.addFilter)(this.dateRangeHook,this.dateRangeHandlerHook,(function(){return a})),Object(v.doAction)("googlesitekit.moduleDataReset"),Object(v.doAction)("googlesitekit.moduleLoaded",n),!1}},{key:"render",value:function(){var e=[Object(b.__)("Last 7 days","google-site-kit"),Object(b.__)("Last 14 days","google-site-kit"),Object(b.__)("Last 28 days","google-site-kit"),Object(b.__)("Last 90 days","google-site-kit")];return React.createElement(f.k,{enhanced:!0,className:"mdc-select--minimal",name:"time_period",label:"",onEnhancedChange:this.handleSelection,options:e,value:Object(v.applyFilters)(this.dateRangeHook,Object(b.__)("Last 28 days","google-site-kit"))})}}]),t}(h.Component);t.a=k},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(m.createPortal)(this.props.children,this.el)}}]),t}(m.Component)},81:function(e,t,n){"use strict";n(1);var a=n(20),i=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(a.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(a.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(i.__)("Site Kit by Google Logo","google-site-kit")))}},87:function(e,t,n){"use strict";n(1);var a=n(26),i=n(0);t.a=function(){var e=googlesitekit.admin.connectURL;return React.createElement(a.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:e,ctaLabel:Object(i.__)("Click here","google-site-kit")})}},88:function(e,t,n){"use strict";n(1);t.a=function(){return React.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"},React.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"}))}},89:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(58),b=n(0),v=n(10),k=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={count:0},n.handleIncrement=n.handleIncrement.bind(g()(n)),n.handleDecrement=n.handleDecrement.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(v.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(v.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications"),Object(f.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(f.e)}},{key:"handleDecrement",value:function(){this.setState(f.a)}},{key:"render",value:function(){var e=Object(b.sprintf)(Object(b._n)("%d notification","%d notifications",this.state.count,"google-site-kit"),this.state.count),t=React.createElement("span",{id:"googlesitekit-notifications-counter",className:"googlesitekit-notifications-counter update-plugins count-".concat(this.state.count)},React.createElement("span",{className:"plugin-count","aria-hidden":"true"},this.state.count),React.createElement("span",{className:"screen-reader-text"},e));return Object(h.createPortal)(t,document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"))}}]),t}(h.Component);t.a=k},9:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(27),r=n.n(o),s=n(49),c=n.n(s),l=n(87),u=(n(1),n(26)),d=n(0),g=function(){return React.createElement(u.a,{id:"permission error",title:Object(d.__)("Permissions issue accessing data","google-site-kit"),description:Object(d.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})},m=n(165),p=n.n(m),h=n(2),f=n(11),b=n(35),v=n.n(b),k=n(36),_=n(10);function y(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 O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(n,!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return R}));var w="core",R="modules",j=function(){googlesitekit.admin=googlesitekit.admin||{},"string"==typeof googlesitekit.admin.datacache&&(googlesitekit.admin.datacache=JSON.parse(googlesitekit.admin.datacache)),"object"!==c()(googlesitekit.admin.datacache)&&(googlesitekit.admin.datacache={})},E=function(e,t){var n=O({data:{}},e);return n.data=O({dateRange:t},n.data),n},C={maxRequests:10,init:function(){googlesitekit.initialized||(googlesitekit.initialized=!0,this.collectModuleData=this.collectModuleData.bind(this),googlesitekit.cache=[],Object(_.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingData",this.collectModuleData))},combinedGetFromCache:function(e){var t=this;return new Promise((function(n,a){try{var i=[],o=Object(h.h)();Object(f.each)(e,(function(e){var n=E(e,o);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,o=Object(h.h)();Object(f.each)(e,(function(e){var n=E(e,o);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var r=t.getCache(n.key,n.maxAge);void 0!==r?(setTimeout((function(){t.resolve(n,r)}),i),i+=25):a.push(n)})),a=Object(f.sortBy)(a,"priority");var r=[],s=[],c={},u=!!a.find((function(e){return e.priority<10}));Object(f.each)(a,(function(e,t){!n&&10<=e.priority&&u?s.push(e):c[e.key]?c[e.key].push(t):(c[e.key]=[t],r.push(e))}));var d=10,m=r.slice(0,d),p=r.slice(d);if(p=p.concat(s),0!==m.length||0!==p.length){0<p.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(p,!0)}),50):this.maxRequests=10;var b=null!==Object(h.l)("datacache");return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/data/",{datacache:b||void 0}),data:{request:m},method:"POST"}).then((function(e){Object(f.each)(e,(function(e,n){if(e.xdebug_message)console.log("data_error",e.xdebug_message);else{if(!c[n])return void console.log("data_error","unknown response key "+n);e.error_data&&e.error_data[403]&&e.error_data[403].reason&&("insufficientPermissions"===e.error_data[403].reason?Object(_.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",Object(h.g)(l.a),1):"forbidden"===e.error_data[403].reason&&Object(_.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",Object(h.g)(g),1),Object(_.addFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(_.removeFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+1}))),Object(f.each)(c[n],(function(n){var i=a[n];t.setCache(i.key,e),t.resolve(i,e)}))}0===p.length&&Object(_.doAction)("googlesitekit.dataLoaded","api")}))})).catch((function(e){console.log("error",e)}))}Object(_.doAction)("googlesitekit.dataLoaded","cache")},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(e,t){if(void 0!==t&&(!t||"object"!==c()(t)||!t.error&&!t.errors)){j(),googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(t);var n={value:t,date:Date.now()/1e3};Object(h.o)().setItem("googlesitekit_"+e,JSON.stringify(n))}},getCache:function(e,t){if(!googlesitekit.admin.nojscache){if(j(),void 0!==googlesitekit.admin.datacache[e])return googlesitekit.admin.datacache[e];var n=JSON.parse(Object(h.o)().getItem("googlesitekit_"+e));return n&&"object"===c()(n)&&n.date&&(!t||Date.now()/1e3-n.date<t)?(googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(n.value),Object(f.cloneDeep)(googlesitekit.admin.datacache[e])):void 0}},deleteCache:function(e){j(),delete googlesitekit.admin.datacache[e],Object(h.o)().removeItem("googlesitekit_"+e)},invalidateCacheGroup:function(e,t,n){var a=this.getCacheKey(e,t,n);j(),Object.keys(googlesitekit.admin.datacache).forEach((function(e){0!==e.indexOf(a+"::")&&e!==a||delete googlesitekit.admin.datacache[e]})),Object.keys(Object(h.o)()).forEach((function(e){0!==e.indexOf("googlesitekit_"+a+"::")&&e!=="googlesitekit_"+a||Object(h.o)().removeItem(e)}))},collectModuleData:function(e,t){var n=Object(_.applyFilters)("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]:{},o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.getCacheKey(e,t,n,i);if(!o){var s=this.getCache(r,3600);if(void 0!==s)return new Promise((function(e){e(s)}))}return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),i)}).then((function(e){return o||a.setCache(r,e),new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))},getNotifications:function(e){var t,n,a,o=arguments;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=o.length>1&&void 0!==o[1]?o[1]:0,n=[],e){r.next=4;break}return r.abrupt("return",n);case 4:if(a=this.getCacheKey("modules",e,"notifications"),(n=C.getCache(a,t))&&0!==n.length){r.next=11;break}return r.next=9,i.a.awrap(v()({path:"/google-site-kit/v1/modules/".concat(e,"/notifications/")}));case 9:n=r.sent,C.setCache(a,n);case 11:return r.abrupt("return",n);case 12:case"end":return r.stop()}}),null,this)},set:function(e,t,n,a){var i={};return i.data=a,v()({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),data:i,method:"POST"}).then((function(a){return C.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=[],o=[e,t,n],r=0,s=o;r<s.length;r++){var l=s[r];if(!l||!l.length)break;i.push(l)}return 3===i.length&&a&&"object"===c()(a)&&Object.keys(a).length&&i.push(p()(JSON.stringify(Object(h.x)(a)))),i.join("::")},setModuleActive:function(e,t){return v()({path:"/google-site-kit/v1/modules/".concat(e),data:{active:t},method:"POST"}).then((function(e){return new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))}};C.init();t.c=C}}]);
1
+ (window.webpackJsonp=window.webpackJsonp||[]).push([[1],{14:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.href,a=e.children,i=e.className,o=e.arrow,r=e.external,s=e.inverse,c=e.back,l=e.small,u=e.inherit,d=e.caps,g=e.danger,m=e.disabled,p=e.id,h=n&&!m,f=h?"a":"button";return React.createElement(f,{className:"\n\t\t\t\t\tgooglesitekit-cta-link\n\t\t\t\t\t".concat(i||"","\n\t\t\t\t\t").concat(o?"googlesitekit-cta-link--arrow":"","\n\t\t\t\t\t").concat(r?"googlesitekit-cta-link--external":"","\n\t\t\t\t\t").concat(s?"googlesitekit-cta-link--inverse":"","\n\t\t\t\t\t").concat(c?"googlesitekit-cta-link--back":"","\n\t\t\t\t\t").concat(l?"googlesitekit-cta-link--small":"","\n\t\t\t\t\t").concat(u?"googlesitekit-cta-link--inherit":"","\n\t\t\t\t\t").concat(d?"googlesitekit-cta-link--caps":"","\n\t\t\t\t\t").concat(g?"googlesitekit-cta-link--danger":"","\n\t\t\t\t\t").concat(m?"googlesitekit-cta-link--disabled":"","\n\t\t\t\t"),onClick:t,id:p,href:h?n:void 0,target:h&&r?"_blank":void 0,rel:r?"noopener noreferrer":void 0,disabled:m},a)}}]),t}(m.Component);f.propTypes={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={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},15:function(e,t,n){"use strict";n.r(t),n.d(t,"extractAnalyticsDataForTrafficChart",(function(){return r})),n.d(t,"extractAnalyticsDashboardData",(function(){return c})),n.d(t,"extractAnalyticsDashboardSparklineData",(function(){return l})),n.d(t,"calculateOverviewData",(function(){return u})),n.d(t,"translateAnalyticsError",(function(){return d})),n.d(t,"getAnalyticsErrorMessageFromData",(function(){return g})),n.d(t,"isDataZeroForReporting",(function(){return m})),n.d(t,"analyticsAdsenseReportDataDefaults",(function(){return p})),n.d(t,"siteAnalyticsReportDataDefaults",(function(){return h})),n.d(t,"overviewReportDataDefaults",(function(){return f})),n.d(t,"trafficSourcesReportDataDefaults",(function(){return b})),n.d(t,"getTopPagesReportDataDefaults",(function(){return v}));var a=n(2),i=n(11),o=n(0),r=function(e){if(!e||!e.length)return null;var t=e[0].data,n=t.rows,a=t.totals[0].values[0],o=[["Source","Percent"]];return Object(i.each)(n,(function(e){var t=e.metrics[0].values[0]/a;if(1>100*t)return!1;var n=e.dimensions[0].replace(/\(none\)/gi,"direct");o.push([n,t])})),o};function s(e,t){var n=[];return Object(i.each)(e,(function(e){if(e.metrics){var a=e.metrics[0].values,i=e.dimensions[0],o=i.slice(0,4)+"-"+i.slice(4,6)+"-"+i.slice(6,8),r=new Date(o);n.push([r,a[t]])}})),n}var c=function(e,t,n){if(!e||!e.length)return null;var a=e[0].data.rows;if(!a)return!1;var r=a.length;if(2*n>r){for(var c=new Date,l=0;n>l;l++){var u=(c.getMonth()+1).toString(),d=c.getDate().toString(),g=c.getFullYear().toString()+(2>u.length?"0":"")+u+(2>d.length?"0":"")+d;if(l>r){var m={dimensions:[g],metrics:[{values:[0,0,0,0,0]}]};a.unshift(m)}c.setDate(c.getDate()-1)}a.push([0,0])}var p=[Object(o.__)("Users","google-site-kit"),Object(o.__)("Sessions","google-site-kit"),Object(o.__)("Bounce Rate","google-site-kit"),Object(o.__)("Session Duration","google-site-kit")],h=[[{type:"date",label:Object(o.__)("Day","google-site-kit")},{type:"number",label:p[t]},{type:"number",label:Object(o.__)("Previous month","google-site-kit")}]],f=a.slice(a.length-n,a.length),b=a.slice(0,a.length-n),v=s(f,t),k=s(b,t);return Object(i.each)(v,(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,n=[[{type:"date",label:"Day"},{type:"number",label:"Users"},{type:"number",label:"Sessions"},{type:"number",label:"Goals Completed"}]];return Object(i.each)(t,(function(e){var t=e.metrics[0].values,a=e.dimensions[0],i=a.slice(0,4)+"-"+a.slice(4,6)+"-"+a.slice(6,8),o=new Date(i);n.push([o,t[0],t[1],t[4]])})),n},u=function(e){if(!e||!e.length)return!1;var t=e[0].data.totals,n=t[0].values,i=t[1].values,o=n[0],r=n[1],s=n[2],c=n[3],l=n[4],u=n[5];return{totalUsers:o,totalSessions:r,averageBounceRate:s,averageSessionDuration:c,totalUsersChange:Object(a.c)(i[0],n[0]),totalSessionsChange:Object(a.c)(i[1],n[1]),averageBounceRateChange:Object(a.c)(i[2],n[2]),averageSessionDurationChange:Object(a.c)(i[3],n[3]),goalCompletions:l,goalCompletionsChange:Object(a.c)(i[4],n[4]),totalPageViews:u,totalPageViewsChange:Object(a.c)(i[5],n[5])}},d=function(e,t){var n="";switch(e){case"INVALID_ARGUMENT":n=Object(o.__)("Analytics module needs to be configured.","google-site-kit");break;case"UNAUTHENTICATED":n=Object(o.__)("You need to be authenticated to get this data.","google-site-kit");break;case"PERMISSION_DENIED":n=Object(o.__)("Your account does not have sufficient permission to access this data, please consult to your web administrator.","google-site-kit");break;case"RESOURCE_EXHAUSTED":n=Object(o.__)("Your account exceeded the maximum quota. Please try again later.","google-site-kit");break;case"INTERNAL":n=Object(o.__)("Unexpected internal server error occurred.","google-site-kit");break;case"BACKEND_ERROR":n=Object(o.__)("Analytics server returned unknown error. Please try again later.","google-site-kit");break;case"UNAVAILABLE":n=Object(o.__)("The service was unable to process the request. Please try again later.","google-site-kit");break;default:n=t}return n},g=function(e){return!(!e.error||!e.error.status)&&d(e.error.status,e.error.message)},m=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,n=!0;return Object(i.each)(t,(function(e){0!==parseInt(e)&&(n=!1)})),n}return!1},p={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},h={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},f={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={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},v=function(){var e=[{expression:"ga:pageviews",alias:"Pageviews"},{expression:"ga:uniquePageviews",alias:"Unique Pageviews"},{expression:"ga:bounceRate",alias:"Bounce rate"}];return window.googlesitekit.modules.analytics.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}}},158:function(e,t,n){"use strict";var a={};n.r(a),n.d(a,"totalStats",(function(){return u})),n.d(a,"firstPostWin",(function(){return d})),n.d(a,"pageviewIncrease",(function(){return m})),n.d(a,"publishingWin",(function(){return p})),n.d(a,"trafficIncrease",(function(){return h}));var i=n(27),o=n.n(i),r=n(2),s=n(9),c=n(33),l=n(0),u=function(e,t){if(5>=parseInt(googlesitekit.admin.newSitePosts,10))return!1;if(!e||!e.rows)return!1;var n=[],a=Object(l.__)("Here are some high level stats","google-site-kit");if(e&&e.rows){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalClicksChange,u=i.totalImpressions,d=i.totalImpressionsChange,g=i.averageCTR,m=i.averageCTRChange;0<s&&0<d&&0<m&&(a="".concat(Object(l.__)("Last month was great!","google-site-kit"),". ").concat(a)),n=[{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:o,datapointUnit:"",change:s,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:u,datapointUnit:"",change:d,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:g,datapointUnit:"%",change:m,changeDataUnit:"%",period:Object(l.__)("for month","google-site-kit")}]}var p=new Date,h=new Date(p.getFullYear(),p.getMonth()+1,0),f=Object(r.j)(p,h)+1;return{id:t,title:Object(l.__)("Welcome Back!","google-site-kit"),description:a,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/g-win.png"),blockData:n,type:"win-stats",dismissExpires:Object(r.p)("day")*f,showOnce:!0}},d=function(e){return!(1!==parseInt(googlesitekit.admin.newSitePosts,10))&&{id:e,title:Object(l.__)("Congrats on your first post!","google-site-kit"),format:"small",smallImage:"".concat(googlesitekit.admin.assetsRoot,"images/thumbs-up.png"),type:"win-success",showOnce:!0}},g=n(15),m=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e.reports)return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalPageViewsChange,i=n.totalPageViews;return!(10>a)&&{id:t,title:Object(l.__)("Increased page views!","google-site-kit"),description:Object(l.__)("Over the past 4 weeks","google-site-kit"),format:"large",logo:!1,winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun-small.png"),blockData:[{title:Object(l.__)("Total Page Views","google-site-kit"),datapoint:Object(r.r)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats-increase",dismissExpires:Object(r.p)("month"),showOnce:!0}},p=function(e,t){if(!(5===parseInt(googlesitekit.admin.newSitePosts,10)))return!1;var n=Object(l.__)("That’s out of this world.","google-site-kit"),a=[];if(googlesitekit.modules["search-console"]&&googlesitekit.modules["search-console"].active&&e){var i=Object(c.extractSearchConsoleDashboardData)(e),o=i.totalClicks,s=i.totalImpressions,u=i.averageCTR;a=[{title:Object(l.__)("Total Impressions","google-site-kit"),datapoint:Object(r.t)(s),datapointUnit:""},{title:Object(l.__)("Total Clicks","google-site-kit"),datapoint:Object(r.t)(o),datapointUnit:""},{title:Object(l.__)("Average CTR","google-site-kit"),datapoint:u,datapointUnit:"%"}],n=Object(l.__)("That’s out of this world. Here are the combined stats for your posts","google-site-kit")}return{id:t,title:Object(l.__)("Congrats on five published posts","google-site-kit"),description:n,format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/rocket.png"),blockData:a,type:"win-stats",showOnce:!0}},h=function(e,t){if(!googlesitekit.modules.analytics||!googlesitekit.modules.analytics.active)return!1;if(!e||!e[0])return!1;var n=Object(g.calculateOverviewData)(e);if(!n)return!1;var a=n.totalUsersChange,i=n.totalUsers;return!(10>a||100<a)&&{id:t,title:Object(l.__)("Congrats on more website visitors!","google-site-kit"),description:Object(l.__)("You had a record-high amount of visitors to your website yesterday.","google-site-kit"),dismiss:Object(l.__)("OK, Got it!","google-site-kit"),format:"large",winImage:"".concat(googlesitekit.admin.assetsRoot,"images/sun.png"),blockData:[{title:Object(l.__)("Site Visitors","google-site-kit"),datapoint:Object(r.t)(i),datapointUnit:""},{title:Object(l.__)("Increase","google-site-kit"),datapoint:a,datapointUnit:"%"}],type:"win-stats",dismissExpires:Object(r.p)("week"),showOnce:!0}},f=n(10);function b(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 v=Object(r.l)("notification");"authentication_success"!==v&&"authentication_failure"!==v&&(Object(f.addFilter)("googlesitekit.winCallbacks","googlesitekit.publisherwinCallbacks",(function(e){return function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?b(n,!0).forEach((function(t){o()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):b(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}({},e,{},a)})),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){return e.push({identifier:"first-post-win"}),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"publishing-win",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),1),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"total-stats",withData:{type:s.b,identifier:"search-console",datapoint:"searchanalytics",data:{dimensions:"date",compareDateRanges:!0},priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2),googlesitekit.modules.analytics.active&&(Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"pageview-increase",withData:{type:s.b,identifier:"analytics",datapoint:"reports",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2),Object(f.addFilter)("googlesitekit.WinsNotificationsRequest","googlesitekit.PublisherWinsNotification",(function(e){var t={identifier:"traffic-increase",withData:{type:s.b,identifier:"analytics",datapoint:"report",data:g.overviewReportDataDefaults,priority:1,maxAge:Object(r.p)("day"),context:"Dashboard"}};return e.push(t),e}),2)))},161:function(e,t,n){"use strict";var a=n(1),i=n(3),o=n.n(i),r=n(4),s=n.n(r),c=n(5),l=n.n(c),u=n(6),d=n.n(u),g=n(7),m=n.n(g),p=n(2),h=n(26),f=n(12),b=n.n(f),v=n(13),k=n.n(v),_=n(11),y=n(9),O=n(54),w=n(53),R=n(0),j=n(14),E=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).setupModuleClick=n.setupModuleClick.bind(k()(n)),n}return m()(t,e),s()(t,[{key:"setupModuleClick",value:function(e){return b.a.async((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.setState({isSaving:!0}),t.next=4,b.a.awrap(Object(p.a)(y.c,e,!0));case 4:return t.next=6,b.a.awrap(Object(p.u)());case 6:window.location=Object(p.m)(e,!0),t.next=13;break;case 9:t.prev=9,t.t0=t.catch(0),Object(p.w)(O.a,{id:"setup-module-error",title:Object(R.__)("Internal Server Error","google-site-kit"),description:t.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 13:case"end":return t.stop()}}),null,this,[[0,9]])}},{key:"render",value:function(){var e=this,t=Object.values(window.googlesitekit.modules||{}).filter((function(e){return!e.internal})),n=t.filter((function(e){return e.active&&e.setupComplete})).reduce((function(e,t){return e[t.slug]=t.name,e}),{}),a=t.filter((function(e){return 0===e.required.length})).sort((function(e,t){return e.sort-t.sort}));return React.createElement("div",{className:"googlesitekit-modules-list"},Object(_.map)(a,(function(t){var a=!1,i="",o=t.slug,r=t.name,s=t.setupComplete,c=t.required;return 0<c.length&&c.forEach((function(e){n[e]&&(a=!0,i=n[e])})),React.createElement("div",{key:o,className:"\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module\n\t\t\t\t\t\t\tgooglesitekit-modules-list__module--".concat(o,"\n\t\t\t\t\t\t\t").concat(a?"googlesitekit-modules-list__module--disabled":"","\n\t\t\t\t\t\t")},React.createElement("div",{className:"googlesitekit-settings-connect-module__wrapper"},React.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},Object(p.q)(o,a)),React.createElement("h3",{className:"googlesitekit-settings-connect-module__title"},r)),React.createElement(w.a,{slug:o,context:"modules-list"}),s&&React.createElement("span",{className:"googlesitekit-settings-module__status"},React.createElement("span",{className:"googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected"},React.createElement("span",{className:"screen-reader-text"},Object(R.__)("Connected","google-site-kit"))),Object(R.__)("Connected","google-site-kit")),!s&&!a&&React.createElement(j.a,{arrow:!0,small:!0,inherit:!0,onClick:function(){e.setupModuleClick(o)}}," ",Object(R.__)("Connect Service","google-site-kit")),!s&&a&&React.createElement(j.a,{disabled:!0,small:!0,inherit:!0},Object(R.sprintf)(Object(R.__)("Enable %s to start setup","google-site-kit"),i)))})))}}]),t}(a.Component),C=n(10),D=function(e){function t(){return o()(this,t),l()(this,d()(t).apply(this,arguments))}return m()(t,e),s()(t,[{key:"render",value:function(){var e=Object(p.l)("notification");if(!e||""===e)return null;var t={id:"connected-successfully",setupTitle:Object(R.__)("Site Kit","google-site-kit"),description:Object(R.__)("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:""}},n=googlesitekit.permissions.canManageOptions;switch(e){case"authentication_success":if(!n)return null;var i=Object(p.l)("slug");return i&&googlesitekit.modules[i]&&!googlesitekit.modules[i].active?null:(i&&googlesitekit.modules[i]&&(t.id="".concat(t.id,"-").concat(i),t.setupTitle=googlesitekit.modules[i].name,t.description=Object(R.__)("Here are some other services you can connect to see even more stats:","google-site-kit"),t=Object(C.applyFilters)("googlesitekit.SetupWinNotification-".concat(i),t)),React.createElement(a.Fragment,null,React.createElement(h.a,{id:t.id,title:Object(R.sprintf)(Object(R.__)("Congrats on completing the setup for %s!","google-site-kit"),t.setupTitle),description:t.description,handleDismiss:function(){},winImage:googlesitekit.admin.assetsRoot+"images/rocket.png",dismiss:Object(R.__)("OK, Got it!","google-site-kit"),format:"large",type:"win-success",learnMoreLabel:t.learnMore.label,learnMoreDescription:t.learnMore.description,learnMoreURL:t.learnMore.url},React.createElement(E,null))));case"authentication_failure":return React.createElement(a.Fragment,null,React.createElement(h.a,{id:"connection error",title:Object(R.__)("There was a problem connecting to Google!","google-site-kit"),description:"",handleDismiss:function(){},format:"small",type:"win-error"}))}}}]),t}(a.Component),N=n(58),x=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentDidMount",value:function(){var e=this,t=Object(N.f)();t&&Object(N.b)(t).then((function(t){e.setState({data:t.results})}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(_.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage?"".concat(googlesitekit.admin.assetsRoot,"images/").concat(e.winImage):"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaURL||"",ctaLabel:e.ctaLabel||"",ctaTarget:e.ctaTarget||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!0,module:n,moduleName:googlesitekit.modules[n].name,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),S=function(e){function t(e){var n;return o()(this,t),(n=l()(this,d()(t).call(this,e))).state={data:!1},n}return m()(t,e),s()(t,[{key:"componentWillMount",value:function(){var e=this;Object(C.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(C.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications");var t=Object(N.g)();t&&Object(N.d)(t).then((function(t){e.setState({data:t.results})}))}))}},{key:"render",value:function(){var e=this.state.data;if(0===Object.keys(e).length)return null;var t=[];return Object.keys(e).forEach((function(n){Object(_.each)(e[n],(function(e){t.push(React.createElement(h.a,{key:e.id,id:e.id,title:e.title||"",description:e.description||"",blockData:e.blockData||[],winImage:e.winImage||"",format:e.format||"small",learnMoreURL:e.learnMoreURL||"",learnMoreDescription:e.learnMoreDescription||"",learnMoreLabel:e.learnMoreLabel||"",ctaLink:e.ctaLink||"",ctaLabel:e.ctaLabel||"",type:e.severity||"",dismiss:e.dismiss||Object(R.__)("OK, Got it!","google-site-kit"),isDismissable:e.isDismissable||!0,logo:e.logo||!1,pageIndex:e.pageIndex||"",dismissExpires:e.dismissExpires||0,showOnce:e.showOnce||!1}))}))})),React.createElement(a.Fragment,null,t)}}]),t}(a.Component),A=n(87),L=n(24),I=window.googlesitekit.setup,P=Object(p.l)("notification"),M=Object(L.a)(React.createElement(D,null)),T=Object(L.a)(React.createElement(x,null)),U=Object(L.a)(React.createElement(S,null)),F=Object(L.a)(React.createElement(A.a,null));I.needReauthenticate&&Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",F,1),"authentication_success"===P||"authentication_failure"===P?Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.SetupNotification",M,1):I.isAuthenticated&&I.isVerified&&(Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.ModulesNotification",T,1),Object(C.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.WinsNotification",U,1))},17:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.ctaLabel,a=e.ctaLink;return React.createElement("header",{className:"googlesitekit-layout__header"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:"\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\t\t\t".concat(a?"mdc-layout-grid__cell--span-6-desktop":"mdc-layout-grid__cell--span-12-desktop","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--align-middle\n\t\t\t\t\t\t\t\t\t").concat(a?"":"mdc-layout-grid__cell--span-8-tablet","\n\t\t\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\t\t")},React.createElement("h3",{className:"googlesitekit-subheading-1 googlesitekit-layout__header-title"},t)),a&&React.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 "},React.createElement(f.a,{href:a,external:!0,inherit:!0},n)))))}}]),t}(m.Component);b.propTypes={title:h.a.string,ctaLabel:h.a.string,ctaLink:h.a.string},b.defaultProps={title:"",ctaLabel:"",ctaLink:""};var v=b,k=n(60),_=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.ctaLabel,n=e.ctaLink,a=e.footerContent;return React.createElement("footer",{className:"googlesitekit-layout__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},n&&t&&React.createElement(k.a,{className:"googlesitekit-data-block__source",name:t,href:n,external:!0}),a))))}}]),t}(m.Component);_.propTypes={ctaLabel:h.a.string,ctaLink:h.a.string};var y=_,O=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.header,n=e.footer,a=e.children,i=e.title,o=e.headerCtaLabel,r=e.headerCtaLink,s=e.footerCtaLabel,c=e.footerCtaLink,l=e.footerContent,u=e.className,d=e.fill,g=e.relative;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-layout\n\t\t\t\t".concat(u&&u,"\n\t\t\t\t").concat(d?"googlesitekit-layout--fill":"","\n\t\t\t\t").concat(g?"googlesitekit-layout--relative":"","\n\t\t\t")},t&&React.createElement(v,{title:i,ctaLabel:o,ctaLink:r}),a,n&&React.createElement(y,{ctaLabel:s,ctaLink:c,footerContent:l}))}}]),t}(m.Component);O.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},O.defaultProps={header:!1,footer:!1,title:"",headerCtaLabel:"",headerCtaLink:"",footerCtaLabel:"",footerCtaLink:"",footerContent:null,className:"",fill:!1,relative:!1};t.a=O},2:function(e,t,n){"use strict";var a,i=n(49),o=n.n(i),r=n(68),s=n.n(r),c=n(27),l=n.n(c),u=n(12),d=n.n(u),g=n(61),m=n.n(g),p=(n(1),n(11)),h=n(9),f=n(20),b=n(18),v=n.n(b),k=n(35),_=n.n(k),y=n(10),O=n(0),w=n(36),R=n(3),j=n.n(R),E=n(4),C=n.n(E),D=function(e){var t=window[e];if(!t)return!1;try{var n="__storage_test__";return t.setItem(n,n),t.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!==t.length}},N=function(){function e(){j()(this,e)}return C()(e,[{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}}]),e}(),x=function(){return a||(a=D("sessionStorage")?window.sessionStorage:D("localStorage")?window.localStorage:new N),a};function S(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 A(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?S(n,!0).forEach((function(t){l()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):S(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"t",(function(){return L})),n.d(t,"r",(function(){return I})),n.d(t,"p",(function(){return P})),n.d(t,"s",(function(){return M})),n.d(t,"j",(function(){return T})),n.d(t,"c",(function(){return U})),n.d(t,"l",(function(){return q})),n.d(t,"f",(function(){return H})),n.d(t,"u",(function(){return W})),n.d(t,"m",(function(){return G})),n.d(t,"g",(function(){return K})),n.d(t,"n",(function(){return B})),n.d(t,"z",(function(){return z})),n.d(t,"A",(function(){return V})),n.d(t,"b",(function(){return Q})),n.d(t,"v",(function(){return Y})),n.d(t,"k",(function(){return J})),n.d(t,"a",(function(){return $})),n.d(t,"y",(function(){return ee})),n.d(t,"w",(function(){return te})),n.d(t,"e",(function(){return ne})),n.d(t,"i",(function(){return ie})),n.d(t,"h",(function(){return oe})),n.d(t,"q",(function(){return re})),n.d(t,"d",(function(){return se})),n.d(t,"x",(function(){return ce})),n.d(t,"o",(function(){return x}));var L=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(t=Object(p.isUndefined)(e)?0:1e6<e?(e/=1e6).toFixed(1)+"M":1e3<e?99<(e/=1e3)?Math.round(e)+"K":e.toFixed(1)+"K":e,(Object(p.isNull)(e)||Object(p.isUndefined)(e)||isNaN(e))&&(t="",e=0),0===e)return t="0.00",n?new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).format(e):e;if(!1!==n&&""!==t){var a=new Intl.NumberFormat(navigator.language,{style:"currency",currency:n}).formatToParts(e),i=a.find((function(e){return"decimal"===e.type}));!Object(p.isUndefined)(i)&&!Object(p.isUndefined)(i.value)&&1e3>e&&(t=Number.isInteger(e)?e:e.replace(".",i.value));var o=a.find((function(e){return"currency"===e.type})),r=o?o.value:"";return"".concat(r).concat(t)}return t.toString()},I=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return t||(t=navigator.language),t=t.replace("_","-").toLocaleLowerCase(),new Intl.NumberFormat(t).format(e)},P=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}},M=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()},T=function(e,t){var n=1e3*P("day"),a=e.getTime(),i=t.getTime();return Math.round(Math.abs(a-i)/n)},U=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},F=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},q=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):F(e);var a={},i=!0,o=!1,r=void 0;try{for(var s,c=n.searchParams.entries()[Symbol.iterator]();!(i=(s=c.next()).done);i=!0){var l=m()(s.value,2),u=l[0],d=l[1];a[u]=d}}catch(e){o=!0,r=e}finally{try{i||null==c.return||c.return()}finally{if(o)throw r}}return a},H=function(e,t){return Object(p.map)(e,(function(e,n){return[e[0],e[t]||(0===n?"":0)]}))},W=function(){var e,t;return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,d.a.awrap(h.c.get(h.a,"user","authentication"));case 3:e=n.sent,t=e.grantedScopes.filter((function(t){return-1!==e.requiredScopes.indexOf(t)})),window.googlesitekit.setup=window.googlesitekit.setup||{},window.googlesitekit.setup.isAuthenticated=e.isAuthenticated,window.googlesitekit.setup.requiredScopes=e.requiredScopes,window.googlesitekit.setup.grantedScopes=e.grantedScopes,window.googlesitekit.setup.needReauthenticate=t.length<e.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]])},G=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:googlesitekit,a=n.admin,i=a.connectURL,o=a.adminRoot,r=n.setup.needReauthenticate,s=n.modules[e].screenID,c="pagespeed-insights"===e?{notification:"authentication_success",reAuth:void 0}:{},l=Object(w.addQueryArgs)(o,A({page:e&&t&&s?s:"googlesitekit-dashboard",slug:e,reAuth:t},c));if(!r)return l;var u=encodeURIComponent(Object(w.getQueryString)(l));return l=o+"?"+u,Object(w.addQueryArgs)(i,{redirect:l,status:t})},K=function(e,t){return function(n){return function(a){return v.a.createElement(e,s()({},a,t,{OriginalComponent:n}))}}},B=function(e,t){var n=googlesitekit.admin.adminRoot;return e||(e="googlesitekit-dashboard"),t=A({page:e},t),Object(w.addQueryArgs)(n,t)},z=function(e){try{return JSON.parse(e)&&!!e}catch(e){return!1}},V=function(e){return e.match(/^GTM-[a-zA-Z\d]{7}$/)},Q=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)),o.setAttribute("id","googlesitekit-notifications-counter");var r=document.createElement("span");r.setAttribute("class","plugin-count"),r.setAttribute("aria-hidden","true"),r.textContent=e;var s=document.createElement("span");return s.setAttribute("class","screen-reader-text"),s.textContent=Object(O.sprintf)(Object(O._n)("%d notification","%d notifications",e,"google-site-kit"),e),o.appendChild(r),o.appendChild(s),t&&null===a&&t.appendChild(o),n&&null===i&&n.appendChild(o),o},Y=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"";if("undefined"!=typeof gtag&&window.googlesitekitTrackingEnabled){var i=googlesitekit.admin,o=i.siteURL,r=i.siteUserID,s=googlesitekit.setup.isFirstAdmin;return gtag("event",t,{send_to:googlesitekit.admin.trackingID,event_category:e,event_label:n,event_value:a,dimension1:Object(p.trimEnd)(o,"/"),dimension2:s?"true":"false",dimension3:r})}},J=function(e){var t,n,a,i,o;return d.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return t=googlesitekit.admin,n=t.homeURL,a=t.ampMode,i={tagverify:1,timestamp:Date.now()},r.next=4,d.a.awrap(Z(Object(w.addQueryArgs)(n,i),e));case 4:if((o=r.sent)||"secondary"!==a){r.next=9;break}return r.next=8,d.a.awrap(_()({path:"/wp/v2/posts?per_page=1"}).then((function(t){return t.slice(0,1).map((function(t){return d.a.async((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.a.awrap(Z(Object(w.addQueryArgs)(t.link,A({},i,{amp:1})),e));case 2:return n.abrupt("return",n.sent);case 3:case"end":return n.stop()}}))})).pop()})));case 8:o=r.sent;case 9:return r.abrupt("return",Promise.resolve(o||null));case 10:case"end":return r.stop()}}))},Z=function(e,t){var n;return d.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,a.next=3,d.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=!1;switch(t){case"analytics":(n=!!(n=new RegExp(/<script [^>]*src=['|"]https:\/\/www.googletagmanager.com\/gtag\/js\?id=(UA-.*?)['|"][^>]*><\/script>/gm).exec(e))&&n[1])||(n=!!(n=new RegExp(/<script[^>]*>[^<]+google-analytics\.com\/analytics\.js[^<]+(UA-\d+-\d+)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/__gaTracker\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/ga\( ?['|"]create['|"], ?['|"](UA-.*?)['|"], ?['|"]auto['|"] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/_gaq.push\( ?\[ ?['|"]_setAccount['|"], ?['|"](UA-.*?)['|"] ?] ?\)/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/<amp-analytics [^>]*type="gtag"[^>]*>[^<]*<script type="application\/json">[^<]*"gtag_id":\s*"(UA-[^"]+)"/gm).exec(e))&&n[1]),n||(n=!!(n=new RegExp(/<amp-analytics [^>]*type="googleanalytics"[^>]*>[^<]*<script type="application\/json">[^<]*"account":\s*"(UA-[^"]+)"/gm).exec(e))&&n[1]);break;case"adsense":(n=!!(n=new RegExp(/google_ad_client: ?["|'](.*?)["|']/gm).exec(e))&&n[1])||(n=!!(n=new RegExp(/<(?:script|amp-auto-ads) [^>]*data-ad-client="([^"]+)"/gm).exec(e))&&n[1])}return n},$=function(e,t,n){return e.setModuleActive(t,n).then((function(e){return window.googlesitekit.modules&&window.googlesitekit.modules[t]&&(window.googlesitekit.modules[t].active=e.active),Y("".concat(t,"_setup"),e.active?"module_activate":"module_deactivate",t),new Promise((function(t){t(e)}))}))},ee=function(e,t,n){var a=arguments.length>3&&void 0!==arguments[3]&&arguments[3],i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:googlesitekit,o=i.modules[e],r=o.settings,s=o.setupComplete,c=a||document.getElementById("confirm-changes-".concat(e));if(s&&c){var l=[];Object.keys(n).forEach((function(e){-1<Object.keys(t).indexOf(e)&&(l[t[e]]=n[e])}));var u=[];Object.keys(r).forEach((function(e){-1<Object.values(t).indexOf(e)&&(u[e]=r[e])}));var d=Object.keys(u).filter((function(e){return u[e]!==l[e]}));if(0<d.length){if(a)return!0;c.removeAttribute("disabled")}else{if(a)return!1;c.setAttribute("disabled","disabled")}}},te=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Object(y.addFilter)("googlesitekit.ErrorNotification","googlesitekit.ErrorNotification",K(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(p.unescape)(t)};function ae(){return Object(y.applyFilters)("googlesitekit.dateRange",Object(O.__)("Last 28 days","google-site-kit"))}function ie(){return ae().replace("Last ","")}function oe(){return e=ae(),Object(p.toLower)(Object(p.deburr)(Object(p.trim)(e.replace(/[\s./_]+/g,"-"),"-")));var e}function re(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"33",a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"33",i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(googlesitekit){var o=v.a.createElement(f.a,{id:e,width:n,height:a,className:i});return t?o=v.a.createElement(f.a,{id:"".concat(e,"-disabled"),width:n,height:a,className:i}):"pagespeed-insights"===e&&(o=v.a.createElement("img",{src:googlesitekit.admin.assetsRoot+"images/icon-pagespeed.png",width:n,alt:"",className:i})),o}}function se(){window.localStorage&&window.localStorage.clear(),window.sessionStorage&&window.sessionStorage.clear()}function ce(e){var t={};return Object.keys(e).sort().forEach((function(n){var a=e[n];a&&"object"===o()(a)&&!Array.isArray(a)&&(a=ce(a)),t[n]=a})),t}},20:function(e,t,n){"use strict";n(1);var a=n(8),i=n.n(a),o=function(e){var t=e.id,n=e.className,a=e.height,i=e.width,o="".concat(googlesitekit.admin.assetsRoot,"svg/svg.svg");return React.createElement("svg",{className:"svg".concat(" ",n),height:a,width:i},React.createElement("use",{xlinkHref:"".concat(o,"#").concat(t)}))};o.propTypes={id:i.a.string.isRequired,className:i.a.string,height:i.a.string,width:i.a.string},o.defaultProps={className:"",height:20,width:20},t.a=o},21:function(e,t,n){"use strict";n.d(t,"a",(function(){return v}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(11),h=n(10),f=n(59),b=16;function v(e){return Object(f.createHigherOrderComponent)((function(t){var n,a="core/with-filters/"+e;var o=function(o){function s(){var a;return i()(this,s),a=c()(this,u()(s).apply(this,arguments)),void 0===n&&(n=Object(h.applyFilters)(e,t)),a}return g()(s,o),r()(s,[{key:"componentDidMount",value:function(){s.instances.push(this),1===s.instances.length&&(Object(h.addAction)("hookRemoved",a,l),Object(h.addAction)("hookAdded",a,l))}},{key:"componentWillUnmount",value:function(){s.instances=Object(p.without)(s.instances,this),0===s.instances.length&&(Object(h.removeAction)("hookRemoved",a),Object(h.removeAction)("hookAdded",a))}},{key:"render",value:function(){return React.createElement(n,this.props)}}]),s}(m.Component);o.instances=[];var s=Object(p.debounce)((function(){n=Object(h.applyFilters)(e,t),o.instances.forEach((function(e){e.forceUpdate()}))}),b);function l(t){t===e&&s()}return o}),"withFilters")}},22:function(e,t,n){"use strict";var a=n(82),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 o=n(151);n.d(t,"h",(function(){return o.a}));var r=n(162);n.d(t,"e",(function(){return r.a}));var s=n(163);n.d(t,"g",(function(){return s.a}));var c=n(97),l=n.n(c);n.d(t,"k",(function(){return l.a})),n.d(t,"j",(function(){return c.Option}));var u=n(164);n.d(t,"i",(function(){return u.a}));var d=n(160);n.d(t,"d",(function(){return d.a}));var g=n(159);n.d(t,"c",(function(){return g.a}));var m=n(157);n.d(t,"f",(function(){return m.a}))},24: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(n){return Object(a.createElement)(a.Fragment,{},"",Object(a.createElement)(t,n),e)}}}},25:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(60),k=n(20),_=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).handleClick=n.handleClick.bind(g()(n)),n.handleKeyPress=n.handleKeyPress.bind(g()(n)),n}return p()(t,e),r()(t,[{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 e=this.props,t=e.className,n=e.title,a=e.datapoint,i=e.datapointUnit,o=e.change,r=e.changeDataUnit,s=e.context,c=e.period,l=e.selected,u=e.handleStatSelection,d=e.source,g=e.sparkline,m=e.reverseArrowDirection,p="button"===s?"button":"",f=0<=o?"-positive":"-negative";return React.createElement("div",{className:"\n\t\t\t\t\tgooglesitekit-data-block\n\t\t\t\t\tgooglesitekit-data-block--".concat(s,"\n\t\t\t\t\t").concat(l?"googlesitekit-data-block--selected":"","\n\t\t\t\t\t").concat(t,"\n\t\t\t\t"),tabIndex:"button"===s?"0":"-1",role:u&&p,onClick:u&&this.handleClick,onKeyPress:u&&this.handleKeyPress,"aria-label":u&&n,"aria-pressed":u&&l},React.createElement("div",{className:"googlesitekit-data-block__title-datapoint-wrapper"},React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-data-block__title "},n),React.createElement("div",{className:"googlesitekit-data-block__datapoint"},"".concat(a).concat(i))),g&&React.createElement("div",{className:"googlesitekit-data-block__sparkline"},g),React.createElement("div",{className:"googlesitekit-data-block__change-source-wrapper"},React.createElement("div",{className:"\n\t\t\t\t\t\tgooglesitekit-data-block__change\n\t\t\t\t\t\tgooglesitekit-data-block__change--".concat(0<=o?"positive":"negative","\n\t\t\t\t\t")},""===o&&React.createElement(h.Fragment,null," "),o&&[React.createElement("span",{key:"arrow",className:"googlesitekit-data-block__arrow ".concat(m?"googlesitekit-data-block__arrow--reverse":"")},React.createElement(k.a,{id:"arrow".concat(f),height:"9",width:"9"})),React.createElement("span",{key:"values",className:"googlesitekit-data-block__value"},"".concat(Math.abs(o)).concat(r," ").concat(c))]),d&&React.createElement(v.a,{className:"googlesitekit-data-block__source",name:d.name,href:d.link})))}}]),t}(h.Component);_.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,reverseArrowDirection:b.a.bool},_.defaultProps={stat:null,onClick:null,className:"",title:"",datapoint:null,datapointUnit:"",change:null,changeDataUnit:"",context:"default",period:"",selected:!1,handleStatSelection:null,reverseArrowDirection:!1},t.a=_},26:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(8),b=n.n(f),v=n(9),k=n(25),_=n(29);var y=function(){return React.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"},React.createElement("path",{d:"M0 0h24v24H0z",fill:"none"}),React.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"}))},O=n(88),w=n(14),R=n(20),j=n(11),E=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={isClosed:!1},n.cardRef=Object(h.createRef)(),n.handleDismiss=n.handleDismiss.bind(g()(n)),0<n.props.dismissExpires&&n.expireDismiss(),n.props.showOnce&&v.c.setCache("notification::displayed::".concat(n.props.id),new Date),n}return p()(t,e),r()(t,[{key:"handleDismiss",value:function(e){var t=this,n=this.state.isClosed,a=this.cardRef.current;e.preventDefault(),this.setState({isClosed:!n}),setTimeout((function(){v.c.setCache("notification::dismissed::".concat(t.props.id),new Date),a.style.display="none";var e=new Event("notificationDismissed");document.dispatchEvent(e)}),350)}},{key:"expireDismiss",value:function(){var e=this.props,t=e.id,n=e.dismissExpires,a=v.c.getCache("notification::dismissed::".concat(t));if(a){var i=new Date(a);i.setSeconds(i.getSeconds()+parseInt(n,10)),i<new Date&&v.c.deleteCache("notification::dismissed::".concat(t))}}},{key:"render",value:function(){var e=this.state.isClosed,t=this.props,n=t.children,a=t.id,i=t.title,o=t.description,r=t.blockData,s=t.winImage,c=t.smallImage,l=t.format,u=t.learnMoreURL,d=t.learnMoreDescription,g=t.learnMoreLabel,m=t.ctaLink,p=t.ctaLabel,f=t.ctaTarget,b=t.type,E=t.dismiss,C=t.isDismissable,D=t.logo,N=t.module,x=t.moduleName,S=t.pageIndex;if(v.c.getCache("notification::dismissed::".concat(a)))return null;var A,L=e?"is-closed":"is-open",I="large"===l&&"win-stats-increase"===b,P="mdc-layout-grid__cell--span-12";"large"===l?(P="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 ",I&&(P="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"===l&&(P="mdc-layout-grid__cell--span-11-desktop mdc-layout-grid__cell--span-7-tablet mdc-layout-grid__cell--span-3-phone"),A="win-warning"===b?React.createElement(y,null):"win-error"===b?React.createElement(O.a,null):"";var M=React.createElement(h.Fragment,null,r&&React.createElement("div",{className:"mdc-layout-grid__inner"},Object(j.map)(r,(function(e,t){return React.createElement("div",{key:t,className:"mdc-layout-grid__cell ".concat(I?"mdc-layout-grid__cell--span-5-desktop":"mdc-layout-grid__cell--span-4-desktop")},React.createElement("div",{className:"googlesitekit-publisher-win__stats"},React.createElement(k.a,e)))})))),T=React.createElement(h.Fragment,null,React.createElement("h3",{className:"googlesitekit-heading-2 googlesitekit-publisher-win__title"},i),o&&React.createElement("div",{className:"googlesitekit-publisher-win__desc"},React.createElement("p",null,o,g&&React.createElement(h.Fragment,null," ",React.createElement(w.a,{href:u,external:!0,inherit:!0},g),d),S&&React.createElement("span",{className:"googlesitekit-publisher-win__detect"},S))),n),U=N?React.createElement(R.a,{id:N,height:"19",width:"19"}):React.createElement(R.a,{id:"logo-g",height:"34",width:"32"});return React.createElement("section",{ref:this.cardRef,className:"\n\t\t\t\tgooglesitekit-publisher-win\n\t\t\t\t".concat(l?"googlesitekit-publisher-win--".concat(l):"","\n\t\t\t\t").concat(b?"googlesitekit-publisher-win--".concat(b):"","\n\t\t\t\t").concat(L?"googlesitekit-publisher-win--".concat(L):"","\n\t\t\t")},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},D&&React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12 ".concat(I?"mdc-layout-grid__cell--order-2-phone mdc-layout-grid__cell--order-1-tablet":"")},React.createElement("div",{className:"googlesitekit-publisher-win__logo"},U),x&&React.createElement("div",{className:"googlesitekit-publisher-win__module-name"},x)),c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("img",{className:"googlesitekit-publisher-win__small-image",alt:"",src:c})),React.createElement("div",{className:"mdc-layout-grid__cell ".concat(P)},I?React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-5-desktop mdc-layout-grid__cell--span-8-tablet"},T),React.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"},M)):React.createElement(h.Fragment,null,T,M),m&&React.createElement(_.a,{href:m,target:f},p),C&&E&&React.createElement(w.a,{onClick:this.handleDismiss},E)),s&&React.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 "},React.createElement("div",{className:"googlesitekit-publisher-win__image-large"},React.createElement("img",{alt:"",src:s}))),("win-error"===b||"win-warning"===b)&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-1 "},React.createElement("div",{className:"googlesitekit-publisher-win__icons"},A)))))}}]),t}(h.Component);E.propTypes={id:b.a.string.isRequired,title:b.a.string.isRequired,description:b.a.string,learnMoreURL:b.a.string,learnMoreDescription:b.a.string,learnMoreLabel:b.a.string,blockData:b.a.array,winImage:b.a.string,smallImage:b.a.string,format:b.a.string,ctaLink:b.a.string,ctaLabel:b.a.string,type:b.a.string,dismiss:b.a.string,isDismissable:b.a.bool,logo:b.a.bool,module:b.a.string,moduleName:b.a.string,pageIndex:b.a.string,dismissExpires:b.a.number,showOnce:b.a.bool},E.defaultProps={isDismissable:!0,dismissExpires:0,showOnce:!1};t.a=E},29:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(22),h=n(8),f=n.n(h),b=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).buttonRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new p.h(this.buttonRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onClick,n=e.children,a=e.href,i=e.text,o=e.className,r=e.danger,s=e.disabled,c=e.target,l=e.id,u=e.icon,d=e.trailingIcon,g=e.ariaHaspopup,m=e.ariaExpanded,p=e.ariaControls,h=a?"a":"button";return React.createElement(h,{className:"\n\t\t\t\t\tmdc-button\n\t\t\t\t\t".concat(!i&&"mdc-button--raised","\n\t\t\t\t\t").concat(o&&o,"\n\t\t\t\t\t").concat(r?"mdc-button--danger":"","\n\t\t\t\t"),onClick:t,href:a,ref:this.buttonRef,disabled:s?"disabled":"",target:c||"_self",id:l,"aria-haspopup":g,"aria-expanded":m,"aria-controls":p},u&&u,React.createElement("span",{className:"mdc-button__label"},n),d&&d)}}]),t}(m.Component);b.propTypes={onClick:f.a.func,children:f.a.string.isRequired,href:f.a.string,text:f.a.bool,className:f.a.string,danger:f.a.bool,disabled:f.a.bool,icon:f.a.element,trailingIcon:f.a.element,ariaHaspopup:f.a.string,ariaExpanded:f.a.bool,ariaControls:f.a.string},b.defaultProps={onClick:null,href:null,text:!1,className:"",danger:!1,disabled:!1,icon:null,trailingIcon:null,ariaHaspopup:"",ariaExpanded:!1,ariaControls:""},t.a=b},31:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.small,a=e.compress,i=e.height,o=i?Math.round(i/2):null;return React.createElement("div",{role:"progressbar",className:"\n\t\t\t\t\tmdc-linear-progress\n\t\t\t\t\tmdc-linear-progress--indeterminate\n\t\t\t\t\t".concat(t||"","\n\t\t\t\t\t").concat(n?"mdc-linear-progress--small":"","\n\t\t\t\t\t").concat(a?"mdc-linear-progress--compress":"","\n\t\t\t\t"),style:{marginTop:o,marginBottom:o}},React.createElement("div",{className:"mdc-linear-progress__buffering-dots"}),React.createElement("div",{className:"mdc-linear-progress__buffer"}),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__primary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})),React.createElement("div",{className:"mdc-linear-progress__bar mdc-linear-progress__secondary-bar"},React.createElement("span",{className:"mdc-linear-progress__bar-inner"})))}}]),t}(m.Component);f.propTypes={className:h.a.string,small:h.a.bool,compress:h.a.bool},f.defaultProps={className:"",small:!1,compress:!1},t.a=f},32:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.description,a=e.ctaLink,i=e.ctaLabel,o=e.error,r=e.onClick;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-cta\n\t\t\t\t".concat(o?"googlesitekit-cta--error":"","\n\t\t\t")},t&&React.createElement("h3",{className:"googlesitekit-cta__title"},t),n&&React.createElement("p",{className:"googlesitekit-cta__description"},n),i&&React.createElement(f.a,{href:a,onClick:r,inverse:!o,caps:!0,arrow:!0},i))}}]),t}(m.Component);b.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},b.defaultProps={title:"",description:"",ctaLink:"",ctaLabel:"",error:!1,onClick:function(){}},t.a=b},33:function(e,t,n){"use strict";n.r(t),n.d(t,"extractSearchConsoleDashboardData",(function(){return r})),n.d(t,"isDataZeroSearchConsole",(function(){return s}));var a=n(2),i=n(11);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"}]],n=0,o=0,r=0,s=0,c=e.length;Object(i.each)(e,(function(e){var a=new Date(e.keys[0]);t.push([a.getMonth()+1+"/"+a.getUTCDate(),e.clicks,e.impressions,e.ctr,e.position]),n+=e.clicks,o+=e.impressions,r+=e.ctr,s+=e.position}));var l=n,u=o;n=Object(a.t)(n),o=Object(a.t)(o);var d=(r/c*100).toFixed(1),g=r/c,m=(s/c).toFixed(1);return{dataMap:t,totalClicks:n,totalClicksRaw:l,totalImpressions:o,totalImpressionsRaw:u,averageCTR:d,averageCTRRaw:g,averagePosition:m}}var r=function(e){var t=Math.floor(e.length/2),n=e.slice(e.length-t,e.length),i=e.slice(0,e.length-t),r=o(n),s=o(i),c=Object(a.c)(s.totalClicksRaw,r.totalClicksRaw),l=Object(a.c)(s.totalImpressionsRaw,r.totalImpressionsRaw),u=Object(a.c)(s.averageCTRRaw,r.averageCTRRaw),d=Object(a.c)(s.averagePosition,r.averagePosition);return{dataMap:r.dataMap,totalClicks:r.totalClicks,totalImpressions:r.totalImpressions,averageCTR:r.averageCTR,averagePosition:r.averagePosition,totalClicksChange:c,totalImpressionsChange:l,averageCTRChange:u,averagePositionChange:d}},s=function(e){if(!e.length)return!0;var t=r(e),n=t.totalClicks,a=t.totalImpressions,i=t.averageCTR,o=t.averagePosition;return 0===parseInt(n)&&0===parseInt(a)&&0===parseInt(i)&&0===parseInt(o)}},43:function(e,t,n){"use strict";n(1);var a=n(0),i=n(14);t.a=function(){var e=Object(a.__)("Need help?","google-site-kit");return React.createElement(i.a,{className:"googlesitekit-help-link",href:"https://sitekit.withgoogle.com/documentation/",external:!0},e)}},44:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component),f=Object(p.a)("googlesitekit.ErrorNotification")(h),b=n(81),v=n(12),k=n.n(v),_=n(13),y=n.n(_),O=n(67),w=n(29),R=n(22),j=n(8),E=n.n(j),C=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this.props.menuOpen;this.menu=new R.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 e=this.props,t=e.menuOpen,n=e.menuItems,a=e.onSelected,i=e.id;return React.createElement("div",{className:"mdc-menu mdc-menu-surface",ref:this.menuRef},React.createElement("ul",{id:i,className:"mdc-list",role:"menu","aria-hidden":!t,"aria-orientation":"vertical",tabIndex:"-1"},n.map((function(e,t){return React.createElement("li",{key:t,className:"mdc-list-item",role:"menuitem",onClick:a.bind(null,t),onKeyDown:a.bind(null,t)},React.createElement("span",{className:"mdc-list-item__text"},e))}))))}}]),t}(m.Component);C.propTypes={menuOpen:E.a.bool.isRequired,menuItems:E.a.array.isRequired,id:E.a.string.isRequired};var D=C,N=n(80),x=n(2),S=n(0),A=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={dialogActive:!1,menuOpen:!1},n.handleMenu=n.handleMenu.bind(y()(n)),n.handleMenuClose=n.handleMenuClose.bind(y()(n)),n.handleMenuItemSelect=n.handleMenuItemSelect.bind(y()(n)),n.handleDialog=n.handleDialog.bind(y()(n)),n.handleDialogClose=n.handleDialogClose.bind(y()(n)),n.handleUnlinkConfirm=n.handleUnlinkConfirm.bind(y()(n)),n.menuButtonRef=Object(m.createRef)(),n.menuRef=Object(m.createRef)(),n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){window.addEventListener("mouseup",this.handleMenuClose),window.addEventListener("keyup",this.handleMenuClose),window.addEventListener("keyup",this.handleDialogClose)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("mouseup",this.handleMenuClose),window.removeEventListener("keyup",this.handleMenuClose),window.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(e,t){var n=googlesitekit.admin.proxyPermissionsURL;if("keydown"===t.type&&(13===t.keyCode||32===t.keyCode)||"click"===t.type)switch(e){case 0:this.handleDialog();break;case 1:window.location.assign(n);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 k.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:this.setState({dialogActive:!1}),Object(x.d)(),document.location=Object(x.n)("googlesitekit-splash",{googlesitekit_context:"revoked"});case 3:case"end":return e.stop()}}),null,this)}},{key:"render",value:function(){var e=googlesitekit.admin,t=e.userData,n=t.email,a=void 0===n?"":n,i=t.picture,o=void 0===i?"":i,r=e.proxyPermissionsURL,s=this.state,c=s.dialogActive,l=s.menuOpen;return React.createElement(m.Fragment,null,React.createElement("div",{className:"googlesitekit-dropdown-menu mdc-menu-surface--anchor"},React.createElement(w.a,{ref:this.menuButtonRef,className:"googlesitekit-header__dropdown mdc-button--dropdown",text:!0,onClick:this.handleMenu,icon:o?React.createElement("i",{className:"mdc-button__icon","aria-hidden":"true"},React.createElement("img",{className:"mdc-button__icon--image",src:o,alt:Object(S.__)("User Avatar","google-site-kit")})):void 0,ariaHaspopup:"menu",ariaExpanded:l,ariaControls:"user-menu"},a),React.createElement(D,{ref:this.menuRef,menuOpen:l,menuItems:[Object(S.__)("Disconnect","google-site-kit")].concat(r?[Object(S.__)("Manage sites...","google-site-kit")]:[]),onSelected:this.handleMenuItemSelect,id:"user-menu"})),React.createElement(N.a,null,React.createElement(O.a,{dialogActive:c,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(S.__)("Disconnect","google-site-kit"),subtitle:Object(S.__)("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(S.__)("Disconnect","google-site-kit"),provides:[]})))}}]),t}(m.Component),L=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=googlesitekit.setup.isAuthenticated;return React.createElement(m.Fragment,null,React.createElement("header",{className:"googlesitekit-header"},React.createElement("section",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(b.a,null)),React.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 "},e&&React.createElement(A,null))))),React.createElement(f,null))}}]),t}(m.Component);t.a=L},47:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(69),h=n(8),f=n.n(h),b=n(20),v=n(10),k=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.title,n=e.icon,a=e.iconWidth,i=e.iconHeight,o=e.iconID,r=e.className,s=e.status,c=e.statusText,l=e.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(v.applyFilters)("googlesitekit.showDateRangeSelector-".concat(o),!1),d=!(""===s&&!u);return React.createElement("header",{className:"googlesitekit-page-header"},React.createElement("div",{className:"mdc-layout-grid__inner"},t&&React.createElement("div",{className:l},n&&React.createElement(b.a,{id:o,height:i,width:a,className:"googlesitekit-page-header__icon"}),React.createElement("h1",{className:"googlesitekit-page-header__title ".concat(r)},t)),d&&React.createElement("div",{className:"\n\t\t\t\t\t\t\tmdc-layout-grid__cell\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-bottom\n\t\t\t\t\t\t\tmdc-layout-grid__cell--align-right-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-phone\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-4-tablet\n\t\t\t\t\t\t\tmdc-layout-grid__cell--span-6-desktop\n\t\t\t\t\t\t"},React.createElement("div",{className:"googlesitekit-page-header__details"},s&&React.createElement("span",{className:"\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status\n\t\t\t\t\t\t\t\t\t\tgooglesitekit-page-header__status--".concat(s,"\n\t\t\t\t\t\t\t\t\t")},c),u&&React.createElement("span",{className:"googlesitekit-page-header__range"},React.createElement(p.a,null))))))}}]),t}(m.Component);k.propTypes={title:f.a.string,icon:f.a.bool,iconID:f.a.string,iconWidth:f.a.string,iconHeight:f.a.string,className:f.a.string,status:f.a.string,statusText:f.a.string,fullWidth:f.a.bool},k.defaultProps={title:"",icon:!1,iconID:"",iconWidth:"",iconHeight:"",className:"googlesitekit-heading-3",status:"",statusText:"",fullWidth:!1},t.a=k},53:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(21),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return null}}]),t}(m.Component);t.a=Object(p.a)("googlesitekit.ModuleSettingsWarning")(h)},54:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(26),h=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){return React.createElement(p.a,this.props)}}]),t}(m.Component);t.a=h},58:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(9),r=n(2),s=n(3),c=n.n(s),l=n(4),u=n.n(l),d=n(11),g=function(){function e(t){c()(this,e),this.wins=t,this.response=[]}return u()(e,[{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(d.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(o.c.combinedGetFromCache(e));case 3:return n.abrupt("return",this.response);case 4:case"end":return n.stop()}}),null,this)}}]),e}(),m=n(10);n.d(t,"g",(function(){return h})),n.d(t,"f",(function(){return f})),n.d(t,"c",(function(){return b})),n.d(t,"b",(function(){return _})),n.d(t,"d",(function(){return y})),n.d(t,"e",(function(){return O})),n.d(t,"a",(function(){return w}));var p=Object(m.applyFilters)("googlesitekit.winCallbacks",{}),h=function(){return Object(m.applyFilters)("googlesitekit.WinsNotificationsRequest",[])},f=function(){return Object(m.applyFilters)("googlesitekit.ModulesNotificationsRequest",[])};function b(){var e,t,n,a;return i.a.async((function(o){for(;;)switch(o.prev=o.next){case 0:if((e=window.googlesitekit.setup).isSiteKitConnected&&(e.isAuthenticated||e.isVerified)){o.next=3;break}return o.abrupt("return",0);case 3:return t=0,o.next=6,i.a.awrap(_());case 6:return(n=o.sent)&&n.total&&(t+=n.total),o.next=10,i.a.awrap(y());case 10:return(a=o.sent)&&a.total&&(t+=a.total),t=Object(m.applyFilters)("googlesitekit.TotalNotifications",t),t=Math.max(0,Math.abs(t)),window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),o.abrupt("return",t);case 16:case"end":return o.stop()}}))}var v=function(e){return e?e.length?e.filter((function(e){return!o.c.getCache("notification::dismissed::".concat(e.id))})):e:[]},k=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=o.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(r.j)(n,i)&&o.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 _(){var e,t,n,a;return i.a.async((function(s){for(;;)switch(s.prev=s.next){case 0:return e={},t=0,s.next=4,i.a.awrap(f());case 4:return n=s.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(s){for(;;)switch(s.prev=s.next){case 0:return n=e.identifier,s.t0=v,s.next=4,i.a.awrap(o.c.getNotifications(n,Object(r.p)("day")));case 4:s.t1=s.sent,a=(0,s.t0)(s.t1),t({identifier:n,notifications:a});case 7:case"end":return s.stop()}}))})),a.push(t);case 2:case"end":return n.stop()}}))})),s.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 s.abrupt("return",{results:e,total:t});case 10:case"end":return s.stop()}}))}function y(){var e,t,n,a,o;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:return e={},t=0,r.next=4,i.a.awrap(h());case 4:return n=r.sent,r.next=7,i.a.awrap(new g(n).get());case 7:return a=r.sent,o=[],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,o,r,s,c;return i.a.async((function(i){for(;;)switch(i.prev=i.next){case 0:n=e.identifier,o=e.callback||Object(d.camelCase)(n),r=null,s=[],e.withData?(c=a[n]||null,r=p[o](c,n)):r=p[o](n),s=v(s=r?[r]:[]),t({identifier:n,notifications:s});case 8:case"end":return i.stop()}}))})),o.push(t);case 2:case"end":return n.stop()}}))})),r.next=12,i.a.awrap(Promise.all(o).then((function(t){t.forEach((function(t){t.notifications.length&&(e[t.identifier]=t.notifications)}))})));case 12:return e=k(e),t=e.length||Object.keys(e).length||0,r.abrupt("return",{results:e,total:t});case 15:case"end":return r.stop()}}))}var O=function(e){var t=Math.abs(e.count)+1;return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}},w=function(e){var t=Math.max(0,Math.abs(e.count)-1);return window.localStorage&&window.localStorage.setItem("googlesitekit::total-notifications",t),{count:t}}},60:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(14),b=n(0),v=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props,t=e.name,n=e.href,a=e.className,i=e.external;return React.createElement("div",{className:"googlesitekit-source-link ".concat(a)},[Object(b.__)("Source:","google-site-kit")," ",React.createElement(f.a,{key:"link",href:n,external:i,inherit:!0},t)])}}]),t}(m.Component);v.propTypes={name:h.a.string,href:h.a.string,className:h.a.string,external:h.a.bool},v.defaultProps={name:"",href:"",className:"",external:!1},t.a=v},62:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(){return i()(this,t),c()(this,u()(t).apply(this,arguments))}return g()(t,e),r()(t,[{key:"render",value:function(){var e=this.props.isSaving;return React.createElement("span",{className:"spinner",style:{display:e?"inline-block":"none",float:"none",marginTop:"0",visibility:"visible"}})}}]),t}(m.Component);t.a=p},63:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(3),r=n.n(o),s=n(4),c=n.n(s),l=n(5),u=n.n(l),d=n(6),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(2),b=n(9),v=n(32),k=n(8),_=n.n(k),y=n(54),O=n(0),w=function(e){function t(){return r()(this,t),u()(this,g()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props,n=e.title,a=e.description,i=e.ctaLabel;return googlesitekit.permissions.canManageOptions?React.createElement(v.a,{title:n,description:a,onClick:t.setupAnalyticsClick,ctaLabel:i}):null}}],[{key:"setupAnalyticsClick",value:function(){return i.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,i.a.awrap(Object(f.a)(b.c,"analytics",!0));case 3:return e.next=5,i.a.awrap(Object(f.u)());case 5:window.location=Object(f.m)("analytics",!0),e.next=11;break;case 8:e.prev=8,e.t0=e.catch(0),Object(f.w)(y.a,{id:"analytics-setup-error",title:Object(O.__)("Internal Server Error","google-site-kit"),description:e.t0.message,format:"small",type:"win-error"});case 11:case"end":return e.stop()}}),null,null,[[0,8]])}}]),t}(h.Component);w.propTypes={title:_.a.string,description:_.a.string,ctaLabel:_.a.string},w.defaultProps={title:Object(O.__)("Learn more about what visitors do on your site.","google-site-kit"),description:Object(O.__)("Connecting with Google Analytics to see unique vistors, goal completions, top pages and more.","google-site-kit"),ctaLabel:Object(O.__)("Set up Analytics","google-site-kit")},t.a=w},65:function(e,t,n){"use strict";n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return r}));var a=n(18),i=n(1),o=i.Suspense?i.Suspense:a.Suspense,r=i.lazy?i.lazy:a.lazy},67:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=n(8),h=n.n(p),f=n(29),b=n(14),v=n(22),k=n(145),_=n.n(k),y=n(0),O=function(e){function t(){var e;return i()(this,t),(e=c()(this,u()(t).call(this))).state={attributes:[Object(y.__)("Audience overview","google-site-kit"),Object(y.__)("Top pages","google-site-kit"),Object(y.__)("Top acquisition sources","google-site-kit"),Object(y.__)("AdSense & Analytics metrics for top pages","google-site-kit")]},e.dialogRef=Object(m.createRef)(),e}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){new v.d(this.dialogRef.current)}},{key:"render",value:function(){var e=this.props,t=e.dialogActive,n=e.handleDialog,a=e.title,i=e.provides,o=e.handleConfirm,r=e.subtitle,s=e.confirmButton,c=e.dependentModules;return React.createElement("div",{ref:this.dialogRef,className:"mdc-dialog ".concat(t?"mdc-dialog--open":""),role:"alertdialog","aria-modal":"true","aria-labelledby":"remove-module-dialog","aria-describedby":"remove-module-dialog-description","aria-hidden":t?"false":"true",tabIndex:"-1"},React.createElement("div",{className:"mdc-dialog__scrim"}," "),React.createElement(_.a,{active:t},React.createElement("div",null,React.createElement("div",{className:"mdc-dialog__container"},React.createElement("div",{className:"mdc-dialog__surface"},a&&React.createElement("h2",{id:"remove-module-dialog",className:"mdc-dialog__title"},a),r&&React.createElement("p",{className:"mdc-dialog__lead"},r),React.createElement("section",{id:"remove-module-dialog-description",className:"mdc-dialog__content"},React.createElement("ul",{className:"mdc-list mdc-list--underlined mdc-list--non-interactive"},i&&i.map((function(e){return React.createElement("li",{className:"mdc-list-item",key:e},React.createElement("span",{className:"mdc-list-item__text"},e))})))),c&&React.createElement("p",{className:"mdc-dialog__dependecies"},React.createElement("strong",null,Object(y.__)("Note: ","google-site-kit")),c),React.createElement("footer",{className:"mdc-dialog__actions"},React.createElement(f.a,{onClick:o,danger:!0},s||Object(y.__)("Disconnect","google-site-kit")),React.createElement(b.a,{className:"mdc-dialog__cancel-button",onClick:function(){return n()},inherit:!0},Object(y.__)("Cancel","google-site-kit"))))))))}}]),t}(m.Component);O.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},O.defaultProps={dialogActive:!1,handleDialog:null,title:null,description:null,confirmButton:null},t.a=O},69:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(22),b=n(0),v=n(10),k=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={context:"Dashboard"},n.dateRangeHook="googlesitekit.dateRange",n.dateRangeHandlerHook="googlesitekit.dateRageHandler",n.dateRangeHookAddedHook="googlesitekit.dateRageHookAddedHandler",Object(v.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector",(function(e){n.setState({context:e}),Object(v.removeAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingDataForDateRangeSelector")})),n.handleSelection=n.handleSelection.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(v.addAction)("hookAdded",this.dateRangeHookAddedHook,(function(t){e.dateRangeHook===t&&e.forceUpdate()}))}},{key:"componentWillUnmount",value:function(){Object(v.removeAction)("hookAdded",this.dateRangeHookAddedHook)}},{key:"handleSelection",value:function(e,t){var n=this.state.context,a=t.getAttribute("data-value");return Object(v.removeFilter)(this.dateRangeHook,this.dateRangeHandlerHook),Object(v.addFilter)(this.dateRangeHook,this.dateRangeHandlerHook,(function(){return a})),Object(v.doAction)("googlesitekit.moduleDataReset"),Object(v.doAction)("googlesitekit.moduleLoaded",n),!1}},{key:"render",value:function(){var e=[Object(b.__)("Last 7 days","google-site-kit"),Object(b.__)("Last 14 days","google-site-kit"),Object(b.__)("Last 28 days","google-site-kit"),Object(b.__)("Last 90 days","google-site-kit")];return React.createElement(f.k,{enhanced:!0,className:"mdc-select--minimal",name:"time_period",label:"",onEnhancedChange:this.handleSelection,options:e,value:Object(v.applyFilters)(this.dateRangeHook,Object(b.__)("Last 28 days","google-site-kit"))})}}]),t}(h.Component);t.a=k},80:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(7),g=n.n(d),m=n(1),p=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).el=document.createElement("div"),n.root=document.querySelector(".googlesitekit-plugin")||document.body,n}return g()(t,e),r()(t,[{key:"componentDidMount",value:function(){this.root.appendChild(this.el)}},{key:"componentWillUnmount",value:function(){this.root.removeChild(this.el)}},{key:"render",value:function(){return Object(m.createPortal)(this.props.children,this.el)}}]),t}(m.Component)},81:function(e,t,n){"use strict";n(1);var a=n(20),i=n(0);t.a=function(){return React.createElement("div",{className:"googlesitekit-logo","aria-hidden":"true"},React.createElement(a.a,{id:"logo-g",className:"googlesitekit-logo__logo-g",height:"34",width:"32"}),React.createElement(a.a,{id:"logo-sitekit",className:"\n\t\t\t\t googlesitekit-logo__logo-sitekit\n\t\t\t\t",height:"26",width:"99"}),React.createElement("span",{className:"screen-reader-text"},Object(i.__)("Site Kit by Google Logo","google-site-kit")))}},87:function(e,t,n){"use strict";n(1);var a=n(26),i=n(0);t.a=function(){var e=googlesitekit.admin.connectURL;return React.createElement(a.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:e,ctaLabel:Object(i.__)("Click here","google-site-kit")})}},88:function(e,t,n){"use strict";n(1);t.a=function(){return React.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"},React.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"}))}},89:function(e,t,n){"use strict";var a=n(3),i=n.n(a),o=n(4),r=n.n(o),s=n(5),c=n.n(s),l=n(6),u=n.n(l),d=n(13),g=n.n(d),m=n(7),p=n.n(m),h=n(1),f=n(58),b=n(0),v=n(10),k=function(e){function t(e){var n;return i()(this,t),(n=c()(this,u()(t).call(this,e))).state={count:0},n.handleIncrement=n.handleIncrement.bind(g()(n)),n.handleDecrement=n.handleDecrement.bind(g()(n)),n}return p()(t,e),r()(t,[{key:"componentDidMount",value:function(){var e=this;Object(v.addAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications",(function(){Object(v.removeAction)("googlesitekit.dataLoaded","googlesitekit.dataLoadedGetNotifications"),Object(f.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(f.e)}},{key:"handleDecrement",value:function(){this.setState(f.a)}},{key:"render",value:function(){var e=Object(b.sprintf)(Object(b._n)("%d notification","%d notifications",this.state.count,"google-site-kit"),this.state.count),t=React.createElement("span",{id:"googlesitekit-notifications-counter",className:"googlesitekit-notifications-counter update-plugins count-".concat(this.state.count)},React.createElement("span",{className:"plugin-count","aria-hidden":"true"},this.state.count),React.createElement("span",{className:"screen-reader-text"},e));return Object(h.createPortal)(t,document.querySelector("#toplevel_page_googlesitekit-dashboard .wp-menu-name"))}}]),t}(h.Component);t.a=k},9:function(e,t,n){"use strict";var a=n(12),i=n.n(a),o=n(27),r=n.n(o),s=n(49),c=n.n(s),l=n(87),u=(n(1),n(26)),d=n(0),g=function(){return React.createElement(u.a,{id:"permission error",title:Object(d.__)("Permissions issue accessing data","google-site-kit"),description:Object(d.__)("This account does not have access to the requested data.","google-site-kit"),handleDismiss:function(){},format:"small",type:"win-error",isDismissable:!0})},m=n(165),p=n.n(m),h=n(2),f=n(11),b=n(35),v=n.n(b),k=n(36),_=n(10);function y(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 O(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?y(n,!0).forEach((function(t){r()(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):y(n).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}n.d(t,"a",(function(){return w})),n.d(t,"b",(function(){return R}));var w="core",R="modules",j=function(){googlesitekit.admin=googlesitekit.admin||{},"string"==typeof googlesitekit.admin.datacache&&(googlesitekit.admin.datacache=JSON.parse(googlesitekit.admin.datacache)),"object"!==c()(googlesitekit.admin.datacache)&&(googlesitekit.admin.datacache={})},E=function(e,t){var n=O({data:{}},e);return n.data=O({dateRange:t},n.data),n},C={maxRequests:10,init:function(){googlesitekit.initialized||(googlesitekit.initialized=!0,this.collectModuleData=this.collectModuleData.bind(this),googlesitekit.cache=[],Object(_.addAction)("googlesitekit.moduleLoaded","googlesitekit.collectModuleListingData",this.collectModuleData))},combinedGetFromCache:function(e){var t=this;return new Promise((function(n,a){try{var i=[],o=Object(h.h)();Object(f.each)(e,(function(e){var n=E(e,o);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,o=Object(h.h)();Object(f.each)(e,(function(e){var n=E(e,o);n.key=t.getCacheKey(n.type,n.identifier,n.datapoint,n.data);var r=t.getCache(n.key,n.maxAge);void 0!==r?(setTimeout((function(){t.resolve(n,r)}),i),i+=25):a.push(n)})),a=Object(f.sortBy)(a,"priority");var r=[],s=[],c={},u=!!a.find((function(e){return e.priority<10}));Object(f.each)(a,(function(e,t){!n&&10<=e.priority&&u?s.push(e):c[e.key]?c[e.key].push(t):(c[e.key]=[t],r.push(e))}));var d=10,m=r.slice(0,d),p=r.slice(d);if(p=p.concat(s),0!==m.length||0!==p.length){0<p.length&&0<this.maxRequests--?setTimeout((function(){t.combinedGet(p,!0)}),50):this.maxRequests=10;var b=null!==Object(h.l)("datacache");return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/data/",{datacache:b||void 0}),data:{request:m},method:"POST"}).then((function(e){Object(f.each)(e,(function(e,n){if(e.xdebug_message)console.log("data_error",e.xdebug_message);else{if(!c[n])return void console.log("data_error","unknown response key "+n);e.error_data&&e.error_data[403]&&e.error_data[403].reason&&("insufficientPermissions"===e.error_data[403].reason?Object(_.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",Object(h.g)(l.a),1):"forbidden"===e.error_data[403].reason&&Object(_.addFilter)("googlesitekit.DashboardNotifications","googlesitekit.AuthNotification",Object(h.g)(g),1),Object(_.addFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease",(function(e){return Object(_.removeFilter)("googlesitekit.TotalNotifications","googlesitekit.AuthCountIncrease"),e+1}))),Object(f.each)(c[n],(function(n){var i=a[n];t.setCache(i.key,e),t.resolve(i,e)}))}0===p.length&&Object(_.doAction)("googlesitekit.dataLoaded","api")}))})).catch((function(e){console.log("error",e)}))}Object(_.doAction)("googlesitekit.dataLoaded","cache")},resolve:function(e,t){e&&"function"==typeof e.callback&&e.callback(t,e.datapoint)},setCache:function(e,t){if(void 0!==t&&(!t||"object"!==c()(t)||!t.error&&!t.errors)){j(),googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(t);var n={value:t,date:Date.now()/1e3};Object(h.o)().setItem("googlesitekit_"+e,JSON.stringify(n))}},getCache:function(e,t){if(!googlesitekit.admin.nojscache){if(j(),void 0!==googlesitekit.admin.datacache[e])return googlesitekit.admin.datacache[e];var n=JSON.parse(Object(h.o)().getItem("googlesitekit_"+e));return n&&"object"===c()(n)&&n.date&&(!t||Date.now()/1e3-n.date<t)?(googlesitekit.admin.datacache[e]=Object(f.cloneDeep)(n.value),Object(f.cloneDeep)(googlesitekit.admin.datacache[e])):void 0}},deleteCache:function(e){j(),delete googlesitekit.admin.datacache[e],Object(h.o)().removeItem("googlesitekit_"+e)},invalidateCacheGroup:function(e,t,n){var a=this.getCacheKey(e,t,n);j(),Object.keys(googlesitekit.admin.datacache).forEach((function(e){0!==e.indexOf(a+"::")&&e!==a||delete googlesitekit.admin.datacache[e]})),Object.keys(Object(h.o)()).forEach((function(e){0!==e.indexOf("googlesitekit_"+a+"::")&&e!=="googlesitekit_"+a||Object(h.o)().removeItem(e)}))},collectModuleData:function(e,t){var n=Object(_.applyFilters)("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]:{},o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],r=this.getCacheKey(e,t,n,i);if(!o){var s=this.getCache(r,3600);if(void 0!==s)return new Promise((function(e){e(s)}))}return v()({path:Object(k.addQueryArgs)("/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),i)}).then((function(e){return o||a.setCache(r,e),new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))},getNotifications:function(e){var t,n,a,o=arguments;return i.a.async((function(r){for(;;)switch(r.prev=r.next){case 0:if(t=o.length>1&&void 0!==o[1]?o[1]:0,n=[],e){r.next=4;break}return r.abrupt("return",n);case 4:if(a=this.getCacheKey("modules",e,"notifications"),(n=C.getCache(a,t))&&0!==n.length){r.next=11;break}return r.next=9,i.a.awrap(v()({path:"/google-site-kit/v1/modules/".concat(e,"/notifications/")}));case 9:n=r.sent,C.setCache(a,n);case 11:return r.abrupt("return",n);case 12:case"end":return r.stop()}}),null,this)},set:function(e,t,n,a){var i={};return i.data=a,v()({path:"/google-site-kit/v1/".concat(e,"/").concat(t,"/data/").concat(n),data:i,method:"POST"}).then((function(a){return C.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=[],o=[e,t,n],r=0,s=o;r<s.length;r++){var l=s[r];if(!l||!l.length)break;i.push(l)}return 3===i.length&&a&&"object"===c()(a)&&Object.keys(a).length&&i.push(p()(JSON.stringify(Object(h.x)(a)))),i.join("::")},setModuleActive:function(e,t){return v()({path:"/google-site-kit/v1/modules/".concat(e),data:{active:t},method:"POST"}).then((function(e){return new Promise((function(t){t(e)}))})).catch((function(e){return Promise.reject(e)}))}};C.init();t.c=C}}]);
dist/assets/js/googlesitekit-dashboard-details.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var a,i,o=t[0],c=t[1],s=t[2],_=0,d=[];_<o.length;_++)i=o[_],n[i]&&d.push(n[i][0]),n[i]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(u&&u(t);d.length;)d.shift()();return l.push.apply(l,s||[]),r()}function r(){for(var e,t=0;t<l.length;t++){for(var r=l[t],a=!0,i=1;i<r.length;i++){var o=r[i];0!==n[o]&&(a=!1)}a&&(l.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var a={},n={11:0},l=[];function __webpack_require__(t){if(a[t])return a[t].exports;var r=a[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=a,__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 a in e)__webpack_require__.d(r,a,function(t){return e[t]}.bind(null,a));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||[],o=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var u=o;l.push([205,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},205:function(e,t,r){"use strict";r.r(t);var a=r(3),n=r.n(a),l=r(4),i=r.n(l),o=r(5),c=r.n(o),u=r(6),s=r.n(u),_=r(7),d=r.n(_),p=r(1),m=r(26),g=r(39),f=r.n(g),h=r(0),b=r(10),k=r(21),y=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return null}}]),t}(p.Component),v=Object(k.a)("googlesitekit.DashboardDetailsModule")(y),w=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(v,{key:"googlesitekit-dashboard-details-module"})}}]),t}(p.Component),E=r(43),R=r(14),q=r(47),O=r(17),j=r(2),x=r(69),N=r(42),D=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={},r}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement(E.a,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard-single-url"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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-8-desktop "},React.createElement(R.a,{href:googlesitekit.dashboardPermalink,inherit:!0,back:!0,small:!0},Object(h.__)("Back to the Site Kit Dashboard","google-site-kit")),React.createElement(q.a,{title:Object(h.__)("Detailed Page Stats","google-site-kit"),className:" googlesitekit-heading-2 googlesitekit-dashboard-single-url__heading ",fullWidth:!0})),React.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-4-desktop mdc-layout-grid__cell--align-right mdc-layout-grid__cell--align-bottom "},React.createElement(x.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(O.a,null,React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-single-url__title "},Object(j.e)(googlesitekit.pageTitle)),React.createElement(R.a,{href:googlesitekit.permaLink,inherit:!0,external:!0},googlesitekit.permaLink)))))),React.createElement(w,null),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(N.a,null)))))))}}]),t}(p.Component),S=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={hasError:!1},Object(h.setLocaleData)(googlesitekit.locale,"google-site-kit"),r}return d()(t,e),i()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.error,a=e.info;return t?React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:r,description:a.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(D,null)}}]),t}(p.Component);f()((function(){var e=document.getElementById("js-googlesitekit-dashboard-details");null!==e&&(Object(p.render)(React.createElement(S,null),e),Object(b.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var a,i,o=t[0],c=t[1],s=t[2],_=0,d=[];_<o.length;_++)i=o[_],n[i]&&d.push(n[i][0]),n[i]=0;for(a in c)Object.prototype.hasOwnProperty.call(c,a)&&(e[a]=c[a]);for(u&&u(t);d.length;)d.shift()();return l.push.apply(l,s||[]),r()}function r(){for(var e,t=0;t<l.length;t++){for(var r=l[t],a=!0,i=1;i<r.length;i++){var o=r[i];0!==n[o]&&(a=!1)}a&&(l.splice(t--,1),e=__webpack_require__(__webpack_require__.s=r[0]))}return e}var a={},n={11:0},l=[];function __webpack_require__(t){if(a[t])return a[t].exports;var r=a[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=a,__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 a in e)__webpack_require__.d(r,a,function(t){return e[t]}.bind(null,a));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||[],o=i.push.bind(i);i.push=t,i=i.slice();for(var c=0;c<i.length;c++)t(i[c]);var u=o;l.push([205,0,1]),r()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},18:function(e,t){e.exports=React},205:function(e,t,r){"use strict";r.r(t);var a=r(3),n=r.n(a),l=r(4),i=r.n(l),o=r(5),c=r.n(o),u=r(6),s=r.n(u),_=r(7),d=r.n(_),p=r(1),m=r(26),g=r(39),f=r.n(g),h=r(0),b=r(10),k=r(21),y=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return null}}]),t}(p.Component),v=Object(k.a)("googlesitekit.DashboardDetailsModule")(y),w=function(e){function t(){return n()(this,t),c()(this,s()(t).apply(this,arguments))}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(v,{key:"googlesitekit-dashboard-details-module"})}}]),t}(p.Component),E=r(44),R=r(14),q=r(47),O=r(17),j=r(2),x=r(69),N=r(43),D=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={},r}return d()(t,e),i()(t,[{key:"render",value:function(){return React.createElement(p.Fragment,null,React.createElement(E.a,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard-single-url"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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-8-desktop "},React.createElement(R.a,{href:googlesitekit.dashboardPermalink,inherit:!0,back:!0,small:!0},Object(h.__)("Back to the Site Kit Dashboard","google-site-kit")),React.createElement(q.a,{title:Object(h.__)("Detailed Page Stats","google-site-kit"),className:" googlesitekit-heading-2 googlesitekit-dashboard-single-url__heading ",fullWidth:!0})),React.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-4-desktop mdc-layout-grid__cell--align-right mdc-layout-grid__cell--align-bottom "},React.createElement(x.a,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(O.a,null,React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("h3",{className:" googlesitekit-heading-3 googlesitekit-dashboard-single-url__title "},Object(j.e)(googlesitekit.pageTitle)),React.createElement(R.a,{href:googlesitekit.permaLink,inherit:!0,external:!0},googlesitekit.permaLink)))))),React.createElement(w,null),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(N.a,null)))))))}}]),t}(p.Component),S=function(e){function t(e){var r;return n()(this,t),(r=c()(this,s()(t).call(this,e))).state={hasError:!1},Object(h.setLocaleData)(googlesitekit.locale,"google-site-kit"),r}return d()(t,e),i()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,r=e.error,a=e.info;return t?React.createElement(m.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:r,description:a.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(D,null)}}]),t}(p.Component);f()((function(){var e=document.getElementById("js-googlesitekit-dashboard-details");null!==e&&(Object(p.render)(React.createElement(S,null),e),Object(b.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-dashboard.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var r,l,o=t[0],c=t[1],s=t[2],d=0,m=[];d<o.length;d++)l=o[d],a[l]&&m.push(a[l][0]),a[l]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(u&&u(t);m.length;)m.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,l=1;l<n.length;l++){var o=n[l];0!==a[o]&&(r=!1)}r&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=n[0]))}return e}var r={},a={10:0},i=[];function __webpack_require__(t){if(r[t])return r[t].exports;var n=r[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=r,__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 r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));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 l=window.webpackJsonp=window.webpackJsonp||[],o=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var u=o;i.push([203,0,1]),n()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},156:function(e,t,n){"use strict";n.r(t);var r=n(13),a=n.n(r),i=n(3),l=n.n(i),o=n(4),c=n.n(o),u=n(5),s=n.n(u),d=n(6),m=n.n(d),_=n(7),p=n.n(_),f=n(1),g=n(11),h=n(43),y=n(14),v=n(42),k=n(2),b=n(21),R=n(0),E=n(10),w=function(e){function t(){return l()(this,t),s()(this,m()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(f.Fragment,null,e)}}]),t}(f.Component),S=function(e){function t(e){var n;l()(this,t),n=s()(this,m()(t).call(this,e));var r=googlesitekit.setup.moduleToSetup;return n.state={currentModule:r,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(E.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.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=window.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}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),r=Object(k.n)("googlesitekit-settings",{});return React.createElement(f.Fragment,null,React.createElement(h.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(R.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(y.a,{id:"setup-".concat(e,"-cancel"),href:r},Object(R.__)("Cancel","google-site-kit"))),React.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 "},React.createElement(v.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(b.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(k.n)("googlesitekit-dashboard",e);Object(g.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(f.Component);t.default=S},18:function(e,t){e.exports=React},203:function(e,t,n){"use strict";n.r(t);var r=n(3),a=n.n(r),i=n(4),l=n.n(i),o=n(5),c=n.n(o),u=n(6),s=n.n(u),d=n(7),m=n.n(d),_=n(1),p=n(2),f=n(26),g=n(156),h=n(43),y=n(69),v=n(47),k=(n(158),n(161),n(0)),b=n(21),R=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),E=Object(b.a)("googlesitekit.DashboardModule")(R),w=n(42),S=n(18),O=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(S.Fragment,null,React.createElement(E,{key:"googlesitekit-dashboard-module"}),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(w.a,null)))}}]),t}(_.Component),j=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(O,null))}}]),t}(_.Component),N=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),q=Object(b.a)("googlesitekit.DashboardNotifications")(N),M=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(h.a,null),React.createElement(q,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-10-desktop mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-2-phone "},React.createElement(v.a,{className:" googlesitekit-heading-2 googlesitekit-dashboard__heading ",title:Object(k.__)("Site Overview","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-desktop mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right "},React.createElement(y.a,null)),React.createElement(j,null))))))}}]),t}(_.Component),T=n(89),x=n(39),D=n.n(x),C=n(10),F=function(e){function t(e){var n;return a()(this,t),(n=c()(this,s()(t).call(this,e))).state={hasError:!1},Object(k.setLocaleData)(googlesitekit.locale,"google-site-kit"),n}return m()(t,e),l()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){if(window.googlesitekit.setup.showModuleSetupWizard)return React.createElement(g.default,null);var e=this.state,t=e.hasError,n=e.error,r=e.info;return t?React.createElement(f.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:n,description:r.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(_.Fragment,null,React.createElement(T.a,null),React.createElement(M,null))}}]),t}(_.Component);D()((function(){googlesitekit.admin.resetSession&&Object(p.d)();var e=document.getElementById("js-googlesitekit-dashboard");null!==e&&(Object(_.render)(React.createElement(F,null),e),Object(C.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var r,l,o=t[0],c=t[1],s=t[2],d=0,m=[];d<o.length;d++)l=o[d],a[l]&&m.push(a[l][0]),a[l]=0;for(r in c)Object.prototype.hasOwnProperty.call(c,r)&&(e[r]=c[r]);for(u&&u(t);m.length;)m.shift()();return i.push.apply(i,s||[]),n()}function n(){for(var e,t=0;t<i.length;t++){for(var n=i[t],r=!0,l=1;l<n.length;l++){var o=n[l];0!==a[o]&&(r=!1)}r&&(i.splice(t--,1),e=__webpack_require__(__webpack_require__.s=n[0]))}return e}var r={},a={10:0},i=[];function __webpack_require__(t){if(r[t])return r[t].exports;var n=r[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=r,__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 r in e)__webpack_require__.d(n,r,function(t){return e[t]}.bind(null,r));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 l=window.webpackJsonp=window.webpackJsonp||[],o=l.push.bind(l);l.push=t,l=l.slice();for(var c=0;c<l.length;c++)t(l[c]);var u=o;i.push([203,0,1]),n()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},156:function(e,t,n){"use strict";n.r(t);var r=n(13),a=n.n(r),i=n(3),l=n.n(i),o=n(4),c=n.n(o),u=n(5),s=n.n(u),d=n(6),m=n.n(d),_=n(7),p=n.n(_),f=n(1),g=n(11),h=n(44),y=n(14),v=n(43),k=n(2),b=n(21),R=n(0),E=n(10),w=function(e){function t(){return l()(this,t),s()(this,m()(t).apply(this,arguments))}return p()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.children;return React.createElement(f.Fragment,null,e)}}]),t}(f.Component),S=function(e){function t(e){var n;l()(this,t),n=s()(this,m()(t).call(this,e));var r=googlesitekit.setup.moduleToSetup;return n.state={currentModule:r,refresh:!1},n.timeoutID=null,n.unfocusedTime=0,n.autoRefreshModules=Object(E.applyFilters)("googlesitekit.autoRefreshModules",[]),n.moduleRefresh=n.autoRefreshModules.find((function(e){return n.state.currentModule===e.identifier})),n.refreshStatus=n.refreshStatus.bind(a()(n)),n.startUnfocusedTimer=n.startUnfocusedTimer.bind(a()(n)),n}return p()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("focus",this.refreshStatus),window.addEventListener("blur",this.startUnfocusedTimer)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("focus",this.refreshStatus),window.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=window.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}),window.clearTimeout(this.timeoutID),this.unfocusedTime=0,this.timeoutID=null)}}},{key:"render",value:function(){var e=this.state.currentModule,n=t.loadSetupModule(e),r=Object(k.n)("googlesitekit-settings",{});return React.createElement(f.Fragment,null,React.createElement(h.a,null),React.createElement("div",{className:"googlesitekit-setup"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("section",{className:"googlesitekit-setup__wrapper"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("p",{className:" googlesitekit-setup__intro-title googlesitekit-overline "},Object(R.__)("Connect Service","google-site-kit")),n))),React.createElement("div",{className:"googlesitekit-setup__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.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 "},React.createElement(y.a,{id:"setup-".concat(e,"-cancel"),href:r},Object(R.__)("Cancel","google-site-kit"))),React.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 "},React.createElement(v.a,null)))))))))))}}],[{key:"loadSetupModule",value:function(e){var n=Object(b.a)("googlesitekit.ModuleSetup-".concat(e))(w);return React.createElement(n,{finishSetup:t.finishSetup,onSettingsPage:!1,isEditing:!0})}},{key:"finishSetup",value:function(){var e={notification:"authentication_success"};googlesitekit.setup&&googlesitekit.setup.moduleToSetup&&(e.slug=googlesitekit.setup.moduleToSetup);var t=Object(k.n)("googlesitekit-dashboard",e);Object(g.delay)((function(){window.location.replace(t)}),500,"later")}}]),t}(f.Component);t.default=S},18:function(e,t){e.exports=React},203:function(e,t,n){"use strict";n.r(t);var r=n(3),a=n.n(r),i=n(4),l=n.n(i),o=n(5),c=n.n(o),u=n(6),s=n.n(u),d=n(7),m=n.n(d),_=n(1),p=n(2),f=n(26),g=n(156),h=n(44),y=n(69),v=n(47),k=(n(158),n(161),n(0)),b=n(21),R=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),E=Object(b.a)("googlesitekit.DashboardModule")(R),w=n(43),S=n(18),O=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(S.Fragment,null,React.createElement(E,{key:"googlesitekit-dashboard-module"}),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(w.a,null)))}}]),t}(_.Component),j=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(O,null))}}]),t}(_.Component),N=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return null}}]),t}(_.Component),q=Object(b.a)("googlesitekit.DashboardNotifications")(N),M=function(e){function t(){return a()(this,t),c()(this,s()(t).apply(this,arguments))}return m()(t,e),l()(t,[{key:"render",value:function(){return React.createElement(_.Fragment,null,React.createElement(h.a,null),React.createElement(q,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"googlesitekit-dashboard"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-10-desktop mdc-layout-grid__cell--span-6-tablet mdc-layout-grid__cell--span-2-phone "},React.createElement(v.a,{className:" googlesitekit-heading-2 googlesitekit-dashboard__heading ",title:Object(k.__)("Site Overview","google-site-kit")})),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-2-desktop mdc-layout-grid__cell--span-2-tablet mdc-layout-grid__cell--span-2-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right "},React.createElement(y.a,null)),React.createElement(j,null))))))}}]),t}(_.Component),T=n(89),x=n(39),D=n.n(x),C=n(10),F=function(e){function t(e){var n;return a()(this,t),(n=c()(this,s()(t).call(this,e))).state={hasError:!1},Object(k.setLocaleData)(googlesitekit.locale,"google-site-kit"),n}return m()(t,e),l()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){if(window.googlesitekit.setup.showModuleSetupWizard)return React.createElement(g.default,null);var e=this.state,t=e.hasError,n=e.error,r=e.info;return t?React.createElement(f.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:n,description:r.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(_.Fragment,null,React.createElement(T.a,null),React.createElement(M,null))}}]),t}(_.Component);D()((function(){googlesitekit.admin.resetSession&&Object(p.d)();var e=document.getElementById("js-googlesitekit-dashboard");null!==e&&(Object(_.render)(React.createElement(F,null),e),Object(C.doAction)("googlesitekit.moduleLoaded","Dashboard"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
dist/assets/js/googlesitekit-settings.js CHANGED
@@ -1 +1 @@
1
- !function(e){function t(t){for(var i,c,l=t[0],s=t[1],d=t[2],g=0,u=[];g<l.length;g++)c=l[g],n[c]&&u.push(n[c][0]),n[c]=0;for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i]);for(r&&r(t);u.length;)u.shift()();return o.push.apply(o,d||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],i=!0,c=1;c<a.length;c++){var l=a[c];0!==n[l]&&(i=!1)}i&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=a[0]))}return e}var i={},n={14:0},o=[];function __webpack_require__(t){if(i[t])return i[t].exports;var a=i[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.m=e,__webpack_require__.c=i,__webpack_require__.d=function(e,t,a){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},__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 a=Object.create(null);if(__webpack_require__.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(a,i,function(t){return e[t]}.bind(null,i));return a},__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 c=window.webpackJsonp=window.webpackJsonp||[],l=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var r=l;o.push([201,0,1]),a()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},144:function(e,t,a){"use strict";var i=a(3),n=a.n(i),o=a(4),c=a.n(o),l=a(5),s=a.n(l),r=a(6),d=a.n(r),g=a(13),u=a.n(g),m=a(7),_=a.n(m),p=a(1),h=a(22),v=a(8),k=a.n(v),f=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).formFieldRef=Object(p.createRef)(),a.checkboxRef=Object(p.createRef)(),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){new h.e(this.formFieldRef.current).input=new h.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.id,i=e.name,n=e.value,o=e.checked,c=e.disabled,l=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(c?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:i,value:n,checked:o,disabled:c,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:a},l))}}]),t}(p.Component);f.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},f.defaultProps={checked:!1,disabled:!1};var b=f,y=a(35),E=a.n(y),R=a(0),O=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},a.handleOptIn=a.handleOptIn.bind(u()(a)),a}return _()(t,e),c()(t,[{key:"handleOptIn",value:function(e){var t=this,a=e.target.checked,i={googlesitekit_tracking_optin:a};E()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(i),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!a,a&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!a,error:!1,scriptOnPage:!0})})).catch((function(a){t.setState({optIn:!e.target.checked,error:{errorCode:a.code,errorMsg:a.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,a=e.error,i=this.props,n=i.id,o=i.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(b,{id:n,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(R.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(R.__)("Google Privacy Policy","google-site-kit")),"."),a&&React.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),t}(p.Component);O.propTypes={id:k.a.string,name:k.a.string},O.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=O},146:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var i=a(12),n=a.n(i),o=a(3),c=a.n(o),l=a(4),s=a.n(l),r=a(5),d=a.n(r),g=a(6),u=a.n(g),m=a(13),_=a.n(m),p=a(7),h=a.n(p),v=a(1),k=a(9),f=a(2),b=a(67),y=a(0),E=a(14),R=a(80),O=function(e){function t(e){var a;return c()(this,t),(a=d()(this,u()(t).call(this,e))).state={dialogActive:!1},a.handleDialog=a.handleDialog.bind(_()(a)),a.handleUnlinkConfirm=a.handleUnlinkConfirm.bind(_()(a)),a.handleCloseModal=a.handleCloseModal.bind(_()(a)),a}return h()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return n.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.a.awrap(k.c.set(k.a,"site","reset"));case 2:Object(f.d)(),this.handleDialog(),document.location=Object(f.n)("googlesitekit-splash",{notification:"reset_success"});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,a=this.state.dialogActive;return React.createElement(v.Fragment,null,React.createElement(E.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(y.__)("Reset Site Kit","google-site-kit")),React.createElement(R.a,null,React.createElement(b.a,{dialogActive:a,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(y.__)("Reset Site Kit","google-site-kit"),subtitle:Object(y.__)("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(y.__)("Reset","google-site-kit"),provides:[]})))}}]),t}(v.Component)},18:function(e,t){e.exports=React},201:function(e,t,a){"use strict";a.r(t);var i=a(3),n=a.n(i),o=a(4),c=a.n(o),l=a(5),s=a.n(l),r=a(6),d=a.n(r),g=a(7),u=a.n(g),m=a(1),_=a(13),p=a.n(_),h=a(27),v=a.n(h),k=a(17),f=a(26),b=a(2),y=a(11),E=a(0),R=a(10),O=a(12),w=a.n(O),j=a(8),N=a.n(j),S=a(14),C=a(29),M=a(9),x=a(20),D=a(62),A=a(53),T=a(54),q=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={isSaving:!1,active:e.active},a.activateOrDeactivate=a.activateOrDeactivate.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"activateOrDeactivate",value:function(){var e,t;return w.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.active,t=this.props.slug,this.setState({isSaving:!0}),a.next=6,w.a.awrap(Object(b.a)(M.c,t,!e));case 6:return a.next=8,w.a.awrap(Object(b.u)());case 8:window.location=Object(b.m)(t,!0),a.next=15;break;case 11:a.prev=11,a.t0=a.catch(0),Object(b.w)(T.a,{id:"activate-module-error",title:Object(E.__)("Internal Server Error","google-site-kit"),description:a.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 15:case"end":return a.stop()}}),null,this,[[0,11]])}},{key:"render",value:function(){var e=this.state.isSaving,t=this.props,a=t.slug,i=t.name,n=t.description,o=t.showLink,c=!1,l=googlesitekit.modules;l[a].required.length&&l[a].required.forEach((function(e){l[e].setupComplete||(c=!0)}));return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-settings-connect-module\n\t\t\t\tgooglesitekit-settings-connect-module--".concat(a,"\n\t\t\t\t").concat(c?"googlesitekit-settings-connect-module--disabled":"","\n\t\t\t"),key:a},React.createElement("div",{className:"googlesitekit-settings-connect-module__switch"},React.createElement(D.a,{isSaving:e})),React.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},c?Object(b.q)("".concat(a,"-disabled")):Object(b.q)(a)),React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-settings-connect-module__title "},i),React.createElement("p",{className:"googlesitekit-settings-connect-module__text"},n),React.createElement(A.a,{slug:a,context:"modules-list"}),Object(R.applyFilters)("googlesitekit.SetupModuleShowLink",o,a)&&React.createElement("p",{className:"googlesitekit-settings-connect-module__cta"},React.createElement(S.a,{onClick:this.activateOrDeactivate,href:"",inherit:!0,disabled:c,arrow:!0},c?Object(E.sprintf)(Object(E.__)("Setup Analytics to gain access to %s","google-site-kit"),i):Object(E.sprintf)(Object(E.__)("Set up %s","google-site-kit"),i))))}}]),t}(m.Component);q.propTypes={slug:N.a.string,name:N.a.string,description:N.a.string,homepage:N.a.string,active:N.a.bool,onActive:N.a.func},q.defaultProps={slug:"",name:"",description:"",homepage:"",active:!1};var P=q,I=a(67),F=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component),L=a(21),U=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.slug;return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(A.a,{slug:e,context:"settings"}),Object(E.__)("Setup incomplete: ","google-site-kit"),React.createElement(S.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){window.location=Object(b.m)(e,!0)},inherit:!0},Object(E.__)("continue module setup","google-site-kit")))}}]),t}(m.Component),B=Object(L.a)("googlesitekit.ModuleSetupIncomplete")(U),K=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.compress;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-overlay\n\t\t\t\t".concat(e?"googlesitekit-overlay--compress":"","\n\t\t\t")},React.createElement("div",{className:"googlesitekit-overlay__wrapper"},React.createElement("div",{className:"googlesitekit-overlay__icon"},React.createElement(x.a,{id:"lock",width:"22",height:"30"})),React.createElement("h3",{className:" googlesitekit-heading-2 googlesitekit-overlay__title "},Object(E.__)("Section locked while editing","google-site-kit"))))}}]),t}(m.Component);K.propTypes={compress:N.a.bool},K.defaultProps={compress:!1};var G=K,H=function(e){function t(e){var a;n()(this,t),a=s()(this,d()(t).call(this,e));var i=e.slug,o=googlesitekit.modules[i].setupComplete;return a.state={isSaving:!1,active:e.active,setupComplete:o,dialogActive:!1},a.deactivate=a.deactivate.bind(p()(a)),a.activateOrDeactivate=a.activateOrDeactivate.bind(p()(a)),a.handleDialog=a.handleDialog.bind(p()(a)),a.handleCloseModal=a.handleCloseModal.bind(p()(a)),a.handleConfirmRemoveModule=a.handleConfirmRemoveModule.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"activateOrDeactivate",value:function(){var e,t;return w.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.active,t=!e,this.setState({isSaving:!0}),a.next=6,w.a.awrap(Object(b.a)(M.c,this.props.slug,t));case 6:return a.next=8,w.a.awrap(Object(b.u)());case 8:!1===t&&M.c.invalidateCacheGroup(M.b,this.props.slug),this.setState({isSaving:!1,active:t}),window.location=Object(b.m)(this.props.slug,!1),a.next=17;break;case 13:a.prev=13,a.t0=a.catch(0),Object(b.w)(T.a,{id:"activate-module-error",title:Object(E.__)("Internal Server Error","google-site-kit"),description:a.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 17:case"end":return a.stop()}}),null,this,[[0,13]])}},{key:"deactivate",value:function(){this.props.autoActivate||this.activateOrDeactivate()}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"handleConfirmRemoveModule",value:function(){this.deactivate()}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"getDependentModules",value:function(){var e=this.props.slug,t=googlesitekit.modules,a={};return t[e].dependants&&t[e].dependants.forEach((function(e){t[e]&&(a[e]=t[e])})),a}},{key:"render",value:function(){var e=this.state,t=e.active,a=e.setupComplete,i=e.dialogActive,n=this.props,o=n.name,c=n.slug,l=n.homepage,s=n.isEditing,r=n.isOpen,d=n.handleAccordion,g=n.handleEdit,u=n.description,_=n.hasSettings,p=n.autoActivate,h=n.provides,v=n.isSaving,k=n.screenID,f=n.error,O="".concat(c,"-module"),w=Object(R.applyFilters)("googlesitekit.Connected-".concat(c),a),j=w?"googlesitekit-settings-module__status-icon--connected":"googlesitekit-settings-module__status-icon--not-connected",N=Object(E.sprintf)(Object(E.__)("By disconnecting the %s module from Site Kit, you will no longer have access to:","google-site-kit"),o),M=v==="".concat(c,"-module"),A=Object(L.a)("googlesitekit.ModuleSettingsDetails-".concat(c))(F),T=0<Object(y.filter)(s,(function(e){return e})).length,q=Object(y.map)(this.getDependentModules(),"name").join(", "),U="pagespeed-insights"===c,K=Object(E.__)("Close","google-site-kit");return _&&a&&(M?K=Object(E.__)("Saving...","google-site-kit"):!1===U&&(K=Object(E.__)("Confirm Changes","google-site-kit"))),React.createElement(m.Fragment,null,t?React.createElement("div",{className:"\n\t\t\t\t\t\t\tgooglesitekit-settings-module\n\t\t\t\t\t\t\tgooglesitekit-settings-module--".concat(c,"\n\t\t\t\t\t\t\tgooglesitekit-settings-module--active\n\t\t\t\t\t\t\t").concat(f&&T&&s[O]?"googlesitekit-settings-module--error":"","\n\t\t\t\t\t\t"),key:O},T&&!s[O]&&React.createElement(G,{compress:!r}),React.createElement("button",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-settings-module__header\n\t\t\t\t\t\t\t\t".concat(r?"googlesitekit-settings-module__header--open":"","\n\t\t\t\t\t\t\t"),id:"googlesitekit-settings-module__header--".concat(c),type:"button",role:"tab","aria-selected":!!r,"aria-expanded":!!r,"aria-controls":"googlesitekit-settings-module__content--".concat(c),onClick:d.bind(null,c)},f&&T&&s[O]&&React.createElement("div",{className:"googlesitekit-settings-module__error"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(E.__)("Error:","google-site-kit")," ",f.errorMsg)))),React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-settings-module__title "},Object(b.q)(c,!1,"24","26","googlesitekit-settings-module__title-icon"),o)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement("p",{className:"googlesitekit-settings-module__status"},w?Object(E.sprintf)(Object(E.__)("%s is connected","google-site-kit"),o):Object(E.sprintf)(Object(E.__)("%s is not connected","google-site-kit"),o),React.createElement("span",{className:"googlesitekit-settings-module__status-icon ".concat(j," ")},React.createElement("span",{className:"screen-reader-text"},w?Object(E.__)("Connected","google-site-kit"):Object(E.__)("Not Connected","google-site-kit")))))))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-settings-module__content\n\t\t\t\t\t\t\t\t".concat(r?"googlesitekit-settings-module__content--open":"","\n\t\t\t\t\t\t\t"),id:"googlesitekit-settings-module__content--".concat(c),role:"tabpanel","aria-hidden":!r,"aria-labelledby":"googlesitekit-settings-module__header--".concat(c)},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},a&&React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(A,{module:O,isEditing:s[O],isOpen:r}))),_&&!a&&React.createElement(B,{screenID:k,slug:c}))),React.createElement("footer",{className:"googlesitekit-settings-module__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},s[O]||M?React.createElement(m.Fragment,null,React.createElement(C.a,{onClick:function(){return g(O,a?"confirm":"cancel",U)},disabled:M,id:_&&a?"confirm-changes-".concat(c):"close-".concat(c)},K),React.createElement(D.a,{isSaving:M}),_&&React.createElement(S.a,{className:"googlesitekit-settings-module__footer-cancel",onClick:function(){return g(O,"cancel")},inherit:!0},Object(E.__)("Cancel","google-site-kit"))):_&&React.createElement(S.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){g(O,"edit")},inherit:!0},Object(E.__)("Edit","google-site-kit"),React.createElement(x.a,{className:"googlesitekit-settings-module__edit-button-icon",id:"pencil",width:"10",height:"10"}))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-desktop "},s[O]&&!p&&React.createElement(S.a,{className:"googlesitekit-settings-module__remove-button",onClick:this.handleDialog,inherit:!0,danger:!0},Object(E.sprintf)(Object(E.__)("Disconnect %s from Site Kit","google-site-kit"),o),React.createElement(x.a,{className:"googlesitekit-settings-module__remove-button-icon",id:"trash",width:"13",height:"13"})),!s[O]&&React.createElement(S.a,{href:l,className:"googlesitekit-settings-module__cta-button",inherit:!0,external:!0},Object(E.sprintf)(Object(E.__)("See full details in %s","google-site-kit"),o))))))),React.createElement(I.a,{dialogActive:i,handleDialog:this.handleDialog,title:Object(E.sprintf)(Object(E.__)("Disconnect %s from Site Kit?","google-site-kit"),o),subtitle:N,onKeyPress:this.handleCloseModal,provides:h,handleConfirm:this.handleConfirmRemoveModule,dependentModules:!!q&&Object(E.sprintf)(Object(E.__)("these active modules depend on %s and will also be disconnected: ","google-site-kit"),o)+q})):React.createElement(m.Fragment,null,React.createElement(P,{key:"".concat(c,"-module"),slug:c,name:o,description:u,active:t,showLink:!0})))}}]),t}(m.Component);H.propTypes={name:N.a.string,slug:N.a.string,homepage:N.a.string,isEditing:N.a.object,handleEdit:N.a.func,handleDialog:N.a.func,autoActivate:N.a.bool,hasSettings:N.a.bool,required:N.a.array,active:N.a.bool},H.defaultProps={name:"",slug:"",homepage:"",isEditing:{},handleEdit:null,handleDialog:null,active:!1};var J=H;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 z(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?W(a,!0).forEach((function(t){v()(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 Q=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={error:!1,isEditing:{},openModules:{},isSaving:!1},a.mapToModule=a.mapToModule.bind(p()(a)),a.updateModulesList=a.updateModulesList.bind(p()(a)),a.handleButtonAction=a.handleButtonAction.bind(p()(a)),a.handleAccordion=a.handleAccordion.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"componentDidMount",value:function(){googlesitekit.editmodule&&googlesitekit.modules[googlesitekit.editmodule].active&&this.handleButtonAction("".concat(googlesitekit.editmodule,"-module"),"edit")}},{key:"updateModulesList",value:function(){this.forceUpdate()}},{key:"handleAccordion",value:function(e,t){t.target.closest(".googlesitekit-settings-module__header").focus(),this.setState((function(t){return{openModules:v()({},e,!t.openModules[e])}}))}},{key:"handleButtonAction",value:function(e,t){var a=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("confirm"===t){var n=Object(R.applyFilters)("googlekit.SettingsConfirmed",!1,e);if(i)return void this.setState((function(t){return{isSaving:!1,error:!1,isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e]))}}));if(this.setState({isSaving:e}),!n)return void Object(b.d)();n.then((function(){Object(b.d)(),a.setState((function(t){return{isSaving:!1,error:!1,isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e]))}}))})).catch((function(e){a.setState({isSaving:!1,error:{errorCode:e.code,errorMsg:e.message}})}))}else this.setState((function(t){return{isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e])),error:!1}}))}},{key:"settingsModuleComponent",value:function(e,t){var a=googlesitekit.modules[e.slug].provides,i=this.state,n=i.isEditing,o=i.openModules,c=i.error,l=o[e.slug]||!1;return React.createElement(J,{key:e.slug+"-module",slug:e.slug,name:e.name,description:e.description,homepage:e.homepage,learnmore:e.learnMore,active:e.active,hasSettings:e.hasSettings,autoActivate:e.autoActivate,updateModulesList:this.updateModulesList,handleEdit:this.handleButtonAction,handleConfirm:!0,isEditing:n,isOpen:l,handleAccordion:this.handleAccordion,handleDialog:this.handleDialog,provides:a,isSaving:t,screenID:e.screenID,error:c})}},{key:"mapToModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.state.isSaving;return t?Object(y.map)(e,function(e){return React.createElement(m.Fragment,{key:e.slug+"-module-wrapper"},this.settingsModuleComponent(e,a))}.bind(this)):Object(y.map)(e,function(e){return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-4",key:e.slug+"-module-wrapper"},this.settingsModuleComponent(e,a))}.bind(this))}},{key:"render",value:function(){var e=this.state.isEditing,t=this.props.activeTab,a=0<Object(y.filter)(e,(function(e){return e})).length;if(!window.googlesitekit||!window.googlesitekit.modules)return null;var i=Object(y.filter)(window.googlesitekit.modules,(function(e){return!e.internal})),n=this.mapToModule(Object(y.sortBy)(Object(y.filter)(i,(function(e){return e.active})),"sort"),!0),o=this.mapToModule(Object(y.sortBy)(Object(y.filter)(i,{active:!1}),"sort")),c=0<o.length;return React.createElement(m.Fragment,null,0<n.length&&0===t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,n)),1===t&&c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,{header:!0,title:Object(E.__)("Connect More Services to Gain More Insights","google-site-kit"),relative:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},0<o.length&&o)),a&&React.createElement(G,null))),1===t&&!c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{id:"no-more-modules",title:Object(E.__)("Congrats, you’ve connected all services!","google-site-kit"),description:Object(E.__)("We’re working on adding new services to Site Kit by Google all the time, so please check back in the future.","google-site-kit"),format:"small",smallImage:"".concat(googlesitekit.admin.assetsRoot,"images/thumbs-up.png"),type:"win-success"})))}}]),t}(m.Component),V=a(43),X=a(47),Y=a(70),Z=a.n(Y),$=a(167),ee=a.n($),te=a(144),ae=a(146),ie=function(e){function t(){var e;n()(this,t),e=s()(this,d()(t).call(this));var a=googlesitekit.admin.userData,i=a.email,o=void 0===i?"":i,c=a.picture,l=void 0===c?"":c,r=a.name,g=void 0===r?"":r;return e.state={data:{email:o,img:l,user:g}},e}return u()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,React.createElement("div",{className:" googlesitekit-settings-module googlesitekit-settings-module--active "},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-settings-module__title "},Object(E.__)("Plugin Status","google-site-kit"))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "}),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("p",{className:"googlesitekit-settings-module__status"},Object(E.__)("Site Kit is connected","google-site-kit"),React.createElement("span",{className:" googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected "},React.createElement("span",{className:"screen-reader-text"},Object(E.__)("Connected","google-site-kit")))))))),React.createElement("footer",{className:"googlesitekit-settings-module__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(ae.a,null)))))))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,{header:!0,title:Object(E.__)("Tracking","google-site-kit"),className:"googlesitekit-settings-meta",fill:!0},React.createElement("div",{className:" googlesitekit-settings-module googlesitekit-settings-module--active "},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item googlesitekit-settings-module__meta-item--nomargin "},React.createElement(te.a,null))))))))))}}]),t}(m.Component),ne=a(42),oe=function(e){function t(e){var a;n()(this,t),a=s()(this,d()(t).call(this,e));var i=window.location.hash.replace("#","");return a.state={activeTab:i?Number(i):0},a.handleTabUpdate=a.handleTabUpdate.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"handleTabUpdate",value:function(e){var t=-1===e?0:e;window.location.hash=t,this.setState({activeTab:t})}},{key:"render",value:function(){var e=this.state.activeTab;return React.createElement(m.Fragment,null,React.createElement(V.a,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(X.a,{title:Object(E.__)("Settings","google-site-kit")})),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(k.a,null,React.createElement(ee.a,{activeIndex:e,handleActiveIndexUpdate:this.handleTabUpdate},React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Connected Services","google-site-kit"))),React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Connect More Services","google-site-kit"))),React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Admin Settings","google-site-kit")))))),(0===e||1===e)&&React.createElement(Q,{activeTab:e}),2===e&&React.createElement(m.Fragment,null,React.createElement(ie,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(ne.a,null))))))}}]),t}(m.Component),ce=a(39),le=a.n(ce),se=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={hasError:!1},Object(E.setLocaleData)(googlesitekit.locale,"google-site-kit"),a}return u()(t,e),c()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,a=e.error,i=e.info;return t?React.createElement(f.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:a,description:i.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(oe,null)}}]),t}(m.Component);le()((function(){var e=document.getElementById("googlesitekit-settings-wrapper");null!==e&&(Object(m.render)(React.createElement(se,null),e),Object(R.doAction)("googlesitekit.moduleLoaded","Settings"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
1
+ !function(e){function t(t){for(var i,c,l=t[0],s=t[1],d=t[2],g=0,u=[];g<l.length;g++)c=l[g],n[c]&&u.push(n[c][0]),n[c]=0;for(i in s)Object.prototype.hasOwnProperty.call(s,i)&&(e[i]=s[i]);for(r&&r(t);u.length;)u.shift()();return o.push.apply(o,d||[]),a()}function a(){for(var e,t=0;t<o.length;t++){for(var a=o[t],i=!0,c=1;c<a.length;c++){var l=a[c];0!==n[l]&&(i=!1)}i&&(o.splice(t--,1),e=__webpack_require__(__webpack_require__.s=a[0]))}return e}var i={},n={14:0},o=[];function __webpack_require__(t){if(i[t])return i[t].exports;var a=i[t]={i:t,l:!1,exports:{}};return e[t].call(a.exports,a,a.exports,__webpack_require__),a.l=!0,a.exports}__webpack_require__.m=e,__webpack_require__.c=i,__webpack_require__.d=function(e,t,a){__webpack_require__.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:a})},__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 a=Object.create(null);if(__webpack_require__.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)__webpack_require__.d(a,i,function(t){return e[t]}.bind(null,i));return a},__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 c=window.webpackJsonp=window.webpackJsonp||[],l=c.push.bind(c);c.push=t,c=c.slice();for(var s=0;s<c.length;s++)t(c[s]);var r=l;o.push([201,0,1]),a()}({0:function(e,t){e.exports=wp.i18n},1:function(e,t){e.exports=wp.element},10:function(e,t){e.exports=wp.hooks},11:function(e,t){e.exports=lodash},144:function(e,t,a){"use strict";var i=a(3),n=a.n(i),o=a(4),c=a.n(o),l=a(5),s=a.n(l),r=a(6),d=a.n(r),g=a(13),u=a.n(g),m=a(7),_=a.n(m),p=a(1),h=a(22),v=a(8),k=a.n(v),f=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).formFieldRef=Object(p.createRef)(),a.checkboxRef=Object(p.createRef)(),a}return _()(t,e),c()(t,[{key:"componentDidMount",value:function(){new h.e(this.formFieldRef.current).input=new h.c(this.checkboxRef.current)}},{key:"render",value:function(){var e=this.props,t=e.onChange,a=e.id,i=e.name,n=e.value,o=e.checked,c=e.disabled,l=e.children;return React.createElement("div",{className:"mdc-form-field",ref:this.formFieldRef},React.createElement("div",{className:"\n\t\t\t\t\t\tmdc-checkbox\n\t\t\t\t\t\t".concat(c?"mdc-checkbox--disabled":"","\n\t\t\t\t\t"),ref:this.checkboxRef},React.createElement("input",{className:"mdc-checkbox__native-control",type:"checkbox",id:a,name:i,value:n,checked:o,disabled:c,onChange:t}),React.createElement("div",{className:"mdc-checkbox__background"},React.createElement("svg",{className:"mdc-checkbox__checkmark",viewBox:"0 0 24 24"},React.createElement("path",{className:"mdc-checkbox__checkmark-path",fill:"none",d:"M1.73,12.91 8.1,19.28 22.79,4.59"})),React.createElement("div",{className:"mdc-checkbox__mixedmark"}))),React.createElement("label",{htmlFor:a},l))}}]),t}(p.Component);f.propTypes={onChange:k.a.func.isRequired,id:k.a.string.isRequired,name:k.a.string.isRequired,value:k.a.string.isRequired,checked:k.a.bool,disabled:k.a.bool,children:k.a.node.isRequired},f.defaultProps={checked:!1,disabled:!1};var b=f,y=a(35),E=a.n(y),R=a(0),O=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={scriptOnPage:!!window.googlesitekitTrackingEnabled,optIn:!!window.googlesitekitTrackingEnabled,error:!1},a.handleOptIn=a.handleOptIn.bind(u()(a)),a}return _()(t,e),c()(t,[{key:"handleOptIn",value:function(e){var t=this,a=e.target.checked,i={googlesitekit_tracking_optin:a};E()({path:"/wp/v2/settings",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(i),method:"POST"}).then((function(){if(window.googlesitekitTrackingEnabled=!!a,a&&!t.state.scriptOnPage){var e=window.document;if(!e)return;e.body.insertAdjacentHTML("beforeend",'\n\t\t\t\t\t\t<script async src="https://www.googletagmanager.com/gtag/js?id='.concat(googlesitekit.admin.trackingID,'"><\/script>\n\t\t\t\t\t')),e.body.insertAdjacentHTML("beforeend","\n\t\t\t\t\t\t<script>\n\t\t\t\t\t\t\twindow.dataLayer = window.dataLayer || [];\n\t\t\t\t\t\t\tfunction gtag(){dataLayer.push(arguments);}\n\t\t\t\t\t\t\tgtag('js', new Date());\n\t\t\t\t\t\t\tgtag('config', '".concat(googlesitekit.admin.trackingID,"');\n\t\t\t\t\t\t<\/script>\n\t\t\t\t\t"))}t.setState({optIn:!!a,error:!1,scriptOnPage:!0})})).catch((function(a){t.setState({optIn:!e.target.checked,error:{errorCode:a.code,errorMsg:a.message}})}))}},{key:"render",value:function(){var e=this.state,t=e.optIn,a=e.error,i=this.props,n=i.id,o=i.name;return React.createElement("div",{className:"googlesitekit-opt-in"},React.createElement(b,{id:n,name:o,value:"1",checked:t,onChange:this.handleOptIn},Object(R.__)("Help us improve the Site Kit plugin by allowing tracking of anonymous usage stats. All data are treated in accordance with ","google-site-kit"),React.createElement("a",{href:"https://policies.google.com/privacy",target:"_blank",rel:"noopener noreferrer"},Object(R.__)("Google Privacy Policy","google-site-kit")),"."),a&&React.createElement("div",{className:"googlesitekit-error-text"},a.errorMsg))}}]),t}(p.Component);O.propTypes={id:k.a.string,name:k.a.string},O.defaultProps={id:"googlesitekit-opt-in",name:"optIn"};t.a=O},146:function(e,t,a){"use strict";a.d(t,"a",(function(){return O}));var i=a(12),n=a.n(i),o=a(3),c=a.n(o),l=a(4),s=a.n(l),r=a(5),d=a.n(r),g=a(6),u=a.n(g),m=a(13),_=a.n(m),p=a(7),h=a.n(p),v=a(1),k=a(9),f=a(2),b=a(67),y=a(0),E=a(14),R=a(80),O=function(e){function t(e){var a;return c()(this,t),(a=d()(this,u()(t).call(this,e))).state={dialogActive:!1},a.handleDialog=a.handleDialog.bind(_()(a)),a.handleUnlinkConfirm=a.handleUnlinkConfirm.bind(_()(a)),a.handleCloseModal=a.handleCloseModal.bind(_()(a)),a}return h()(t,e),s()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"handleUnlinkConfirm",value:function(){return n.a.async((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.a.awrap(k.c.set(k.a,"site","reset"));case 2:Object(f.d)(),this.handleDialog(),document.location=Object(f.n)("googlesitekit-splash",{notification:"reset_success"});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,a=this.state.dialogActive;return React.createElement(v.Fragment,null,React.createElement(E.a,{className:"googlesitekit-reset-button",onClick:function(){return e.setState({dialogActive:!0})},inherit:!0},t||Object(y.__)("Reset Site Kit","google-site-kit")),React.createElement(R.a,null,React.createElement(b.a,{dialogActive:a,handleConfirm:this.handleUnlinkConfirm,handleDialog:this.handleDialog,title:Object(y.__)("Reset Site Kit","google-site-kit"),subtitle:Object(y.__)("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(y.__)("Reset","google-site-kit"),provides:[]})))}}]),t}(v.Component)},18:function(e,t){e.exports=React},201:function(e,t,a){"use strict";a.r(t);var i=a(3),n=a.n(i),o=a(4),c=a.n(o),l=a(5),s=a.n(l),r=a(6),d=a.n(r),g=a(7),u=a.n(g),m=a(1),_=a(13),p=a.n(_),h=a(27),v=a.n(h),k=a(17),f=a(26),b=a(2),y=a(11),E=a(0),R=a(10),O=a(12),w=a.n(O),j=a(8),N=a.n(j),S=a(14),C=a(29),M=a(9),x=a(20),D=a(62),A=a(53),T=a(54),q=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={isSaving:!1,active:e.active},a.activateOrDeactivate=a.activateOrDeactivate.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"activateOrDeactivate",value:function(){var e,t;return w.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.active,t=this.props.slug,this.setState({isSaving:!0}),a.next=6,w.a.awrap(Object(b.a)(M.c,t,!e));case 6:return a.next=8,w.a.awrap(Object(b.u)());case 8:window.location=Object(b.m)(t,!0),a.next=15;break;case 11:a.prev=11,a.t0=a.catch(0),Object(b.w)(T.a,{id:"activate-module-error",title:Object(E.__)("Internal Server Error","google-site-kit"),description:a.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 15:case"end":return a.stop()}}),null,this,[[0,11]])}},{key:"render",value:function(){var e=this.state.isSaving,t=this.props,a=t.slug,i=t.name,n=t.description,o=t.showLink,c=!1,l=googlesitekit.modules;l[a].required.length&&l[a].required.forEach((function(e){l[e].setupComplete||(c=!0)}));return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-settings-connect-module\n\t\t\t\tgooglesitekit-settings-connect-module--".concat(a,"\n\t\t\t\t").concat(c?"googlesitekit-settings-connect-module--disabled":"","\n\t\t\t"),key:a},React.createElement("div",{className:"googlesitekit-settings-connect-module__switch"},React.createElement(D.a,{isSaving:e})),React.createElement("div",{className:"googlesitekit-settings-connect-module__logo"},c?Object(b.q)("".concat(a,"-disabled")):Object(b.q)(a)),React.createElement("h3",{className:" googlesitekit-subheading-1 googlesitekit-settings-connect-module__title "},i),React.createElement("p",{className:"googlesitekit-settings-connect-module__text"},n),React.createElement(A.a,{slug:a,context:"modules-list"}),Object(R.applyFilters)("googlesitekit.SetupModuleShowLink",o,a)&&React.createElement("p",{className:"googlesitekit-settings-connect-module__cta"},React.createElement(S.a,{onClick:this.activateOrDeactivate,href:"",inherit:!0,disabled:c,arrow:!0},c?Object(E.sprintf)(Object(E.__)("Setup Analytics to gain access to %s","google-site-kit"),i):Object(E.sprintf)(Object(E.__)("Set up %s","google-site-kit"),i))))}}]),t}(m.Component);q.propTypes={slug:N.a.string,name:N.a.string,description:N.a.string,homepage:N.a.string,active:N.a.bool,onActive:N.a.func},q.defaultProps={slug:"",name:"",description:"",homepage:"",active:!1};var P=q,I=a(67),F=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){return null}}]),t}(m.Component),L=a(21),U=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.slug;return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(A.a,{slug:e,context:"settings"}),Object(E.__)("Setup incomplete: ","google-site-kit"),React.createElement(S.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){window.location=Object(b.m)(e,!0)},inherit:!0},Object(E.__)("continue module setup","google-site-kit")))}}]),t}(m.Component),B=Object(L.a)("googlesitekit.ModuleSetupIncomplete")(U),K=function(e){function t(){return n()(this,t),s()(this,d()(t).apply(this,arguments))}return u()(t,e),c()(t,[{key:"render",value:function(){var e=this.props.compress;return React.createElement("div",{className:"\n\t\t\t\tgooglesitekit-overlay\n\t\t\t\t".concat(e?"googlesitekit-overlay--compress":"","\n\t\t\t")},React.createElement("div",{className:"googlesitekit-overlay__wrapper"},React.createElement("div",{className:"googlesitekit-overlay__icon"},React.createElement(x.a,{id:"lock",width:"22",height:"30"})),React.createElement("h3",{className:" googlesitekit-heading-2 googlesitekit-overlay__title "},Object(E.__)("Section locked while editing","google-site-kit"))))}}]),t}(m.Component);K.propTypes={compress:N.a.bool},K.defaultProps={compress:!1};var G=K,H=function(e){function t(e){var a;n()(this,t),a=s()(this,d()(t).call(this,e));var i=e.slug,o=googlesitekit.modules[i].setupComplete;return a.state={isSaving:!1,active:e.active,setupComplete:o,dialogActive:!1},a.deactivate=a.deactivate.bind(p()(a)),a.activateOrDeactivate=a.activateOrDeactivate.bind(p()(a)),a.handleDialog=a.handleDialog.bind(p()(a)),a.handleCloseModal=a.handleCloseModal.bind(p()(a)),a.handleConfirmRemoveModule=a.handleConfirmRemoveModule.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"componentDidMount",value:function(){window.addEventListener("keyup",this.handleCloseModal,!1)}},{key:"componentWillUnmount",value:function(){window.removeEventListener("keyup",this.handleCloseModal)}},{key:"activateOrDeactivate",value:function(){var e,t;return w.a.async((function(a){for(;;)switch(a.prev=a.next){case 0:return a.prev=0,e=this.state.active,t=!e,this.setState({isSaving:!0}),a.next=6,w.a.awrap(Object(b.a)(M.c,this.props.slug,t));case 6:return a.next=8,w.a.awrap(Object(b.u)());case 8:!1===t&&M.c.invalidateCacheGroup(M.b,this.props.slug),this.setState({isSaving:!1,active:t}),window.location=Object(b.m)(this.props.slug,!1),a.next=17;break;case 13:a.prev=13,a.t0=a.catch(0),Object(b.w)(T.a,{id:"activate-module-error",title:Object(E.__)("Internal Server Error","google-site-kit"),description:a.t0.message,format:"small",type:"win-error"}),this.setState({isSaving:!1});case 17:case"end":return a.stop()}}),null,this,[[0,13]])}},{key:"deactivate",value:function(){this.props.autoActivate||this.activateOrDeactivate()}},{key:"handleDialog",value:function(){this.setState((function(e){return{dialogActive:!e.dialogActive}}))}},{key:"handleConfirmRemoveModule",value:function(){this.deactivate()}},{key:"handleCloseModal",value:function(e){27===e.keyCode&&this.setState({dialogActive:!1})}},{key:"getDependentModules",value:function(){var e=this.props.slug,t=googlesitekit.modules,a={};return t[e].dependants&&t[e].dependants.forEach((function(e){t[e]&&(a[e]=t[e])})),a}},{key:"render",value:function(){var e=this.state,t=e.active,a=e.setupComplete,i=e.dialogActive,n=this.props,o=n.name,c=n.slug,l=n.homepage,s=n.isEditing,r=n.isOpen,d=n.handleAccordion,g=n.handleEdit,u=n.description,_=n.hasSettings,p=n.autoActivate,h=n.provides,v=n.isSaving,k=n.screenID,f=n.error,O="".concat(c,"-module"),w=Object(R.applyFilters)("googlesitekit.Connected-".concat(c),a),j=w?"googlesitekit-settings-module__status-icon--connected":"googlesitekit-settings-module__status-icon--not-connected",N=Object(E.sprintf)(Object(E.__)("By disconnecting the %s module from Site Kit, you will no longer have access to:","google-site-kit"),o),M=v==="".concat(c,"-module"),A=Object(L.a)("googlesitekit.ModuleSettingsDetails-".concat(c))(F),T=0<Object(y.filter)(s,(function(e){return e})).length,q=Object(y.map)(this.getDependentModules(),"name").join(", "),U="pagespeed-insights"===c,K=Object(E.__)("Close","google-site-kit");return _&&a&&(M?K=Object(E.__)("Saving...","google-site-kit"):!1===U&&(K=Object(E.__)("Confirm Changes","google-site-kit"))),React.createElement(m.Fragment,null,t?React.createElement("div",{className:"\n\t\t\t\t\t\t\tgooglesitekit-settings-module\n\t\t\t\t\t\t\tgooglesitekit-settings-module--".concat(c,"\n\t\t\t\t\t\t\tgooglesitekit-settings-module--active\n\t\t\t\t\t\t\t").concat(f&&T&&s[O]?"googlesitekit-settings-module--error":"","\n\t\t\t\t\t\t"),key:O},T&&!s[O]&&React.createElement(G,{compress:!r}),React.createElement("button",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-settings-module__header\n\t\t\t\t\t\t\t\t".concat(r?"googlesitekit-settings-module__header--open":"","\n\t\t\t\t\t\t\t"),id:"googlesitekit-settings-module__header--".concat(c),type:"button",role:"tab","aria-selected":!!r,"aria-expanded":!!r,"aria-controls":"googlesitekit-settings-module__content--".concat(c),onClick:d.bind(null,c)},f&&T&&s[O]&&React.createElement("div",{className:"googlesitekit-settings-module__error"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},Object(E.__)("Error:","google-site-kit")," ",f.errorMsg)))),React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-settings-module__title "},Object(b.q)(c,!1,"24","26","googlesitekit-settings-module__title-icon"),o)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "},React.createElement("p",{className:"googlesitekit-settings-module__status"},w?Object(E.sprintf)(Object(E.__)("%s is connected","google-site-kit"),o):Object(E.sprintf)(Object(E.__)("%s is not connected","google-site-kit"),o),React.createElement("span",{className:"googlesitekit-settings-module__status-icon ".concat(j," ")},React.createElement("span",{className:"screen-reader-text"},w?Object(E.__)("Connected","google-site-kit"):Object(E.__)("Not Connected","google-site-kit")))))))),React.createElement("div",{className:"\n\t\t\t\t\t\t\t\tgooglesitekit-settings-module__content\n\t\t\t\t\t\t\t\t".concat(r?"googlesitekit-settings-module__content--open":"","\n\t\t\t\t\t\t\t"),id:"googlesitekit-settings-module__content--".concat(c),role:"tabpanel","aria-hidden":!r,"aria-labelledby":"googlesitekit-settings-module__header--".concat(c)},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},a&&React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(A,{module:O,isEditing:s[O],isOpen:r}))),_&&!a&&React.createElement(B,{screenID:k,slug:c}))),React.createElement("footer",{className:"googlesitekit-settings-module__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},s[O]||M?React.createElement(m.Fragment,null,React.createElement(C.a,{onClick:function(){return g(O,a?"confirm":"cancel",U)},disabled:M,id:_&&a?"confirm-changes-".concat(c):"close-".concat(c)},K),React.createElement(D.a,{isSaving:M}),_&&React.createElement(S.a,{className:"googlesitekit-settings-module__footer-cancel",onClick:function(){return g(O,"cancel")},inherit:!0},Object(E.__)("Cancel","google-site-kit"))):_&&React.createElement(S.a,{className:"googlesitekit-settings-module__edit-button",onClick:function(){g(O,"edit")},inherit:!0},Object(E.__)("Edit","google-site-kit"),React.createElement(x.a,{className:"googlesitekit-settings-module__edit-button-icon",id:"pencil",width:"10",height:"10"}))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-desktop "},s[O]&&!p&&React.createElement(S.a,{className:"googlesitekit-settings-module__remove-button",onClick:this.handleDialog,inherit:!0,danger:!0},Object(E.sprintf)(Object(E.__)("Disconnect %s from Site Kit","google-site-kit"),o),React.createElement(x.a,{className:"googlesitekit-settings-module__remove-button-icon",id:"trash",width:"13",height:"13"})),!s[O]&&React.createElement(S.a,{href:l,className:"googlesitekit-settings-module__cta-button",inherit:!0,external:!0},Object(E.sprintf)(Object(E.__)("See full details in %s","google-site-kit"),o))))))),React.createElement(I.a,{dialogActive:i,handleDialog:this.handleDialog,title:Object(E.sprintf)(Object(E.__)("Disconnect %s from Site Kit?","google-site-kit"),o),subtitle:N,onKeyPress:this.handleCloseModal,provides:h,handleConfirm:this.handleConfirmRemoveModule,dependentModules:!!q&&Object(E.sprintf)(Object(E.__)("these active modules depend on %s and will also be disconnected: ","google-site-kit"),o)+q})):React.createElement(m.Fragment,null,React.createElement(P,{key:"".concat(c,"-module"),slug:c,name:o,description:u,active:t,showLink:!0})))}}]),t}(m.Component);H.propTypes={name:N.a.string,slug:N.a.string,homepage:N.a.string,isEditing:N.a.object,handleEdit:N.a.func,handleDialog:N.a.func,autoActivate:N.a.bool,hasSettings:N.a.bool,required:N.a.array,active:N.a.bool},H.defaultProps={name:"",slug:"",homepage:"",isEditing:{},handleEdit:null,handleDialog:null,active:!1};var J=H;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 z(e){for(var t=1;t<arguments.length;t++){var a=null!=arguments[t]?arguments[t]:{};t%2?W(a,!0).forEach((function(t){v()(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 Q=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={error:!1,isEditing:{},openModules:{},isSaving:!1},a.mapToModule=a.mapToModule.bind(p()(a)),a.updateModulesList=a.updateModulesList.bind(p()(a)),a.handleButtonAction=a.handleButtonAction.bind(p()(a)),a.handleAccordion=a.handleAccordion.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"componentDidMount",value:function(){googlesitekit.editmodule&&googlesitekit.modules[googlesitekit.editmodule].active&&this.handleButtonAction("".concat(googlesitekit.editmodule,"-module"),"edit")}},{key:"updateModulesList",value:function(){this.forceUpdate()}},{key:"handleAccordion",value:function(e,t){t.target.closest(".googlesitekit-settings-module__header").focus(),this.setState((function(t){return{openModules:v()({},e,!t.openModules[e])}}))}},{key:"handleButtonAction",value:function(e,t){var a=this,i=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("confirm"===t){var n=Object(R.applyFilters)("googlekit.SettingsConfirmed",!1,e);if(i)return void this.setState((function(t){return{isSaving:!1,error:!1,isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e]))}}));if(this.setState({isSaving:e}),!n)return void Object(b.d)();n.then((function(){Object(b.d)(),a.setState((function(t){return{isSaving:!1,error:!1,isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e]))}}))})).catch((function(e){a.setState({isSaving:!1,error:{errorCode:e.code,errorMsg:e.message}})}))}else this.setState((function(t){return{isEditing:z({},t.isEditing,v()({},e,!t.isEditing[e])),error:!1}}))}},{key:"settingsModuleComponent",value:function(e,t){var a=googlesitekit.modules[e.slug].provides,i=this.state,n=i.isEditing,o=i.openModules,c=i.error,l=o[e.slug]||!1;return React.createElement(J,{key:e.slug+"-module",slug:e.slug,name:e.name,description:e.description,homepage:e.homepage,learnmore:e.learnMore,active:e.active,hasSettings:e.hasSettings,autoActivate:e.autoActivate,updateModulesList:this.updateModulesList,handleEdit:this.handleButtonAction,handleConfirm:!0,isEditing:n,isOpen:l,handleAccordion:this.handleAccordion,handleDialog:this.handleDialog,provides:a,isSaving:t,screenID:e.screenID,error:c})}},{key:"mapToModule",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=this.state.isSaving;return t?Object(y.map)(e,function(e){return React.createElement(m.Fragment,{key:e.slug+"-module-wrapper"},this.settingsModuleComponent(e,a))}.bind(this)):Object(y.map)(e,function(e){return React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-4",key:e.slug+"-module-wrapper"},this.settingsModuleComponent(e,a))}.bind(this))}},{key:"render",value:function(){var e=this.state.isEditing,t=this.props.activeTab,a=0<Object(y.filter)(e,(function(e){return e})).length;if(!window.googlesitekit||!window.googlesitekit.modules)return null;var i=Object(y.filter)(window.googlesitekit.modules,(function(e){return!e.internal})),n=this.mapToModule(Object(y.sortBy)(Object(y.filter)(i,(function(e){return e.active})),"sort"),!0),o=this.mapToModule(Object(y.sortBy)(Object(y.filter)(i,{active:!1}),"sort")),c=0<o.length;return React.createElement(m.Fragment,null,0<n.length&&0===t&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,n)),1===t&&c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,{header:!0,title:Object(E.__)("Connect More Services to Gain More Insights","google-site-kit"),relative:!0},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},0<o.length&&o)),a&&React.createElement(G,null))),1===t&&!c&&React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(f.a,{id:"no-more-modules",title:Object(E.__)("Congrats, you’ve connected all services!","google-site-kit"),description:Object(E.__)("We’re working on adding new services to Site Kit by Google all the time, so please check back in the future.","google-site-kit"),format:"small",smallImage:"".concat(googlesitekit.admin.assetsRoot,"images/thumbs-up.png"),type:"win-success"})))}}]),t}(m.Component),V=a(44),X=a(47),Y=a(70),Z=a.n(Y),$=a(167),ee=a.n($),te=a(144),ae=a(146),ie=function(e){function t(){var e;n()(this,t),e=s()(this,d()(t).call(this));var a=googlesitekit.admin.userData,i=a.email,o=void 0===i?"":i,c=a.picture,l=void 0===c?"":c,r=a.name,g=void 0===r?"":r;return e.state={data:{email:o,img:l,user:g}},e}return u()(t,e),c()(t,[{key:"render",value:function(){return React.createElement(m.Fragment,null,React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,null,React.createElement("div",{className:" googlesitekit-settings-module googlesitekit-settings-module--active "},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement("h3",{className:" googlesitekit-heading-4 googlesitekit-settings-module__title "},Object(E.__)("Plugin Status","google-site-kit"))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-6-desktop mdc-layout-grid__cell--span-4-tablet mdc-layout-grid__cell--span-4-phone mdc-layout-grid__cell--align-middle mdc-layout-grid__cell--align-right-tablet "}),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("p",{className:"googlesitekit-settings-module__status"},Object(E.__)("Site Kit is connected","google-site-kit"),React.createElement("span",{className:" googlesitekit-settings-module__status-icon googlesitekit-settings-module__status-icon--connected "},React.createElement("span",{className:"screen-reader-text"},Object(E.__)("Connected","google-site-kit")))))))),React.createElement("footer",{className:"googlesitekit-settings-module__footer"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--span-8-tablet mdc-layout-grid__cell--span-4-phone "},React.createElement(ae.a,null)))))))),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement(k.a,{header:!0,title:Object(E.__)("Tracking","google-site-kit"),className:"googlesitekit-settings-meta",fill:!0},React.createElement("div",{className:" googlesitekit-settings-module googlesitekit-settings-module--active "},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 "},React.createElement("div",{className:"googlesitekit-settings-module__meta-items"},React.createElement("div",{className:" googlesitekit-settings-module__meta-item googlesitekit-settings-module__meta-item--nomargin "},React.createElement(te.a,null))))))))))}}]),t}(m.Component),ne=a(43),oe=function(e){function t(e){var a;n()(this,t),a=s()(this,d()(t).call(this,e));var i=window.location.hash.replace("#","");return a.state={activeTab:i?Number(i):0},a.handleTabUpdate=a.handleTabUpdate.bind(p()(a)),a}return u()(t,e),c()(t,[{key:"handleTabUpdate",value:function(e){var t=-1===e?0:e;window.location.hash=t,this.setState({activeTab:t})}},{key:"render",value:function(){var e=this.state.activeTab;return React.createElement(m.Fragment,null,React.createElement(V.a,null),React.createElement("div",{className:"googlesitekit-module-page"},React.createElement("div",{className:"mdc-layout-grid"},React.createElement("div",{className:"mdc-layout-grid__inner"},React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(X.a,{title:Object(E.__)("Settings","google-site-kit")})),React.createElement("div",{className:"mdc-layout-grid__cell mdc-layout-grid__cell--span-12"},React.createElement(k.a,null,React.createElement(ee.a,{activeIndex:e,handleActiveIndexUpdate:this.handleTabUpdate},React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Connected Services","google-site-kit"))),React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Connect More Services","google-site-kit"))),React.createElement(Z.a,null,React.createElement("span",{className:"mdc-tab__text-label"},Object(E.__)("Admin Settings","google-site-kit")))))),(0===e||1===e)&&React.createElement(Q,{activeTab:e}),2===e&&React.createElement(m.Fragment,null,React.createElement(ie,null)),React.createElement("div",{className:" mdc-layout-grid__cell mdc-layout-grid__cell--span-12 mdc-layout-grid__cell--align-right "},React.createElement(ne.a,null))))))}}]),t}(m.Component),ce=a(39),le=a.n(ce),se=function(e){function t(e){var a;return n()(this,t),(a=s()(this,d()(t).call(this,e))).state={hasError:!1},Object(E.setLocaleData)(googlesitekit.locale,"google-site-kit"),a}return u()(t,e),c()(t,[{key:"componentDidCatch",value:function(e,t){this.setState({hasError:!0,error:e,info:t})}},{key:"render",value:function(){var e=this.state,t=e.hasError,a=e.error,i=e.info;return t?React.createElement(f.a,{id:"googlesitekit-error",key:"googlesitekit-error",title:a,description:i.componentStack,dismiss:"",isDismissable:!1,format:"small",type:"win-error"}):React.createElement(oe,null)}}]),t}(m.Component);le()((function(){var e=document.getElementById("googlesitekit-settings-wrapper");null!==e&&(Object(m.render)(React.createElement(se,null),e),Object(R.doAction)("googlesitekit.moduleLoaded","Settings"))}))},35:function(e,t){e.exports=wp.apiFetch},36:function(e,t){e.exports=wp.url},39:function(e,t){e.exports=wp.domReady},50:function(e,t){e.exports=ReactDOM},59:function(e,t){e.exports=wp.compose}});
google-site-kit.php CHANGED
@@ -11,7 +11,7 @@
11
  * Plugin Name: Site Kit by Google
12
  * Plugin URI: https://sitekit.withgoogle.com
13
  * Description: Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
14
- * Version: 1.1.2
15
  * Author: Google
16
  * Author URI: https://opensource.google.com
17
  * License: Apache License 2.0
@@ -24,7 +24,7 @@ if ( ! defined( 'ABSPATH' ) ) {
24
  }
25
 
26
  // Define most essential constants.
27
- define( 'GOOGLESITEKIT_VERSION', '1.1.2' );
28
  define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
29
 
30
  /**
11
  * Plugin Name: Site Kit by Google
12
  * Plugin URI: https://sitekit.withgoogle.com
13
  * Description: Site Kit is a one-stop solution for WordPress users to use everything Google has to offer to make them successful on the web.
14
+ * Version: 1.1.3
15
  * Author: Google
16
  * Author URI: https://opensource.google.com
17
  * License: Apache License 2.0
24
  }
25
 
26
  // Define most essential constants.
27
+ define( 'GOOGLESITEKIT_VERSION', '1.1.3' );
28
  define( 'GOOGLESITEKIT_PLUGIN_MAIN_FILE', __FILE__ );
29
 
30
  /**
includes/Context.php CHANGED
@@ -58,7 +58,7 @@ final class Context {
58
  /**
59
  * Input access abstraction.
60
  *
61
- * @since n.e.x.t
62
  * @var Input
63
  */
64
  private $input;
@@ -67,7 +67,7 @@ final class Context {
67
  * Constructor.
68
  *
69
  * @since 1.0.0
70
- * @since n.e.x.t Added optional $input instance.
71
  *
72
  * @param string $main_file Absolute path to the plugin main file.
73
  * @param Input $input Input instance.
@@ -103,7 +103,7 @@ final class Context {
103
  /**
104
  * Gets the Input instance.
105
  *
106
- * @since n.e.x.t
107
  *
108
  * @return Input
109
  */
58
  /**
59
  * Input access abstraction.
60
  *
61
+ * @since 1.1.2
62
  * @var Input
63
  */
64
  private $input;
67
  * Constructor.
68
  *
69
  * @since 1.0.0
70
+ * @since 1.1.2 Added optional $input instance.
71
  *
72
  * @param string $main_file Absolute path to the plugin main file.
73
  * @param Input $input Input instance.
103
  /**
104
  * Gets the Input instance.
105
  *
106
+ * @since 1.1.2
107
  *
108
  * @return Input
109
  */
includes/Core/Authentication/Authentication.php CHANGED
@@ -123,7 +123,7 @@ final class Authentication {
123
  /**
124
  * Google_Proxy instance.
125
  *
126
- * @since n.e.x.t
127
  * @var Google_Proxy
128
  */
129
  protected $google_proxy;
@@ -709,7 +709,7 @@ final class Authentication {
709
  /**
710
  * Verifies the nonce for processing proxy setup.
711
  *
712
- * @since n.e.x.t
713
  */
714
  private function verify_proxy_setup_nonce() {
715
  $nonce = $this->context->input()->filter( INPUT_GET, 'nonce', FILTER_SANITIZE_STRING );
@@ -722,7 +722,7 @@ final class Authentication {
722
  /**
723
  * Handles the exchange of a code and site code for client credentials from the proxy.
724
  *
725
- * @since n.e.x.t
726
  *
727
  * @param string $code Code ('googlesitekit_code') provided by proxy.
728
  * @param string $site_code Site code ('googlesitekit_site_code') provided by proxy.
@@ -774,7 +774,7 @@ final class Authentication {
774
  /**
775
  * Redirects back to the authentication service with any added parameters.
776
  *
777
- * @since n.e.x.t
778
  *
779
  * @param string $code Code ('googlesitekit_code') provided by proxy.
780
  */
123
  /**
124
  * Google_Proxy instance.
125
  *
126
+ * @since 1.1.2
127
  * @var Google_Proxy
128
  */
129
  protected $google_proxy;
709
  /**
710
  * Verifies the nonce for processing proxy setup.
711
  *
712
+ * @since 1.1.2
713
  */
714
  private function verify_proxy_setup_nonce() {
715
  $nonce = $this->context->input()->filter( INPUT_GET, 'nonce', FILTER_SANITIZE_STRING );
722
  /**
723
  * Handles the exchange of a code and site code for client credentials from the proxy.
724
  *
725
+ * @since 1.1.2
726
  *
727
  * @param string $code Code ('googlesitekit_code') provided by proxy.
728
  * @param string $site_code Site code ('googlesitekit_site_code') provided by proxy.
774
  /**
775
  * Redirects back to the authentication service with any added parameters.
776
  *
777
+ * @since 1.1.2
778
  *
779
  * @param string $code Code ('googlesitekit_code') provided by proxy.
780
  */
includes/Core/Authentication/Clients/Google_Proxy_Client.php CHANGED
@@ -34,7 +34,7 @@ final class Google_Proxy_Client extends Google_Client {
34
  /**
35
  * Base URL to the proxy.
36
  *
37
- * @since n.e.x.t
38
  * @var string
39
  */
40
  protected $proxy_base_path = '';
@@ -42,7 +42,7 @@ final class Google_Proxy_Client extends Google_Client {
42
  /**
43
  * Construct the Google Client.
44
  *
45
- * @since n.e.x.t
46
  *
47
  * @param array $config Proxy client configuration.
48
  */
34
  /**
35
  * Base URL to the proxy.
36
  *
37
+ * @since 1.1.2
38
  * @var string
39
  */
40
  protected $proxy_base_path = '';
42
  /**
43
  * Construct the Google Client.
44
  *
45
+ * @since 1.1.2
46
  *
47
  * @param array $config Proxy client configuration.
48
  */
includes/Core/Authentication/Clients/OAuth_Client.php CHANGED
@@ -92,7 +92,7 @@ final class OAuth_Client {
92
  /**
93
  * Google_Proxy instance.
94
  *
95
- * @since n.e.x.t
96
  * @var Google_Proxy
97
  */
98
  private $google_proxy;
@@ -626,7 +626,7 @@ final class OAuth_Client {
626
  * Returns the setup URL to the authentication proxy.
627
  *
628
  * @since 1.0.0
629
- * @since n.e.x.t Added googlesitekit_proxy_setup_url_params filter.
630
  *
631
  * @param string $access_code Optional. Temporary access code for an undelegated access token. Default empty string.
632
  * @param string $error_code Optional. Error code, if the user should be redirected because of an error. Default empty string.
@@ -651,7 +651,7 @@ final class OAuth_Client {
651
  /**
652
  * Filters parameters included in proxy setup URL.
653
  *
654
- * @since n.e.x.t
655
  *
656
  * @param string $access_code Temporary access code for an undelegated access token.
657
  * @param string $error_code Error code, if the user should be redirected because of an error.
@@ -678,7 +678,7 @@ final class OAuth_Client {
678
  * Gets the list of features to declare support for when setting up with the proxy.
679
  *
680
  * @since 1.1.0
681
- * @since n.e.x.t Added 'credentials_retrieval'
682
  * @return array Array of supported features.
683
  */
684
  private function get_proxy_setup_supports() {
92
  /**
93
  * Google_Proxy instance.
94
  *
95
+ * @since 1.1.2
96
  * @var Google_Proxy
97
  */
98
  private $google_proxy;
626
  * Returns the setup URL to the authentication proxy.
627
  *
628
  * @since 1.0.0
629
+ * @since 1.1.2 Added googlesitekit_proxy_setup_url_params filter.
630
  *
631
  * @param string $access_code Optional. Temporary access code for an undelegated access token. Default empty string.
632
  * @param string $error_code Optional. Error code, if the user should be redirected because of an error. Default empty string.
651
  /**
652
  * Filters parameters included in proxy setup URL.
653
  *
654
+ * @since 1.1.2
655
  *
656
  * @param string $access_code Temporary access code for an undelegated access token.
657
  * @param string $error_code Error code, if the user should be redirected because of an error.
678
  * Gets the list of features to declare support for when setting up with the proxy.
679
  *
680
  * @since 1.1.0
681
+ * @since 1.1.2 Added 'credentials_retrieval'
682
  * @return array Array of supported features.
683
  */
684
  private function get_proxy_setup_supports() {
includes/Core/Authentication/Google_Proxy.php CHANGED
@@ -16,7 +16,7 @@ use Exception;
16
  /**
17
  * Class for authentication service.
18
  *
19
- * @since n.e.x.t
20
  * @access private
21
  * @ignore
22
  */
@@ -34,7 +34,7 @@ class Google_Proxy {
34
  /**
35
  * Plugin context.
36
  *
37
- * @since n.e.x.t
38
  * @var Context
39
  */
40
  private $context;
@@ -42,7 +42,7 @@ class Google_Proxy {
42
  /**
43
  * Google_Proxy constructor.
44
  *
45
- * @since n.e.x.t
46
  *
47
  * @param Context $context Plugin context.
48
  */
@@ -53,7 +53,7 @@ class Google_Proxy {
53
  /**
54
  * Gets a URL to the proxy with optional path.
55
  *
56
- * @since n.e.x.t
57
  *
58
  * @param string $path Optional. Path to append to the base URL.
59
  * @return string Complete proxy URL.
@@ -77,7 +77,7 @@ class Google_Proxy {
77
  /**
78
  * Exchanges a site code for client credentials from the proxy.
79
  *
80
- * @since n.e.x.t
81
  *
82
  * @param string $site_code Site code identifying the site.
83
  * @param string $undelegated_code Undelegated code identifying the undelegated token.
16
  /**
17
  * Class for authentication service.
18
  *
19
+ * @since 1.1.2
20
  * @access private
21
  * @ignore
22
  */
34
  /**
35
  * Plugin context.
36
  *
37
+ * @since 1.1.2
38
  * @var Context
39
  */
40
  private $context;
42
  /**
43
  * Google_Proxy constructor.
44
  *
45
+ * @since 1.1.2
46
  *
47
  * @param Context $context Plugin context.
48
  */
53
  /**
54
  * Gets a URL to the proxy with optional path.
55
  *
56
+ * @since 1.1.2
57
  *
58
  * @param string $path Optional. Path to append to the base URL.
59
  * @return string Complete proxy URL.
77
  /**
78
  * Exchanges a site code for client credentials from the proxy.
79
  *
80
+ * @since 1.1.2
81
  *
82
  * @param string $site_code Site code identifying the site.
83
  * @param string $undelegated_code Undelegated code identifying the undelegated token.
includes/Core/Util/Input.php CHANGED
@@ -13,7 +13,7 @@ namespace Google\Site_Kit\Core\Util;
13
  /**
14
  * Class for input superglobal access.
15
  *
16
- * @since n.e.x.t
17
  * @access private
18
  * @ignore
19
  */
@@ -22,7 +22,7 @@ class Input {
22
  /**
23
  * Gets a specific external variable by name and optionally filters it.
24
  *
25
- * @since n.e.x.t
26
  *
27
  * @link https://php.net/manual/en/function.filter-input.php
28
  *
13
  /**
14
  * Class for input superglobal access.
15
  *
16
+ * @since 1.1.2
17
  * @access private
18
  * @ignore
19
  */
22
  /**
23
  * Gets a specific external variable by name and optionally filters it.
24
  *
25
+ * @since 1.1.2
26
  *
27
  * @link https://php.net/manual/en/function.filter-input.php
28
  *
includes/Modules/AdSense.php CHANGED
@@ -641,7 +641,14 @@ tag_partner: "site_kit"
641
  $option = (array) $this->options->get( self::OPTION );
642
  $option['setupComplete'] = true;
643
  $option['clientID'] = $data['clientID'];
644
- $option['useSnippet'] = ! empty( $data['useSnippet'] );
 
 
 
 
 
 
 
645
 
646
  $this->options->set( self::OPTION, $option );
647
 
641
  $option = (array) $this->options->get( self::OPTION );
642
  $option['setupComplete'] = true;
643
  $option['clientID'] = $data['clientID'];
644
+ $option['useSnippet'] = isset( $option['useSnippet'] ) ? true : $data['useSnippet'];
645
+
646
+ // Set useSnippet explicitly using $data param, otherwise default to true if not set in option.
647
+ if ( isset( $data['useSnippet'] ) ) {
648
+ $option['useSnippet'] = $data['useSnippet'];
649
+ } elseif ( ! isset( $option['useSnippet'] ) ) {
650
+ $option['useSnippet'] = true;
651
+ }
652
 
653
  $this->options->set( self::OPTION, $option );
654
 
includes/Modules/Site_Verification.php CHANGED
@@ -382,7 +382,7 @@ final class Site_Verification extends Module implements Module_With_Scopes {
382
  * Handles receiving a verification token for a user by the authentication proxy.
383
  *
384
  * @since 1.1.0
385
- * @since n.e.x.t Runs on `admin_action_googlesitekit_proxy_setup` and no longer redirects directly.
386
  */
387
  private function handle_verification_token() {
388
  $verification_token = $this->context->input()->filter( INPUT_GET, 'googlesitekit_verification_token', FILTER_SANITIZE_STRING );
382
  * Handles receiving a verification token for a user by the authentication proxy.
383
  *
384
  * @since 1.1.0
385
+ * @since 1.1.2 Runs on `admin_action_googlesitekit_proxy_setup` and no longer redirects directly.
386
  */
387
  private function handle_verification_token() {
388
  $verification_token = $this->context->input()->filter( INPUT_GET, 'googlesitekit_verification_token', FILTER_SANITIZE_STRING );
readme.txt CHANGED
@@ -4,7 +4,7 @@ Contributors: google
4
  Requires at least: 4.7
5
  Tested up to: 5.3
6
  Requires PHP: 5.4
7
- Stable tag: 1.1.2
8
  License: Apache License 2.0
9
  License URI: https://www.apache.org/licenses/LICENSE-2.0
10
  Tags: google, search-console, analytics, adsense, pagespeed-insights, optimize, tag-manager, site-kit
4
  Requires at least: 4.7
5
  Tested up to: 5.3
6
  Requires PHP: 5.4
7
+ Stable tag: 1.1.3
8
  License: Apache License 2.0
9
  License URI: https://www.apache.org/licenses/LICENSE-2.0
10
  Tags: google, search-console, analytics, adsense, pagespeed-insights, optimize, tag-manager, site-kit