!function(){var n,t={};function e(){}function r(n){return n}function i(n){return!!n}function o(n){return!n}var u="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;function c(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function a(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}null!=u&&(n=u.async),t.noConflict=function(){return u.async=n,t};var s=Object.prototype.toString,l=Array.isArray||function(n){return"[object Array]"===s.call(n)};function f(n){return l(n)||"number"==typeof n.length&&n.length>=0&&n.length%1==0}function p(n,t){for(var e=-1,r=n.length;++e3?n(r,i,a,c):(u=o,o=i,n(r,a,c))}}function A(n,t){return t}function C(n,t,r){r=r||e;var i=f(t)?[]:{};n(t,function(n,t,e){n(b(function(n,r){r.length<=1&&(r=r[0]),i[t]=r,e(n)}))},function(n){r(n,i)})}function z(n,t,e,r){var i=[];n(t,function(n,t,r){e(n,function(n,t){i=i.concat(t||[]),r(n)})},function(n){r(n,i)})}function V(n,r,i){if(null==r)r=1;else if(0===r)throw new Error("Concurrency must not be zero");function o(n,r,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");if(n.started=!0,l(r)||(r=[r]),0===r.length&&n.idle())return t.setImmediate(function(){n.drain()});p(r,function(t){var r={data:t,callback:o||e};i?n.tasks.unshift(r):n.tasks.push(r),n.tasks.length===n.concurrency&&n.saturated()}),t.setImmediate(n.process)}function u(n,t){return function(){a-=1;var e=arguments;p(t,function(n){n.callback.apply(n,e)}),n.tasks.length+a===0&&n.drain(),n.process()}}var a=0,s={tasks:[],concurrency:r,payload:i,saturated:e,empty:e,drain:e,started:!1,paused:!1,push:function(n,t){o(s,n,!1,t)},kill:function(){s.drain=e,s.tasks=[]},unshift:function(n,t){o(s,n,!0,t)},process:function(){if(!s.paused&&a=i&&r(null)}!function(n,t){f(n)?p(n,t):m(n,t)}(n,function(e,r){t(n[r],r,c(u))})},t.forEachOfSeries=t.eachOfSeries=function(n,r,i){i=a(i||e);var o=g(n=n||[]),u=o();!function e(){var a=!0;if(null===u)return i(null);r(n[u],u,c(function(n){if(n)i(n);else{if(null===(u=o()))return i(null);a?t.nextTick(e):e()}})),a=!1}()},t.forEachOfLimit=t.eachOfLimit=function(n,t,e,r){Q(t)(n,e,r)},t.map=x(O),t.mapSeries=T(O),t.mapLimit=S(O),t.inject=t.foldl=t.reduce=function(n,e,r,i){t.eachOfSeries(n,function(n,t,i){r(e,n,function(n,t){e=t,i(n)})},function(n){i(n||null,e)})},t.foldr=t.reduceRight=function(n,e,r,i){var o=h(n,function(n){return n}).reverse();t.reduce(o,e,r,i)},t.select=t.filter=x(E),t.selectLimit=t.filterLimit=S(E),t.selectSeries=t.filterSeries=T(E),t.reject=x(L),t.rejectLimit=S(L),t.rejectSeries=T(L),t.any=t.some=I(t.eachOf,i,r),t.someLimit=I(t.eachOfLimit,i,r),t.all=t.every=I(t.eachOf,o,o),t.everyLimit=I(t.eachOfLimit,o,o),t.detect=I(t.eachOf,r,A),t.detectSeries=I(t.eachOfSeries,r,A),t.sortBy=function(n,e,r){function i(n,t){var e=n.criteria,r=t.criteria;return er?1:0}t.map(n,function(n,t){e(n,function(e,r){e?t(e):t(null,{value:n,criteria:r})})},function(n,t){if(n)return r(n);r(null,h(t.sort(i),function(n){return n.value}))})},t.auto=function(n,r){r=a(r||e);var i=v(n),o=i.length;if(!o)return r(null);var u={},c=[];function s(n){c.unshift(n)}function f(){o--,p(c.slice(0),function(n){n()})}s(function(){o||r(null,u)}),p(i,function(e){for(var i,o=l(n[e])?n[e]:[n[e]],a=b(function(n,i){if(i.length<=1&&(i=i[0]),n){var o={};m(u,function(n,t){o[t]=n}),o[e]=i,r(n,o)}else u[e]=i,t.setImmediate(f)}),h=o.slice(0,o.length-1),y=h.length;y--;){if(!(i=n[h[y]]))throw new Error("Has inexistant dependency");if(l(i)&&d(i,e)>=0)throw new Error("Has cyclic dependencies")}function v(){return n=function(n,t){return n&&u.hasOwnProperty(t)},t=!0,p(h,function(e,r,i){t=n(t,e,r,i)}),t&&!u.hasOwnProperty(e);var n,t}v()?o[o.length-1](a,u):s(function n(){v()&&((t=d(c,n))>=0&&c.splice(t,1),o[o.length-1](a,u));var t})})},t.retry=function(n,e,r){var i=5,o=0,u=[],c={times:i,interval:o};var a=arguments.length;if(a<1||a>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");function s(n,e){function r(n,t){return function(r){n(function(n,e){r(!n||t,{err:n,result:e})},e)}}function i(n){return function(t){setTimeout(function(){t(null)},n)}}for(;c.times;){var o=!(c.times-=1);u.push(r(c.task,o)),!o&&c.interval>0&&u.push(i(c.interval))}t.series(u,function(t,e){e=e[e.length-1],(n||c.callback)(e.err,e.result)})}return a<=2&&"function"==typeof n&&(r=e,e=n),"function"!=typeof n&&function(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}(c,n),c.callback=r,c.task=e,c.callback?s():s},t.waterfall=function(n,r){if(r=a(r||e),!l(n)){var i=new Error("First argument to waterfall must be an array of functions");return r(i)}if(!n.length)return r();!function n(t){return b(function(e,i){if(e)r.apply(null,[e].concat(i));else{var o=t.next();o?i.push(n(o)):i.push(r),N(t).apply(null,i)}})}(t.iterator(n))()},t.parallel=function(n,e){C(t.eachOf,n,e)},t.parallelLimit=function(n,t,e){C(Q(t),n,e)},t.series=function(n,e){C(t.eachOfSeries,n,e)},t.iterator=function(n){return function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e>>1);e(t,n[o])>=0?r=o:i=o-1}return r}(n.tasks,c,i)+1,0,c),n.tasks.length===n.concurrency&&n.saturated(),t.setImmediate(n.process)})}(o,n,r,u)},delete o.unshift,o},t.cargo=function(n,t){return V(n,1,t)},t.log=_("log"),t.dir=_("dir"),t.memoize=function(n,e){var r={},i={};e=e||function(n){return n};var o=b(function(o){var u=o.pop(),c=e.apply(null,o);c in r?t.nextTick(function(){u.apply(null,r[c])}):c in i?i[c].push(u):(i[c]=[u],n.apply(null,o.concat([b(function(n){r[c]=n;var t=i[c];delete i[c];for(var e=0,o=t.length;e/g)||[]).join("");const e=/<\/?([a-z0-9]*)\b[^>]*>?/gi,r=/|<\?(?:php)?[\s\S]*?\?>/gi;let i=_phpCastString(n);for(i="<"===i.substring(i.length-1)?i.substring(0,i.length-1):i;;){if(i===(i=i.replace(r,"").replace(e,function(n,e){return t.indexOf("<"+e.toLowerCase()+">")>-1?n:""})))return i}}function renderStatement(n){n=stripTags(n),jQuery(".chat-container").append('

'+n+"

")}function showTyping(){jQuery(".chat-container").append('

')}function hideTyping(){jQuery(".typing-wrapper").remove()}const chatWrapper=jQuery(".bot-chat-wrapper");function scrollToBottom(){chatWrapper.animate({scrollTop:600},"slow")}function inputError(n){jQuery(".bot-error p").text(n),jQuery(".bot-error").animate({bottom:"20px"},500).delay(3e3).animate({bottom:"-70px"},500)}function checkInput(n){let t=jQuery(".bot-container input[type=text]").val();return(t=stripTags(t)).length>2?showResponse(n):inputError(botVars.validationName),!1}function checkEmail(n){const t=jQuery(".bot-container input[type=email]").val(),e=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(String(t.toLowerCase()));if(t.length>7&&!0===e){const t="action=wpmm_add_subscriber&"+jQuery(".bot_subscribe_form").serialize();jQuery.post(wpmmVars.ajaxURL,t,function(n){if(!n.success)return alert(n.data),!1},"json"),showResponse(n)}else inputError(botVars.validationEmail);return!1}function clearChat(){jQuery(".chat-container").empty()}function clearFooter(){jQuery(".choices").empty(),jQuery(".input").empty()}function startConversation(n,t){if(conversationStarted)return!1;conversationStarted=!0,clearFooter(),clearChat(),conversationPos=n,jQuery.getScript(botVars.uploadsBaseUrl+"data.js",function(n){showStatement(t)})}function showStatement(n){const t=conversationData[conversationPos][n];let e;"sideeffect"in t&&jQuery.type("function"===t.sideeffect)&&t.sideeffect(context),"array"===jQuery.type(t.statement)?e=t.statement:"string"===jQuery.type(t.statement)?e=[t.statement]:"function"===jQuery.type(t.statement)&&(e=t.statement(context)),1.5!==n&&1.6!==n||jQuery(".avatar-notice").remove(),async.eachSeries(e,function(n,t){showTyping(),scrollToBottom();let e=900;!DEBUG&&jQuery(".bot-chat-wrapper")[0]||(e=0),setTimeout(function(){hideTyping(),renderStatement(n),scrollToBottom(),t()},e)},function(n){if("options"in t){jQuery(".input").hide(),jQuery(".choices").show();const n=t.options;n.length>0&&setTimeout(function(){for(let e=0;e",{text:r.choice,class:"chat-message user",click:t}).appendTo(".choices")}},750)}else if("input"in t){jQuery(".input").show(),jQuery(".choices").hide();var e=t.input,r=jQuery("
",{submit:checkInput.bind(null,e)}),i=jQuery("

",{class:"chat-message user"}).appendTo(r),o=jQuery("",{type:"text",placeholder:botVars.typeName,name:e.name,autocomplete:"off",required:!0}).appendTo(i);jQuery("",{text:botVars.send,click:checkInput.bind(null,e)}).appendTo(i);r.appendTo(".input"),async.nextTick(function(){o.focus()})}else if("email"in t){jQuery(".input").show(),jQuery(".choices").hide();e=t.email,r=jQuery("",{class:"bot_subscribe_form",submit:checkEmail.bind(null,e)}),i=jQuery("

",{class:"chat-message user"}).appendTo(r),o=jQuery("",{type:"hidden",name:"_wpnonce",value:botVars.wpnonce}).appendTo(i),o=jQuery("",{type:"email",placeholder:botVars.typeEmail,name:e.email,autocomplete:"off"}).appendTo(i),jQuery("",{text:botVars.send,click:checkEmail.bind(null,e)}).appendTo(i);r.appendTo(".input"),async.nextTick(function(){o.focus()})}scrollToBottom()})}function showResponse(n){let t="";"name"in n?(context[n.name]=jQuery(".bot-container input[type=text]").val(),t=context[n.name]):"email"in n?(context[n.email]=jQuery(".bot-container input[type=email]").val(),t=context[n.email]):t=n.choice,clearFooter(),t=stripTags(t),jQuery(".chat-container").append('

'+t+"

"),"consequence"in n&&showStatement(n.consequence)}let isOpen=!1;jQuery(".bot-avatar").on("click",function(){const n=jQuery(".bot-chat-wrapper")[0];isOpen||(isOpen=!0,startConversation("homepage",1)),"none"!==n.style.display?(jQuery(".avatar-notice").show(),jQuery(".bot-chat-wrapper").hide()):(jQuery(".bot-chat-wrapper").show(),jQuery(".avatar-notice").hide())});