!function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=70)}({0:function(e,t,n){"use strict";n.d(t,"f",function(){return o}),n.d(t,"b",function(){return i}),n.d(t,"e",function(){return a}),n.d(t,"c",function(){return c}),n.d(t,"a",function(){return u}),n.d(t,"d",function(){return l});var r=window.wp,o=r.i18n,i=r.blocks,a=r.editor,c=r.components,u=r.apiFetch,l=r.data;r.element},1:function(e,t){e.exports=window.wp.element},10:function(e,t,n){"use strict";e.exports=function(e){return encodeURIComponent(e).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}},11:function(e,t,n){"use strict"; /* object-assign (c) Sindre Sorhus @license MIT */var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,a,c=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;ut.time&&t.endIterations>3)return o(e,r.x,r.y),e._scrollSettings=null,t.end(n);t.endIterations++;var u=1-t.ease(c);if(o(e,r.x-r.differenceX*u,r.y-r.differenceY*u),a>=t.time)return i(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(i.bind(null,e))}}function a(e,t,n,o){var a,c=!t._scrollSettings,u=t._scrollSettings,l=Date.now();function s(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),o(e),t.removeEventListener("touchstart",a,{passive:!0}),t.removeEventListener("wheel",a,{passive:!0})}u&&u.end(r),t._scrollSettings={startTime:u?u.startTime:Date.now(),endIterations:0,target:e,time:n.time+(u?l-u.startTime:0),ease:n.ease,align:n.align,end:s},a=s.bind(null,r),t.addEventListener("touchstart",a,{passive:!0}),t.addEventListener("wheel",a,{passive:!0}),c&&i(t)}function c(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function u(){return!0}e.exports=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)};for(var r=e.parentElement,o=0,i=t.validTarget||u,l=t.isScrollable;r;){if(i(r,o)&&(l?l(r,c):c(r))&&(o++,a(e,r,t,s)),!(r=r.parentElement))return;"BODY"===r.tagName&&(r=(r=r.ownerDocument).defaultView||r.ownerWindow)}}function s(e){--o||n&&n(e)}}},7:function(e,t,n){"use strict";var r=n(10),o=n(11),i=n(12);function a(e,t){return t.encode?t.strict?r(e):encodeURIComponent(e):e}function c(e){var t=e.indexOf("?");return-1===t?"":e.slice(t+1)}function u(e,t){var n=function(e){var t;switch(e.arrayFormat){case"index":return function(e,n,r){t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return function(e,n,r){t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),t?void 0!==r[e]?r[e]=[].concat(r[e],n):r[e]=[n]:r[e]=n};default:return function(e,t,n){void 0!==n[e]?n[e]=[].concat(n[e],t):n[e]=t}}}(t=o({arrayFormat:"none"},t)),r=Object.create(null);return"string"!=typeof e?r:(e=e.trim().replace(/^[?#&]/,""))?(e.split("&").forEach(function(e){var t=e.replace(/\+/g," ").split("="),o=t.shift(),a=t.length>0?t.join("="):void 0;a=void 0===a?null:i(a),n(i(o),a,r)}),Object.keys(r).sort().reduce(function(e,t){var n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort(function(e,t){return Number(e)-Number(t)}).map(function(e){return t[e]}):t}(n):e[t]=n,e},Object.create(null))):r}t.extract=c,t.parse=u,t.stringify=function(e,t){!1===(t=o({encode:!0,strict:!0,arrayFormat:"none"},t)).sort&&(t.sort=function(){});var n=function(e){switch(e.arrayFormat){case"index":return function(t,n,r){return null===n?[a(t,e),"[",r,"]"].join(""):[a(t,e),"[",a(r,e),"]=",a(n,e)].join("")};case"bracket":return function(t,n){return null===n?a(t,e):[a(t,e),"[]=",a(n,e)].join("")};default:return function(t,n){return null===n?a(t,e):[a(t,e),"=",a(n,e)].join("")}}}(t);return e?Object.keys(e).sort(t.sort).map(function(r){var o=e[r];if(void 0===o)return"";if(null===o)return a(r,t);if(Array.isArray(o)){var i=[];return o.slice().forEach(function(e){void 0!==e&&i.push(n(r,e,i.length))}),i.join("&")}return a(r,t)+"="+a(o,t)}).filter(function(e){return e.length>0}).join("&"):""},t.parseUrl=function(e,t){return{url:e.split("?")[0]||"",query:u(c(e),t)}}},70:function(e,t,n){"use strict";n.r(t);var r,o=n(1),i=n(7),a=n.n(i),c=n(0),u=n(3),l=n.n(u),s=n(42),f=n.n(s);function p(e,t){if(r!==e){r=e;var n="ab-testing-for-wp__highlight__".concat(e);if(!document.getElementById(n)){document.querySelectorAll(".ab-testing-for-wp__highlight").forEach(function(e){document.body&&document.body.removeChild(e)});var o,i,a,c=t.getBoundingClientRect(),u=(o=c,i=window.pageXOffset||(document.documentElement||{scrollLeft:0}).scrollLeft,a=window.pageYOffset||(document.documentElement||{scrollTop:0}).scrollTop,{top:o.top+a,left:o.left+i}),l=document.createElement("div");l.className="ab-testing-for-wp__highlight",l.setAttribute("id",n),l.style.position="absolute",l.style.width="".concat(c.width+30,"px"),l.style.height="".concat(c.height+30,"px"),l.style.top="".concat(u.top-15,"px"),l.style.left="".concat(u.left-15,"px"),document.body&&(document.body.appendChild(l),setTimeout(function(){document.body&&document.body.contains(l)&&document.body.removeChild(l)},5e3))}}}var d=function(e){var t=e.id,n=e.name,r=e.isSelected,o=e.onChangeVariant;return wp.element.createElement("li",{className:l()("ab-testing-for-wp__variant",{"ab-testing-for-wp__selected":r})},wp.element.createElement("button",{className:"ab-item ab-empty-item",type:"button",onClick:function(){return o(t)}},n))};function m(){return(m=Object.assign||function(e){for(var t=1;tt.offsetTop?1:e.offsetTop0?"(".concat(r.length,")"):"")),wp.element.createElement("div",{className:"ab-sub-wrapper"},wp.element.createElement("ul",{id:"wp-admin-bar-ab-testing-for-wp-default",className:"ab-submenu"},n&&wp.element.createElement("li",null,wp.element.createElement("div",{className:"ab-item ab-empty-item","aria-haspopup":"true"},_("Scanning for tests on page"))),n||0!==r.length?r.map(function(t){return wp.element.createElement(b,y({},t,{pickedVariants:i,onChangeVariant:e.onChangeVariant}))}):wp.element.createElement("li",null,wp.element.createElement("div",{className:"ab-item ab-empty-item","aria-haspopup":"true"},_("No tests found on page"))))))}}])&&v(n.prototype,r),i&&v(n,i),t}();document.addEventListener("DOMContentLoaded",function(){var e=document.getElementById("wp-admin-bar-ab-testing-for-wp");e&&Object(o.render)(wp.element.createElement(x,null),e)})}});