!function(e){var t={};function n(i){if(t[i])return t[i].exports;var s=t[i]={i:i,l:!1,exports:{}};e[i].call(s.exports,s,s.exports,n);s.l=!0;return s.exports}n.m=e;n.c=t;n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})};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){1&t&&(e=n(e));if(8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);n.r(i);Object.defineProperty(i,"default",{enumerable:!0,value:e});if(2&t&&"string"!=typeof e)for(var s in e)n.d(i,s,function(t){return e[t]}.bind(null,s));return i};n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};n.d(t,"a",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p="//static.hsappstatic.net/CmsManagePreferences/static-1.434/";n(n.s=0)}([function(e,t,n){"use strict";n.r(t);const i={subscriptionForm:"email-prefs-form",languageSelect:"hs-localization-select",checkBox:e=>"id_"+e,emailPlaceholder:"hs-subscriptions-masked-email",preLoadStyle:"hs-susbscriptions-custom-style",unsubscribeAll:"globalunsub",archivedType:"hs-subscriptions-archived-type",globalResubContainer:"globalresub-container",formSubmit:"submitbutton"},s={loading:"hs-subscriptions-load",uiSpinner:"hs-subscriptions-custom-spinner",loadingMessage:"hs-subscriptions-custom-message",unsubAllConfirmMessage:"hs-subscriptions-unsub-all-success",subConfirmMessage:"hs-subscriptions-update-success"},o={inputCheckbox:'input[type="checkbox"]',subscriptionItem:".email-prefs .item",subscriptionItemInner:".item-inner",modifiedEmail:'input[type="email"][name="modified_email"]',email:'input[type="hidden"][name="email"]'};let r;!function(e){e.failure="fallback";e.confirmation="confirm"}(r||(r={}));const a=(e,t)=>{const n=new URL(e),i=n.pathname.split("/");i[i.length-2]="default"===t?"en":t;n.pathname=i.join("/");return n.toString()},c=(e,t,n)=>{const i=document.getElementById(e);i&&(i[t]=n)},l=(e,t)=>{c(e,"checked",t)},u=(e,t)=>{c(e,"innerText",t)},d=(e,t)=>{const n=document.querySelector(e);n&&(n.value=t)},p=e=>{window.location.href=e},m=e=>{const t=document.createElement("div");t.innerHTML=e.trim();return t.firstChild},f=e=>e&&`${e}`,h=(e,t=window.location.href)=>{const n=new URL(t),i=n.pathname.split("/");i[i.length-1]=e;n.pathname=i.join("/");e===r.failure&&(n.search="");return n.toString()},b=(e=window.location.pathname)=>e?e.split("/").pop():"",g=(e,t)=>{e.classList?e.classList.add(t):e.className+=" "+t};function y({subscriptionIdToCheckboxState:e,maskedEmail:t,unsubscribedFromAll:n,sentSubscriptionId:s}){if(e){const t=document.querySelectorAll(o.subscriptionItem);for(let i=0;i{const e=document.createElement("style");e.id=i.preLoadStyle;document.head.appendChild(e);S.forEach((t,n)=>{e&&e.sheet&&e.sheet.insertRule(t,n)})},C=()=>{const e=document.querySelectorAll(`[id=${i.preLoadStyle}]`),t=e.length;for(let n=0;n\n
\n
\n \n \n ${f(r)}\n ${f(a)}\n ${l&&f(" | ")}\n ${f(n)}\n \n
\n

${s}

\n
\n \n `;c&&c.replaceWith(m(u))}function P({unsubscribedFromAll:e}){if(e){const e=document.getElementById(i.globalResubContainer);e&&(e.style.display="unset")}}class k{constructor(){this.httpClient=new XMLHttpRequest}redirectToFallbackPage(){const e=h(r.failure);p(e)}serializePayload(e){const t=new URLSearchParams;e.forEach((e,n)=>{t.append(n,e)});return t.toString()}async get(e){return new Promise((t,n)=>{const i=this.httpClient;i.open("GET",e);i.onreadystatechange=()=>{if(i.readyState===XMLHttpRequest.DONE)if(200===i.status)try{const e=JSON.parse(i.responseText);e&&e.shouldRedirect&&e.url&&p(e.url);t(e)}catch(e){this.redirectToFallbackPage()}else i.status>=400&&i.status<=500&&this.redirectToFallbackPage()};i.onerror=()=>{this.redirectToFallbackPage()};i.send()})}postFormData(e,t){const n=this.httpClient,i=this.serializePayload(t);n.open("POST",e,!0);n.setRequestHeader("Content-Type","application/x-www-form-urlencoded");n.onreadystatechange=()=>{if(n.readyState===XMLHttpRequest.DONE){if(n.status>=200&&n.status<400){const e=h(r.confirmation);p(e);return}if(n.status>=400&&n.status<=500){this.redirectToFallbackPage();return}}};n.onerror=()=>{this.redirectToFallbackPage()};n.send(i)}}let F;!function(e){e.SAVE_PREFERENCES="save-preferences";e.LOAD_PREFERENCES="get-preferences";e.UNKNOWN="unknown"}(F||(F={}));const R=e=>{switch(e){case F.LOAD_PREFERENCES:return`/hs/cms-preferences-page/load/${b()}${window.location.search}`;case F.SAVE_PREFERENCES:return`${window.location.pathname}${window.location.search}`;default:return""}},x=async()=>{const e=new k,t=R(F.LOAD_PREFERENCES);return e.get(t)},$=async e=>{const t=new k,n=R(F.SAVE_PREFERENCES);return t.postFormData(n,e)};function A(e){return function(t){t.preventDefault();const n=t.submitter,i=new FormData(e);"globalresub2"===n.id&&i.append("is_resubscribe","true");$(i)}}function L(){const e=document.getElementById(i.subscriptionForm);if(e){const t=A(e);e.addEventListener("submit",t)}}function M(e){const t=a(window.location.href,e);p(t)}function _(){const e=document.getElementById(i.languageSelect);e&&(e.onchange=function(){M(e.value)})}function T(){const e=document.getElementById(i.unsubscribeAll);e&&e.addEventListener("change",(function(e){if(e.target.checked){const e=document.querySelectorAll(o.subscriptionItem);for(let t=0;t{E(e)})};w();const e=this.isPage;return function(){x().then(t=>{y(t);e&&P(t);v(t.archivedSentSubscription);_();T();C();L()})}}}const I=window.CMSDynamicFetchingEnabled;if("complete"!==document.readyState&&!I){window.CMSDynamicFetchingEnabled=!0;const e=(new O).init();document.addEventListener("DOMContentLoaded",e)}}]);