if(typeof window.jQuery!=="undefined"){(function(global,$){"use strict";var modal={activeElement:undefined,lastActive:undefined,stackedElements:[],tabbableElements:"a[href], area[href], input:not([disabled]),"+"select:not([disabled]), textarea:not([disabled]),"+"button:not([disabled]), iframe, object, embed, *[tabindex],"+"*[contenteditable]",on:function(event,elements,callback){var i=0;if(typeof event!=="string"){throw new Error("Type error: `event` has to be a string")}if(typeof callback!=="function"){throw new Error("Type error: `callback` has to be a function")}if(!elements){return}if(!elements.length){elements=[elements]}for(;i=0;i--){if(modal.isElementVisible(nodeList[i])){return nodeList[i]}}}else{return lastTabbableElement}return null},isElementVisible:function(element){return!(element.offsetWidth===0&&element.offsetHeight===0)},setActive:function(element){modal.addClass(element,"is-active");modal.activeElement=element;modal.activeElement.setAttribute("aria-hidden","false");modal.setFocus(element.id);modal.trigger("cssmodal:show",modal.activeElement)},unsetActive:function(isStacked,shouldNotBeStacked){modal.removeClass(document.documentElement,"has-overlay");if(modal.activeElement){modal.removeClass(modal.activeElement,"is-active");modal.trigger("cssmodal:hide",modal.activeElement);modal.activeElement.setAttribute("aria-hidden","true");modal.removeFocus();if(isStacked&&!shouldNotBeStacked){modal.stackModal(modal.activeElement)}if(!isStacked&&modal.stackedElements.length>0){modal.unstackModal()}modal.activeElement=null}},stackModal:function(stackableModal){modal.addClass(stackableModal,"is-stacked");modal.stackedElements.push(modal.activeElement)},unstackModal:function(){var stackedCount=modal.stackedElements.length;var lastStacked=modal.stackedElements[stackedCount-1];modal.removeClass(lastStacked,"is-stacked");global.location.hash=lastStacked.id;modal.stackedElements.splice(stackedCount-1,1)},mainHandler:function(event,noHash){var hash=global.location.hash.replace("#","");var index=0;var tmp=[];var modalElement;var modalChild;if(noHash){hash=event.currentTarget.getAttribute("href").replace("#","")}modalElement=document.getElementById(hash);if(hash.indexOf("/")!==-1){tmp=hash.split("/");index=tmp.pop();hash=tmp.join("/");modalElement=document.getElementById(hash);if(!modalElement){throw new Error('ReferenceError: element "'+hash+'" does not exist!')}modalElement.index=1*index}if(modalElement){try{event.preventDefault()}catch(ex){event.returnValue=false}modalChild=modalElement.children[0];if(modalChild&&modalChild.className.match(/modal--inner/)){modal.unsetActive(!modal.hasClass(modalElement,"is-active"),modalElement.getAttribute("data-stackable")==="false");modal.addClass(document.documentElement,"has-overlay");modal._currentScrollPositionY=global.scrollY;modal._currentScrollPositionX=global.scrollX;modal.setActive(modalElement);modal.activeElement._noHash=noHash}}else{modal.unsetActive()}return true},injectIframes:function(){var iframes=document.querySelectorAll("[data-iframe-src]");var iframe;var i=0;for(;iiframeWidth){modalWidth=iframeWidth}else{modalWidth=viewport[0]-60}var modalHeight=viewport[1]-90;var modalInners=document.getElementsByClassName("modal--inner");var modalContents=document.getElementsByClassName("modal--content");var modalQuizContainers=document.getElementsByClassName("modal--quiz-container");for(var x=0;xmobileBreakpoint){modalInner.style.marginLeft=(modalWidth/-2).toString()+"px"}else{modalInner.style.marginLeft="0px"}var quizContainerHeight=parseInt(modalQuizContainer.style.height);var modalContentMinHeight=quizContainerHeight+40;if(quizContainerHeight&&modalContentMinHeight{let cookie=document.cookie;if(cookie!==lastCookie){try{callback({oldValue:lastCookie,newValue:cookie})}finally{lastCookie=cookie}}if(++x===10){window.clearInterval(intervalId)}},interval)};listenCookieChange(setCookies,1e3);var cssId="survey_css";if(!document.getElementById(cssId)){var head=document.getElementsByTagName("head")[0];var link=document.createElement("link");link.id=cssId;link.rel="stylesheet";link.type="text/css";link.href=HOST+"/s/css_embed";link.media="all";head.appendChild(link)}var Quiz=function(el,index){var frame;this.el=el;this.quizId=el.getAttribute("data-quiz");this.offset=el.getAttribute("data-offset");this.isPreview=!!el.getAttribute("data-preview");this.version=el.getAttribute("data-version");this.isAutoscroll=el.getAttribute("data-autoscroll");this.appendAttributes=el.getAttribute("data-append-attributes");if(!this.quizId)return null;this.index=index;this.quizUrl=this.buildQuizUrl();frame=this.frame=this.createFrame();this.render(frame)};Quiz.prototype.createFrame=function(){var frame=document.createElement("iframe");frame.setAttribute("height","100%");iframeId=iframePrefix+this.quizId;frame.setAttribute("id",iframeId);frame.setAttribute("width","100%");frame.setAttribute("allowFullScreen","true");frame.setAttribute("frameborder","0");frame.setAttribute("border","none");frame.setAttribute("scrolling","no");frame.setAttribute("style","width:100px; min-width:100%;*width: 100%;");frame.setAttribute("data-offset",this.offset||0);frame.setAttribute("data-autoscroll",this.isAutoscroll);frame.src=this.quizUrl;var appendAttributes=this.appendAttributes?parseAttributes(this.appendAttributes):[];if(appendAttributes.length>0){var appendAttributesLen=appendAttributes.length;for(var i=0;i=0&&rect.right>=0&&rect.top<=(window.innerHeight||document.documentElement.clientHeight)&&rect.left<=(window.innerWidth||document.documentElement.clientWidth)}})(window);