!function(){"use strict";const e={RECEIVED_ANALYTICS:"HS_CTA_PARENT_RECEIVED_ANALYTICS",DEVICE_TYPE:"HS_CTA_PARENT_DEVICE_TYPE",PROXY_ANALYTICS_FN_CALLBACK:"HS_CTA_PARENT_PROXY_ANALYTICS_FN",INIT:"HS_CTA_PARENT_INIT",SHOWING_CTA:"HS_CTA_SHOWING_CTA",SEND_EXTRACTED_STYLES:"HS_SEND_EXTRACTED_STYLES",STARTED:"HS_CTA_STARTED",NAVIGATE_PAGE:"HS_CTA_NAVIGATE_PAGE",CLICK_EVENT:"HS_CTA_CLICK_EVENT",CLOSE_INTERACTIVE:"HS_CTA_CLOSE_INTERACTIVE",HAS_CLOSED:"HS_CTA_HAS_CLOSED",NEW_HEIGHT:"HS_CTA_NEW_HEIGHT",DISPLAY_CALL_TO_ACTION:"HS_DISPLAY_CALL_TO_ACTION",PROXY_ANALYTICS:"HS_CTA_PROXY_ANALYTICS",PROXY_ANALYTICS_FN:"HS_CTA_PROXY_ANALYTICS_FN",SEND_FORM_DEFINITION:"HS_SEND_FORM_DEFINITION",SEND_CTA_CONFIG:"HS_SEND_CTA_CONFIG",SEND_EMBED_CONTEXT:"HS_SEND_EMBED_CONTEXT",RECEIVE_FILTERED_STYLESHEETS:"RECEIVE_FILTERED_STYLESHEETS",SEND_STYLESHEETS:"SEND_STYLESHEETS",TRIGGER_CTA:"HS_CTA_TRIGGER_CTA",CTA_FORM_SUBMITTED:"HS_CTA_FORM_SUBMITTED",V4_FORM_READY:"HS_V4_FORM_READY",V4_RECAPTCHA_RENDER:"HS_V4_RECAPTCHA_RENDER",V4_RECAPTCHA_EXECUTE:"HS_V4_RECAPTCHA_EXECUTE",V4_RECAPTCHA_RESET:"HS_V4_RECAPTCHA_RESET",V4_RECAPTCHA_SUCCESS:"HS_V4_RECAPTCHA_SUCCESS",V4_RECAPTCHA_EXPIRED:"HS_V4_RECAPTCHA_EXPIRED",V4_RECAPTCHA_ERROR:"HS_V4_RECAPTCHA_ERROR",SEND_FORM_EXTRA_SUBMISSION_METADATA:"HS_SEND_FORM_EXTRA_SUBMISSION_METADATA",SEND_FORM_SUBMISSION_SUCCESS_INFO:"HS_SEND_FORM_SUBMISSION_SUCCESS_INFO",SEND_FORM_SUBMISSION_SUCCESS:"HS_SEND_FORM_SUBMISSION_SUCCESS",SEND_FORM_SUBMISSION_FAILED:"HS_SEND_FORM_SUBMISSION_FAILED",SEND_FORM_INTERACTION_NAVIGATE:"HS_SEND_FORM_INTERACTION_NAVIGATE",SEND_FORM_INTERACTION_NAVIGATE_NEXT:"HS_SEND_FORM_INTERACTION_NAVIGATE_NEXT",SEND_FORM_INTERACTION_NAVIGATE_PREVIOUS:"HS_SEND_FORM_INTERACTION_NAVIGATE_PREVIOUS",GET_FORM_FIELD_VALUES:"HS_GET_FORM_FIELD_VALUES",SEND_FORM_FIELD_VALUES:"HS_SEND_FORM_FIELD_VALUES",GET_FORM_SUBMISSION_METADATA:"HS_GET_FORM_SUBMISSION_METADATA",SEND_FORM_SUBMISSION_METADATA:"HS_SEND_FORM_SUBMISSION_METADATA",GET_FIELD_VALUE:"HS_GET_FIELD_VALUE",SET_FIELD_VALUE:"HS_SET_FIELD_VALUE",SEND_FIELD_VALUE:"HS_SEND_FIELD_VALUE",MEETINGS_BOOKING_SUCCESS:"HS_CTA_MEETINGS_BOOKING_SUCCESS"};function t(...e){if(window.location.search.indexOf("hs_debug_interactive")>-1||window.location.host.includes("local.hsappstatic")){console.log("[web-interactives-embed]",...e);window.location.search.indexOf("hs_is_selenium")>-1&&console.log(...[...e].map((e=>JSON.stringify(e))))}}class i{constructor(){this.listeners=new Map}on(e,t){if(!this.listeners.has(e)){this.listeners.set(e,[t]);return}const i=this.listeners.get(e);this.listeners.set(e,[...i,t])}off(e){this.listeners.delete(e)}emit(e,t){const i=this.listeners.get(e);i&&i.length&&i.forEach((e=>e(t)))}reset(){this.listeners=new Map}}function n(){return new i}const s=(...e)=>{t("[GlobalIframeCommunication]",...e)};class o{constructor(){this.iframeCommunicators=new Map;this.eventEmitter=n();this.reset=()=>{this.eventEmitter.reset();this.iframeCommunicators=new Map}}registerHandler(e,t){this.eventEmitter.on(e,t)}registerHandlers(e){s("Registering handlers",e);Object.keys(e).forEach((t=>{const i=t,n=e[i];n&&this.registerHandler(i,n)}))}registerCommunicator(e,t){s("Registering communicator",t);const i=this.iframeCommunicators.get(t)||[];this.iframeCommunicators.set(t,[...i,e])}removeCommunicator(e){s("Removing Iframe Communicator from GlobalCommunication: ",e);this.iframeCommunicators.delete(e)}emit(e,t){s("Emitting event",{event:e,messagePayload:t});this.eventEmitter.emit(e,t)}broadcast(e,t){const i=this.iframeCommunicators.get(e);if(i){s("Broadcasting",i);i.forEach((e=>{e.sendMessage(t)}))}else s("Cannot find communcators array, not broadcasting",e,t)}broadcastAll(e){s("Broadcasting",e,"to all",this.iframeCommunicators);for(const[t,i]of this.iframeCommunicators)this.broadcast(t,e)}}new o;class r{constructor(e,t){this.listeners=new Set;this.batching=!1;this.queue=[];this.subscribe=e=>{this.listeners.add(e);let t=()=>{};this.options&&this.options.onSubscribe&&(t=this.options.onSubscribe(e,this));return()=>{this.listeners.delete(e);t()}};this.setState=e=>{const t=this.state;this.options&&this.options.updateFn?this.state=this.options.updateFn(t)(e):this.state=e(t);if(this.state!==t){this.queue.push((()=>{this.listeners.forEach((e=>e(this.state,t)));this.options&&this.options.onUpdate&&this.options.onUpdate(this.state,t)}));this._flush()}};this._flush=()=>{if(!this.batching){this.queue.forEach((e=>e()));this.queue=[]}};this.batch=e=>{this.batching=!0;e();this.batching=!1;this._flush()};this.state=e;this.options=t}}class a{constructor(){this.storage=[]}enqueue(e){this.storage.push(e)}dequeue(){return this.storage.shift()}peek(){return this.storage[0]}size(){return this.storage.length}}function l(){return new a}const c="addIdentityListener";class h{constructor({applicationController:t}){this.trackerCallbacks=l();this.identityListenerCallbacks=l();this.parentAnalytics=null;this.handleAnalyticsRecieved=e=>{this.parentAnalytics=e;this.flushQueues()};this.handlePushToHSQ=t=>{if("function"!=typeof t){Array.isArray(t)&&(t[0]===c&&"function"==typeof t[1]?this.identityListenerCallbacks.enqueue(t[1]):this.applicationController.sendMessage({type:e.PROXY_ANALYTICS,payload:{analytics:t}}));this.parentAnalytics&&this.flushQueues()}else this.trackerCallbacks.enqueue(t)};window._hsq=window._hsq||[];this.applicationController=t;this.registerAnalyticsHandler();this.proxyHsq()}registerAnalyticsHandler(){this.applicationController.registerHandler(e.RECEIVED_ANALYTICS,this.handleAnalyticsRecieved)}flushQueues(){if(this.parentAnalytics){do{const e=this.trackerCallbacks.dequeue();e&&e(this.tracker)}while(this.trackerCallbacks.peek());do{const e=this.identityListenerCallbacks.dequeue();e&&e(this.parentAnalytics.hstc,this.parentAnalytics.hssc,this.parentAnalytics.hsfp)}while(this.identityListenerCallbacks.peek())}}get tracker(){return this.parentAnalytics?{path:this.parentAnalytics.path,referrerPath:this.parentAnalytics.referrerPath,utk:{visitor:this.parentAnalytics.hutk,get:()=>this.parentAnalytics.hutk},pageId:this.parentAnalytics.pageId,_getFingerprint:()=>this.parentAnalytics.hsfp,canonicalUrl:this.parentAnalytics.canonicalUrl,contentType:this.parentAnalytics.contentType,session:{get:()=>this.parentAnalytics.hssc}}:null}proxyHsq(){window._hsq.push=this.handlePushToHSQ;window._hsq.forEach(this.handlePushToHSQ)}}function d(e){window.open(e,"_blank","noopener")}function u(e){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",e):e()}const p="data-container-navigation-controller";function m(){return Array.from(document.getElementsByTagName("a"))}function E(e){let t;try{t=new URL(e)}catch(e){return!1}return"http:"===t.protocol||"https:"===t.protocol||"tel:"===t.protocol||"mailto:"===t.protocol}class g{constructor({applicationController:e}){this.overrideAnchorTags=()=>{new MutationObserver((()=>{m().forEach((e=>{if(!e.hasAttribute(p)){e.setAttribute(p,"true");e.addEventListener("click",this.handleAnchorClick)}}))})).observe(document.body,{childList:!0,subtree:!0});m().forEach((e=>{e.setAttribute(p,"true");e.addEventListener("click",this.handleAnchorClick)}))};this.handleAnchorClick=e=>{e.preventDefault();if(!e.target)return;const t=e.currentTarget,i=E(t.href);this.applicationController.onLinkClick(t);if(!i)return;const n="_blank"===t.target||"blank"===t.target;this.navigatePage(t.href,n)};this.applicationController=e;u(this.overrideAnchorTags)}navigatePage(t,i=!1){i&&d(t);this.applicationController.sendMessage({type:e.NAVIGATE_PAGE,payload:{url:t,openNewTab:i}})}}function S(e){new ResizeObserver(e).observe(document.body)}class C{constructor({applicationController:t}){this.listenForResize=()=>{S((()=>this.handleResize()))};this.getNewHeight=()=>document.body.getBoundingClientRect().height;this.handleResize=()=>{this.applicationController.sendMessage({type:e.NEW_HEIGHT,payload:{height:this.getNewHeight()}})};this.applicationController=t;u(this.listenForResize)}}const _="web-interactives-external-style";class y{constructor({applicationController:e}){this.handleExtractedStyles=({extractedStyles:e})=>{let t="";for(const[i,n]of Object.entries(e.rules)){t+=`${i} { `;for(const[e,i]of Object.entries(n))t+=`${e}: ${i}; `;t+="} "}for(const[i,n]of Object.entries(e.keyframes)){t+=`@keyframes ${i} { `;for(const e of n){t+=`${e.keyText} { `;for(const[i,n]of Object.entries(e.style))t+=`${i}: ${n}; `;t+="} "}t+="} "}this.styleElement.innerHTML=t};this.applicationController=e;this.styleElement=document.getElementById(_)||document.createElement("style");this.styleElement.id=_;this.registerExternalStylesHandler();u((()=>{document.head.appendChild(this.styleElement)}))}registerExternalStylesHandler(){this.applicationController.registerHandler(e.SEND_EXTRACTED_STYLES,this.handleExtractedStyles)}}class A{constructor({ContainerResizeControllerClass:t=C}={}){this.queue=l();this.gates=[];this.gatesHydrated=!1;this.gatedCallbackQueue=[];this.eventEmitter=n();this.initPort=t=>{if(t.data.type===e.INIT){this.port=t.ports[0];this.port.onmessage=this.handleMessage;window.removeEventListener("message",this.initPort);this.flushQueue()}};this.handleMessage=e=>{const t=e.data;this.receivedMessage(t);this.eventEmitter.emit(t.type,t.payload)};this.handleIfUngated=(e,t)=>{const i=()=>{this.isUngatedFor(e)&&t()};this.gatesHydrated?i():this.gatedCallbackQueue.push(i)};this.isUngatedFor=e=>this.gates.includes(e);this.listenForPort();this.setRegisterHandlers();this.analyticsController=new h({applicationController:this});this.navigationController=new g({applicationController:this});this.resizeController=new t({applicationController:this});this.externalStylesController=new y({applicationController:this})}listenForPort(){window.addEventListener("message",this.initPort)}setGates(e=[]){this.gates=e;this.gatesHydrated=!0;this.gatedCallbackQueue.forEach((e=>e()))}sendMessage(e){if(this.port)try{this.port.postMessage(e)}catch(t){console.warn("[ContainerApplicationController] Dropping non-serializable message",e,t)}else this.queue.enqueue(e)}fireContainerReady(){const t=this.getStartedMessagePayload();this.sendMessage({type:e.STARTED,payload:t})}navigatePage(e){this.navigationController.navigatePage(e)}setRegisterHandlers(){const e=this.registerMessageHandlers();Object.keys(e).forEach((t=>{const i=t,n=e[i];n&&this.registerHandler(i,n)}))}flushQueue(){do{const e=this.queue.dequeue();e&&this.sendMessage(e)}while(this.queue.peek())}registerHandler(e,t){this.eventEmitter.on(e,t)}receivedMessage(e){}registerMessageHandlers(){return{}}onLinkClick(e){}getStartedMessagePayload(){return{}}}const f="hubspotutk",T="__hstc",b="__hssc",I=e=>{const t=document.cookie.match(`(^|[^;]+)\\s*${e}\\s*=\\s*([^;]+)`);return t?t.pop():""},w=()=>I(f),F=()=>I(T),R=()=>I(b),N=(...e)=>{t("[models/Analytics]",...e)};class v{constructor(){this._handleFetchSucceded=e=>{this.store.setState((t=>{const i={};i.path=e.path;i.referrerPath=e.referrerPath;i.referrer="";i.analyticsPageId=e.pageId;i.hsfp=e._getFingerprint();i.canonicalUrl=e.canonicalUrl;i.contentType=e.contentType;i.pageId=v.getPageId()||e.pageId;e.session&&(i.hssc=e.session.get());if(e.utk){i.hstc=e.utk.get();i.hutk=e.utk.visitor}return Object.assign({},t,i,{isLoaded:!0})}))};window._hsq=window._hsq||[];const e={isLoaded:!1,pageUrl:window.location.href,pageTitle:window.document.title,referrer:window.document.referrer,userAgent:window.navigator.userAgent,hutk:w(),hssc:R(),hstc:F(),pageId:v.getPageId()};this.store=new r(e);this.fetchAnalytics()}fetchAnalytics(){this._analyticsQueue.push(this._handleFetchSucceded)}refresh(){const e=new Promise((e=>{this._analyticsQueue.push((t=>{this._handleFetchSucceded(t);e()}))})),t=new Promise((e=>setTimeout(e,100)));return Promise.race([e,t])}subscribe(e){return this.store.subscribe(e)}get analytics(){return this.store.state}track(e){N("Tracking analytics",e);this._analyticsQueue.push(e)}get _analyticsQueue(){return window._hsq}static getPageId(){const e=window.hsVars;return e&&e.analytics_page_id?e.analytics_page_id:e&&e.page_id?e.page_id:null}static getLanguage(){const e=window.hsVars;return e&&e.language?e.language:null}}new v;function O(e){const t=t=>{"Escape"===t.key&&e()};document.addEventListener("keydown",t);return()=>{document.removeEventListener("keydown",t)}}const M=["api","local","app","private","platform","tools","meetings","payments","mcp"],H=["hubspotstarter","hubspotfree","hubspotemail"],D=["growth"],L=["breeze"],U={com:["hubspot","hubteam","grader","getsignals","getsidekick","gettally","hubspotemail","customer-hub","hubspotservicehub","hubspotquote","hubspotdocuments","hubspotrecap","hs-data-privacy"].join("|"),net:H.join("|"),org:D.join("|"),ai:L.join("|")},x=function e(t){const i=new RegExp(`^(?!local|test|selenium)(.*\\.)?(${Object.entries(U).map((([e,t])=>`(?:${t})(qa)?\\.${e}`)).join("|")}|(?:connect)\\.com|(?:connect)(qa)\\.co|wthubspot\\.(com|de|es|fr|jp))$`),n=new RegExp("^(?:[^.]+)\\.(?:preview).app(-[a-z]+[0-9])?\\.hubspotqa\\.com"),s=new RegExp("^(?:[^.]+)\\.(?:local)\\.(app|tools|private)(-[a-z]+[0-9])?\\.(hubspot|hubteam)(qa)?\\.com"),o=new RegExp("^(?:[^.]+)\\.local(-[a-z]+[0-9])?\\.(hubspot|hubteam)(qa)?\\.com"),r=i.test(t.hostname),a=s.test(t.hostname)||o.test(t.hostname),l=n.test(t.hostname),c=r&&!a||l,h=new RegExp(`${Object.entries(U).map((([e,t])=>`(?:${t})qa\\.${e}`)).join("|")}|(?:connect)qa\\.co|wthubspot\\.(com|de|es|fr|jp)|hsqa-sales(?:crm)?-sub\\.com|(?:hubspotstarter|hubspotfree|hubspotemail)(qa)(?:-.*)\\.net|(?:hubspotemail)(qa)(?:-.*)\\.com`),d=[new RegExp(`^(?:${M.join("|")})-([a-z0-9]+)\\.(?:hubspot|hubteam)(?:qa)?\\.com`),new RegExp("^(.*).(?:hubspotquote)(?:qa)?.com"),new RegExp("^app-(.*).(?:hubspotdocuments)(?:qa)?.com"),new RegExp("^app-(.*).(?:hubspotrecap)(?:qa)?.com"),new RegExp("^artifacts-(.*).(?:breeze)(?:qa)?.ai"),new RegExp("^(?:[0-9]+).(.*).hs(?:qa)?-sales(?:crm)?-sub.com"),new RegExp("^(?:[a-zA-Z0-9-]+)\\.([a-z0-9]+)\\.hs(?:qa)?-sales(?:crm)?-sub\\.com"),new RegExp("^hs-(?:[0-9]+).s.(?:hubspotfree|hubspotstarter|hubspotemail)(?:qa)?-(.*).net"),new RegExp("^hs-(?:[0-9]+).s.(?:hubspotemail)(?:qa)?-(.*).com"),new RegExp("^t.sidekickopen(?:\\d)+-([a-z]+[0-9]).com"),new RegExp("^([a-z]+[0-9]).hs-data-privacy(?:qa)?.com"),new RegExp("^(?:[^.]+)\\.(?:preview|local)\\.app-([a-z]+[0-9])\\.hubspot(qa)?\\.com"),new RegExp("^(?:[^.]+)\\.local-([a-z]+[0-9])\\.(hubspot|hubteam)(qa)?\\.com")],u="ENV",p="Enviro error: the default argument for .get and .getShort is no longer supported",m=e=>{let t=window[e];if(null==t)try{t=window.sessionStorage.getItem(e)}catch(e){}if(null==t)try{t=window.localStorage.getItem(e)}catch(e){}return t},E=()=>{const e=m(u);return e||(h.test(t.host)?"qa":"prod")},g=(e,t)=>{window[e]=t;return t},S={prod:"production",qa:"development"},C=e=>{if("string"==typeof e){const t=e.toLowerCase();return S[t]||t}return e},_=e=>{e="string"==typeof e?e.toLowerCase():void 0;return Object.keys(S).find((t=>e===S[t]))||e},y=(e,t)=>{if(null!=t)throw new Error(p);let i=null;if(e){const t=e.split(".").reverse();for(let e=0;e{if(null!=t)throw new Error(p);return _(y(e))},T=f,b=e=>"prod"===T(e),I=e=>"qa"===T(e),w=()=>{const e=m("HUBLET");if(e)return e;for(const e of d)if(e.test(t.hostname))return e.exec(t.hostname)[1];return"na1"};function F({isNa1:e,isNonNa1:t},i){i||(i=w());return"na1"===i?"function"==typeof e?e(i):void 0:"function"==typeof t?t(i):void 0}return{createEnviro:e,debug:(e,t=!1)=>{let i;"string"==typeof e&&(i=m(`${e.toUpperCase()}_DEBUG`));null==i&&(i=m("DEBUG"));return null==i?t:i},denormalize:_,deployed:e=>{let t;"string"==typeof e&&(t=m(`${e.toUpperCase()}_DEPLOYED`));null==t&&(t=m("DEPLOYED"));return null==t?c:!!t},enabled:(e,t=!1)=>{let i=m(`${e.toUpperCase()}_ENABLED`);null==i&&(i=JSON.stringify(t));return"true"===`${i}`.toLowerCase()},get:y,getHublet:w,getInternal:f,getShort:T,isProd:b,isQa:I,ifHublet:F,normalize:C,set:A,setDebug:(e,t=!0)=>{if("string"==typeof e)try{t?localStorage.setItem(`${e.toUpperCase()}_DEBUG`,JSON.stringify(!0)):localStorage.removeItem(`${e.toUpperCase()}_DEBUG`)}catch(i){g(`${e.toUpperCase()}_DEBUG`,t||void 0)}else{t=null==e||e;try{t?localStorage.setItem("DEBUG",JSON.stringify(t)):localStorage.removeItem("DEBUG")}catch(e){g("DEBUG",t||void 0)}}}}};x(document.location);const k=async e=>{var t;if("undefined"==typeof navigator||null===(t=navigator.clipboard)||void 0===t||!t.writeText)return!1;try{await navigator.clipboard.writeText(e);return!0}catch(e){0;return!1}},P=e=>{const t=document.createElement("textarea");t.value=e;document.body.appendChild(t);try{t.select();t.setSelectionRange(0,e.length);document.execCommand("copy");return!0}catch(e){0;return!1}finally{document.body.removeChild(t)}};async function V(e){let t=await k(e);t||(t=P(e));return t}function q(e){return V(e).then((e=>{if(!e)throw new Error("Clipboard API not available")}))}const B=e=>null===e,G=e=>void 0===e,$=e=>"object"==typeof e,Y=e=>"string"==typeof e,z=e=>$(e)&&0===Object.keys(e).length,W=e=>Y(e)&&0===e.trim().length,j=e=>B(e)||G(e)||W(e)||z(e);function X(e,t,i){return new Promise(((n,s)=>{let o=0;const r=()=>{try{const t=e();n(t)}catch(e){o++;o>=t?s(e):setTimeout(r,i)}};r()}))}const Q="interactive-close-button-container";function K(){return document.getElementById(Q)}function J(){try{return Array.from(document.querySelectorAll("a[href*='closeInteractive()'"))}catch(e){return[]}}class Z{constructor({applicationController:e}){this.listenForCloseClick=()=>{const e=K();null==e||e.addEventListener("click",(()=>{this.applicationController.closeCTA()}));null==e||e.addEventListener("keypress",(e=>{"Enter"===e.key&&this.applicationController.closeCTA();"Space"===e.code&&this.applicationController.closeCTA()}));J().forEach((e=>{e.addEventListener("click",(()=>{this.applicationController.closeCTA()}))}))};this.applicationController=e;u(this.listenForCloseClick);u(this.addA11yAttributes)}addA11yAttributes(){const e=K();null==e||e.setAttribute("tabindex","0")}}function ee(e,t){if(!e||!e.parentElement)return null;const i=document.createElement(t);Array.from(e.attributes).forEach((e=>{i.setAttribute(e.name,e.value)}));i.innerHTML=e.innerHTML;e.parentElement.replaceChild(i,e);return i}const te=(...e)=>{t("[ContainerVideoController",...e)};class ie{constructor({applicationController:e}){this.updateHubspotPlayerContainerStyles=()=>{const e=document.querySelector(".hs-video-container"),t=document.querySelector(".hs-video-wrapper"),i=document.querySelector(".hs-video-wrapper iframe");if(!t||!i)return;this.videoFrame=i;this.videoWrapper=t;let n=Number(i.dataset.hsvHeight),s=Number(i.dataset.hsvWidth);const o=e.style.maxWidth;let r=this.determineMaxWidthContainer(t);if(o){const e=Number(o.replace("px",""));r=r?Math.min(r,e):e}s=s?Math.min(r,s):r;n=n||this.determineHeightFromWidth(s);e.style.margin="0";t.style.height="100%";t.style.paddingBottom="0px";i.style.position="static";s&&(i.style.width=`${s}px`);n&&(i.style.height=`${n}px`)};this.determineMaxWidthContainer=e=>{let t=e,i=0;for(;t&&!i;){t.clientWidth&&(i=t.clientWidth);t=t.parentElement}return i};this.determineHeightFromWidth=e=>{const t=this.videoWrapper.style.paddingBottom;if(t){return e*(Number(t.replace("%",""))/100)}return 0};this.updateOembedPlayerContainerStyles=()=>{const e=document.createElement("style"),t=document.querySelector(".oembed_container, .embed_container");if(!t)return;t.classList.add("with-alignment","hs-video-dimension-override");const i=t.querySelector(".iframe_wrapper"),n=i.querySelector("iframe");n&&(this.videoFrame=n);const s=Number(n.height)/Number(n.width);let o,r,a=this.determineMaxWidthContainer(t.parentElement);const l=a*s;if(t.classList.contains("oembed_container--full-size")){o=l;r=a}else{const e=i.dataset.maxHeight||i.dataset.height||n.height;o=e?Number(e):0;const l=i.dataset.maxWidth||i.dataset.width||n.width;r=l?Number(l):0;const c=t.style.maxWidth,h=t.style.maxHeight;if(c&&h){const e=Number(c.replace("px",""));a=a?Math.min(a,e):e;r=r?Math.min(a,Number(r)):a;o=r*s}r=r?Math.min(a,Number(r)):a}let c="";r&&(c=`width: ${r}px!important;`);o&&(c=`${c}height:${o}px!important;`);e.innerHTML=`\n .oembed_custom-thumbnail {\n ${c};\n padding-bottom: 0px !important;\n padding-top: 0px !important;\n }\n .hs-video-dimension-override .iframe_wrapper {\n padding-bottom: 0px !important;\n padding-top: 0px !important;\n max-width: 100%!important;\n ${c}\n }\n .hs-video-dimension-override iframe {\n ${c}\n padding-bottom: 0px !important;\n padding-top: 0px !important;\n max-width: 100%!important\n }\n `;document.head.appendChild(e)};this.handleClose=()=>{if(window.hsVideoApi&&"function"==typeof window.hsVideoApi.pauseAllPlayers)window.hsVideoApi.pauseAllPlayers();else if(this.videoFrame){const e=ee(this.videoFrame,"div");this.videoFrame=e}};this.handleShowing=()=>{if(this.videoFrame&&"DIV"===this.videoFrame.tagName){const e=ee(this.videoFrame,"iframe");this.videoFrame=e}};this.applicationController=e;this.listenForCloseEvent();this.listenForShowingEvent();u((()=>{if(this.needsStyleUpdate()){te("Using flex styling, so need to override relative styling for video");this.listenForVideoPlayer();this.updateOembedPlayerContainerStyles()}else te("No need to override relative styling for video");this.isHubspotVideo()||this.setOEmbedElements()}))}needsStyleUpdate(){const e=1e3;let t=0;const i=document.querySelector(".oembed_container, .embed_container, .hs-video-wrapper");if(!i)return!1;let n=i;for(;n&&te.includes("-flexbox-positioning"))))return!0;n=n.parentElement;t++}return!1}listenForCloseEvent(){this.applicationController.registerHandler(e.HAS_CLOSED,this.handleClose)}listenForShowingEvent(){this.applicationController.registerHandler(e.SHOWING_CTA,this.handleShowing)}listenForVideoPlayer(){window._hsVideoReady=window._hsVideoReady||[];window._hsVideoReady.push(this.updateHubspotPlayerContainerStyles)}setOEmbedElements(){if(this.videoFrame)return;const e=document.querySelector(".oembed_container, .embed_container");if(!e)return;const t=e.querySelector(".iframe_wrapper").querySelector("iframe");t&&(this.videoFrame=t)}isHubspotVideo(){return Boolean(window.hsVideoApi)}}class ne{constructor({applicationController:e}){this.handleClose=()=>{document.querySelectorAll("audio").forEach((e=>{e.pause()}))};this.applicationController=e;this.listenForCloseEvent()}listenForCloseEvent(){this.applicationController.registerHandler(e.HAS_CLOSED,this.handleClose)}}class se{constructor({applicationController:e}){this.allowedOrigin=null;this.applicationController=e;this.extractAllowedOrigin();this.listenForMeetingsSuccess()}extractAllowedOrigin(){const e=document.querySelector(".meetings-iframe-container");if(e){const t=e.getAttribute("data-src");if(t)try{const e=new URL(t);this.allowedOrigin=e.origin}catch(e){}}}listenForMeetingsSuccess(){window.addEventListener("message",(e=>{const t=e.data;this.allowedOrigin&&e.origin!==this.allowedOrigin||t&&t.meetingBookSucceeded&&t.meetingsPayload&&this.handleMeetingsSuccess(t.meetingsPayload)}))}handleMeetingsSuccess(t){this.applicationController.sendMessage({type:e.MEETINGS_BOOKING_SUCCESS,payload:t})}}var oe=" @media (max-width: 767px) {\n .row-depth-1 .row-fluid {\n width: 100%;\n flex-direction: column!important;\n }\n\n .row-depth-1 .row-fluid > .dnd-column {\n width: 100%;\n margin-left: 0;\n }\n\n .row-depth-1 .row-fluid > .dnd-column + .dnd-column {\n margin-top: 10px!important;\n }\n }\n";const re=(...e)=>{t("[ContainerVideoController",...e)};class ae{constructor({applicationController:t,handleResize:i}){this.handleSendStylesheets=()=>{const t={media:oe};re("Sending stylesheets",t);this.applicationController.sendMessage({type:e.SEND_STYLESHEETS,payload:{stylesheetsHtml:t}})};this.handleReceiveUpdatedStylesheets=e=>{re("Stylesheets updated",e);Object.keys(this.initialStylesheets).forEach((t=>{const i=document.querySelector(`style[data-hs-id="${t}"]`);i&&(i.innerHTML=e.stylesheets[t]||this.initialStylesheets[t])}));this.handleResize()};this.applicationController=t;this.initialStylesheets={media:""};this.createMediaQueryStyle();this.handleResize=i;this.listenForStylesheetUpdates()}init(){u(this.handleSendStylesheets)}listenForStylesheetUpdates(){this.applicationController.registerHandler(e.RECEIVE_FILTERED_STYLESHEETS,this.handleReceiveUpdatedStylesheets)}createMediaQueryStyle(){re("Adding media query stylesheet");const e=document.createElement("style");e.dataset.hsId="media";document.head.appendChild(e)}}class le extends C{constructor({applicationController:e}){super({applicationController:e});this.applicationController=e;const t=window.location.search.indexOf("enableResponsiveStyles")>-1;this.stylesheetSyncer=new ae({applicationController:this.applicationController,handleResize:this.handleResize});t&&this.stylesheetSyncer.init();this.listenForConfigs()}listenForConfigs(){this.applicationController.registerHandler(e.SEND_CTA_CONFIG,(e=>{e.containerStyles.useResponsiveStyling&&this.stylesheetSyncer.init();e.containerStyles.scaleHeightToFitContent||this.setBodyDimensions(e);this.hideScrollbar(e)}))}hideScrollbar(e){if(e.containerStyles.scaleHeightToFitContent||e.containerStyles.isSingleModuleOnly){const e=document.createElement("style");e.id="web-interactives-scroll-hide";e.innerHTML="body::-webkit-scrollbar{ display: none; }.body-wrapper::-webkit-scrollbar{ display: none; }";document.head.appendChild(e)}}setBodyDimensions(e){const t=e.containerStyles.height.value,i=e.containerStyles.width.value;if(window.frameElement){const e=getComputedStyle(window.frameElement);document.body.style.minHeight=`calc(${t}px - ${e.borderBottomWidth} - ${e.borderTopWidth})`;document.body.style.minWidth=`calc(${i}px - ${e.borderLeftWidth} - ${e.borderRightWidth})`}else{document.body.style.minHeight=`${t}px`;document.body.style.minWidth=`${i}px`}}}class ce{constructor({handleClose:e}){this.listenForClose=()=>{O(this.handleClose)};this.handleClose=e;this.listenForClose()}}const he=(...e)=>{t("[populateLinksWithTrackingParams]",...e)},de=["currentUrl","referrer","canon","canonicalUrl","pageUrl","contentType","encryptedPayload","pageId","analyticsPageId","hutk","hstc","hssc","hsfp","utk","containerType","webInteractiveId","webInteractiveContentId","audienceId","campaignGuid","campaignId","userAgent","timeStarted","timeFinished","redirectUrl","skip","includeInitial","pageTitle","contentGroupId","portalId","hsCtaAttrib"],ue=`https://${(new Date).getTime()}-dummy.com`,pe=(e,t)=>{let i,n=!1;try{i=new URL(e)}catch(t){he("[populateLinksWithTrackingParams]","Checking for relative URL",e);n=!0}if(n)try{i=new URL(`${ue}${e.startsWith("/"),""}${e}`)}catch(t){he("Could not parse url for link",t);return e}Object.entries(t).forEach((([e,t])=>{de.includes(e)?null!=t&&i.searchParams.set(e,String(t)):he("Invalid analytics parameter passed",e)}));const s=i.href;return n?s.replace(ue,""):s};var me=(e,t=[...document.querySelectorAll(".hs-web-interactive a")])=>{t.length&&t.forEach((t=>{const i=t.getAttribute("href");i&&!i.startsWith("javascript")&&t.setAttribute("href",pe(i,e))}))};const Ee="0-91";class ge{constructor({applicationController:t}){this.analyticsForForm={};this.listenForConfig=t=>{this.applicationController.registerHandler(e.SEND_CTA_CONFIG,(e=>{const{webInteractiveId:i,portalId:n}=e;t(Object.assign({},e,{callToActionId:this.getCallToActionId(i,n)}))}))};this.listenForAnalytics=t=>{this.applicationController.registerHandler(e.RECEIVED_ANALYTICS,(e=>t(this.extractAnalytics(e))))};this.handleFormReady=()=>{this.applicationController.fireContainerReady()};this.handleFormSubmit=({formId:t,conversionId:i,redirectUrl:n,submissionValues:s,shouldCloseCTAOnFormSubmission:o})=>{this.applicationController.sendMessage({type:e.CTA_FORM_SUBMITTED,payload:{formId:t,conversionId:i,submissionValues:s}});o?this.applicationController.closeCTA():n&&this.applicationController.navigatePage(n)};this.applicationController=t}extractAnalytics(e){return["hutk","canonicalUrl","contentType","pageId","path","referrerPath","referrer","pageUrl","pageTitle","userAgent"].reduce(((t,i)=>e[i]&&!j(e[i])?Object.assign({},t,{[i]:e[i]}):t),{})}getCallToActionId(e,t){return`${t}-${Ee}-${e}`}}function Se(){const e=document.querySelector('[class*="hs-content-id-"]');if(!e)return null;const t=e.className.match(/hs-content-id-(\d+)/);return t?Number(t[1]):null}function Ce(){const e=Se();try{const t=window.location.href.match(/hs-web-interactive-[^-]*-(\d+)/);if(!t)return!1;const i=Number(t[1]);return!isNaN(i)&&e!==i}catch(e){return!1}}function _e(){return document.body.dataset.hsContainerType}const ye="closeOnCTASubmission",Ae=(...e)=>{t("[ContainerFormControllerV3",...e)},fe={ON_FORM_SUBMITTED:"onFormSubmitted",ON_FORM_SUBMIT:"onFormSubmit",ON_FORM_READY:"onFormReady"},Te=5,be=200;class Ie extends ge{constructor(e){super(e);this.callToActionId="";this.isActiveAbTest=!1;this.isPersonalizationEnabled=!1;this.handleReceiveAnalytics=e=>{this.analyticsForForm=e};this.handleReceiveConfig=({pageUrl:e,pageTitle:t,pageId:i,callToActionId:n,hutk:s,isActiveAbTest:o,isPersonalizationEnabled:r})=>{this.callToActionId=n;e&&!this.analyticsForForm.pageUrl&&(this.analyticsForForm.pageUrl=e);t&&!this.analyticsForForm.pageTitle&&(this.analyticsForForm.pageTitle=t);i&&!this.analyticsForForm.pageId&&(this.analyticsForForm.pageId=i);s&&!this.analyticsForForm.hutk&&(this.analyticsForForm.hutk=s);this.isActiveAbTest=null!=o&&o;this.isPersonalizationEnabled=null!=r&&r};this.handlePresubmit=()=>{this.setFormContext()};this.initializeFormInstance();this.listenForConfig(this.handleReceiveConfig)}get shouldCloseOnCTASubmission(){var e;if("EMBED"===_e())return!1;return"true"===(null===(e=this.formInstance)||void 0===e?void 0:e.getMetaData(ye))}initializeFormInstance(){X((()=>{const e=window.HubSpotForms.getForms();if(0===e.length)throw new Error("No forms available");this.formInstance=e[0]}),Te,be).then((()=>{this.registerFormInstanceEvents();this.listenForAnalytics(this.handleReceiveAnalytics)})).catch((e=>{Ae("Failed to initialize form instance:",e)}))}registerFormInstanceEvents(){if(this.formInstance){this.formInstance.isFormReady?this.handleFormReady():this.formInstance.on(fe.ON_FORM_READY,this.handleFormReady);this.formInstance.on(fe.ON_FORM_SUBMITTED,((e,{redirectUrl:t,submissionValues:i})=>{this.handleFormSubmit({formId:this.getFormId(),redirectUrl:t,submissionValues:i,shouldCloseCTAOnFormSubmission:this.shouldCloseOnCTASubmission})}));this.formInstance.on(fe.ON_FORM_SUBMIT,this.handlePresubmit)}}setFormContext(){const e=this.callToActionId,t=Se(),i={callToActionId:e};(this.isActiveAbTest||this.isPersonalizationEnabled)&&Ce()&&t&&(i.callToActionContentId=t);this.formInstance.setContext(Object.assign({},this.formInstance.getContext(),this.analyticsForForm,{extraSubmissionMetadata:i,getExtraMetaDataBeforeSubmit:()=>i,__INTERNAL__CONTEXT:{disableRedirect:!0}}))}getFormId(){return this.formInstance?this.formInstance.id:""}}const we="HubSpotFormsV4",Fe={ON_FORM_READY:"hs-form-event:on-ready",ON_FORM_SUBMISSION_SUCCESS:"hs-form-event:on-submission:success"};class Re extends ge{constructor(e){super(e);this.extraSubmissionMetadata=[];this.handleReceiveConfig=({pageUrl:e,pageTitle:t,pageId:i,callToActionId:n,isActiveAbTest:s,isPersonalizationEnabled:o})=>{const r=Se(),a=Object.assign({callToActionId:n},this.analyticsForForm.pageUrl?{}:{pageUrl:e},this.analyticsForForm.pageTitle?{}:{pageTitle:t},this.analyticsForForm.pageId?{}:{pageId:i});(s||o)&&Ce()&&r&&(a.callToActionContentId=r);window[we]?this.setExtraSubmissionMetadata(a):this.extraSubmissionMetadata.push(a)};this.handleReceiveAnalytics=e=>{this.analyticsForForm=e;window[we]?this.setExtraSubmissionMetadata(e):this.extraSubmissionMetadata.push(e)};this.listenForGlobalEvents();this.listenForConfig(this.handleReceiveConfig)}listenForGlobalEvents(){this.listenForFormReady();this.listenForFormSubmissionSuccess()}listenForFormReady(){document.addEventListener(Fe.ON_FORM_READY,(()=>{this.handleFormReady();this.listenForAnalytics(this.handleReceiveAnalytics);this.flushExtraSubmissionMetadata()}))}listenForFormSubmissionSuccess(){document.addEventListener(Fe.ON_FORM_SUBMISSION_SUCCESS,(e=>{const{formId:t}=e.detail,i=window[we].getFormFromEvent(e);i.getFormFieldValues().then((e=>{this.handleFormSubmit({formId:t,conversionId:i.getConversionId(),redirectUrl:i.getRedirectUrl(),submissionValues:this.getSubmissionValues(e)})})).catch((()=>{}))}))}getSubmissionValues(e){return e.reduce(((e,{name:t,value:i})=>{e[t]="string"==typeof i?i:0===i.length?"":1===i.length?i[0]:i;return e}),{})}flushExtraSubmissionMetadata(){this.extraSubmissionMetadata.forEach((e=>this.setExtraSubmissionMetadata(e)));this.extraSubmissionMetadata=[]}setExtraSubmissionMetadata(e){const t=window;t[we]&&t[we].getForms()[0].setExtraSubmissionMetadata(e)}}class Ne{constructor(){this.isScreenshot()&&this.disableDialogs()}isScreenshot(){return new URLSearchParams(window.location.search).has("isScreenshot")}disableDialogs(){window.alert=()=>{};window.confirm=()=>!1;window.prompt=()=>"overriden"}}function ve(){return Boolean(window.HubSpotForms)}function Oe(){return Boolean(document.getElementsByClassName("hs-form-html")[0])}class Me extends A{constructor(){super({ContainerResizeControllerClass:le});this.shouldPopulateLinks=!0;this.closeCTA=()=>{this.sendMessage({type:e.CLOSE_INTERACTIVE,payload:{}})};this.overrideBodyHeight=()=>{document.body.style.height="fit-content"};this.closeButtonController=new Z({applicationController:this});u((()=>{this.setupForms();this.overrideBodyHeight()}));this.listenForConfigs();this.listenForAnalytics();this.keyPressController=new ce({handleClose:this.closeCTA});this.ContainerVideoController=new ie({applicationController:this});this.containerAudioController=new ne({applicationController:this});this.containerMeetingsController=new se({applicationController:this});this.containerScreenshotController=new Ne}triggerClickCTA(t){this.sendMessage({type:e.TRIGGER_CTA,payload:{triggerCTA:t}})}listenForConfigs(){this.registerHandler(e.SEND_CTA_CONFIG,(e=>{this.setGates(e.gates);if(e.shouldUseJsTracking){this.shouldPopulateLinks=!1;me({hsCtaAttrib:e.contentModelId})}else me({webInteractiveId:e.webInteractiveId,webInteractiveContentId:e.contentModelId,audienceId:e.audienceId,containerType:e.containerType,campaignId:e.campaignGuid,pageUrl:e.pageUrl,portalId:e.portalId},[...document.querySelectorAll("a")])}))}listenForAnalytics(){this.registerHandler(e.RECEIVED_ANALYTICS,(e=>{this.shouldPopulateLinks&&me(e)}))}setupForms(){Oe()?this.containerFormControllerV4=new Re({applicationController:this}):ve()?this.containerFormControllerV3=new Ie({applicationController:this}):this.fireContainerReady()}onLinkClick(e){e.dataset.ctaTrigger&&this.triggerClickCTA(parseInt(e.dataset.ctaTrigger,10));if(e.dataset.clickCopyValue)q(e.dataset.clickCopyValue);else if(e.parentNode&&e.parentNode.parentNode){const t=e.parentNode.parentNode;t&&t instanceof HTMLElement&&t.dataset.ctaTrigger&&this.triggerClickCTA(parseInt(t.dataset.ctaTrigger,10))}}getStartedMessagePayload(){return{contentId:Se(),containerStyles:window.hsInteractiveContainerStyles}}}function He(){return new Me}He()}(); //# sourceMappingURL=//static.hsappstatic.net/web-interactives-container/static-2.5800/bundles/project.js.map