14 lines
59 KiB
JavaScript
14 lines
59 KiB
JavaScript
|
|
(window.__googlesitekit_webpackJsonp=window.__googlesitekit_webpackJsonp||[]).push([[11],{1:function(e,t){e.exports=googlesitekit.i18n},1085:function(e,t,r){"use strict";r.r(t);var n=r(4),o=r.n(n),i=r(5),a=r.n(i),c=r(6),u=r.n(c),s=r(35),f=r.n(s),l=r(15),p=r(45);function d(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function g(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?d(Object(r),!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var v=o.a.createRegistrySelector,b=Object(p.a)({baseName:"getConnection",controlCallback:function(){return f.a.get("core","site","connection",void 0,{useCache:!1})},reducerCallback:function(e,t){return g(g({},e),{},{connection:t})}}),y={connection:void 0},m={getConnection:a.a.mark((function e(){var t;return a.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.a.commonActions.getRegistry();case 2:if(t=e.sent,t.select(l.c).getConnection()){e.next=7;break}return e.next=7,b.actions.fetchGetConnection();case 7:case"end":return e.stop()}}),e)}))},O={getConnection:function(e){return e.connection},getOwnerID:v((function(e){return function(){return(e(l.c).getConnection()||{}).ownerID}})),hasConnectedAdmins:v((function(e){return function(){return(e(l.c).getConnection()||{}).hasConnectedAdmins}})),isConnected:v((function(e){return function(){var t=e(l.c).getConnection();return void 0!==t?t.connected:t}})),isResettable:v((function(e){return function(){var t=e(l.c).getConnection();return void 0!==t?t.resettable:t}})),isSetupCompleted:v((function(e){return function(){var t=e(l.c).getConnection();return void 0!==t?t.setupCompleted:t}})),hasMultipleAdmins:v((function(e){return function(){var t;return null===(t=e(l.c).getConnection())||void 0===t?void 0:t.hasMultipleAdmins}}))},h=o.a.combineStores(b,{initialState:y,resolvers:m,selectors:O}),j=(h.initialState,h.actions,h.controls,h.reducer,h.resolvers,h.selectors,h),w=r(22),R=r.n(w),S=r(7),E=r.n(S),P=r(61),L=r.n(P),k=r(1);function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function D(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?U(Object(r),!0).forEach((function(t){u()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):U(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var A,x={internalServerError:void 0},_={setInternalServerError:function(e){E()(L()(e),"internalServerError must be a plain object.");var t=e.title,r=void 0===t?Object(k.__)("Internal Server Error","google-site-kit"):t,n=e.format,o=void 0===n?"small":n,i=e.type;return{type:"SET_SERVER_ERROR",payload:{internalServerError:D({title:r,format:o,type:void 0===i?"win-error":i},R()(e,["title","format","type"]))}}},clearInternalServerError:function(){return{type:"CLEAR_SERVER_ERROR"}}},N=o.a.combineStores({initialState:x,actions:_,reducer:function(e,t){var r=t.type,n=t.payload;switch(r){case"SET_SERVER_ERROR":return D(D({},e),{},{internalServerError:n.internalServerError});case"CLEAR_SERVER_ERROR":return D(D({},e),{},{internalServerError:void 0});default:return e}},resolvers:{},selectors:{getInternalServerError:function(e){return e.internalServerError}}}),C=(N.initialState,N.actions,N.controls,N.reducer,N.resolvers,N.selectors,N),I=r(16),T=r.n(I),M=r(101),F=r(245),q=r(221);function H(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.pu
|
||
|
|
/* translators: %s: number of days */
|
||
|
|
Object(p._n)("Last %s day","Last %s days",e,"google-site-kit"),e)};return{"last-7-days":{slug:"last-7-days",label:e(7),days:7},"last-14-days":{slug:"last-14-days",label:e(14),days:14},"last-28-days":{slug:"last-28-days",label:e(28),days:28},"last-90-days":{slug:"last-90-days",label:e(90),days:90}}}},731:function(e,t,r){"use strict";(function(e){var n=r(14),o=r.n(n),i=r(22),a=r.n(i),c=r(5),u=r.n(c),s=r(6),f=r.n(s),l=r(7),p=r.n(l),d=r(732),g=r.n(d),v=r(245),b=r(435),y=r(4),m=r.n(y),O=r(15),h=r(9);function j(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function w(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?j(Object(r),!0).forEach((function(t){f()(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):j(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var R=m.a.createRegistrySelector;function S(e){return R((function(t){return function(){return(t(O.c).getSiteInfo()||{})[e]}}))}var E={siteInfo:void 0,permaLink:!1},P={receiveSiteInfo:function(e){return p()(e,"siteInfo is required."),{payload:{siteInfo:e},type:"RECEIVE_SITE_INFO"}},receivePermaLinkParam:function(e){return p()(e,"permaLink is required."),{payload:{permaLink:e},type:"RECEIVE_PERMALINK_PARAM"}}},L={getSiteInfo:u.a.mark((function t(){var r,n,o,i,a,c,s,f,l,p,d,g,v,b,y,h,j,w,R,S,E,L,k,U;return u.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,m.a.commonActions.getRegistry();case 2:if(!t.sent.select(O.c).getSiteInfo()){t.next=5;break}return t.abrupt("return");case 5:if(e._googlesitekitBaseData&&e._googlesitekitEntityData){t.next=8;break}return e.console.error("Could not load core/site info."),t.abrupt("return");case 8:return r=e._googlesitekitBaseData,n=r.adminURL,o=r.ampMode,i=r.homeURL,a=r.proxyPermissionsURL,c=r.proxySetupURL,s=r.referenceSiteURL,f=r.setupErrorCode,l=r.setupErrorMessage,p=r.setupErrorRedoURL,d=r.siteName,g=r.timezone,v=r.usingProxy,b=r.webStoriesActive,y=r.proxySupportLinkURL,h=r.widgetsAdminURL,j=r.postTypes,w=r.wpVersion,R=r.updateCoreURL,S=e._googlesitekitEntityData,E=S.currentEntityID,L=S.currentEntityTitle,k=S.currentEntityType,U=S.currentEntityURL,t.next=12,P.receiveSiteInfo({adminURL:n,ampMode:o,currentEntityID:E,currentEntityTitle:L,currentEntityType:k,currentEntityURL:U,homeURL:i,proxyPermissionsURL:a,proxySetupURL:c,referenceSiteURL:s,setupErrorCode:f,setupErrorMessage:l,setupErrorRedoURL:p,siteName:d,timezone:g,postTypes:j,usingProxy:!!v,webStoriesActive:b,proxySupportLinkURL:y,widgetsAdminURL:h,wpVersion:w,updateCoreURL:R});case 12:case"end":return t.stop()}}),t)}))},k={getSiteInfo:function(e){return e.siteInfo},getAdminURL:R((function(e){return function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},o=e(O.c).getSiteInfo()||{},i=o.adminURL;if(void 0===i||void 0===r)return i;var c="/"===i[i.length-1]?i:"".concat(i,"/"),u=r,s="admin.php";if(-1!==r.indexOf(".php?")){var f=r.split("?");if(!(u=g.a.parse(f.pop()).page))return i;s=f.shift()}n.page;var l=a()(n,["page"]);return Object(v.a)("".concat(c).concat(s),w({page:u},l))}})),getAMPMode:S("ampMode"),getCurrentEntityID:S("currentEntityID"),getCurrentEntityTitle:S("currentEntityTitle"),getCurrentEntityType:S("currentEntityType"),getCurrentEntityURL:S("currentEntityURL"),getHomeURL:S("homeURL"),getReferenceSiteURL:S("referenceSiteURL"),getProxySetupURL:S("proxySetupURL"),getProxyPermissionsURL:S("proxyPermissionsURL"),getCurrentReferenceURL:R((function(e){return function(){var t=e(O.c).getCurrentEntityURL();return null!==t?t:e(O.c).getReferenceSiteURL()}})),isAMP:R((function(e){return function(){var t=e(O.c).getAMPMode();if(void 0!==t)return!!t}})),isPrimaryAMP:R((function(e){return function(){var t=e(O.c).getAMPMode();if(void 0!==t)return t===O.a}})),isSecondaryAMP:R((function(e){return function(){var t=e(O.c).getAMPMode();if(void 0!=
|
||
|
|
/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
||
|
|
Object(g._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?R(o,b(b({},a),{},{unit:"second"})):"",n?R(n,b(b({},a),{},{unit:"minute"})):"",r?R(r,b(b({},a),{},{unit:"hour"})):"").trim()},formatDecimal:function(){var t=Object(g.sprintf)(// translators: %s: number of seconds with "s" as the abbreviated unit.
|
||
|
|
Object(g.__)("%ds","google-site-kit"),o);if(0===e)return t;var i=Object(g.sprintf)(// translators: %s: number of minutes with "m" as the abbreviated unit.
|
||
|
|
Object(g.__)("%dm","google-site-kit"),n),a=Object(g.sprintf)(// translators: %s: number of hours with "h" as the abbreviated unit.
|
||
|
|
Object(g.__)("%dh","google-site-kit"),r);return Object(g.sprintf)(
|
||
|
|
/* translators: 1: formatted seconds, 2: formatted minutes, 3: formatted hours */
|
||
|
|
Object(g._x)("%3$s %2$s %1$s","duration of time: hh mm ss","google-site-kit"),o?t:"",n?i:"",r?a:"").trim()}}},O=function(e){return 1e6<=e?Math.round(e/1e5)/10:1e4<=e?Math.round(e/1e3):1e3<=e?Math.round(e/100)/10:e},h=function(e){var t={minimumFractionDigits:1,maximumFractionDigits:1};return 1e6<=e?Object(g.sprintf)(// translators: %s: an abbreviated number in millions.
|
||
|
|
Object(g.__)("%sM","google-site-kit"),R(O(e),e%10==0?{}:t)):1e4<=e?Object(g.sprintf)(// translators: %s: an abbreviated number in thousands.
|
||
|
|
Object(g.__)("%sK","google-site-kit"),R(O(e))):1e3<=e?Object(g.sprintf)(// translators: %s: an abbreviated number in thousands.
|
||
|
|
Object(g.__)("%sK","google-site-kit"),R(O(e),e%10==0?{}:t)):R(e,{signDisplay:"never",maximumFractionDigits:1})},j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};e=Object(l.isFinite)(e)?e:Number(e),Object(l.isFinite)(e)||(console.warn("Invalid number",e,a()(e)),e=0);var r={};if("%"===t)r={style:"percent",maximumFractionDigits:2};else{if("s"===t)return y(e,{unitDisplay:"narrow"});t&&"string"==typeof t?r={style:"currency",currency:t}:Object(l.isPlainObject)(t)&&(r=b({},t))}var n=r,o=n.style,i=void 0===o?"metric":o;return"metric"===i?h(e):"duration"===i?y(e,t):R(e,r)},w=d()(console.warn),R=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.locale,n=void 0===r?E():r,i=f()(t,["locale"]);try{return new Intl.NumberFormat(n,i).format(e)}catch(t){w("Site Kit numberFormat error: Intl.NumberFormat( ".concat(JSON.stringify(n),", ").concat(JSON.stringify(i)," ).format( ").concat(a()(e)," )"),t.message)}for(var c={currencyDisplay:"narrow",currencySign:"accounting",style:"unit"},u=["signDisplay","compactDisplay"],s={},l=0,p=Object.entries(i);l<p.length;l++){var d=o()(p[l],2),g=d[0],v=d[1];c[g]&&v===c[g]||(u.includes(g)||(s[g]=v))}try{return new Intl.NumberFormat(n,s).format(e)}catch(t){return new Intl.NumberFormat(n).format(e)}},S=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.locale,n=void 0===r?E():r,o=t.style,i=void 0===o?"long":o,a=t.type,c=void 0===a?"conjunction":a;if(Intl.ListFormat){var u=new Intl.ListFormat(n,{style:i,type:c});return u.format(e)}
|
||
|
|
/* translators: used between list items, there is a space after the comma. */var s=Object(g.__)(", ","google-site-kit");return e.join(s)},E=function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:e,r=Object(l.get)(t,["_googlesitekitLegacyData","locale"]);if(r){var n=r.match(/^(\w{2})?(_)?(\w{2})/);if(n&&n[0])return n[0].replace(/_/g,"-")}return t.navigator.language}}).call(this,r(21))},77:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return o}));var n=r(130),o=r.n(n)()(e)}).call(this,r(21))},85:function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return c})),r.d(t,"b",(function(){return s}));var n=r(14),o=r.n(n);function i(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return a(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var i,c=!0,u=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return c=e.done,e},e:function(e){u=!0,i=e},f:function(){try{c||null==r.return||r.return()}finally{if(u)throw i}}}}function a(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var c=function(){e.localStorage&&e.localStorage.clear(),e.sessionStorage&&e.sessionStorage.clear()},u=function(e){for(var t=location.search.substr(1).split("&"),r={},n=0;n<t.length;n++)r[t[n].split("=")[0]]=decodeURIComponent(t[n].split("=")[1]);return e?r.hasOwnProperty(e)?decodeURIComponent(r[e].replace(/\+/g," ")):"":r},s=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:location,r=new URL(t.href);if(e)return r.searchParams&&r.searchParams.get?r.searchParams.get(e):u(e);var n,a={},c=i(r.searchParams.entries());try{for(c.s();!(n=c.n()).done;){var s=o()(n.value,2),f=s[0],l=s[1];a[f]=l}}catch(e){c.e(e)}finally{c.f()}return a}}).call(this,r(21))},86:function(e,t,r){"use strict";r.d(t,"b",(function(){return n})),r.d(t,"a",(function(){return o})),r.d(t,"c",(function(){return i}));var n=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},o=function(e){return e.replace(/([a-z0-9]{1})([A-Z]{1})/g,"$1_$2").toUpperCase()};function i(e){return e.split("-").map((function(e){return e.charAt(0).toUpperCase()+e.slice(1)})).join("")}},88:function(e,t,r){"use strict";(function(e){r(41),r(42)}).call(this,r(21))},89:function(e,t,r){"use strict";(function(e){r.d(t,"b",(function(){return i})),r.d(t,"c",(function(){return a})),r.d(t,"a",(function(){return c}));var n=r(177),o=r(67),i=function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Number.isNaN(Number(t)))return"";var i=r.invertColor,a=void 0!==i&&i;return Object(n.a)(e.createElement(o.a,{direction:t>0?"up":"down",invertColor:a}))},a=function(e){var t,r,n,o,i,a,c,u,s,f,l,p,d,g,v;if(void 0!==e)return 1===(null==e||null===(t=e[0])||void 0===t||null===(r=t.data)||void 0===r||null===(n=r.rows)||void 0===n?void 0:n.length)||(null==e||null===(o=e[0])||void 0===o||null===(i=o.data)||void 0===i||null===(a=i.rows)||void 0===a||null===(c=a[0])||void 0===c||null===(u=c.metrics)||void 0===u||null===(s=u[0])||void 0===s||null===(f=s.values)||void 0===f?void 0:f[0])===(null==e||null===(l=e[0])||void 0===l||null===(p=l.data)||void 0===p||null===(d=p.totals)||void 0===d||null===(g=d[0])||void 0===g||null===(v=g.values)||void 0===v?void 0:v[0])},c=function(e,t){return e>0&&t>0?e/t-1:e>0?1:t>0?-1:0}}).call(this,r(3))},9:function(e,t,r){"use strict";r.d(t,"z",(function(){return c.b})),r.d(t,"w",(function(){return u.a})),r.d(t,"A",(function(){return u.b})),r.d(t,"y",(function()
|