try { (function(){ var exports=exports||{};!function(t){exports.qs=t()}(function(){return function t(e,n,i){function r(s,a){if(!n[s]){if(!e[s]){var u="function"==typeof require&&require;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var l=new Error("Cannot find module '"+s+"'");throw l.code="MODULE_NOT_FOUND",l}var c=n[s]={exports:{}};e[s][0].call(c.exports,function(t){var n=e[s][1][t];return r(n?n:t)},c,c.exports,t,e,n,i)}return n[s].exports}for(var o="function"==typeof require&&require,s=0;s=0&&i.parseArrays&&a<=i.arrayLimit?(r=[],r[a]=t(e,n,i)):r[s]=t(e,n,i)}return r},a=function(t,e,n){if(t){var r=n.allowDots?t.replace(/\.([^\.\[]+)/g,"[$1]"):t,o=/^([^\[\]]*)/,a=/(\[[^\[\]]*\])/g,u=o.exec(r),l=[];if(u[1]){if(!n.plainObjects&&i.call(Object.prototype,u[1])&&!n.allowPrototypes)return;l.push(u[1])}for(var c=0;null!==(u=a.exec(r))&&c=48&&o<=57||o>=65&&o<=90||o>=97&&o<=122?n+=e.charAt(r):o<128?n+=i[o]:o<2048?n+=i[192|o>>6]+i[128|63&o]:o<55296||o>=57344?n+=i[224|o>>12]+i[128|o>>6&63]+i[128|63&o]:(r+=1,o=65536+((1023&o)<<10|1023&e.charCodeAt(r)),n+=i[240|o>>18]+i[128|o>>12&63]+i[128|o>>6&63]+i[128|63&o])}return n},n.compact=function(t,e){if("object"!=typeof t||null===t)return t;var i=e||[],r=i.indexOf(t);if(r!==-1)return i[r];if(i.push(t),Array.isArray(t)){for(var o=[],s=0;s=0;--s)o.push(n.slice(s).join("."));return o},i.cookie=o,n=e.exports=i},{"component-cookie":2,"component-url":3}],2:[function(t,e){function n(t,e,n){n=n||{};var i=s(t)+"="+s(e);null==e&&(n.maxage=-1),n.maxage&&(n.expires=new Date(+new Date+n.maxage)),n.path&&(i+="; path="+n.path),n.domain&&(i+="; domain="+n.domain),n.expires&&(i+="; expires="+n.expires.toUTCString()),n.secure&&(i+="; secure"),document.cookie=i}function i(){var t;try{t=document.cookie}catch(t){return"undefined"!=typeof console&&"function"==typeof console.error&&console.error(t.stack||t),{}}return o(t)}function r(t){return i()[t]}function o(t){var e,n={},i=t.split(/ *; */);if(""==i[0])return n;for(var r=0;r1){for(s=[],e=i=r=t.length-1;r<=1?i<=1:i>=1;e=r<=1?++i:--i)n=Math.floor(Math.random()*(e+1)),s.push((o=[t[n],t[e]],t[e]=o[0],t[n]=o[1],o));return s}},buildLogger:function(t,e){var n,i,r,o;i={silent:0,error:1,warn:2,info:3,debug:4},r={level:e||"warn"},n=function(e,n){return r[e]=function(){var o,s;if(n<=i[r.level]){o=Array.prototype.slice.apply(arguments),i[r.level]>3&&"performance"in window&&"now"in window.performance&&o.unshift("+"+Math.round(performance.now())+"ms"),o.unshift(t);try{return"undefined"!=typeof console&&null!==console&&null!=(s=console[e])?s.apply(console,o):void 0}catch(t){return console.log(e+" "+o.join(", "))}}}};for(e in i)o=i[e],n(e,o);return r},ajaxSimpleCors:function(t){var e,n,i,r;return e=t.body||{},i=(t.method||"GET").toUpperCase(),n="GET"===i||"POST"===i?i:(e._method=i,"POST"),r=new XMLHttpRequest,r.open(n,t.url,t.async),r.withCredentials=!!t.withCredentials,r.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),r.setRequestHeader("Accept","application/json"),t.callback&&(r.onload=function(){var e;return e=JSON.parse(r.responseText),e.redirect_url?(t.onRedirect&&t.onRedirect(e),exports.utils.ajaxSimpleCors({url:e.redirect_url,callback:t.callback,withCredentials:t.withCredentials})):t.callback(e)}),"GET"!==n?r.send(exports.qs.stringify(e,t.qsOpts)):r.send()},isBlank:function(t){return!t||/^\s*$/.test(t)}}}.call(this),function(t){exports.Cookies=t()}(function(){function t(){for(var t=0,e={};tthis.calcWindowWidth()?"portrait":"landscape"},e.prototype.isVisible=function(t){return!(!t||!(t.offsetWidth||t.offsetHeight||t.getClientRects().length))},e.prototype.reverseChildren=function(t){var e,n,i,r;for(r=[],n=e=0,i=t.childNodes.length-1;0<=i?e<=i:e>=i;n=0<=i?++e:--e)r.push(t.insertBefore(t.childNodes[n],t.firstChild));return r},e.prototype.getElement=function(t){return t instanceof HTMLElement?t:document.querySelector(t)},e}()}.call(this),function(){var t=Date.now||function(){return(new Date).getTime()},e=function(e,n,i){var r,o,s,a=null,u=0;i||(i={});var l=function(){u=i.leading===!1?0:t(),a=null,s=e.apply(r,o),a||(r=o=null)};return function(){var c=t();u||i.leading!==!1||(u=c);var d=n-(c-u);return r=this,o=arguments,d<=0||d>n?(a&&(clearTimeout(a),a=null),u=c,s=e.apply(r,o),a||(r=o=null)):a||i.trailing===!1||(a=setTimeout(l,d)),s}};exports.throttle=e}(),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};exports.TypingIndicator=function(){function e(e,n){this._bindTypingEvents=t(this._bindTypingEvents,this),this._handleWebSocketMessage=t(this._handleWebSocketMessage,this);var i;i=e.BROWSER_SUPPORT.features.webSocket&&e.BROWSER_SUPPORT.features.cors&&e.BROWSER_SUPPORT.features.json,i&&(this.$el=n.$el,this.config=e,this.pusherData=JSON.parse(this.$el.getAttribute("data-pusher")),this.ws=new WebSocket(this.pusherData.web_socket_url),this.ws.onmessage=this._handleWebSocketMessage)}return e.prototype._handleWebSocketMessage=function(t){var e;return e=JSON.parse(t.data),"string"==typeof e.data&&(e.data=JSON.parse(e.data)),"pusher_internal:subscription_succeeded"===e.event?this._bindTypingEvents():"pusher:connection_established"===e.event?exports.utils.ajaxSimpleCors({method:"POST",url:this.pusherData.auth_url,withCredentials:/^(staging|preprod)/.test(this.config.ENV),body:{survey_request_token:this.pusherData.survey_request_token,socket_id:e.data.socket_id,channel_name:this.pusherData.channel_name},callback:function(t){return function(e){var n;return n={event:"pusher:subscribe",data:{auth:e.auth,channel:t.pusherData.channel_name}},t.ws.send(JSON.stringify(n))}}(this)}):void 0},e.prototype._bindTypingEvents=function(){var t,e,n,i;return i=0,n=1e3,t=function(t){return function(){var e;if(!(i>=n))return e={event:"client-typing",channel:t.pusherData.channel_name,data:{survey_request_token:t.pusherData.survey_request_token}},t.ws.send(JSON.stringify(e)),i+=1}}(this),e=exports.throttle(t,2e3),exports.addEventListener(this.$el,"input",e)},e}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}};this.AdditionalQuestionsOptions=function(){function e(e){this._handleOptionSelected=t(this._handleOptionSelected,this);var n,i,r,o;if(this.dom=new exports.DomHelpers,this.$container=this.dom.getElement(e),this.$container){for(this.$options=this.$container.querySelectorAll("input"),o=this.$options,i=0,r=o.length;i '"+i+"'."),this.score&&(e=this.score),o=r+" -> "+i){case"toast -> question":return this._showQuestion();case"toast -> comment":return this._showComment(e);case"question -> toast":return this._hideQuestion();case"question -> comment":return this._showComment(e);case"comment -> question":return n.disableClearScoreOnHideComment||this._clearScore(),this._showQuestion();case"comment -> toast":return n.disableClearScoreOnHideComment||this._clearScore(),this._hideComment();default:return this.config.LOGGER.error("Cannot toggle '"+r+"' -> '"+i+"'.")}},e.prototype._getTemplate=function(t){var e;return e=function(e){return function(n){return e.token=n.token,t(n)}}(this),this.config.SURVEY_TEMPLATE?e(this.config.SURVEY_TEMPLATE):(this.config.TELEMETRY.instrument("GET_TEMPLATE_START",{token:this.opts.params._delighted_survey_request_token}),exports.utils.ajaxSimpleCors({method:"POST",url:this.config.SURVEY_URL,body:this.opts.params,withCredentials:/^(staging|preprod)/.test(this.config.ENV),callback:function(t){return function(n){return n.abort?(t.config.TELEMETRY.instrument("GET_TEMPLATE_ABORT",{reason:n.reason}),t.config.LOGGER.warn("Survey cancelled because "+n.reason+"."),null!=n.last_surveyed_timestamp?t.config.STATE_MANAGER.setLastSurveyedTimestamp(1e3*n.last_surveyed_timestamp,{token:n.last_surveyed_token}):void 0):(t.config.TELEMETRY.instrument("GET_TEMPLATE_OK",{token:n.token}),e(n))}}(this),onRedirect:function(t){return function(e){return t.config.TELEMETRY.instrument("GET_TEMPLATE_REDIRECT",{original_url:t.config.SURVEY_URL,redirect_url:e.redirect_url})}}(this)}))},e.prototype._remove=function(){return exports.requestAnimationFrame(function(t){return function(){return exports.utils.timeout(1e3*t.transitionDuration,function(){if(t.$root)return t.$root.parentNode.removeChild(t.$root),t.$root=null})}}(this))},e.prototype._removeModal=function(){return exports.requestAnimationFrame(function(t){return function(){return exports.utils.timeout(1e3*t.transitionDuration,function(){if(t.$rootModal)return t.$rootModal.parentNode.removeChild(t.$rootModal),t.$rootModal=null})}}(this))},e.prototype._injectTemplate=function(t){var e;return document.body.insertAdjacentHTML("beforeend",t.html),this.$root=document.querySelector("#delighted-web-"+t.id),this.$rootModal=document.querySelector("#delighted-web-modal-"+t.id),this.$survey=this.$root.querySelector(".delighted-web-survey"),this.$surveyInner=this.$root.querySelector(".delighted-web-survey-inner"),this.$surveyPowered=this.$root.querySelector(".delighted-web-survey-powered"),this.$surveyClose=this.$root.querySelector(".delighted-web-survey-close"),this.$stepQuestion=this.$root.querySelector(".delighted-web-step-question"),this.$stepComment=this.$root.querySelector(".delighted-web-step-comment"),this.$stepThanks=this.$root.querySelector(".delighted-web-step-thanks"),this.$stepAdditionalQuestion=this.$rootModal.querySelector(".delighted-web-aq-content"),this.$stepAdditionalQuestionClose=this.$rootModal.querySelector(".delighted-web-aq-close"),this.$surveyModalClose=this.$rootModal.querySelector(".delighted-web-survey-close"),e=this.$root.querySelector(".delighted-web-label-comment").getAttribute("data-text"),this._confirmationTextByScore=JSON.parse(e),this._setupMask()},e.prototype._measure=function(){return this.heightSurvey=this.$survey.offsetHeight,this.heightStepQuestion=this.$stepQuestion.offsetHeight,this.heightStepComment=this.$stepComment.offsetHeight,this.heightStepThanks=this.$stepThanks.offsetHeight},e.prototype._getScore=function(t){return{text:t.innerText,number:parseInt(t.getAttribute("data-score"),10)}},e.prototype._setScore=function(t){var e,n,i,r,o;if(t){for(this.score=t,o=this.$stepQuestion.querySelectorAll(".delighted-web-question-score-number"),n=0,i=o.length;n0?this.dom.setStyle(this.$root,"bottom",this.opts.offsets.bottom+"px"):this.dom.setStyle(this.$root,"overflow","visible")},e.prototype._computeMaskHeight=function(t){return t+16},e.prototype._resizeMask=function(t,e){var n,i,r,o;return null==e&&(e=!0),i=this.$root.offsetHeight,n=this._computeMaskHeight(t),r=n>i,o=function(t){return function(){return t.dom.setStyle(t.$root,"height",n+"px"),t._measure()}}(this),r||!e?o():exports.utils.timeout(1e3*this.transitionDuration,o)},e.prototype._disableMask=function(){return this.dom.setStyle(this.$root,"height","auto"),this.dom.setStyle(this.$root,"overflow","visible"),this.dom.setStyle(this.$root,"bottom",0)},e.prototype._setupTypingIndicator=function(){if(!this.opts.disableTypingIndicator&&!this.hasSetupTypingIndicator)return this.hasSetupTypingIndicator=!0,new exports.TypingIndicator(this.config,{$el:this.$stepComment.querySelector(".delighted-web-comment-box")})},e}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e=function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;exports.DisplayStrategyDesktop=function(n){function i(){this._autoSizeQuestionLabel=t(this._autoSizeQuestionLabel,this),this._animateBtns=t(this._animateBtns,this),this._resetBtnsAnimation=t(this._resetBtnsAnimation,this),this._setupEventHandlers=t(this._setupEventHandlers,this),this._injectTemplate=t(this._injectTemplate,this),this._showThanks=t(this._showThanks,this),this._showAdditionalQuestion=t(this._showAdditionalQuestion,this),this._hideComment=t(this._hideComment,this),this._showComment=t(this._showComment,this),this._showQuestion=t(this._showQuestion,this),this.hideModal=t(this.hideModal,this),this.hide=t(this.hide,this),this.show=t(this.show,this),i.__super__.constructor.apply(this,arguments),this.autoHideDelay=2*this.timingFactor,this.opacityTransitionDuration=.15*this.timingFactor,this.opacityTransitionEasing="ease-in-out"}return e(i,n),i.prototype.show=function(){return this._getTemplate(function(t){return function(e){return t._injectTemplate(e),t._measure(),t._setupEventHandlers(),t._showQuestion()}}(this))},i.prototype.hide=function(t){return null==t&&(t={}),this.state="hidden",exports.requestAnimationFrame(function(e){return function(){return e.hideModal(),e.dom.setOpacity(e.$survey,1),exports.requestAnimationFrame(function(){var n;return e.dom.transition(e.$survey,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s, opacity "+e.opacityTransitionDuration+"s "+e.opacityTransitionEasing+" "+(e.transitionDuration-e.opacityTransitionDuration)/5+"s"),e.dom.setOpacity(e.$survey,0),e.dom.translateY(e.$survey,e.heightSurvey),e._remove(),"function"==typeof(n=e.opts).onHide?n.onHide({token:e.token,source:t.source}):void 0})}}(this))},i.prototype.hideModal=function(){return exports.requestAnimationFrame(function(t){return function(){if(t.$rootModal)return t.dom.setOpacity(t.$rootModal,1),exports.requestAnimationFrame(function(){if(t.$rootModal)return t.dom.transition(t.$rootModal,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" "+(t.transitionDuration-t.opacityTransitionDuration)/5+"s"),t.dom.setOpacity(t.$rootModal,0),t._removeModal()})}}(this))},i.prototype._showQuestion=function(t){return"comment"===this.state?void this._hideComment():(this.state="question",exports.requestAnimationFrame(function(e){return function(){return e.$stepQuestion.classList.add("delighted-web-is-shown"),e._autoSizeQuestionLabel(),e._measure(),e.dom.setStyle(e.$root,"visibility","visible"),e.dom.transition(e.$survey,"none"),e.dom.translateY(e.$survey,e.heightSurvey),exports.requestAnimationFrame(function(){var n;return e.opts.disableShowAnimations||e.dom.transition(e.$survey,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s"),e.dom.setOpacity(e.$survey,1),e.dom.translateY(e.$survey,e.heightSurvey-e.heightStepQuestion),e.dom.translateY(e.$surveyPowered,-(e.heightSurvey-e.heightStepQuestion)),e._resizeMask(e.heightStepQuestion),e.opts.disableShowAnimations||e._animateBtns(),"function"==typeof(n=e.opts).onShow&&n.onShow({token:e.token}),"function"==typeof t?t():void 0})}}(this)))},i.prototype._showComment=function(t){return this.state="comment",exports.requestAnimationFrame(function(e){return function(){var n,i;return e._setScore(t),e.opts.disableShowCommentAnimations||e.dom.transition(e.$survey,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s"),e.dom.translateY(e.$survey,e.heightSurvey-e.heightStepQuestion-e.heightStepComment),e.opts.disableShowCommentAnimations||e.dom.transition(e.$surveyPowered,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s"),e.dom.translateY(e.$surveyPowered,-(e.heightSurvey-e.heightStepQuestion-e.heightStepComment)),e._resizeMask(e.heightStepQuestion+e.heightStepComment),i=e.opts.disableShowCommentAnimations?0:1e3*e.transitionDuration,exports.utils.timeout(i,function(){return e.$stepComment.querySelector(".delighted-web-comment-box").focus()}),e._pseudoFocusCommentBox(),e.$stepComment.querySelector(".delighted-web-comment-box").setAttribute("tabindex","0"),e.$stepComment.querySelector(".delighted-web-comment-submit").setAttribute("tabindex","0"),"function"==typeof(n=e.opts).onShowComment?n.onShowComment():void 0}}(this))},i.prototype._hideComment=function(){return"comment"!==this.state?void this.config.LOGGER.error("Must be in 'comment' state to hide comment (was '"+this.state+"')."):(this.state="question",exports.requestAnimationFrame(function(t){return function(){return t.$stepComment.querySelector(".delighted-web-comment-box").blur(),t.dom.transition(t.$survey,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$survey,t.heightSurvey-t.heightStepQuestion),t.dom.transition(t.$surveyPowered,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$surveyPowered,-(t.heightSurvey-t.heightStepQuestion)),t._resizeMask(t.heightStepQuestion)}}(this)))},i.prototype._showAdditionalQuestion=function(){return this.state="additional_question",exports.requestAnimationFrame(function(t){return function(){var e;return t.dom.setOpacity(t.$stepQuestion,1),t.dom.setOpacity(t.$stepComment,1),t.dom.setOpacity(t.$rootModal,0),t.dom.setStyle(t.$rootModal,"visibility","visible"),t._measure(),e=t.skipComment?0:t.heightStepComment,t.dom.transition(t.$survey,"none"),t.dom.translateY(t.$survey,t.heightSurvey-t.heightStepQuestion-e),t.dom.transition(t.$surveyPowered,"none"),t.dom.translateY(t.$surveyPowered,-(t.heightSurvey-t.heightStepQuestion-e)),exports.requestAnimationFrame(function(){return t.dom.transition(t.$rootModal,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" "+(t.transitionDuration-t.opacityTransitionDuration)/5+"s"),t.dom.setOpacity(t.$rootModal,1),t.dom.transition(t.$stepQuestion,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" 0s"),t.dom.setOpacity(t.$stepQuestion,0),t.dom.transition(t.$stepComment,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" 0s"),t.dom.setOpacity(t.$stepComment,0),t.dom.transition(t.$survey,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$survey,t.heightSurvey),t.dom.transition(t.$surveyPowered,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$surveyPowered,-t.heightSurvey),t._resizeMask(t.heightSurvey-t.heightStepQuestion-t.heightStepComment)})}}(this))},i.prototype._showThanks=function(){return this.state="thanks",exports.requestAnimationFrame(function(t){return function(){var e,n,i;return t.dom.setOpacity(t.$stepQuestion,1),t.dom.setOpacity(t.$stepComment,1),t.dom.setOpacity(t.$stepThanks,0),t.hideModal(),n=t.skipComment?0:t.heightStepComment,e=t.$stepThanks.querySelector(".delighted-web-thanks"),i=e.classList.contains("delighted-web-thanks-custom"),t.dom.setStyle(e,"display","block"),t._measure(),t.dom.transition(t.$survey,"none"),t.dom.translateY(t.$survey,t.heightSurvey-t.heightStepQuestion-n),t.dom.transition(t.$surveyPowered,"none"),t.dom.translateY(t.$surveyPowered,-(t.heightSurvey-t.heightStepQuestion-n)),i||(t.dom.setOpacity(t.$surveyPowered,1),t.dom.setOpacity(t.$surveyClose,1)),exports.requestAnimationFrame(function(){if(t.dom.transition(t.$stepQuestion,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" 0s"),t.dom.setOpacity(t.$stepQuestion,0),t.dom.transition(t.$stepComment,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" 0s"),t.dom.setOpacity(t.$stepComment,0),t.dom.transition(t.$stepThanks,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" 0s"),t.dom.setOpacity(t.$stepThanks,1),t.dom.translateY(t.$stepThanks,-(t.heightStepQuestion+t.heightStepComment)),t.dom.transition(t.$survey,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$survey,t.heightSurvey-t.heightStepThanks),t.dom.transition(t.$surveyPowered,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$surveyPowered,-(t.heightSurvey-t.heightStepThanks)),t._resizeMask(t.heightSurvey-t.heightStepQuestion-t.heightStepComment),!i)return t.dom.transition(t.$surveyPowered,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" 0s"),t.dom.setOpacity(t.$surveyPowered,0),t.dom.transition(t.$surveyClose,"opacity "+t.opacityTransitionDuration+"s "+t.opacityTransitionEasing+" 0s"),t.dom.setOpacity(t.$surveyClose,0),exports.utils.timeout(1e3*(t.transitionDuration+t.autoHideDelay),function(){return t.hide({source:"auto_hide"})})})}}(this))},i.prototype._injectTemplate=function(){if(i.__super__._injectTemplate.apply(this,arguments),this.dom.setStyle(this.$survey,"display","block"),this.$root.classList.add("delighted-web-desktop"),this.$rootModal.classList.add("delighted-web-desktop"),this.opts.darkBackground===!0)return this.$rootModal.classList.add("delighted-web-modal-dark")},i.prototype._setupEventHandlers=function(){var t,e;return i.__super__._setupEventHandlers.apply(this,arguments),this.dom.bindEvent(this.$root.querySelector(".delighted-web-label-question"),"click",function(t){return function(){return exports.requestAnimationFrame(function(){return t._resetBtnsAnimation(),exports.requestAnimationFrame(function(){return t._animateBtns()})})}}(this)),t=this.$stepComment.querySelector(".delighted-web-comment-box"),e=this.$root.querySelector(".delighted-web-label-comment"),this.dom.bindEvent(t,"input",function(n){return function(){var i;return i=""===t.value?"block":"none",n.dom.setStyle(e,"display",i)}}(this))},i.prototype._resetBtnsAnimation=function(){var t,e,n,i,r,o,s;if(this.config.BROWSER_SUPPORT.features.animation){for(e=this.$stepQuestion.querySelectorAll(".delighted-web-question-score-number"),n=e.length,s=[],r=i=0,o=e.length;i0?s:i-s,l.push(this.dom.setStyle(t,"animation","delighted-web-btn-anim "+r+"s linear "+(u*r/(i-1)).toFixed(3)+"s 1 normal both"));return l}},i.prototype._autoSizeQuestionLabel=function(){var t,e,n,i;return n=this.$root.querySelector(".delighted-web-question .delighted-web-column"),t=this.$root.querySelector(".delighted-web-label-question"),e=t.cloneNode(!0),this.dom.setStyle(e,"position","absolute"),this.dom.setStyle(e,"white-space","nowrap"),this.dom.setStyle(e,"opacity","0"),t.parentNode.appendChild(e),i=e.offsetWidth,t.parentNode.removeChild(e),i<650?this.dom.setStyle(n,"max-width","none"):this.dom.clearInlineStyle(n,"max-width")},i}(exports.DisplayStrategy)}.call(this),function(){var t,e,n,i=function(t,e){return function(){return t.apply(e,arguments)}};t=0,e=1,n=function(){function n(){this.disengage=i(this.disengage,this),this.engage=i(this.engage,this),this.inferState=i(this.inferState,this),this.isEngaged=!1,this.originals={}}return n.prototype.inferState=function(n){return n.config.BROWSER_SUPPORT.platform.isIos&&n.windowHeight<.94*n.availHeight?t:e},n.prototype.engage=function(t){var n;if(!this.isEngaged)return n=t===e?"100px":"101vh",this.originals.bodyHeight=document.body.style.height,this.originals.bodyOverflow=document.body.style.overflow,document.body.style.height=n,document.body.style.overflow="hidden",this.originals.htmlHeight=document.documentElement.style.height,this.originals.htmlOverflow=document.documentElement.style.overflow,document.documentElement.style.height=n,document.documentElement.style.overflow="hidden",this.originals.windowScrollX=scrollX,this.originals.windowScrollY=scrollY,window.scrollX=0,window.scrollY=0,this.isEngaged=!0},n.prototype.disengage=function(){if(this.isEngaged)return document.body.style.height=this.originals.bodyHeight,document.body.style.overflow=this.originals.bodyOverflow,document.documentElement.style.height=this.originals.htmlHeight,document.documentElement.style.overflow=this.originals.htmlOverflow,scrollTo(this.originals.windowScrollX,this.originals.windowScrollY),this.isEngaged=!1},n}(),exports.ScrollLock=new n}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e=function(t,e){function i(){this.constructor=t}for(var r in e)n.call(e,r)&&(t[r]=e[r]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;exports.DisplayStrategyTouch=function(n){function i(){this._optimizeCommentBoxHeight=t(this._optimizeCommentBoxHeight,this),this._computeMaskHeight=t(this._computeMaskHeight,this),this._inferScrollState=t(this._inferScrollState,this),this._setupEventHandlers=t(this._setupEventHandlers,this),this._measure=t(this._measure,this),this._injectTemplate=t(this._injectTemplate,this),this._hideToast=t(this._hideToast,this),this._showThanks=t(this._showThanks,this),this._showAdditionalQuestion=t(this._showAdditionalQuestion,this),this._hideComment=t(this._hideComment,this),this._showComment=t(this._showComment,this),this._hideQuestion=t(this._hideQuestion,this),this._showQuestion=t(this._showQuestion,this),this._showSurvey=t(this._showSurvey,this),this._hideSurvey=t(this._hideSurvey,this),this._showToast=t(this._showToast,this),this.hideModal=t(this.hideModal,this),this.hide=t(this.hide,this),this.show=t(this.show,this),i.__super__.constructor.apply(this,arguments),this.autoHideDelay=1.5*this.timingFactor}return e(i,n),i.prototype.show=function(){return this._getTemplate(function(t){return function(e){return t._injectTemplate(e),t._measure(),t._setupEventHandlers(),t._showToast()}}(this))},i.prototype.hide=function(t){return null==t&&(t={}),this.state="hidden",exports.requestAnimationFrame(function(e){return function(){var n;return e.hideModal(),e.opts.disableScrollLock||exports.ScrollLock.disengage(),e.dom.transition(e.$survey,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s"),e.dom.translateY(e.$survey,e.heightSurvey),e._remove(),"function"==typeof(n=e.opts).onHide?n.onHide({token:e.token,source:t.source}):void 0}}(this))},i.prototype.hideModal=function(){return this._removeModal()},i.prototype._showToast=function(){return this.state="toast",exports.requestAnimationFrame(function(t){return function(){return t.dom.setStyle(t.$root,"visibility","visible"),t.dom.translateY(t.$toast,t.heightToast),exports.requestAnimationFrame(function(){var e;return t.opts.disableShowAnimations||t.dom.transition(t.$toast,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$toast,0),t._resizeMask(t.heightToast),"function"==typeof(e=t.opts).onShow?e.onShow({token:t.token}):void 0})}}(this))},i.prototype._hideSurvey=function(t){return window.clearTimeout(this.showSurveyTimeout),this.surveyShowing=!1,exports.requestAnimationFrame(function(e){return function(){return e.dom.setStyle(e.$toast,"display","block"),e.dom.translateY(e.$toast,0),e.dom.transition(e.$survey,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s"),e.dom.translateY(e.$survey,e.heightSurvey),e._resizeMask(e.heightToast),"function"==typeof t?t():void 0}}(this))},i.prototype._showSurvey=function(t){return this.surveyShowing?"function"==typeof t?t():void 0:(this.surveyShowing=!0,exports.requestAnimationFrame(function(e){return function(){var n;return n=e._inferScrollState(),e.dom.setStyle(e.$survey,"display","block"),e._measure(),e.dom.transition(e.$toast,"none"),e.dom.translateY(e.$toast,0),e.dom.transition(e.$survey,"none"),e.dom.translateY(e.$survey,e.heightSurvey),exports.requestAnimationFrame(function(){var i;return e.dom.transition(e.$toast,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s"),e.dom.translateY(e.$toast,e.heightToast),e.dom.transition(e.$survey,"transform "+e.transitionDuration+"s "+e.transitionEasing+" 0s"),e.dom.translateY(e.$survey,0),e._disableMask(),i=1e3*e.transitionDuration,e.showSurveyTimeout=exports.utils.timeout(i,function(){return e.opts.disableScrollLock||exports.ScrollLock.engage(n),e.dom.setStyle(e.$toast,"display","none"),"function"==typeof t?t():void 0})})}}(this)))},i.prototype._showQuestion=function(t){return this.state="question",exports.requestAnimationFrame(function(e){return function(){return e.$surveyInner.classList.add("delighted-web-is-questioning"),e.$surveyInner.classList.remove("delighted-web-is-commenting"),e.$surveyInner.classList.remove("delighted-web-is-thanking"),e.$stepQuestion.classList.add("delighted-web-is-shown"),e.$stepComment.classList.remove("delighted-web-is-shown"),e.$stepThanks.classList.remove("delighted-web-is-shown"),e.dom.setStyle(e.$stepQuestion,"display","flex"),e.dom.setStyle(e.$stepComment,"display","none"),e.dom.setStyle(e.$stepThanks,"display","none"),e.$stepQuestion.setAttribute("aria-hidden","false"),e.$stepComment.setAttribute("aria-hidden","true"),e.$stepAdditionalQuestion.setAttribute("aria-hidden","true"),e.$stepThanks.setAttribute("aria-hidden","true"),e._showSurvey(t)}}(this))},i.prototype._hideQuestion=function(){return"question"!==this.state?void this.config.LOGGER.error("Must be in 'question' state to hide question (was '"+this.state+"')."):(this.state="toast",this._hideSurvey(function(t){return function(){return t.$surveyInner.classList.remove("delighted-web-is-questioning"),t.$surveyInner.classList.remove("delighted-web-is-commenting"),t.$surveyInner.classList.remove("delighted-web-is-thanking"),t.$stepQuestion.classList.remove("delighted-web-is-shown"),t.$stepComment.classList.remove("delighted-web-is-shown"),t.$stepThanks.classList.remove("delighted-web-is-shown"),t.dom.setStyle(t.$stepQuestion,"display","none"),t.dom.setStyle(t.$stepComment,"display","none"),t.dom.setStyle(t.$stepThanks,"display","none")}}(this)))},i.prototype._showComment=function(t){return this.state="comment",this._setScore(t),this._optimizeCommentBoxHeight(),this.dom.setStyle(this.$stepQuestion,"display","none"),this.dom.setStyle(this.$stepComment,"display","block"),this.dom.setStyle(this.$stepThanks,"display","none"),this.$stepComment.setAttribute("aria-hidden","false"),this._measure(),this.$surveyInner.classList.remove("delighted-web-is-questioning"),this.$surveyInner.classList.add("delighted-web-is-commenting"),this.$surveyInner.classList.remove("delighted-web-is-thanking"),this.$stepComment.querySelector(".delighted-web-comment-box").focus(),this._showSurvey(this.opts.onShowComment)},i.prototype._hideComment=function(){return"comment"!==this.state?void this.config.LOGGER.error("Must be in 'comment' state to hide comment (was '"+this.state+"')."):(this.state="toast",this._hideSurvey(function(t){return function(){return t.$surveyInner.classList.remove("delighted-web-is-questioning"),t.$surveyInner.classList.remove("delighted-web-is-commenting"),t.$surveyInner.classList.remove("delighted-web-is-thanking"),t.$stepQuestion.classList.remove("delighted-web-is-shown"),t.$stepComment.classList.remove("delighted-web-is-shown"),t.$stepThanks.classList.remove("delighted-web-is-shown"),t.dom.setStyle(t.$stepQuestion,"display","none"),t.dom.setStyle(t.$stepComment,"display","none"),t.dom.setStyle(t.$stepThanks,"display","none")}}(this)))},i.prototype._showAdditionalQuestion=function(){return this.state="additional_question",exports.requestAnimationFrame(function(t){return function(){return t.dom.setStyle(t.$root,"display","none"),t.dom.setStyle(t.$rootModal,"display","block"),t.dom.setStyle(t.$rootModal,"visibility","visible"),t.$stepQuestion.setAttribute("aria-hidden","true"),t.$stepComment.setAttribute("aria-hidden","true"),t.$stepAdditionalQuestion.setAttribute("aria-hidden","false"),t.$stepThanks.setAttribute("aria-hidden","true")}}(this))},i.prototype._showThanks=function(){return this.state="thanks",exports.requestAnimationFrame(function(t){return function(){var e,n;if(t.dom.setStyle(t.$root,"display","block"),t.dom.setStyle(t.$rootModal,"display","none"),t.dom.setStyle(t.$stepQuestion,"display","none"),t.dom.setStyle(t.$stepComment,"display","none"),t.dom.setStyle(t.$stepThanks,"display","flex"),t._removeModal(),t.$surveyInner.classList.remove("delighted-web-is-commenting"),t.$surveyInner.classList.add("delighted-web-is-thanking"),t.$stepQuestion.setAttribute("aria-hidden","true"),t.$stepComment.setAttribute("aria-hidden","true"),t.$stepAdditionalQuestion.setAttribute("aria-hidden","true"),t.$stepThanks.setAttribute("aria-hidden","false"),e=t.$stepThanks.querySelector(".delighted-web-thanks"),n=e.classList.contains("delighted-web-thanks-custom"),t.dom.setStyle(e,"display","block"),t._measure(),!n)return t.dom.setOpacity(t.$surveyClose,1),exports.requestAnimationFrame(function(){return t.dom.transition(t.$surveyClose,"opacity "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.setOpacity(t.$surveyClose,0),exports.utils.timeout(1e3*(t.transitionDuration+t.autoHideDelay),function(){return t.hide({source:"auto_hide"})})})}}(this))},i.prototype._hideToast=function(){return this.state="initial",exports.requestAnimationFrame(function(t){return function(){return t.dom.transition(t.$toast,"transform "+t.transitionDuration+"s "+t.transitionEasing+" 0s"),t.dom.translateY(t.$toast,t.heightToast)}}(this))},i.prototype._injectTemplate=function(){return i.__super__._injectTemplate.apply(this,arguments),this.$toast=this.$root.querySelector(".delighted-web-toast"),this.$toastClose=this.$root.querySelector(".delighted-web-toast-close"),this.dom.setStyle(this.$toast,"display","block"),this.opts.offsets.top&&this.dom.setStyle(this.$surveyInner,"margin-top",this.opts.offsets.top+"px"),this.opts.offsets.top&&this.dom.setStyle(this.$surveyClose,"margin-top",this.opts.offsets.top+"px"),"asc"===this.opts.mobileScoreOrdering&&this.dom.reverseChildren(this.$root.querySelector(".delighted-web-question-score-numbers")),this.$root.classList.add("delighted-web-touch"),this.$rootModal.classList.add("delighted-web-touch")},i.prototype._measure=function(){return i.__super__._measure.apply(this,arguments),this.widthToast=this.$toast.offsetWidth,this.widthToastClose=this.$toastClose.offsetWidth,this.heightToast=this.$toast.offsetHeight},i.prototype._setupEventHandlers=function(){return i.__super__._setupEventHandlers.apply(this,arguments),this.dom.bindEvent(this.$toast,"click",function(t){return function(e){var n;return t._measure(),e.clientX