PageSourceSearch

https://carolineabbott.com/wp-content/plugins/mailchimp-top-bar/assets/script.js?ver=1.7.7

js carolineabbott.com collected 2026-10-05 19:05:01 UTC 4,979 bytes, 1 lines download raw bytes

1(()=>{"use strict";function t(t,e,n){const i=n?";max-age="+24*n*60*60:"";document.cookie=encodeURIComponent(t)+"="+encodeURIComponent(e)+i+";path=/;SameSite=lax"}const e={exists:function(t){return new RegExp(t+"=").test(document.cookie)},create:t,erase:function(e){t(e,"",-1)}};function n(t){return t.innerHTML?t.innerHTML:t.value}function i(t,e){t.innerHTML?t.innerHTML=e:t.value=e}function o(t){this.form=t,this.button=t.querySelector('input[type="submit"],button[type="submit"]'),this.char="·",this.button&&(this.originalButton=this.button.cloneNode(!0)),this.start()}o.prototype.setCharacter=function(t){this.char=t},o.prototype.start=function(){if(this.button){const t=this.button.getAttribute("data-loading-text");if(t)return void i(this.button,t);const e=window.getComputedStyle(this.button);this.button.style.width=e.width,i(this.button,this.char),this.loadingInterval=window.setInterval(this.tick.bind(this),500)}else this.form.style.opacity="0.5"},o.prototype.tick=function(){const t=n(this.button),e=this.char;i(this.button,t.length>=5?e:t+" "+e)},o.prototype.stop=function(){if(this.button){this.button.style.width=this.originalButton.style.width;const t=n(this.originalButton);i(this.button,t),window.clearInterval(this.loadingInterval)}else this.form.style.opacity=""};const s=o,r="mctb_bar_hidden";function d(){const t=document.getElementById("mailchimp-top-bar"),n=window.mctb,i=t.querySelector(".mctb-bar"),o=document.createElement("span"),d=i.querySelector("form");let c,l,a=t.querySelector(".mctb-response"),u=!e.exists(r),h=0,m=0;const p="bottom"===n.position,g=n.state,y=i.querySelector('input[name="_mctb_no_js"]');function b(){u||(i.style.visibility="hidden"),i.style.display="",i.style.height="",i.style.paddingTop="",i.style.paddingBottom="";const e=window.getComputedStyle(i);c=e.height,l=e.paddingTop,m=h+i.clientHeight+"px",u&&(document.body.style[p?"paddingBottom":"paddingTop"]=m),t.className=t.className.replace("mctb-icon-inside-bar",""),function(){let t=0;for(let e=0;e<i.firstElementChild.children.length;e++)t+=i.firstElementChild.children[e].clientWidth;return t+o.clientWidth+200<i.clientWidth}()&&(t.className+=" mctb-icon-inside-bar",p&&(t.style.minHeight=o.clientHeight+"px")),a&&(a.style.height=i.clientHeight+"px",a.style.lineHeight=i.clientHeight+"px"),i.style.visibility="",i.style.height=u?c:0,i.style.paddingTop=u?l:0,i.style.paddingBottom=u?l:0}function f(t){t.target.style.transition="",t.target.removeEventListener("transitionend",f)}function w(t,e){t.style.transition="all 0.6s ease",t.addEventListener("transitionend",f),window.requestAnimationFrame(()=>T(t,e))}function T(t,e){for(const n in e)t.style[n]=e[n]}function v(t){if(u)return!1;const s={height:c,paddingTop:l,paddingBottom:l},d={};return d[p?"paddingBottom":"paddingTop"]=m,t?(w(i,s),w(document.body,d),e.erase(r)):(T(i,s),T(document.body,d)),o.innerHTML=n.icons.hide,u=!0,!0}function E(t){if(!u)return!1;const s={height:0,paddingBottom:0,paddingTop:0},d={};return d[p?"paddingBottom":"paddingTop"]=h+"px",t?(w(i,s),w(document.body,d),e.create(r,g.success?"used":"hidden",n.cookieLength)):(T(i,s),T(document.body,d)),u=!1,o.innerHTML=n.icons.show,!0}function L(){a&&(a.style.opacity="0",window.setTimeout(()=>{a.parentElement.removeChild(a),g.submitted&&g.success&&E(!0)},1e3))}function B(){return u?E(!0):v(!0)}return y.parentElement.removeChild(y),d.addEventListener("submit",function(t){t.preventDefault();const e=new s(d),n=new FormData(d),i=new XMLHttpRequest;i.onload=function(){let t;if(e.stop(),this.status>=200&&this.status<400){try{t=JSON.parse(this.responseText)}catch(t){return void console.log('MailChimp Top Bar: failed to parse AJAX response.\n\nError: "'+t+'"')}if(g.success=!!t.success,g.submitted=!0,t.success&&t.redirect_url)return void(window.location.href=t.redirect_url);!function(t){a&&a.parentElement&&a.parentElement.removeChild(a),a=document.createElement("div"),a.className="mctb-response";const e=document.createElement("label");e.className="mctb-response-label",e.innerText=t,a.appendChild(e),d.parentElement.insertBefore(a,d.nextElementSibling),b(),window.setTimeout(L,4e3)}(t.message),g.success&&d.reset()}else console.log(this.responseText)},i.open("POST",window.location.href,!0),i.setRequestHeader("X-Requested-With","XMLHttpRequest"),i.send(n)}),p?(t.insertBefore(o,i),h=parseInt(document.body.style.paddingBottom)||
10):(t.insertBefore(o,i.nextElementSibling),h=parseInt(document.body.style.paddingTop)||0),o.className="mctb-close",o.innerHTML=u?n.icons.hide:n.icons.show,o.addEventListener("click",B),i.querySelectorAll('input:not([type="hidden"])').length>3&&(t.className+=" multiple-input-fields"),window.requestAnimationFrame(b),window.addEventListener("load",b),window.addEventListener("resize",function(t){let e;return function(){clearTimeout(e),e=setTimeout(t,100)}}(b)),a&&window.setTimeout(L,4e3),{element:t,toggle:B,show:v,hide:E}}document.addEventListener("DOMContentLoaded",function(){window.MailChimpTopBar=new d})})();

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.