apxor-qe 2.0.6 → 2.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],t):(e=e||self)["apxor-qe"]=t(e.Apxor)}(this,(function(e){"use strict";function t(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,i)}return n}function n(e){for(var n=1;n<arguments.length;n++){var i=null!=arguments[n]?arguments[n]:{};n%2?t(Object(i),!0).forEach((function(t){a(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):t(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,f(i.key),i)}}function s(e,t,n){return t&&o(e.prototype,t),n&&o(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function a(e,t,n){return(t=f(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var i,r,o,s,a=[],l=!0,u=!1;try{if(o=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;l=!1}else for(;!(l=(i=o.call(n)).done)&&(a.push(i.value),a.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=n.return&&(s=n.return(),Object(s)!==s))return}finally{if(u)throw r}}return a}}(e,t)||d(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||d(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e,t){if(e){if("string"==typeof e)return v(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,i=new Array(t);n<t;n++)i[n]=e[n];return i}function c(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=d(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var i=0,r=function(){};return{s:r,n:function(){return i>=e.length?{done:!0}:{done:!1,value:e[i++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==n.return||n.return()}finally{if(a)throw o}}}}function f(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,t||"default");if("object"!=typeof i)return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var g=window.ApxorLogger,_=function(e){return void 0===e},h=function(e){return null===e},m=function(e){return void 0!==e&&!h(e)},p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y(e,t){return Array.from(t).map((function(t,n){return String.fromCharCode(t^function(e,t){return e.charCodeAt(Math.floor(t%e.length))}(e,n))})).join("")}var C=function(e,t){return y(e,t=function(e){var t,n,i,r,o,s,a=0,l=[];if(!e)return e;e+="";do{t=(s=p.indexOf(e.charAt(a++))<<18|p.indexOf(e.charAt(a++))<<12|(r=p.indexOf(e.charAt(a++)))<<6|(o=p.indexOf(e.charAt(a++))))>>16&255,n=s>>8&255,i=255&s,l.push(t),64!==r&&(l.push(n),64!==o&&l.push(i))}while(a<e.length);return l}(t))},N=function(e){return m(e)&&!h(e)&&!isNaN(e)},w=function(e){switch(e){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE";case"apxor_event":return"AEV";case"customer_event":return"CEV";case"any_event":return"ANV";case"campaign_event":return"CNV";case"survey_event":return"SVE"}return"Unknown"},E=function(e){return e.toUpperCase()},b=function(e,t,n){switch(n){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;case"NEQ":return e!==t;case"R":return F(t).test(e);default:return!1}},F=function(e){var t=e.replace(/.*\/([gimuy]*)$/,"$1");t===e&&(t="");var n=t?e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1"):e;return new RegExp(n,t)},K=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},S=function(e,t,n){if("GT"===n){var i=e.split(":"),r=t.split(":");if(!(i[0]>=r[0]))return!1;if(i[0]>r[0])return!0;if(i[0]!=r[0])return!1;if(i[1]>=r[1])return!0}else if("LT"===n){var o=e.split(":"),s=t.split(":");if(!(o[0]<=s[0]))return!1;if(o[0]<s[0])return!0;if(o[0]!=s[0])return!1;if(o[1]<=s[1])return!0}},W=function(e,t){switch(e){case"second":return 1e3*t;case"minute":return 60*t*1e3;case"hour":return 60*t*60*1e3;case"day":return 24*t*60*60*1e3;default:return 1}},Y=function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t||!n)return!1;var r=n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=t.replace(new RegExp(r,"g"),"(.+)"),s=i?"^".concat(o):"".concat(o,"$"),a=new RegExp(s);return a.test(e)};function x(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=q(e,t);if(o){var s=function(){if(T(o)){return function(e){return J(e)}(o)}return g.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return s()}return n?(g.info("Not found yet. Rechecking the DOM."),D(r,i,e,t)):(g.info("Element with selector:".concat(e," not found.")),!1)}function D(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var t=q(n,i);if(t){clearInterval(r);!function(){if(T()){J()}else g.info("Invalid target element. Width and height are 0 for element: ".concat(n,". Can't show tooltip"))}()}else(e-=1)<=0&&(clearInterval(r),console.warn("Element with selector:".concat(n," not found.")))}),t)}var q=function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=document.getElementById(e);if(!i)try{i=document.querySelector(e)}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}(i||(i=A(e)),!i&&n.length>0)&&(i=null===(t=document.getElementById(n))||void 0===t||null===(t=t.contentWindow)||void 0===t||null===(t=t.document)||void 0===t?void 0:t.querySelector(e));return i},A=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.iMZf(e,document,(function(e){return"svg"===e?"http://www.w3.org/2000/svg":null}),XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}return null};function T(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function H(e,t){for(var n=0;n<e.length;n++)if(e[n].hasOwnProperty(t))return e[n];return null}function J(e){var t,n,i,r;return!!(n=(t=e).offsetHeight,i=t.offsetWidth,(r=t.getBoundingClientRect()).left>=-i&&r.top>=-n&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+i&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+n)}var L=function(e){!function(e){var t='\n <style> \n .apx-container{\n padding:10px;\n }\n </style>\n <div id="apx-innerElement" class="apx-container">\n <div id="close-button" style="cursor: pointer;position:absolute;top:9px;right:9px;"><svg width="11" height="11" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path opacity="0.5" d="M11.0962 9.07071L17.8586 15.8331L15.8331 17.8586L9.0707 11.0962L8.99999 11.0255L8.92928 11.0962L2.16693 17.8586L0.141421 15.8331L6.90379 9.07071L6.9745 9L6.90379 8.92929L0.141421 2.16694L2.16693 0.141422L8.92928 6.9038L8.99999 6.97451L9.0707 6.9038L15.8331 0.141422L17.8586 2.16694L11.0962 8.92929L11.0255 9L11.0962 9.07071Z" fill="white" stroke="#002845" stroke-width="0.2"/>\n </svg>\n </div>\n <div style="font-family: inherit;font-style: normal;font-weight: 600;font-size: 16px;line-height: 22px;\n color: #FFFFFF; display: flex; gap: 12px;"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-circle-check-filled" width="33" height="33" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff" fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="none" d="M0 0h24v24H0z" fill="none"/>\n <path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor" />\n</svg><div style = "align-self: center;padding-right:20px;">'.concat(e,"</div></div>\n </div>\n "),n=document.createElement("div");n.style="\n z-index:99999999;\n background:#16202f;\n position:fixed;\n top:1%;\n right:1%;\n border-radius: 12px;\n ",n.innerHTML=t,n.id="apx-container",document.body.appendChild(n)}(e);var t=document.getElementById("close-button"),n=function(){var e=document.getElementById("apx-container");null==e||e.remove()};null==t||t.addEventListener("click",n),window.setTimeout(n,2e4)},I=window.ApxorLogger,P=s((function t(){var n=this;r(this,t),a(this,"KlQa","ALL"),a(this,"vuUy",[]),a(this,"TvMJ",[]),a(this,"userAttributesValidated",!0),a(this,"sessionAttributeValidated",!0),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.KlQa=e.audience.audience_type,n.vuUy=e.audience.attributes.user,n.TvMJ=e.audience.attributes.session,!Array.isArray(n.vuUy)||!Array.isArray(n.TvMJ))return I.error("No attributes"),!1}catch(e){return I.error(e),!1}return!0})),a(this,"validate",(function(t,i){var r=!0;"FTU"===n.KlQa&&(r=e.getController().getSessionInfo().is_first_session);var o=n.KGxX(t,n.vuUy),s=n.KGxX(i,n.TvMJ);return o||(n.userAttributesValidated=!1),s||(n.sessionAttributeValidated=!1),r&&o&&s})),a(this,"KGxX",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[s];if(_(e[n.name])||!1===i)return{v:!1};var r=n.operator,o=n.type,a=n.value.map((function(e){if("s"===o)return e;if("l"===o)return parseInt(e);if("f"===o)return parseFloat(e);if("b"===o)switch(e){case"true":return!0;case"false":return!1;default:return e}})),l=(Array.isArray(e[n.name])?e[n.name]:[e[n.name]]).some((function(e){return a.some((function(t){return"s"===o?e="".concat(e):"l"===o?e=parseInt(e):"f"===o?e=parseFloat(e):"b"===o&&(e=!!e),b(e,t,r)}))}));i=i&&l},s=0;s<n;s++)if(r=o())return r.v}catch(e){I.error(e),i=!1}return i}))})),k=s((function e(){var t=this;r(this,e),a(this,"KyJY",""),a(this,"Sqrf",{}),a(this,"WgXw",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.KyJY=e.name,t.Sqrf=e.additional_info,t.WgXw=null==e?void 0:e.path}catch(e){return!1}return!0}))})),V=s((function e(){var t=this;r(this,e),a(this,"MREo",0),a(this,"Hllr",0),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.MREo=Number(e.lower),t.Hllr=Number(e.upper),isNaN(t.MREo)||isNaN(t.Hllr))return!1}catch(e){return!1}return!0}))})),G=s((function e(){var t=this;r(this,e),a(this,"SqYL",0),a(this,"HvGe",""),a(this,"FDiq",""),a(this,"lKqH",new k),a(this,"Gufw",new V),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.HvGe=e.event_type,t.FDiq=e.activity,t.lKqH.parse(e.details)&&t.Gufw.parse(e.time_bounds)}catch(e){return!1}}))})),B=window.ApxorLogger,O=s((function e(){var t=this;r(this,e),a(this,"SqYL",0),a(this,"DlWo",-1),a(this,"rZaN",0),a(this,"Yfhc",""),a(this,"FDiq",""),a(this,"HvGe",""),a(this,"Gufw",new V),a(this,"lKqH",new k),a(this,"uhVV",new G),a(this,"GWsZ","AND"),a(this,"DePE",!1),a(this,"KlQa",void 0),a(this,"bgZN",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;return t.DlWo=null==e?void 0:e.sequence,t._conditionType=null==e?void 0:e.condition_type,t._id=null==e?void 0:e._id,t._eventCategory=null!=e&&e.event_category?null==e?void 0:e.event_category:"specific_event",t.rZaN=null==e||null===(n=e.count_config)||void 0===n?void 0:n.count,t.Yfhc=null==e||null===(i=e.count_config)||void 0===i?void 0:i.operator,t.FDiq=null==e?void 0:e.activity,t.HvGe=null==e?void 0:e.event_type,t.GWsZ=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.KlQa=null==e?void 0:e.type,t.bgZN=null==e?void 0:e.route,t.lKqH.parse(null==e?void 0:e.details)&&t.uhVV.parse(e.trigger)&&t.Gufw.parse(e.time_bounds)}catch(e){return B.error(e),!1}}))})),U=window.ApxorLogger,Q=s((function e(){var t=this;r(this,e),a(this,"rZaN",0),a(this,"Yfhc",""),a(this,"HvGe",""),a(this,"Gufw",new V),a(this,"lKqH",new k),a(this,"GWsZ","AND"),a(this,"parse",(function(e){try{return t.rZaN=e.count_config.count,t.Yfhc=e.count_config.operator,t.HvGe=e.event_type,t.GWsZ=e.combine_operator,t.lKqH.parse(e.details)&&t.Gufw.parse(e.time_bounds)}catch(e){return U.error(e),!1}}))})),z=window.ApxorLogger,R=function(){function t(){var n=this;r(this,t),a(this,"EVry",0),a(this,"bdFJ",""),a(this,"WClN",new O),a(this,"PRzK",new Q),a(this,"sqtm",!1),a(this,"YgKd",!1),a(this,"oSvu",0),a(this,"GWsZ","AND"),a(this,"jNho","OR"),a(this,"thKi",-1),a(this,"PHRJ",[]),a(this,"oFGe",{}),a(this,"scDF",!1),a(this,"mxgE",void 0),a(this,"YiPY",void 0),a(this,"AvID",void 0),a(this,"eCfL",void 0),a(this,"no_KPI_TriggerDetails",[]),a(this,"JUwB",!1),a(this,"timerDidnt",void 0),a(this,"timerDid",void 0),a(this,"initialize",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:-1,d=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(n.bdFJ=i,n.oSvu=r,n.PHRJ=s,n.mxgE=o,n.childConditionIndex=u,n.across_sessions=a||!1,"termination"===l&&""!==l){n.PRzK.parse(t);return n.jNho=n.PRzK.GWsZ,n.hrYw(),!0}var v=n.WClN.parse(t);if(v){if(n.GWsZ=n.WClN.GWsZ,n.WClN.DePE){var c=n.WClN.lKqH.KyJY;"APX_PAGE_OPENED"===c&&(c=n.WClN.lKqH.Sqrf.navigation_id,c=m(c)?c:n.WClN.lKqH.KyJY),n.thKi=e.getController().getEventCount(c);var f=n.WClN.rZaN,g=n.WClN.Yfhc;if(n.YgKd=n.FhUD(n.thKi-1,f,g,!1),n.sqtm=n.YgKd,n.YgKd&&"APX_PAGE_OPENED"===n.WClN.lKqH.KyJY)return!0}return!0===d&&(o&&0!==r&&"unordered"!==o||n.APPb()),!0}return!1})),a(this,"APPb",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(n.YiPY=t);var i=n.WClN,r=null!=i&&i._eventCategory?null==i?void 0:i._eventCategory:"specific_event",o=i.uhVV,s=_e.getInstance();if("app_start"===o.HvGe)if(n.sqtm=!0,null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var a=W(i._time.unit,i._time.value);if("didn't"==(null==i?void 0:i.KlQa)){if(n.scDF=!1,n.timerDidnt=setTimeout((function(){n.scDF||(n.YgKd=!0,n.YgKd&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(n.WClN.SqYL=Date.now(),n.scDF=!1,s.validate(n.bdFJ,n.oSvu,n.YiPY))),"specific_event"===r?s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF):n.xWgh(r),n.sqtm=!1)}),a),n.across_sessions){var l=W(i._time.unit,i._time.value),u=i._timeEnabled,d=i._id;n.cYfS(i.KlQa,i.lKqH.KyJY,Date.now(),i.lKqH.Sqrf,l,u,d)}"specific_event"===r?(s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF),n.eCfL=n.WClN):n.CUnC(r)}else if("did"==(null==i?void 0:i.KlQa)){if(n.timerDid=setTimeout((function(){n.JUwB||("specific_event"===r?s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw):n.Byhk(r))}),a),n.across_sessions){var v=W(i._time.unit,i._time.value),c=i._timeEnabled,f=i._id;n.cYfS(i.KlQa,i.lKqH.KyJY,Date.now(),i.lKqH.Sqrf,v,c,f)}"specific_event"===r?(s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw),n.AvID=n.WClN):n.mRBf(r)}}}else"specific_event"===r?s.registerForEvent(w(i.HvGe)+"___"+i.lKqH.KyJY,n.EXBl):n.nrMH(r);else if(null!=i&&i._timeEnabled){if("session"!=(null==i?void 0:i._time.unit)){var g=W(i._time.unit,i._time.value);"didn't"==(null==i?void 0:i.KlQa)?(n.scDF=!1,n.timerDidnt=setTimeout((function(){n.scDF||(n.YgKd=!0,n.YgKd&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(n.WClN.SqYL=Date.now(),n.scDF=!1,s.validate(n.bdFJ,n.oSvu)))),"specific_event"===r&&s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF),n.sqtm=!1}),g),"specific_event"===r?(s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.tTcF),n.eCfL=n.WClN):n.CUnC()):"did"==(null==i?void 0:i.KlQa)&&(n.timerDid=setTimeout((function(){n.JUwB||"specific_event"===r&&s.unregisterFromEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw)}),g),"specific_event"===r&&s.registerForEvent(w(n.WClN.HvGe)+"___"+n.WClN.lKqH.KyJY,n.lvQw))}}else"specific_event"===r&&s.registerForEvent(w(i.HvGe)+"___"+o.lKqH.KyJY,n.EXBl);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(n.bdFJ)&&s.registerForEvent(w(i.HvGe)+"___"+"apxor-badge-container-".concat("-".concat(n.bdFJ).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.EXBl)})),a(this,"nrMH",(function(e){var t=new _e;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,i,r){n.EXBl(w(n.WClN.HvGe),n.WClN.lKqH.KyJY,i,n.WClN.lKqH.Sqrf)}))})),a(this,"xWgh",(function(e){var t=new _e,i=n.WClN._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.tTcF):"customer_event"===i?t.unregisterFromEvent("customer_event",n.tTcF):"any_event"===i?t.unregisterFromEvent("any_event",n.tTcF):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.tTcF):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.tTcF)})),a(this,"CUnC",(function(){var e=new _e,t=n.WClN._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.tTcF):"customer_event"===t?e.registerForEvent("customer_event",n.tTcF):"any_event"===t?e.registerForEvent("any_event",n.tTcF):"campaign_event"===t?e.registerForEvent("campaign_event",n.tTcF):"survey_event"===t&&e.registerForEvent("survey_event",n.tTcF)})),a(this,"mRBf",(function(){var e=new _e,t=n.WClN._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",n.lvQw):"customer_event"===t?e.registerForEvent("customer_event",n.lvQw):"any_event"===t?e.registerForEvent("any_event",n.lvQw):"campaign_event"===t?e.registerForEvent("campaign_event",n.lvQw):"survey_event"===t&&e.registerForEvent("survey_event",n.lvQw)})),a(this,"Byhk",(function(){var e=new _e,t=n.WClN._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",n.lvQw):"customer_event"===t?e.unregisterFromEvent("customer_event",n.lvQw):"any_event"===t?e.unregisterFromEvent("any_event",n.lvQw):"campaign_event"===t?e.unregisterFromEvent("campaign_event",n.lvQw):"survey_event"===t&&e.unregisterFromEvent("survey_event",n.lvQw)})),a(this,"hrYw",(function(){var e=n.PRzK,t=_e.getInstance();n.sqtm=!0,t.registerForEvent(w(e.HvGe)+"___"+e.lKqH.KyJY,n.ipby)})),a(this,"cwAa",(function(e,t,i,r){var o,s=(Date.now()-n.oFGe[t])/1e3;(null===(o=n.WClN)||void 0===o||null===(o=o.lKqH)||void 0===o||null===(o=o.Sqrf)||void 0===o?void 0:o.time)/1e3>s&&n._displayCampaign(i)})),a(this,"rZJt",(function(e,t,i,r){var o,s;n.scDF=!0;var a=Date.now(),l=null===(o=n.WClN)||void 0===o||null===(o=o.uhVV)||void 0===o?void 0:o.lKqH.KyJY,u=(a-n.oFGe[l])/1e3,d=null===(s=n.WClN)||void 0===s||null===(s=s.lKqH)||void 0===s||null===(s=s.Sqrf)||void 0===s?void 0:s.time;(d/=1e3)>u&&n._displayCampaign(i)})),a(this,"lvQw",(function(){n.JUwB=!0;var e=new _e;clearTimeout(n.timerDid),n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(e.unregisterFromEvent(w(n.AvID.HvGe)+"___"+n.AvID.lKqH.KyJY,n.lvQw),n.JUwB=!1,e.validate(n.bdFJ,n.oSvu,n.YiPY))})),a(this,"tTcF",(function(e,t,i,r){n.scDF=!0,clearTimeout(n.timerDidnt),(new _e).unregisterFromEvent(w(n.eCfL.HvGe)+"___"+n.eCfL.lKqH.KyJY,n.tTcF)})),a(this,"EXBl",(function(t,i,r,o){var s,a,l=_e.getInstance();if(n.sqtm){if(null!==(s=window.ApxorRTM)&&void 0!==s&&s.isBadgePresent&&null!==(a=window.ApxorRTM)&&void 0!==a&&a.badgesLists.includes(n.bdFJ)&&e.getController().isBadgeTriggerSatisfied(n.bdFJ))return n.YgKd=!0,n.WClN.SqYL=r,void l.validate(n.bdFJ,n.oSvu);if(w(n.WClN.HvGe)===t&&n.LYgL(r-n.WClN.uhVV.SqYL,n.WClN.Gufw)&&n.WClN.lKqH.KyJY===i&&n.esVc(n.WClN.lKqH.Sqrf,o)&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd)){if(n.WClN.SqYL=r,n.across_sessions){var u=W(n.WClN._time.unit,n.WClN._time.value),d=n.WClN._timeEnabled,v=n.WClN._id,c=n.EVry;n.cYfS(n.WClN.KlQa,i,r,o,u,d,v,c)}l.validate(n.bdFJ,n.oSvu,n.YiPY)}}else if(n.sqtm=n.YUkH(t,i,r,o),n.sqtm){var f=n.WClN,g=f.uhVV;if(g.SqYL=r,"activity_time"===(null==f?void 0:f.HvGe)){var _,h,m,p,y=null==f||null===(_=f.lKqH)||void 0===_||null===(_=_.Sqrf)||void 0===_?void 0:_.time;(null==f||null===(h=f.bgZN)||void 0===h?void 0:h.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&f.bgZN===location.pathname&&n._displayCampaign(r)}),y):(null==f||null===(m=f.lKqH)||void 0===m||null===(m=m.Sqrf)||void 0===m?void 0:m.nkpi.length)>0?(setTimeout((function(){n.scDF||(n.YgKd=!0,n.YgKd&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.WClN.rZaN,n.WClN.Yfhc),n.YgKd&&(n.WClN.SqYL=r,n.scDF=!1,l.validate(n.bdFJ,n.oSvu)))),f.lKqH.Sqrf.nkpi.map((function(e){l.unregisterFromEvent(E(f.lKqH.Sqrf.et)+"___"+e,n),n.sqtm=!1}))}),y),f.lKqH.Sqrf.nkpi.map((function(e){l.registerForEvent(E(f.lKqH.Sqrf.et)+"___"+e,n.tTcF)}))):(null==f||null===(p=f.lKqH)||void 0===p||null===(p=p.Sqrf)||void 0===p?void 0:p.kpi.length)>0&&(setTimeout((function(){f.lKqH.Sqrf.kpi.map((function(e){l.unregisterFromEvent(E(f.lKqH.Sqrf.et)+"___"+e,n)}))}),y),f.lKqH.Sqrf.kpi.map((function(e){e===f.uhVV.lKqH.KyJY?(l.unregisterFromEvent(w(g.HvGe)+"___"+g.lKqH.KyJY,n),l.registerForEvent(E(f.lKqH.Sqrf.et)+"___"+e,n.cwAa)):l.registerForEvent(E(f.lKqH.Sqrf.et)+"___"+e,n.rZJt)})))}else l.unregisterFromEvent(w(g.HvGe)+"___"+g.lKqH.KyJY,n),l.registerForEvent(w(f.HvGe)+"___"+f.lKqH.KyJY,n);n.oFGe[i]=Date.now()}})),a(this,"ipby",(function(e,t,i,r){var o=_e.getInstance();w(n.PRzK.HvGe)===e&&n.LYgL(i,n.PRzK.Gufw)&&n.PRzK.lKqH.KyJY===t&&n.esVc(n.PRzK.lKqH.Sqrf,r)&&(n.EVry+=1,n.YgKd=n.FhUD(n.EVry,n.PRzK.rZaN,n.PRzK.Yfhc),n.YgKd&&(n.PRzK.SqYL=i,o.validateForTermination(n.bdFJ,n.oSvu)))})),a(this,"YUkH",(function(e,t,i,r){var o=n.WClN.uhVV,s=w(o.HvGe)===e&&o.lKqH.KyJY===t&&n.LYgL(i,o.Gufw)&&n.esVc(o.lKqH.Sqrf,r);return s="APX_PAGE_OPENED"===t?s&&location.pathname===o.lKqH.WgXw:s})),a(this,"LYgL",(function(e,t){var n=Math.ceil(e);return n>t.MREo&&n<t.Hllr})),a(this,"FhUD",(function(e,t,i){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&n.WClN.DePE&&(e+=n.thKi),i){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;default:return!1}})),a(this,"esVc",(function(e,t){var n=!0;try{var r,o=function(){if(!1===n)return{v:!1};if("object"===i(e[s])){var r,o,a,l=e[s].op,u=e[s].t;if("s"===u)a=e[s].val;else if("l"===u||"f"===u)a=parseFloat(e[s].val);else if("b"===u)switch(e[s].val){case"true":a=!0;break;case"false":a=!1;break;default:a=e[s].val}var d,v=(Array.isArray(t[s])?t[s]:[t[s]]).some((function(e){return"s"===u?e="".concat(e):"l"===u?e=parseInt(e):"f"===u?e=parseFloat(e):"b"===u&&(e=!!e),b(e,a,l)}));if(!(null===(r=e[s])||void 0===r||!r.present)&&(null===(o=e[s])||void 0===o?void 0:o.present))d=!!t.hasOwn(t,s),n=n&&d;n=n&&v}else n=n&&b(t[s],e[s],"EQ")};for(var s in e)if(r=o())return r.v}catch(e){z.error(e),n=!1}return n})),a(this,"cYfS",(function(t,i,r,o,s,a,l,u){var d,v=!1;n.no_KPI_TriggerDetails=e.getController().getFromStorage("apx_nokpi_triggerdetails"),null===n.no_KPI_TriggerDetails||void 0===n.no_KPI_TriggerDetails?n.no_KPI_TriggerDetails=[]:n.no_KPI_TriggerDetails=JSON.parse(n.no_KPI_TriggerDetails);var c,f=0;a&&(f=Date.now()+s);for(var g=0;g<n.no_KPI_TriggerDetails.length;g++)if(n.no_KPI_TriggerDetails[g].id===l){v=!0,d=n.no_KPI_TriggerDetails[g];break}v?d.satisfiedCount+=1:(c={id:l,type:t,time:r,name:i,additionalInfo:o,satisfiedCount:u,timeBased:a,finishTime:f},n.no_KPI_TriggerDetails.push(c)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(n.no_KPI_TriggerDetails))})),a(this,"ADTy",(function(e){var t,i=new _e,r=c(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(1===(null==o?void 0:o.length)||void 0===(null==o?void 0:o.length))i.unregisterFromEvent(w(null==o?void 0:o.WClN.HvGe)+"___"+(null==o?void 0:o.WClN.lKqH.KyJY),n.EXBl);else{var s,a=c(o);try{for(a.s();!(s=a.n()).done;){var l,u=s.value;i.unregisterFromEvent(w(null==u?void 0:u.WClN.HvGe)+"___"+(null==u||null===(l=u.WClN)||void 0===l?void 0:l.lKqH.KyJY),n.EXBl)}}catch(e){a.e(e)}finally{a.f()}}}}catch(e){r.e(e)}finally{r.f()}}))}return s(t,[{key:"_displayCampaign",value:function(e){var t=_e.getInstance();this.YgKd=!0,this.YgKd&&(this.EVry+=1,this.YgKd=this.FhUD(this.EVry,this.WClN.rZaN,this.WClN.Yfhc),this.YgKd&&(this.WClN.SqYL=e,t.validate(this.bdFJ,this.oSvu)))}}]),t}(),Z=window.ApxorLogger,M=s((function t(){var n=this;r(this,t),a(this,"rZaN",0),a(this,"vpQG",0),a(this,"sRWr","SESSION"),a(this,"nWdc",0),a(this,"dOdV",0),a(this,"aObU",0),a(this,"_enable_repetition_gap",void 0),a(this,"_enable_days_limit",void 0),a(this,"_enable_session_limit",void 0),a(this,"DWGK",void 0),a(this,"ClXk",void 0),a(this,"chzi",void 0),a(this,"DSLimits",void 0),a(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,r,o,s,a,l,u,d;if(n.bdFJ=t._id,n.Busn=t.meta,n.rZaN=t.frequency.count,-1===n.rZaN&&(n.rZaN=9999999),n.aObU=n.rZaN,n.vpQG=t.frequency.time_interval,n.sRWr=t.frequency.validity,n.DSLimits=t.frequency.DSLimits,n.dOdV=t.frequency.ses_lmt,n._enable_session_limit=null===(i=t.frequency)||void 0===i?void 0:i.enable_session_limit,n._enable_session_limit)n.DWGK=null===(l=t.frequency)||void 0===l?void 0:l.session_count;if(n._dayCount=null!==(r=t.frequency)&&void 0!==r&&r.day_lmt?null===(o=t.frequency)||void 0===o?void 0:o.day_lmt:0,n._enable_repetition_gap=!!t.frequency.enable_repetition_gap&&t.frequency.enable_repetition_gap,n._enable_repetition_gap)n._repetitionValue=null===(u=t.frequency)||void 0===u?void 0:u.repetition_gap.val,n._repetitionUnit=null===(d=t.frequency)||void 0===d?void 0:d.repetition_gap.unit;n._enable_days_limit=!(null===(s=t.frequency)||void 0===s||!s.enable_days_limit)&&(null===(a=t.frequency)||void 0===a?void 0:a.enable_days_limit),n._enable_days_limit&&(n.chzi=t.frequency.days_limit.days?t.frequency.days_limit.days:1,n.ClXk=t.frequency.days_limit.limit);var v=_e.getInstance().getQeState();if(!m(v)||!m(v[t._id]))return!0;if("SESSION"===n.sRWr){if(n.rZaN=parseInt(n.rZaN)-parseInt(v[t._id].SESSION),n.rZaN<=0)return n.cwbp("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&L("Maximum overall limit reached for campaign name ".concat(n.Busn.name)),!1}else{if("OVERALL"!==n.sRWr)return Z.info("Invalid config."),!1;if(n.rZaN=parseInt(n.rZaN)-parseInt(v[t._id].OVERALL),n.rZaN<=0)return n.cwbp("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&L("Maximum overall limit reached for campaign name ".concat(n.Busn.name)),!1}}catch(e){return Z.error(e),!1}return!0})),a(this,"IAEG",(function(){n.rZaN=n.rZaN-1})),a(this,"getFrequencyCount",(function(){return n.rZaN})),a(this,"raNn",(function(){"SESSION"===n.sRWr&&(n.rZaN=n.aObU,Z.info("Campaign Limit reset"))})),a(this,"LJcq",(function(t){try{if(n.rZaN<=0)return"OVERALL"===n.sRWr?(n.cwbp("Overall limit reached"),e.getController().isTestDevice()&&L("Maximum overall limit reached for campaign name ".concat(n.Busn.name))):"SESSION"===n.sRWr&&(e.getController().isTestDevice()&&L("Maximum session limit reached for campaign name ".concat(n.Busn.name)),n.cwbp("Session limit reached")),!1;var i=_e.getInstance().getQeState();if(!m(i)||!m(i[t]))return!0;if(n._enable_session_limit)if(parseInt(n.DWGK)-parseInt(i[t].SESSION)<=0)return n.cwbp("Session limit reached"),e.getController().isTestDevice()&&L("Maximum session limit reached for campaign name ".concat(n.Busn.name)),!1;if(n._enable_repetition_gap)if("session"!=n._repetitionUnit){var r=e.getController().getFromStorage("apx-last-shown-times");if(r=JSON.parse(r),!h(H(r,n.bdFJ))){var o=H(r,n.bdFJ)[n.bdFJ];if(Date.now()-o<W(n._repetitionUnit,n._repetitionValue))return n.cwbp("Config does not satisfy time difference "),e.getController().isTestDevice()&&L("Config does not satisfy time difference for campaign name ".concat(n.Busn.name)),!1}}else{var s=e.getController().getFromStorage("apx-last-shown-session");if(s=JSON.parse(s),!h(H(s,n.bdFJ))){var a=H(s,n.bdFJ)[n.bdFJ];if(e.getController().getFromStorage("apx_retained_session")-a<parseInt(n._repetitionValue))return n.cwbp("Config does not satisfy session difference "),e.getController().isTestDevice()&&L("Config does not satisfy session difference for campaign name ".concat(n.Busn.name)),!1}}if(0!==n.dOdV&&n.DSLimits)if(parseInt(n.dOdV)-parseInt(i[t].SESSION)<=0)return n.cwbp("Session limit reached"),e.getController().isTestDevice()&&L("Session limit reached for campaign name ".concat(n.Busn.name)),!1;if(0!==n._dayCount){var l,u=K();if(parseInt(n._dayCount)-parseInt((null===(l=i[t])||void 0===l?void 0:l.DATES[u])||0)<=0)return n.cwbp("Day limit reached"),e.getController().isTestDevice()&&L("Day limit reached for campaign name ".concat(n.Busn.name)),!1}if(n.chzi>0&&n._enable_days_limit){var d=n.chzi,v=0;if(function(e){for(var t=[],n=new Date,i=0;i<e;i++){var r=new Date(n);r.setDate(n.getDate()-i);var o=String(r.getDate()),s=String(r.getMonth()),a=r.getFullYear();t.push(o+"/"+s+"/"+a)}return t}(d).forEach((function(e){var n;v+=parseInt((null===(n=i[t])||void 0===n?void 0:n.DATES[e])||0)})),v>n.ClXk)return Z.info("Shown Limit Crossed"),e.getController().isTestDevice()&&L("Days limit reached for campaign name ".concat(n.Busn.name)),!1}}catch(e){n.cwbp("Error validating the frequency: ".concat(e)),Z.error("Error validating the frequency:"+e)}return!0})),a(this,"cwbp",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.Busn.type?"survey":"campaign",apx_nudge_id:n.bdFJ,apx_nudge_name:n.Busn.name,message_name:n.Busn.KyJY,id:n.bdFJ,apx_variant_code:n.Busn.isExperiment||n.Busn.only_context?null===(i=n.Busn.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),j=window.ApxorLogger,X=s((function e(){var t=this;r(this,e),a(this,"HygX",[]),a(this,"UYsF",0),a(this,"kfNs",!1),a(this,"sclT",void 0),a(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unordered",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5?arguments[5]:void 0,a=arguments.length>6&&void 0!==arguments[6]&&arguments[6];t.bdFJ=n,t.oSvu=i,t.PHRJ=o,t.mxgE=r,t.across_sessions=a;var l=[];t.UYsF=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.onrv(e,t.UYsF),"unordered"!==s&&0!==t.oSvu||t.APPb(),t.HygX}catch(e){return j.error(e),!1}})),a(this,"onrv",(function(e,n){for(var i=0;i<n;i++){t.sclT=new R;try{t.sclT.initialize(e[i],t.bdFJ,t.oSvu,t.mxgE,t.YFCU,t.across_sessions,"",-1,!1)&&(t.HygX.push(t.sclT),t.HygX.sequence_type=t.mxgE)}catch(e){j.error(e)}}return t.HygX})),a(this,"APPb",(function(){if("ordered"===t.mxgE||"strictly_ordered"===t.mxgE)t.HygX[0].APPb(0);else{var e,n=c(t.HygX);try{for(n.s();!(e=n.n()).done;){e.value.APPb()}}catch(e){n.e(e)}finally{n.f()}}})),a(this,"ADTy",(function(e){t.sclT.ADTy(e)}))})),$=s((function e(){var t=this;r(this,e),a(this,"KyJY",""),a(this,"KlQa",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i;t.KyJY=e.meta.name,t.KlQa=e.meta.type,t._only_context=e.meta.only_context,t._attr=(null===(n=e.meta)||void 0===n?void 0:n.attr)||{},t._isExperiment=null===(i=e.meta)||void 0===i?void 0:i.isExperiment}catch(e){return window.ApxorLogger.error(e),!1}return!0}))})),ee=window.ApxorLogger,te=s((function t(){var n=this;r(this,t),a(this,"Fzfv",[]),a(this,"_ret_day",{}),a(this,"ypuj",{}),a(this,"noaz",!1),a(this,"jbkV",!1),a(this,"retainedDaysValidated",!0),a(this,"retainedSessionValidated",!0),a(this,"eventDoneInLT",!1),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.Fzfv=e.overall_cfg.events,n._ret_day=e.overall_cfg.ret_day,n.ypuj=e.overall_cfg.session,n.noaz=e.overall_cfg.toggleRetDay,n.jbkV=e.overall_cfg.toggleSession}catch(e){return ee.error(e),!1}return!0})),a(this,"validate",(function(){var t=parseInt(e.getController().getFromStorage("apx_retained_days")),i=parseInt(e.getController().getFromStorage("apx_retained_session"));if(n.noaz&&!isNaN(t)&&!(t>=n._ret_day.from&&t<=n._ret_day.to))return n.retainedDaysValidated=!1,!1;if(n.jbkV&&!isNaN(i)&&!(i>=n.ypuj.from&&i<=n.ypuj.to))return n.retainedSessionValidated=!1,!1;try{for(var r=e.getController().getFromStorage("_apx_lt_count"),o=e.getSiteId(),s=JSON.parse((new TextDecoder).decode(function(e){for(var t=new ArrayBuffer(e.length),n=new Uint8Array(t),i=0;i<e.length;i++)n[i]=e.charCodeAt(i);return t}(C(o,r)))),a=0;a<n.Fzfv.length;a++){if(s[n.Fzfv[a].name.replace("'","").replace("’","")])return n.eventDoneInLT=!0,!1}}catch(e){ee.error("Failed to validate the lt count:"+e)}return!0}))})),ne=window.ApxorLogger,ie=s((function e(){var t=this;r(this,e),a(this,"vuUy",[]),a(this,"TvMJ",[]),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.vuUy=e.attributes.user,t.TvMJ=e.attributes.session,!Array.isArray(t.vuUy)||!Array.isArray(t.TvMJ))return ne.error("No attributes"),!1}catch(e){return ne.error(e),!1}return!0})),a(this,"validate",(function(e,n){return t.KGxX(e,t.vuUy)&&t.KGxX(n,t.TvMJ)})),a(this,"KGxX",(function(e,t){var n=t.length,i=!0;try{for(var r,o=function(){var n=t[s];if(!e[n.name]||!1===i)return{v:!1};var r=n.operator,o=n.type,a=n.value.map((function(e){return"s"===o?e:"l"===o?parseInt(e):"f"===o?parseFloat(e):void 0})),l=(Array.isArray(e[n.name])?e[n.name]:[e[n.name]]).some((function(e){return a.some((function(t){return b(e,t,r)}))}));i=i&&l},s=0;s<n;s++)if(r=o())return r.v}catch(e){ne.error(e),i=!1}return i}))})),re=s((function t(){var n=this;r(this,t),a(this,"yIng",e.getController()),a(this,"type",""),a(this,"_duration_seconds",0),a(this,"wIYn",1),a(this,"parse",(function(e){try{var t,i,r;if(n.KlQa=null===(t=e.terminate_info.time_based)||void 0===t?void 0:t.type,n._duration_seconds=null===(i=e.terminate_info)||void 0===i?void 0:i.time_based.duration_seconds,n.wIYn=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,n.ldZx(e._id))return n.yIng.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),a(this,"ldZx",(function(e){var t,i=JSON.parse(n.yIng.getFromStorage("apx_termination_ID"));if(!i[e]||null===(t=i[e])||void 0===t||!t.startDate)return!1;var r,o=new Date(i[e].startDate),s=new Date((r=new Date).getMonth()+"/"+r.getDate()+"/"+r.getFullYear()),a=parseInt((s-o)/864e5,10),l=function(){var e=new Date;return{hours:e.getHours(),mins:e.getMinutes()}}(),u=i[e].dLHN;return a===n.wIYn&&l.hours>=u.hours||a>n.wIYn||i[e].goalAcheived}))})),oe=s((function e(){var t=this;r(this,e),a(this,"enable_goal_events",!1),a(this,"attributes",{}),a(this,"ErYc",new ie),a(this,"TVJQ",new re),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,i,r;if(t.enable_time_based=null==e||null===(n=e.terminate_info)||void 0===n?void 0:n.enable_time_based,t.enable_time_based&&!t.TVJQ.parse(e))return!1;if(t.enable_goal_events=null==e||null===(i=e.terminate_info)||void 0===i?void 0:i.enable_goal_events,t.enable_attributes=null==e||null===(r=e.terminate_info)||void 0===r?void 0:r.enable_attributes,t.enable_attributes&&!t.ErYc.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),a(this,"validate",(function(e,n){return t.ErYc.validate(e,n)}))})),se=window.ApxorLogger,ae=s((function t(){var n=this;r(this,t),a(this,"RuvQ",-1),a(this,"ZQoY",-1),a(this,"dLHN",-1),a(this,"UIpJ",-1),a(this,"OXLD",-1),a(this,"MinM",-1),a(this,"_is_user_timezone",void 0),a(this,"cIGW",!1),a(this,"KEdX",!1),a(this,"_nudge_expired",!1),a(this,"_not_yet_active",!1),a(this,"_not_in_specified_time",!1),a(this,"_days_in_week",[]),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,i;if(n.bdFJ=e._id,n.Busn=e.meta,isNaN(Date.parse(e.validity.start_date))||isNaN(Date.parse(e.validity.end_date))||!Array.isArray(e.validity.days_in_week))return se.error("Not valid dates"),!1;if(n.RuvQ=Date.parse(e.validity.start_date),n.ZQoY=Date.parse(e.validity.end_date),n._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(i=e.validity)||void 0===i?void 0:i.days_in_week:[1,2,3,4,5,6,7],n._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,m(e.at_specific_time)&&(n.cIGW=e.at_specific_time,n.cIGW&&m(e.time_limits)&&(n.dLHN=e.time_limits.start_time,n.UIpJ=e.time_limits.end_time,N(n.dLHN)||N(n.UIpJ))))return se.error("Not valid times"),!1;if(m(e.time_excludes_in_day)&&(n.KEdX=e.time_excludes_in_day,n.KEdX&&m(e.time_excludes)&&(n.OXLD=e.time_excludes.start_time,n.MinM=e.time_excludes.end_time,N(n.OXLD)||N(n.MinM))))return se.error("Not valid exclude times"),!1}catch(e){return se.error(e),!1}return!0})),a(this,"validate",(function(){var t=Date.now(),i=(new Date).getDay()+1,r=function(e){var t=new Date,n=t.getHours(),i=t.getMinutes(),r=(n=(n<10?"0":"")+n)+":"+(i=(i<10?"0":"")+i);if(!e){var o=t.getUTCHours(),s=t.getUTCMinutes();r=(o=(o<10?"0":"")+o)+":"+(s=(s<10?"0":"")+s)}return r}(n._is_user_timezone);if(t>n.RuvQ&&t<n.ZQoY&&n._days_in_week.includes(i))return!n.cIGW||S(r,n.dLHN,"GT")&&S(r,n.UIpJ,"LT")||(n._not_in_specified_time=!0),n.KEdX&&function(e,t,n){var i=l(e.split(":").map(Number),2),r=i[0],o=i[1],s=l(t.split(":").map(Number),2),a=s[0],u=s[1],d=l(n.split(":").map(Number),2),v=60*d[0]+d[1];return v>=60*r+o&&v<=60*a+u}(n.OXLD,n.MinM,r)?(n.cwbp("Exclude Time limits check failed"),e.getController().isTestDevice()&&L("Exclude Time Limits check failed for campaign name ".concat(n.Busn.name)),!1):!n.cIGW||S(r,n.dLHN,"GT")&&S(r,n.UIpJ,"LT");if(t<n.RuvQ)n._not_yet_active=!0;else if(t>n.ZQoY)n._nudge_expired=!0;else if(!n._days_in_week.includes(i))return n.cwbp("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&L("Current week day did not match with Configured Week day for campaign name ".concat(n.Busn.name)),!1;return!1})),a(this,"cwbp",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.Busn.type?"survey":"campaign",apx_nudge_id:n.bdFJ,apx_nudge_name:n.Busn.name,message_name:n.Busn.KyJY,id:n.bdFJ,apx_variant_code:n.Busn.isExperiment||n.Busn.only_context?null===(i=n.Busn.attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),le=s((function e(){var t=this;r(this,e),a(this,"eHmB",""),a(this,"orYZ",""),a(this,"jewV",""),a(this,"kULT",""),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.eHmB=null==e?void 0:e.screen_binding,!t.eHmB||(t.orYZ=null==e?void 0:e.binding.url,t.jewV=null==e?void 0:e.binding.var,t.kULT=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),a(this,"validate",(function(){var e=t.orYZ,n=t.jewV,i=t.kULT,r=window.location.href;return!t.eHmB||("EQ"===i?e.includes(n)?!!Y(r,e,n,!1):r===e:"SW"===i?e.includes(n)?!!Y(r,e,n,!0):!!r.startsWith(e):void 0)}))})),ue=window.ApxorLogger,de=s((function t(){var i=this;r(this,t),a(this,"slst",[]),a(this,"OakL",[]),a(this,"bdFJ",""),a(this,"Busn",new $),a(this,"PnhJ",new P),a(this,"sRWr",new ae),a(this,"jznt",new M),a(this,"lgot",new te),a(this,"poNk",new oe),a(this,"iJQR",new le),a(this,"mxgE",!1),a(this,"YFCU",[]),a(this,"_variant_code",""),a(this,"kfNs",!1),a(this,"groupCombineOperator","OR"),a(this,"scDF",!1),a(this,"nWvj",!1),a(this,"yOuv",void 0),a(this,"timeForKPI",void 0),a(this,"kpiIndex",0),a(this,"PVCi",void 0),a(this,"_across_sessions",!1),a(this,"ijiy",void 0),a(this,"Puvj",!1),a(this,"ztNO",void 0),a(this,"doLk",void 0),a(this,"LwyE",void 0),a(this,"tLbv",void 0),a(this,"YjoD",void 0),a(this,"kMGf",void 0),a(this,"MeLD",void 0),a(this,"SFmA",void 0),a(this,"wzIA",void 0),a(this,"MzoY",void 0),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(!m(e._id))return ue.error("No Id"),!1;if(!m(e.enabled)||!e.enabled)return ue.error("Not enabled"),!1;if(!(i.Busn.parse(e)&&i.sRWr.parse(e)&&i.jznt.parse(e)&&i.PnhJ.parse(e)&&i.lgot.parse(e)&&i.poNk.parse(e)&&i.iJQR.parse(e)))return!1;if(i._variant_code=i.Busn._isExperiment||i.Busn._only_context?null===(t=i.Busn._attr)||void 0===t?void 0:t.apx_variant_code:"TG",i._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),i.enable_conditions=null==e?void 0:e.enable_conditions,i.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!m(e.conditions)||!Array.isArray(e.conditions))return ue.error("No valid conditions",e.conditions),!1;i.bdFJ=e._id,i.mxgE=!!m(e.sequence_enabled)&&e.sequence_enabled,m(e.conditions_v2)&&i.enable_conditions_v2&&(i.mxgE=null==e?void 0:e.sequence_type),!0===i.mxgE&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),m(e.conditions_v2)&&i.enable_conditions_v2?(n=e.conditions_v2,i.Puvj=!0):n=e.conditions,i.ijiy=n;var r=n.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){i.gdmS()}),10),i.MzoY=r,i.Jhsx(n,r),i.fALS(),i.poNk.enable_goal_events)for(var s=e.terminate_info.goal_events.events,a=s.length,l=0;l<a;l++){var u=new R;u.initialize(s[l],i.bdFJ,l,!0,[],i._across_sessions,"termination")&&i.OakL.push(u)}return i.slst.length>0}catch(e){return ue.error(e),!1}})),a(this,"Jhsx",(function(e,t){for(var n=function(){i.YFCU=[];var t=e[r];if("group"===(null!=t&&t.condition_type?null==t?void 0:t.condition_type:"single")){var n=t.conditions_v2;i.groupCombineOperator=t.combine_operator;var o=null==t?void 0:t.sequence_type;i.wzIA=new X;var s=i.wzIA.initialize(n,i.bdFJ,r,o,i.YFCU,i.mxgE,i._across_sessions);i.slst.push(s)}else{if("didn't"===t.type){var a,l={trigger_key:t.trigger.details.name,no_kpi_array:null==t||null===(a=t.details)||void 0===a||null===(a=a.additional_info)||void 0===a?void 0:a.nkpi,condition_id:null==t?void 0:t._id,time_bounds:t.time_bounds.upper};i.YFCU=[].concat(u(i.YFCU),[l])}if(i.wzIA=new R,i.wzIA.initialize(t,i.bdFJ,r,i.mxgE,i.YFCU,i._across_sessions)){i.slst.push(i.wzIA);var d=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),v=(null==t?void 0:t.frameid)||"",c=null==t?void 0:t.url;window.location.href===c&&"view_visibility"===t.event_type&&!0===x(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.gdmS(!0),window.addEventListener("navigate",(function(e){var n=null==t?void 0:t.url;window.location.href===n&&"view_visibility"===t.event_type&&!0===x(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,d)&&i.gdmS(!0)}))}}},r=0;r<t;r++)n()})),a(this,"fALS",(function(){if(i._across_sessions&&"ordered"===i.mxgE){var t=!1,n=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(n=JSON.parse(n))&&null!=n)for(var r=function(e){var r,o,s;if(null!==(r=i.slst[e])&&void 0!==r&&null!==(r=r.WClN)&&void 0!==r&&r._timeEnabled&&void 0===i.slst[e].length){if("didn't"===i.slst[e].WClN.KlQa){var a=i.slst[e].WClN._id,l=i.doSy(a,n);if(l)if(Date.now()>l.finishTime)i.slst[e].YgKd=!0,i.slst[e].EVry=l.satisfiedCount,t=!0;else{var u=l.finishTime-Date.now(),d=i.slst[e].WClN._eventCategory?i.slst[e].WClN._eventCategory:"specific_event",v=new _e;"specific_event"===d?(v.registerForEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.tTcF),i.YjoD=i.slst[e]):i.CUnC(d),setTimeout((function(){e!==i.slst.length-1||i.scDF||(i.slst[e].YgKd=!0,i.slst[e].EVry=l.satisfiedCount,t=!0,"specific_event"===d?v.unregisterFromEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.tTcF):i.FkGU(i.slst[e]),i.gdmS())}),u)}}if("did"===i.slst[e].WClN.KlQa){var c=i.slst[e].WClN._id,f=i.doSy(c,n);if(f)if(null==f.satisfiedCount){if(Date.now()<f.finishTime){i.LwyE=f,i.doLk=e;var g=f.finishTime-Date.now(),_=i.slst[e].WClN._eventCategory?i.slst[e].WClN._eventCategory:"specific_event",h=new _e;"specific_event"===_?h.registerForEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.raUd):i.CUnC(_),setTimeout((function(){"specific_event"===_?h.unregisterFromEvent(w(i.slst[e].WClN.HvGe)+"___"+i.slst[e].WClN.lKqH.KyJY,i.raUd):i.FkGU(i.slst[e])}),g)}}else i.slst[e].EVry=f.satisfiedCount,i.slst[e].YgKd=!0}}else t=i.xUFw(e,n);t&&(null===(o=i.slst[e])||void 0===o||null===(o=o.WClN)||void 0===o||!o._timeEnabled||(null===(s=i.slst[e])||void 0===s?void 0:s.length)>1)?e===i.slst.length-1&&i.gdmS():t||void 0===!i.slst[e].length&&i.slst[e].APPb()},o=0;o<i.slst.length;o++)r(o)}else if(i._across_sessions&&"unordered"===i.mxgE){var s=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(s=JSON.parse(s))&&null!=s)for(var a=0;a<i.slst.length;a++)i.xUFw(a,s)}})),a(this,"xUFw",(function(e,t){if(void 0===i.slst[e].length||1===i.slst[e].length){var n=i.slst[e].WClN._id,r=!1,o=i.doSy(n,t);if(o)i.ztNO=o,r=(new R).FhUD(o.satisfiedCount,i.slst[e].WClN.rZaN,i.slst[e].WClN.Yfhc),o&&(r?i.slst[e].YgKd=!0:i.slst[e].EVry=o.satisfiedCount);else i.slst[e].APPb();return r}if(i.slst[e].length>=1){var s,a,l;if("ordered"===(a=null===(s=i.slst[e])||void 0===s?void 0:s.sequence_type)||"strictly_ordered"===a){for(var u=0;u<i.slst[e].length;u++){var d=i.slst[e][u],v=d.WClN._id;l=!1;var c=i.doSy(v,t);if(c){if(l=(new R).FhUD(c.satisfiedCount,d.WClN.rZaN,d.WClN.Yfhc),c)if(l){i.slst[e][u].YgKd=!0;var f=u+1,g=i.slst[e][u+1];void 0===g&&m(i.slst[e+1])&&(i.slst[e+1].APPb(),l=!0),null!=g&&i.slst[e][u+1].APPb(f)}else i.slst[e][u].EVry=c.satisfiedCount}else(m(i.slst[e][u-1])&&!0===i.slst[e][u].YgKd||_(i.slst[e][u-1]))&&i.slst[e][u].APPb()}return l}for(var h,p=0;p<i.slst[e].length;p++){var y=i.slst[e][0].WClN.GWsZ;h="OR"!==y;var C=i.slst[e][p],N=C.WClN._id;l=!1;var w=i.doSy(N,t);if(w)l=(new R).FhUD(w.satisfiedCount,C.WClN.rZaN,C.WClN.Yfhc),w&&(l?i.slst[e][p].YgKd=!0:i.slst[e][p].EVry=w.satisfiedCount);else C.APPb();h="AND"===y?h&&l:h||l}return h}})),a(this,"doSy",(function(e,t){return t.find((function(t){return t.id===e}))})),a(this,"iMZf",(function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=_e.getInstance();if(!(t<0)){var o=i.slst[t],s="unordered";if((null==o?void 0:o.length)>1&&(s=null==o?void 0:o.sequence_type),!0===i.mxgE||"ordered"===i.mxgE||"strictly_ordered"===i.mxgE||"ordered"===s||"strictly_ordered"===s){i.kpiIndex=t+1;var a=i.slst[t];if((null==a?void 0:a.length)>0){if(m(a))if("unordered"===i.mxgE&&"ordered"===s){var l=o[n-1];if(m(l))if(void 0===l.length||1==l.length){if(!l.YgKd)return}else if(l.length>1&&!i.EioD(l))return;var u,d=o[n+1];if(m(d)){if(d.APPb(n+1),"strictly_ordered"===i.mxgE){i._currentEventname=a[n].WClN.lKqH.KyJY;var v=e.getController();v.registerForEvent("APP_EVENT",i.XtWv),v.registerForEvent("CLIENT_EVENT",i.XtWv)}}else if("strictly_ordered"===s)1!=i.kfNs&&i.gdmS();else(null===(u=o[n])||void 0===u?void 0:u.length)>0?i.EioD(o)&&i.gdmS():i.gdmS()}else{var f,g=i.slst[t-1];if(m(g))if(void 0===g.length||1==g.length){if(!g.YgKd)return}else if(g.length>1&&!i.EioD(g))return;if(void 0===a.length||1===a.length?f=i.slst[t+1]:a.length>1&&("ordered"===s||"strictly_ordered"===s?f=n===a.length-1?i.slst[t+1]:i.slst[t][n+1]:i.EioD(a)&&(f=i.slst[t+1])),m(f)){if(void 0===f.length||1===f.length)f.APPb(n+1);else if(i.EioD(a))if(void 0===f.length)f.APPb();else if(f.length>1)if("unordered"===f.sequence_type)for(var _=0;_<f.length;_++)f[_].APPb(_);else"ordered"!==f.sequence_type&&"strictly_ordered"!==f.sequence_type||f[0].APPb(0);if("strictly_ordered"===i.mxgE){i._currentEventname=a[n].WClN.lKqH.KyJY;var h=e.getController();h.registerForEvent("APP_EVENT",i.XtWv),h.registerForEvent("CLIENT_EVENT",i.XtWv)}}else"strictly_ordered"===i.mxgE?1!=i.kfNs&&i.gdmS():i.EioD(a)&&i.gdmS()}}else if(m(a)&&a.YgKd){a.oFGe[a.WClN.lKqH.KyJY]=Date.now();var p=i.slst[t-1];if(m(p))if(void 0===p.length||1==p.length){if(!p.YgKd)return}else if(p.length>1&&!i.EioD(p))return;var y=i.slst[t+1];if(m(y)){var C,N;if(null!=y&&null!==(C=y.WClN)&&void 0!==C&&C._timeEnabled){if("session"!=(null===(N=y.WClN)||void 0===N?void 0:N._time.unit)){var E,b,F=W(y.WClN._time.unit,y.WClN._time.value);if("didn't"==(null===(E=y.WClN)||void 0===E?void 0:E.KlQa)){if(i.MeLD=setTimeout((function(){if(i.scDF)i.scDF=!1;else{if(i.scDF=!1,y.YgKd=!0,y.YgKd){y.EVry+=1;var e=new R;if(y.YgKd=e.FhUD(y.EVry,y.WClN.rZaN,y.WClN.Yfhc),y.YgKd){y.WClN.SqYL=Date.now();var n=t+1,o=i.slst[n+1];m(o)?o.APPb():i.gdmS()}}r.unregisterFromEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.tTcF),y.sqtm=!1}}),F),i._across_sessions){var K=W(y.WClN._time.unit,y.WClN._time.value),S=y.WClN._timeEnabled,Y=y.WClN._id,x=new R;x.cYfS(y.WClN.KlQa,y.WClN.lKqH.KyJY,Date.now(),y.WClN.lKqH.Sqrf,K,S,Y)}"specific_event"===y.WClN._eventCategory?(r.registerForEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.tTcF),i.YjoD=y):i.CUnC(y)}else if("did"==(null===(b=y.WClN)||void 0===b?void 0:b.KlQa)&&(i.scDF=!1,i.PVCi=y,m(i.slst[t+2])&&i._across_sessions&&(i.tLbv=i.slst[t+2]),i.SFmA=setTimeout((function(){i.scDF?i.scDF=!1:(i.scDF=!1,r.unregisterFromEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.rZJt))}),F),i.yOuv=a,i.timeForKPI=F,r.registerForEvent(w(y.WClN.HvGe)+"___"+y.WClN.lKqH.KyJY,i.rZJt),i.kMGf=y,i._across_sessions)){var D=W(y.WClN._time.unit,y.WClN._time.value),q=y.WClN._timeEnabled,A=y.WClN._id,T=new R;T.cYfS(y.WClN.KlQa,y.WClN.lKqH.KyJY,Date.now(),y.WClN.lKqH.Sqrf,D,q,A)}}}else if(y.length>0)if("ordered"===y.sequence_type||"strictly_ordered"===y.sequence_type)y[0].APPb(n+1);else{var H,J=c(y);try{for(J.s();!(H=J.n()).done;){var L=H.value;L.APPb()}}catch(e){J.e(e)}finally{J.f()}}else y.APPb();if("strictly_ordered"===i.mxgE){i._currentEventname=a.WClN.lKqH.KyJY;var I=e.getController();I.registerForEvent("APP_EVENT",i.XtWv),I.registerForEvent("CLIENT_EVENT",i.XtWv)}}else"strictly_ordered"===i.mxgE?1!=i.kfNs&&i.gdmS():i.gdmS()}}else i.DSfp(),i.gdmS()}})),a(this,"XtWv",(function(e){e&&e.name!=i._currentEventname&&(i.kfNs=!0)})),a(this,"CUnC",(function(e){var t=new _e,n=e.WClN._eventCategory;"apxor_event"===n?t.registerForEvent("apxor_event",i.tTcF):"customer_event"===n?t.registerForEvent("customer_event",i.tTcF):"any_event"===n?t.registerForEvent("any_event",i.tTcF):"campaign_event"===n?t.registerForEvent("campaign_event",i.tTcF):"survey_event"===n&&t.registerForEvent("survey_event",i.tTcF)})),a(this,"FkGU",(function(e){var t=new _e,n=e.WClN._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.tTcF):"customer_event"===n?t.unregisterFromEvent("customer_event",i.tTcF):"any_event"===n?t.unregisterFromEvent("any_event",i.tTcF):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.tTcF):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.tTcF)})),a(this,"tTcF",(function(){var e,t;i.MeLD&&(i.scDF=!1,clearTimeout(i.MeLD));var n=new _e;i.scDF=!0,i._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),n.unregisterFromEvent(w(null===(e=i.YjoD)||void 0===e||null===(e=e.WClN)||void 0===e?void 0:e.HvGe)+"___"+(null===(t=i.YjoD)||void 0===t||null===(t=t.WClN)||void 0===t||null===(t=t.lKqH)||void 0===t?void 0:t.KyJY),i.tTcF)})),a(this,"rZJt",(function(){var t,n,r,o=new _e;i.scDF=!0,i.SFmA&&clearTimeout(i.SFmA);var s=new R;if(i.PVCi.EVry+=1,i.PVCi.YgKd=s.FhUD(i.PVCi.EVry,i.PVCi.WClN.rZaN,i.PVCi.WClN.Yfhc),o.unregisterFromEvent(w(null===(t=i.kMGf)||void 0===t||null===(t=t.WClN)||void 0===t?void 0:t.HvGe)+"___"+(null===(n=i.kMGf)||void 0===n||null===(n=n.WClN)||void 0===n?void 0:n.lKqH.KyJY),i.rZJt),i._across_sessions&&null!==(r=i.tLbv)&&void 0!==r&&r.WClN._timeBased){var a,l,u,d=e.getController().getFromStorage("apx_nokpi_triggerdetails");d=null==d?[]:JSON.parse(d);for(var v=0;v<d.length;v++)if(i.no_KPI_TriggerDetails[v].id===i.tLbv.WClN._id){a=!0,l=d[v];break}if(a)l.satisfiedCount+=1;else{var c=i.PVCi.WClN._id,f=i.PVCi.WClN.KlQa,g=i.PVCi.WClN.lKqH.KyJY,_=i.PVCi.WClN.lKqH.Sqrf;u={id:c,type:f,time:Date.now(),name:g,additionalInfo:_,satisfiedCount:i.PVCi.WClN._timeEnabled,timeBased:i.PVCi.WClN._timeEnabled},i.no_KPI_TriggerDetails.push(u)}}if(i.PVCi.YgKd){var h=i.slst[i.kpiIndex+1];m(h)?h.APPb():i.gdmS()}})),a(this,"raUd",(function(){if(i.doLk===i.slst.length-1){i.nWvj=!0;i.slst[i.doLk]&&(i.slst[i.doLk].EVry=i.LwyE.satisfiedCount,i.slst[i.doLk].YgKd=!0,i.gdmS())}else{var t,n,r=e.getController().getFromStorage("apx_nokpi_triggerdetails");r=null==r?[]:JSON.parse(r);for(var o=0;o<r.length;o++)if(r[o].id===i.doLk){n=!0,t=r[o];break}if(n&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),i.slst[i.doLk].EVry=i.LwyE.satisfiedCount,i.slst[i.doLk].YgKd=!0,i.slst[i.doLk+1].WClN._timeEnabled){var s=W(i.slst[i.doLk+1].WClN._time.unit,i.slst[i.doLk+1].WClN._time.value),a=i.slst[i.doLk+1].WClN._timeEnabled,l=i.slst[i.doLk+1].WClN._id,u=i.slst[i.doLk+1].EVry,d=i.slst[i.doLk+1].WClN.lKqH.KyJY,v=i.slst[i.doLk+1].lKqH.Sqrf;(new R).cYfS(i.WClN.KlQa,d,Date.now(),v,s,a,l,u)}}})),a(this,"DSfp",(function(){if(i._across_sessions&&i.Puvj){var t,n,r,o="single",s=!1,a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if((a=JSON.parse(a)).length>0){var l,u=c(a);try{var d=function(){var e=l.value,a=e.id,u=e.satisfiedCount;if(t=i.slst.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.WClN._id===a)return o="single",n=t,!0}else if(e.length>0){var i=e.findIndex((function(e){return e.WClN._id===a}));if(-1!==i)return n=t,r=i,o="group",!0}return!1})),"single"===o&&t){var d=new R;s=d.FhUD(u,t.WClN.rZaN,t.WClN.Yfhc);var v=i.slst.findIndex((function(e){var t;return(null==e||null===(t=e.WClN)||void 0===t?void 0:t._id)===a}));void 0===v&&(v=n),s&&(i.slst[v].YgKd=!0)}else if("group"===o&&t){var c=new R;(s=c.FhUD(u,t[r].WClN.rZaN,t[r].WClN.Yfhc))&&(i.slst[n][r].YgKd=!0)}};for(u.s();!(l=u.n()).done;)d()}catch(e){u.e(e)}finally{u.f()}}}})),a(this,"HScg",(function(e){e<0||i.NpcX()})),a(this,"gdmS",(function(){var t,r,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],s=e.getController().getUserAttributes(),a=e.getController().getSessionAttributes();if(null!==(t=window.ApxorRTM)&&void 0!==t&&t.isBadgePresent&&null!==(r=window.ApxorRTM)&&void 0!==r&&r.badgesLists.includes(i.bdFJ)&&e.getController().isBadgeTriggerSatisfied(i.bdFJ)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===i.Busn.KlQa?"survey":"campaign",apx_nudge_id:i.bdFJ,apx_nudge_name:i.Busn.KyJY,message_name:i.Busn.KyJY,id:i.bdFJ,apx_variant_code:i.Busn._isExperiment||i.Busn._only_context?i.Busn._attr.apx_variant_code:"TG"}),!(i.sRWr.validate()&&i.PnhJ.validate(s,a)&&i.lgot.validate()&&i.iJQR.validate())){i.Busn.KlQa;return i.lgot.retainedDaysValidated?i.lgot.retainedSessionValidated?i.lgot.eventDoneInLT?void i.cwbp("Event done in life time"):i.PnhJ.userAttributesValidated?i.PnhJ.sessionAttributeValidated?i.sRWr._not_in_specified_time?void i.cwbp("Time limits check failed"):i.sRWr._not_yet_active?void i.cwbp("not in the scheduled time"):i.sRWr._nudge_expired?void i.cwbp("nudge expired"):void 0:void i.cwbp("Session property filter not met"):void i.cwbp("User property filter not met"):void i.cwbp("User session criteria not met"):void i.cwbp("Retained day criteria not met")}var l=i.slst.length,u=l<1,d="";0===l&&(u=!0);for(var v=0;v<l;v++){var f=void 0,g=i.slst[v];if(g.length>1){var _=g[0].WClN.GWsZ;f="AND"===_;for(var h=0;h<g.length;h++){var m=g[0].WClN.GWsZ;f="AND"===m?f&&g[h].YgKd:f||g[h].YgKd}}else f=g.YgKd;if(""===d.trim())u=f;else switch(d){case"AND":u=u&&f;break;case"OR":u=u||f}d=g.length>1?i.groupCombineOperator:g.GWsZ}if(!0===o&&(u=!0),u){if(console.debug("onCondition satisfied"),!i.jznt.LJcq(i.bdFJ))return void console.warn("Maximum limit reached",i.bdFJ);i._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var p,y=c(i.slst);try{for(y.s();!(p=y.n()).done;){var C=p.value;if(1===(null==C?void 0:C.length)||void 0===(null==C?void 0:C.length))C.YgKd=!1,C.EVry=0;else{var N,w=c(C);try{for(w.s();!(N=w.n()).done;){var E=N.value;E.YgKd=!1,E.EVry=0}}catch(e){w.e(e)}finally{w.f()}}}}catch(e){y.e(e)}finally{y.f()}if(i.wzIA.ADTy(i.slst),i.slst=[],i.Jhsx(i.ijiy,i.MzoY),!0===i.Busn._only_context){var b="SURVEY"===i.Busn.KlQa?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.Busn._attr),{},{message_name:i.Busn.KyJY,apx_nudge_name:i.Busn.KyJY,apx_nudge_id:i.bdFJ,id:i.bdFJ}),!1,"",b)}e.getController().dispatchEvent(i.Busn.KlQa,{name:i.Busn.KlQa,additional_info:{uuid:i.bdFJ,name:i.Busn.KyJY}})}})),a(this,"NpcX",(function(){for(var t=i.OakL.length,r=t<1,o="",s=0;s<t;s++){var a=i.OakL[s],l=a.YgKd;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=a.jNho}if(r){if(e.getController().persistTerminationInfoLocally(i.bdFJ),!0===i.Busn._only_context){var u="SURVEY"===i.Busn.KlQa?"survey":"campaign";e.logEvent("apx_context_evaluated",n(n({},i.Busn._attr),{},{message_name:i.Busn.KyJY,apx_nudge_name:i.Busn.KyJY,apx_nudge_id:i.bdFJ,id:i.bdFJ}),!1,"apxor",u)}e.getController().dispatchEvent(i.Busn.KlQa,{name:i.Busn.KlQa,additional_info:{uuid:i.bdFJ,name:i.Busn.KyJY}})}})),a(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),n=e.getController().getSessionAttributes();return i.poNk.validate(t,n)})),a(this,"IAEG",(function(){i.jznt.IAEG()})),a(this,"getFrequencyCount",(function(){return i.jznt.getFrequencyCount()})),a(this,"kcZO",(function(){return i.jznt.raNn()})),a(this,"EioD",(function(e){var t;t="AND"===e[0].WClN.GWsZ;for(var n=0;n<e.length;n++){t="AND"===e[0].WClN.GWsZ?t&&e[n].YgKd:t||e[n].YgKd}return t})),a(this,"cwbp",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.Busn.KlQa?"survey":"campaign",apx_nudge_id:i.bdFJ,apx_nudge_name:i.Busn.KyJY,message_name:i.Busn.KyJY,id:i.bdFJ,apx_variant_code:i.Busn._isExperiment||i.Busn._only_context?null===(n=i.Busn._attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),ve=s((function e(){var t=this;r(this,e),a(this,"YeAl",{}),a(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(m(e)&&m(e.configs)){var n=e.configs;if(!Array.isArray(n))return;n.sort((function(e,t){var n,i;return(null!==(n=e.prio)&&void 0!==n?n:-1)-(null!==(i=t.prio)&&void 0!==i?i:-1)}));for(var i=0;i<n.length;i++){var r=n[i],o=r._id,s=new de;s.parse(r)?t.YeAl[o]=s:console.warn("Failed to parse cfg",o)}}})),a(this,"validate",(function(e,n){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t.YeAl[e]){var r=t.YeAl[e];r.iMZf(n,i)}})),a(this,"getVariantCode",(function(e){return t.YeAl[e]?t.YeAl[e]._variant_code:""})),a(this,"validateForTermination",(function(e,n){t.YeAl[e]&&t.YeAl[e].HScg(n)})),a(this,"validateForTerminationAttributes",(function(e){return!!t.YeAl[e]&&t.YeAl[e].validateForTerminationAttributes()})),a(this,"IAEG",(function(e){t.YeAl[e].IAEG()})),a(this,"getFrequencyCount",(function(e){var n=t.YeAl[e];if(null!=n)return n.getFrequencyCount()})),a(this,"resetFrequencyCounts",(function(){var e=t.YeAl;for(var n in e)e[n].kcZO()})),a(this,"ZzjC",(function(e){try{if(t.YeAl){var n=t.YeAl[e];if(n&&n.Busn)return n.Busn}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),ce=window.ApxorLogger,fe=s((function t(){var n=this;r(this,t),a(this,"Idml",{}),a(this,"nouG",[]),a(this,"CEfy",!1),a(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return n.xozT(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return n.xozT(e,"CE")}))})),a(this,"kQde",(function(){var e,t=c(n.nouG);try{for(t.s();!(e=t.n()).done;){var i=e.value;n.BpMO(i.event,i.key,i.type)}}catch(e){t.e(e)}finally{t.f()}n.CEfy=!0})),a(this,"wofl",(function(e,t){var i;"function"==typeof t&&((i=n.Idml[e]?n.Idml[e]:[]).push(t),n.Idml[e]=i,ce.debug("Listeners list: ",n.Idml))})),a(this,"unregisterFromEvent",(function(e,t){if(n.Idml[e]){for(var i=n.Idml[e],r=[],o=0;o<i.length;o++){var s=i[o];s!==t&&r.push(s)}n.Idml[e]=r}})),a(this,"xozT",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";n.BpMO(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?n.BpMO(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&n.BpMO(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?n.BpMO(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&n.BpMO(e,"survey_event",t);var i=t+"___"+e.name;n.BpMO(e,i,t)})),a(this,"BpMO",(function(t,i,r){if(n.CEfy){if(ce.debug("Notifying listeners for event: "+t+", "+i,n.Idml),n.Idml[i])for(var o=n.Idml[i],s=e.getController().getSDKRunningTimeInSec(),a=0;a<o.length;a++){(0,o[a])(r,t.name,s,t.additional_info)}}else n.nouG.push({event:t,key:i,type:r})}))})),ge=window.ApxorLogger,_e=function(){function t(){var n=this;return r(this,t),a(this,"xyDu",!1),a(this,"HyVs",null),a(this,"azNS",K()),a(this,"gWXS",new fe),a(this,"WBFQ",e.getSiteId()),a(this,"Cwkb",{}),a(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(C(n.WBFQ,t)):(n.Cwkb={},n.setQeState())}catch(e){return n.Cwkb={},n.setQeState()}})),a(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",n.Cwkb,!0)}catch(i){""===t?n.Cwkb={}:n.Cwkb[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",n.Cwkb,!0)}return n.Cwkb})),a(this,"initialize",(function(){n.xyDu||(n.xyDu=!0,n.HyVs=new ve,n.gWXS.initialize(),n.Cwkb=n.getQeState(),ge.info("QE Initialized.."))})),a(this,"parse",(function(e){n.wPzN()?(n.HyVs.parse(e),n.gWXS.kQde()):ge.warn("Must call init first. Unable to proceed")})),a(this,"validate",(function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;n.wPzN()&&n.HyVs.validate(e,t,i)})),a(this,"getVariantCode",(function(e){return n.HyVs.getVariantCode(e)})),a(this,"validateForTermination",(function(e,t){n.wPzN()&&n.HyVs.validateForTermination(e,t)})),a(this,"validateForTerminationAttributes",(function(e,t){return n.HyVs.validateForTerminationAttributes(e,t)})),a(this,"updateCount",(function(e){try{m(n.Cwkb[e])||n.createObjConfig(e),n.incrementFrequencies(e),n.setQeState(e),n.HyVs.IAEG(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),a(this,"resetFrequencyCounts",(function(){n.HyVs.resetFrequencyCounts()})),a(this,"getFrequencyCount",(function(e){return n.HyVs.getFrequencyCount(e)})),a(this,"registerForEvent",(function(e,t){n.gWXS.wofl(e,t)})),a(this,"unregisterFromEvent",(function(e,t){n.gWXS.unregisterFromEvent(e,t)})),a(this,"notifyEventListener",(function(e){n.gWXS.xozT(e)})),a(this,"fetch",(function(t,n,i,r){e.getController().fetchConfiguration(t,n,i,r)})),a(this,"wPzN",(function(){return n.xyDu})),a(this,"getCampaignMetaFromQueryEngine",(function(e){return n.HyVs.ZzjC(e)})),a(this,"TpGv",(function(){return n.azNS})),t.instance||(t.instance=this),t.instance}return s(t,[{key:"createObjConfig",value:function(e){try{this.Cwkb=this.getQeState(),m(this.Cwkb[e])||(this.Cwkb[e]={SESSION:0,OVERALL:0,DATES:{}},this.azNS&&(this.Cwkb[e].DATES[this.azNS]=0),this.setQeState(e))}catch(e){ge.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.Cwkb=this.getQeState();var t=this.Cwkb[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var n=K();n===this.azNS&&t.DATES&&t.DATES[n]||(this.azNS=n,t.DATES={},t.DATES[this.azNS]=0),t.DATES[this.azNS]=t.DATES[this.azNS]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();a(_e,"instance",void 0),window.ceVersion=205;try{void 0===exports&&null===exports||(exports.default=_e,module.exports=exports.default)}catch(e){}return _e}));
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],t):(e=e||self)["apxor-qe"]=t(e.Apxor)}(this,(function(e){"use strict";function t(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,n)}return i}function i(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?t(Object(n),!0).forEach((function(t){s(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){for(var i=0;i<t.length;i++){var n=t[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,f(n.key),n)}}function a(e,t,i){return t&&o(e.prototype,t),i&&o(e,i),Object.defineProperty(e,"prototype",{writable:!1}),e}function s(e,t,i){return(t=f(t))in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function l(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var i=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=i){var n,r,o,a,s=[],l=!0,u=!1;try{if(o=(i=i.call(e)).next,0===t){if(Object(i)!==i)return;l=!1}else for(;!(l=(n=o.call(i)).done)&&(s.push(n.value),s.length!==t);l=!0);}catch(e){u=!0,r=e}finally{try{if(!l&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(u)throw r}}return s}}(e,t)||c(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(e){return function(e){if(Array.isArray(e))return v(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||c(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function c(e,t){if(e){if("string"==typeof e)return v(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);return"Object"===i&&e.constructor&&(i=e.constructor.name),"Map"===i||"Set"===i?Array.from(e):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?v(e,t):void 0}}function v(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,n=new Array(t);i<t;i++)n[i]=e[i];return n}function d(e,t){var i="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!i){if(Array.isArray(e)||(i=c(e))||t&&e&&"number"==typeof e.length){i&&(e=i);var n=0,r=function(){};return{s:r,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:r}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){i=i.call(e)},n:function(){var e=i.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==i.return||i.return()}finally{if(s)throw o}}}}function f(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var i=e[Symbol.toPrimitive];if(void 0!==i){var n=i.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}e=e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e;var _=window.ApxorLogger,h=function(e){return void 0===e},g=function(e){return null===e},m=function(e){return void 0!==e&&!g(e)},p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function y(e,t){return Array.from(t).map((function(t,i){return String.fromCharCode(t^function(e,t){return e.charCodeAt(Math.floor(t%e.length))}(e,i))})).join("")}var E=function(e,t){return y(e,t=function(e){var t,i,n,r,o,a,s=0,l=[];if(!e)return e;e+="";do{t=(a=p.indexOf(e.charAt(s++))<<18|p.indexOf(e.charAt(s++))<<12|(r=p.indexOf(e.charAt(s++)))<<6|(o=p.indexOf(e.charAt(s++))))>>16&255,i=a>>8&255,n=255&a,l.push(t),64!==r&&(l.push(i),64!==o&&l.push(n))}while(s<e.length);return l}(t))},I=function(e){return m(e)&&!g(e)&&!isNaN(e)},S=function(e){switch(e){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE";case"apxor_event":return"AEV";case"customer_event":return"CEV";case"any_event":return"ANV";case"campaign_event":return"CNV";case"survey_event":return"SVE"}return"Unknown"},w=function(e){return e.toUpperCase()},N=function(e,t,i){switch(i){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;case"NEQ":return e!==t;case"R":return b(t).test(e);default:return!1}},b=function(e){var t=e.replace(/.*\/([gimuy]*)$/,"$1");t===e&&(t="");var i=t?e.replace(new RegExp("^/(.*?)/"+t+"$"),"$1"):e;return new RegExp(i,t)},O=function(){var e=new Date;return e.getDate()+"/"+e.getMonth()+"/"+e.getFullYear()},x=function(e,t,i){if("GT"===i){var n=e.split(":"),r=t.split(":");if(!(n[0]>=r[0]))return!1;if(n[0]>r[0])return!0;if(n[0]!=r[0])return!1;if(n[1]>=r[1])return!0}else if("LT"===i){var o=e.split(":"),a=t.split(":");if(!(o[0]<=a[0]))return!1;if(o[0]<a[0])return!0;if(o[0]!=a[0])return!1;if(o[1]<=a[1])return!0}},L=function(e,t){switch(e){case"second":return 1e3*t;case"minute":return 60*t*1e3;case"hour":return 60*t*60*1e3;case"day":return 24*t*60*60*1e3;default:return 1}},P=function(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]&&arguments[3];if(!e||!t||!i)return!1;var r=i.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"),o=t.replace(new RegExp(r,"g"),"(.+)"),a=n?"^".concat(o):"".concat(o,"$"),s=new RegExp(a);return s.test(e)};function G(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,r=arguments.length>4?arguments[4]:void 0,o=k(e,t);if(o){var a=function(){if(T(o)){return function(e){return C(e)}(o)}return _.info("Invalid target element. Width and height are 0 for element: ".concat(e,". Can't show tooltip")),!1};return a()}return i?(_.info("Not found yet. Rechecking the DOM."),F(r,n,e,t)):(_.info("Element with selector:".concat(e," not found.")),!1)}function F(e,t,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"",r=setInterval((function(){var t=k(i,n);if(t){clearInterval(r);!function(){if(T()){C()}else _.info("Invalid target element. Width and height are 0 for element: ".concat(i,". Can't show tooltip"))}()}else(e-=1)<=0&&(clearInterval(r),console.warn("Element with selector:".concat(i," not found.")))}),t)}var k=function(e){var t,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=document.getElementById(e);if(!n)try{n=document.querySelector(e)}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}(n||(n=q(e)),!n&&i.length>0)&&(n=null===(t=document.getElementById(i))||void 0===t||null===(t=t.contentWindow)||void 0===t||null===(t=t.document)||void 0===t?void 0:t.querySelector(e));return n},q=function(e){var t=e.indexOf("svg");-1!==t&&(e=e.substring(0,t)+"svg:svg");try{return document.nVOZ(e,document,(function(e){return"svg"===e?"http://www.w3.org/2000/svg":null}),XPathResult.FIRST_ORDERED_NODE_TYPE,null).singleNodeValue}catch(e){window.ApxorLogger.error("Error finding element in DOM:"+e)}return null};function T(e){try{var t=e.getBoundingClientRect();if(0===t.width||0===t.height)return!1}catch(e){return!1}return!0}function D(e,t){for(var i=0;i<e.length;i++)if(e[i].hasOwnProperty(t))return e[i];return null}function C(e){var t,i,n,r;return!!(i=(t=e).offsetHeight,n=t.offsetWidth,(r=t.getBoundingClientRect()).left>=-n&&r.top>=-i&&r.right<=(window.innerWidth||document.documentElement.clientWidth)+n&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)+i)}var R=function(e){!function(e){var t='\n <style> \n .apx-container{\n padding:10px;\n }\n </style>\n <div id="apx-innerElement" class="apx-container">\n <div id="close-button" style="cursor: pointer;position:absolute;top:9px;right:9px;"><svg width="11" height="11" viewBox="0 0 18 18" fill="none" xmlns="http://www.w3.org/2000/svg">\n <path opacity="0.5" d="M11.0962 9.07071L17.8586 15.8331L15.8331 17.8586L9.0707 11.0962L8.99999 11.0255L8.92928 11.0962L2.16693 17.8586L0.141421 15.8331L6.90379 9.07071L6.9745 9L6.90379 8.92929L0.141421 2.16694L2.16693 0.141422L8.92928 6.9038L8.99999 6.97451L9.0707 6.9038L15.8331 0.141422L17.8586 2.16694L11.0962 8.92929L11.0255 9L11.0962 9.07071Z" fill="white" stroke="#002845" stroke-width="0.2"/>\n </svg>\n </div>\n <div style="font-family: inherit;font-style: normal;font-weight: 600;font-size: 16px;line-height: 22px;\n color: #FFFFFF; display: flex; gap: 12px;"><svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-circle-check-filled" width="33" height="33" viewBox="0 0 24 24" stroke-width="1.5" stroke="#ffffff" fill="none" stroke-linecap="round" stroke-linejoin="round">\n <path stroke="none" d="M0 0h24v24H0z" fill="none"/>\n <path d="M17 3.34a10 10 0 1 1 -14.995 8.984l-.005 -.324l.005 -.324a10 10 0 0 1 14.995 -8.336zm-1.293 5.953a1 1 0 0 0 -1.32 -.083l-.094 .083l-3.293 3.292l-1.293 -1.292l-.094 -.083a1 1 0 0 0 -1.403 1.403l.083 .094l2 2l.094 .083a1 1 0 0 0 1.226 0l.094 -.083l4 -4l.083 -.094a1 1 0 0 0 -.083 -1.32z" stroke-width="0" fill="currentColor" />\n</svg><div style = "align-self: center;padding-right:20px;">'.concat(e,"</div></div>\n </div>\n "),i=document.createElement("div");i.style="\n z-index:99999999;\n background:#16202f;\n position:fixed;\n top:1%;\n right:1%;\n border-radius: 12px;\n ",i.innerHTML=t,i.id="apx-container",document.body.appendChild(i)}(e);var t=document.getElementById("close-button"),i=function(){var e=document.getElementById("apx-container");null==e||e.remove()};null==t||t.addEventListener("click",i),window.setTimeout(i,2e4)},Y=window.ApxorLogger,Z=a((function t(){var i=this;r(this,t),s(this,"gMol","ALL"),s(this,"ecjf",[]),s(this,"TNqH",[]),s(this,"userAttributesValidated",!0),s(this,"sessionAttributeValidated",!0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(i.gMol=e.audience.audience_type,i.ecjf=e.audience.attributes.user,i.TNqH=e.audience.attributes.session,!Array.isArray(i.ecjf)||!Array.isArray(i.TNqH))return Y.error("No attributes"),!1}catch(e){return Y.error(e),!1}return!0})),s(this,"validate",(function(t,n){var r=!0;"FTU"===i.gMol&&(r=e.getController().getSessionInfo().is_first_session);var o=i.RKBd(t,i.ecjf),a=i.RKBd(n,i.TNqH);return o||(i.userAttributesValidated=!1),a||(i.sessionAttributeValidated=!1),r&&o&&a})),s(this,"RKBd",(function(e,t){var i=t.length,n=!0;try{for(var r,o=function(){var i=t[a];if(h(e[i.name])||!1===n)return{v:!1};var r=i.operator,o=i.type,s=i.value.map((function(e){if("s"===o)return e;if("l"===o)return parseInt(e);if("f"===o)return parseFloat(e);if("b"===o)switch(e){case"true":return!0;case"false":return!1;default:return e}})),l=(Array.isArray(e[i.name])?e[i.name]:[e[i.name]]).some((function(e){return s.some((function(t){return"s"===o?e="".concat(e):"l"===o?e=parseInt(e):"f"===o?e=parseFloat(e):"b"===o&&(e=!!e),N(e,t,r)}))}));n=n&&l},a=0;a<i;a++)if(r=o())return r.v}catch(e){Y.error(e),n=!1}return n}))})),J=a((function e(){var t=this;r(this,e),s(this,"kDEi",""),s(this,"rdll",{}),s(this,"YNpf",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{t.kDEi=e.name,t.rdll=e.additional_info,t.YNpf=null==e?void 0:e.path}catch(e){return!1}return!0}))})),A=a((function e(){var t=this;r(this,e),s(this,"PWUk",0),s(this,"ReRO",0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.PWUk=Number(e.lower),t.ReRO=Number(e.upper),isNaN(t.PWUk)||isNaN(t.ReRO))return!1}catch(e){return!1}return!0}))})),K=a((function e(){var t=this;r(this,e),s(this,"oqnK",0),s(this,"wbLf",""),s(this,"bEzt",""),s(this,"hLZq",new J),s(this,"VBqr",new A),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.wbLf=e.event_type,t.bEzt=e.activity,t.hLZq.parse(e.details)&&t.VBqr.parse(e.time_bounds)}catch(e){return!1}}))})),j=window.ApxorLogger,B=a((function e(){var t=this;r(this,e),s(this,"oqnK",0),s(this,"FZEq",-1),s(this,"YScO",0),s(this,"VOeF",""),s(this,"bEzt",""),s(this,"wbLf",""),s(this,"VBqr",new A),s(this,"hLZq",new J),s(this,"hhSn",new K),s(this,"csYK","AND"),s(this,"gXLu",!1),s(this,"gMol",void 0),s(this,"dwSC",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,n;return t.FZEq=null==e?void 0:e.sequence,t._conditionType=null==e?void 0:e.condition_type,t._id=null==e?void 0:e._id,t._eventCategory=null!=e&&e.event_category?null==e?void 0:e.event_category:"specific_event",t.YScO=null==e||null===(i=e.count_config)||void 0===i?void 0:i.count,t.VOeF=null==e||null===(n=e.count_config)||void 0===n?void 0:n.operator,t.bEzt=null==e?void 0:e.activity,t.wbLf=null==e?void 0:e.event_type,t.csYK=e.combine_operator,t._timeEnabled=null==e?void 0:e.time_enabled,t._time=null==e?void 0:e.time,t.gMol=null==e?void 0:e.type,t.dwSC=null==e?void 0:e.route,t.hLZq.parse(null==e?void 0:e.details)&&t.hhSn.parse(e.trigger)&&t.VBqr.parse(e.time_bounds)}catch(e){return j.error(e),!1}}))})),V=window.ApxorLogger,M=a((function e(){var t=this;r(this,e),s(this,"YScO",0),s(this,"VOeF",""),s(this,"wbLf",""),s(this,"VBqr",new A),s(this,"hLZq",new J),s(this,"csYK","AND"),s(this,"parse",(function(e){try{return t.YScO=e.count_config.count,t.VOeF=e.count_config.operator,t.wbLf=e.event_type,t.csYK=e.combine_operator,t.hLZq.parse(e.details)&&t.VBqr.parse(e.time_bounds)}catch(e){return V.error(e),!1}}))})),W=window.ApxorLogger,z=function(){function t(){var i=this;r(this,t),s(this,"fYKk",0),s(this,"xEum",""),s(this,"INcP",new B),s(this,"uqdv",new M),s(this,"iTuS",!1),s(this,"WGJG",!1),s(this,"mbVI",0),s(this,"csYK","AND"),s(this,"iIVu","OR"),s(this,"Bqli",-1),s(this,"vprY",[]),s(this,"vdGl",{}),s(this,"uGKB",!1),s(this,"wJLZ",void 0),s(this,"CmeD",void 0),s(this,"nGxF",void 0),s(this,"jZUx",void 0),s(this,"no_KPI_TriggerDetails",[]),s(this,"bjhj",!1),s(this,"timerDidnt",void 0),s(this,"timerDid",void 0),s(this,"initialize",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],a=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],s=arguments.length>5&&void 0!==arguments[5]&&arguments[5],l=arguments.length>6&&void 0!==arguments[6]?arguments[6]:"",u=arguments.length>7&&void 0!==arguments[7]?arguments[7]:-1,c=!(arguments.length>8&&void 0!==arguments[8])||arguments[8];if(i.xEum=n,i.mbVI=r,i.vprY=a,i.wJLZ=o,i.childConditionIndex=u,i.across_sessions=s||!1,"termination"===l&&""!==l){i.uqdv.parse(t);return i.iIVu=i.uqdv.csYK,i.zrtw(),!0}var v=i.INcP.parse(t);if(v){if(i.csYK=i.INcP.csYK,i.INcP.gXLu){var d=i.INcP.hLZq.kDEi;"APX_PAGE_OPENED"===d&&(d=i.INcP.hLZq.rdll.navigation_id,d=m(d)?d:i.INcP.hLZq.kDEi),i.Bqli=e.getController().getEventCount(d);var f=i.INcP.YScO,_=i.INcP.VOeF;if(i.WGJG=i.geGB(i.Bqli-1,f,_,!1),i.iTuS=i.WGJG,i.WGJG&&"APX_PAGE_OPENED"===i.INcP.hLZq.kDEi)return!0}return!0===c&&(o&&0!==r&&"unordered"!==o||i.iiJG()),!0}return!1})),s(this,"iiJG",(function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;-1!=t&&(i.CmeD=t);var n=i.INcP,r=null!=n&&n._eventCategory?null==n?void 0:n._eventCategory:"specific_event",o=n.hhSn,a=he.getInstance();if("app_start"===o.wbLf)if(i.iTuS=!0,null!=n&&n._timeEnabled){if("session"!=(null==n?void 0:n._time.unit)){var s=L(n._time.unit,n._time.value);if("didn't"==(null==n?void 0:n.gMol)){if(i.uGKB=!1,i.timerDidnt=setTimeout((function(){i.uGKB||(i.WGJG=!0,i.WGJG&&(i.fYKk+=1,i.WGJG=i.geGB(i.fYKk,i.INcP.YScO,i.INcP.VOeF),i.WGJG&&(i.INcP.oqnK=Date.now(),i.uGKB=!1,a.validate(i.xEum,i.mbVI,i.CmeD))),"specific_event"===r?a.unregisterFromEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.aylO):i.cKRq(r),i.iTuS=!1)}),s),i.across_sessions){var l=L(n._time.unit,n._time.value),u=n._timeEnabled,c=n._id;i.dDvy(n.gMol,n.hLZq.kDEi,Date.now(),n.hLZq.rdll,l,u,c)}"specific_event"===r?(a.registerForEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.aylO),i.jZUx=i.INcP):i.IRSi(r)}else if("did"==(null==n?void 0:n.gMol)){if(i.timerDid=setTimeout((function(){i.bjhj||("specific_event"===r?a.unregisterFromEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.HCFp):i.eVfs(r))}),s),i.across_sessions){var v=L(n._time.unit,n._time.value),d=n._timeEnabled,f=n._id;i.dDvy(n.gMol,n.hLZq.kDEi,Date.now(),n.hLZq.rdll,v,d,f)}"specific_event"===r?(a.registerForEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.HCFp),i.nGxF=i.INcP):i.DkhB(r)}}}else"specific_event"===r?a.registerForEvent(S(n.wbLf)+"___"+n.hLZq.kDEi,i.XRpi):i.oodo(r);else if(null!=n&&n._timeEnabled){if("session"!=(null==n?void 0:n._time.unit)){var _=L(n._time.unit,n._time.value);"didn't"==(null==n?void 0:n.gMol)?(i.uGKB=!1,i.timerDidnt=setTimeout((function(){i.uGKB||(i.WGJG=!0,i.WGJG&&(i.fYKk+=1,i.WGJG=i.geGB(i.fYKk,i.INcP.YScO,i.INcP.VOeF),i.WGJG&&(i.INcP.oqnK=Date.now(),i.uGKB=!1,a.validate(i.xEum,i.mbVI)))),"specific_event"===r&&a.unregisterFromEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.aylO),i.iTuS=!1}),_),"specific_event"===r?(a.registerForEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.aylO),i.jZUx=i.INcP):i.IRSi()):"did"==(null==n?void 0:n.gMol)&&(i.timerDid=setTimeout((function(){i.bjhj||"specific_event"===r&&a.unregisterFromEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.HCFp)}),_),"specific_event"===r&&a.registerForEvent(S(i.INcP.wbLf)+"___"+i.INcP.hLZq.kDEi,i.HCFp))}}else"specific_event"===r&&a.registerForEvent(S(n.wbLf)+"___"+o.hLZq.kDEi,i.XRpi);null!==(e=window.ApxorRTM)&&void 0!==e&&e.badgesLists.includes(i.xEum)&&a.registerForEvent(S(n.wbLf)+"___"+"apxor-badge-container-".concat("-".concat(i.xEum).replaceAll(" ","").replace(/[^\w\s]/gi,"")),i.XRpi)})),s(this,"oodo",(function(e){var t=new he;"apxor_event"===e?t.registerForEvent("apxor_event",(function(e,t,n,r){i.XRpi(S(i.INcP.wbLf),i.INcP.hLZq.kDEi,n,i.INcP.hLZq.rdll)})):"customer_event"===e?t.registerForEvent("customer_event",(function(e,t,n,r){i.XRpi(S(i.INcP.wbLf),i.INcP.hLZq.kDEi,n,i.INcP.hLZq.rdll)})):"any_event"===e?t.registerForEvent("any_event",(function(e,t,n,r){i.XRpi(S(i.INcP.wbLf),i.INcP.hLZq.kDEi,n,i.INcP.hLZq.rdll)})):"campaign_event"===e?t.registerForEvent("campaign_event",(function(e,t,n,r){i.XRpi(S(i.INcP.wbLf),i.INcP.hLZq.kDEi,n,i.INcP.hLZq.rdll)})):"survey_event"===e&&t.registerForEvent("survey_event",(function(e,t,n,r){i.XRpi(S(i.INcP.wbLf),i.INcP.hLZq.kDEi,n,i.INcP.hLZq.rdll)}))})),s(this,"cKRq",(function(e){var t=new he,n=i.INcP._eventCategory;"apxor_event"===n?t.unregisterFromEvent("apxor_event",i.aylO):"customer_event"===n?t.unregisterFromEvent("customer_event",i.aylO):"any_event"===n?t.unregisterFromEvent("any_event",i.aylO):"campaign_event"===n?t.unregisterFromEvent("campaign_event",i.aylO):"survey_event"===n&&t.unregisterFromEvent("survey_event",i.aylO)})),s(this,"IRSi",(function(){var e=new he,t=i.INcP._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",i.aylO):"customer_event"===t?e.registerForEvent("customer_event",i.aylO):"any_event"===t?e.registerForEvent("any_event",i.aylO):"campaign_event"===t?e.registerForEvent("campaign_event",i.aylO):"survey_event"===t&&e.registerForEvent("survey_event",i.aylO)})),s(this,"DkhB",(function(){var e=new he,t=i.INcP._eventCategory;"apxor_event"===t?e.registerForEvent("apxor_event",i.HCFp):"customer_event"===t?e.registerForEvent("customer_event",i.HCFp):"any_event"===t?e.registerForEvent("any_event",i.HCFp):"campaign_event"===t?e.registerForEvent("campaign_event",i.HCFp):"survey_event"===t&&e.registerForEvent("survey_event",i.HCFp)})),s(this,"eVfs",(function(){var e=new he,t=i.INcP._eventCategory;"apxor_event"===t?e.unregisterFromEvent("apxor_event",i.HCFp):"customer_event"===t?e.unregisterFromEvent("customer_event",i.HCFp):"any_event"===t?e.unregisterFromEvent("any_event",i.HCFp):"campaign_event"===t?e.unregisterFromEvent("campaign_event",i.HCFp):"survey_event"===t&&e.unregisterFromEvent("survey_event",i.HCFp)})),s(this,"zrtw",(function(){var e=i.uqdv,t=he.getInstance();i.iTuS=!0,t.registerForEvent(S(e.wbLf)+"___"+e.hLZq.kDEi,i.rhZd)})),s(this,"Zmbx",(function(e,t,n,r){var o,a=(Date.now()-i.vdGl[t])/1e3;(null===(o=i.INcP)||void 0===o||null===(o=o.hLZq)||void 0===o||null===(o=o.rdll)||void 0===o?void 0:o.time)/1e3>a&&i._displayCampaign(n)})),s(this,"wATL",(function(e,t,n,r){var o,a;i.uGKB=!0;var s=Date.now(),l=null===(o=i.INcP)||void 0===o||null===(o=o.hhSn)||void 0===o?void 0:o.hLZq.kDEi,u=(s-i.vdGl[l])/1e3,c=null===(a=i.INcP)||void 0===a||null===(a=a.hLZq)||void 0===a||null===(a=a.rdll)||void 0===a?void 0:a.time;(c/=1e3)>u&&i._displayCampaign(n)})),s(this,"HCFp",(function(){i.bjhj=!0;var e=new he;clearTimeout(i.timerDid),i.fYKk+=1,i.WGJG=i.geGB(i.fYKk,i.INcP.YScO,i.INcP.VOeF),i.WGJG&&(e.unregisterFromEvent(S(i.nGxF.wbLf)+"___"+i.nGxF.hLZq.kDEi,i.HCFp),i.bjhj=!1,e.validate(i.xEum,i.mbVI,i.CmeD))})),s(this,"aylO",(function(e,t,n,r){i.uGKB=!0,clearTimeout(i.timerDidnt),(new he).unregisterFromEvent(S(i.jZUx.wbLf)+"___"+i.jZUx.hLZq.kDEi,i.aylO)})),s(this,"XRpi",(function(t,n,r,o){var a,s,l=he.getInstance();if(i.iTuS){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&null!==(s=window.ApxorRTM)&&void 0!==s&&s.badgesLists.includes(i.xEum)&&e.getController().isBadgeTriggerSatisfied(i.xEum))return i.WGJG=!0,i.INcP.oqnK=r,void l.validate(i.xEum,i.mbVI);if(S(i.INcP.wbLf)===t&&i.XrZj(r-i.INcP.hhSn.oqnK,i.INcP.VBqr)&&i.INcP.hLZq.kDEi===n&&i.ooIu(i.INcP.hLZq.rdll,o)&&(i.fYKk+=1,i.WGJG=i.geGB(i.fYKk,i.INcP.YScO,i.INcP.VOeF),i.WGJG)){if(i.INcP.oqnK=r,i.across_sessions){var u=L(i.INcP._time.unit,i.INcP._time.value),c=i.INcP._timeEnabled,v=i.INcP._id,d=i.fYKk;i.dDvy(i.INcP.gMol,n,r,o,u,c,v,d)}l.validate(i.xEum,i.mbVI,i.CmeD)}}else if(i.iTuS=i.zRrB(t,n,r,o),i.iTuS){var f=i.INcP,_=f.hhSn;if(_.oqnK=r,"activity_time"===(null==f?void 0:f.wbLf)){var h,g,m,p,y=null==f||null===(h=f.hLZq)||void 0===h||null===(h=h.rdll)||void 0===h?void 0:h.time;(null==f||null===(g=f.dwSC)||void 0===g?void 0:g.length)>0?setTimeout((function(){var t;(null===(t=e.getController())||void 0===t?void 0:t._appEventsNoKpi).length<=2&&f.dwSC===location.pathname&&i._displayCampaign(r)}),y):(null==f||null===(m=f.hLZq)||void 0===m||null===(m=m.rdll)||void 0===m?void 0:m.nkpi.length)>0?(setTimeout((function(){i.uGKB||(i.WGJG=!0,i.WGJG&&(i.fYKk+=1,i.WGJG=i.geGB(i.fYKk,i.INcP.YScO,i.INcP.VOeF),i.WGJG&&(i.INcP.oqnK=r,i.uGKB=!1,l.validate(i.xEum,i.mbVI)))),f.hLZq.rdll.nkpi.map((function(e){l.unregisterFromEvent(w(f.hLZq.rdll.et)+"___"+e,i),i.iTuS=!1}))}),y),f.hLZq.rdll.nkpi.map((function(e){l.registerForEvent(w(f.hLZq.rdll.et)+"___"+e,i.aylO)}))):(null==f||null===(p=f.hLZq)||void 0===p||null===(p=p.rdll)||void 0===p?void 0:p.kpi.length)>0&&(setTimeout((function(){f.hLZq.rdll.kpi.map((function(e){l.unregisterFromEvent(w(f.hLZq.rdll.et)+"___"+e,i)}))}),y),f.hLZq.rdll.kpi.map((function(e){e===f.hhSn.hLZq.kDEi?(l.unregisterFromEvent(S(_.wbLf)+"___"+_.hLZq.kDEi,i),l.registerForEvent(w(f.hLZq.rdll.et)+"___"+e,i.Zmbx)):l.registerForEvent(w(f.hLZq.rdll.et)+"___"+e,i.wATL)})))}else l.unregisterFromEvent(S(_.wbLf)+"___"+_.hLZq.kDEi,i),l.registerForEvent(S(f.wbLf)+"___"+f.hLZq.kDEi,i);i.vdGl[n]=Date.now()}})),s(this,"rhZd",(function(e,t,n,r){var o=he.getInstance();S(i.uqdv.wbLf)===e&&i.XrZj(n,i.uqdv.VBqr)&&i.uqdv.hLZq.kDEi===t&&i.ooIu(i.uqdv.hLZq.rdll,r)&&(i.fYKk+=1,i.WGJG=i.geGB(i.fYKk,i.uqdv.YScO,i.uqdv.VOeF),i.WGJG&&(i.uqdv.oqnK=n,o.validateForTermination(i.xEum,i.mbVI)))})),s(this,"zRrB",(function(e,t,n,r){var o=i.INcP.hhSn,a=S(o.wbLf)===e&&o.hLZq.kDEi===t&&i.XrZj(n,o.VBqr)&&i.ooIu(o.hLZq.rdll,r);return a="APX_PAGE_OPENED"===t?a&&location.pathname===o.hLZq.YNpf:a})),s(this,"XrZj",(function(e,t){var i=Math.ceil(e);return i>t.PWUk&&i<t.ReRO})),s(this,"geGB",(function(e,t,n){var r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(r&&i.INcP.gXLu&&(e+=i.Bqli),n){case"EQ":return e===t;case"GT":return e>t;case"GTE":return e>=t;case"LT":return e<t;case"LTE":return e<=t;default:return!1}})),s(this,"ooIu",(function(e,t){var i=!0;try{var r,o=function(){if(!1===i)return{v:!1};if("object"===n(e[a])){var r,o,s,l=e[a].op,u=e[a].t;if("s"===u)s=e[a].val;else if("l"===u||"f"===u)s=parseFloat(e[a].val);else if("b"===u)switch(e[a].val){case"true":s=!0;break;case"false":s=!1;break;default:s=e[a].val}var c,v=(Array.isArray(t[a])?t[a]:[t[a]]).some((function(e){return"s"===u?e="".concat(e):"l"===u?e=parseInt(e):"f"===u?e=parseFloat(e):"b"===u&&(e=!!e),N(e,s,l)}));if(!(null===(r=e[a])||void 0===r||!r.present)&&(null===(o=e[a])||void 0===o?void 0:o.present))c=!!t.hasOwn(t,a),i=i&&c;i=i&&v}else i=i&&N(t[a],e[a],"EQ")};for(var a in e)if(r=o())return r.v}catch(e){W.error(e),i=!1}return i})),s(this,"dDvy",(function(t,n,r,o,a,s,l,u){var c,v=!1;i.no_KPI_TriggerDetails=e.getController().getFromStorage("apx_nokpi_triggerdetails"),null===i.no_KPI_TriggerDetails||void 0===i.no_KPI_TriggerDetails?i.no_KPI_TriggerDetails=[]:i.no_KPI_TriggerDetails=JSON.parse(i.no_KPI_TriggerDetails);var d,f=0;s&&(f=Date.now()+a);for(var _=0;_<i.no_KPI_TriggerDetails.length;_++)if(i.no_KPI_TriggerDetails[_].id===l){v=!0,c=i.no_KPI_TriggerDetails[_];break}v?c.satisfiedCount+=1:(d={id:l,type:t,time:r,name:n,additionalInfo:o,satisfiedCount:u,timeBased:s,finishTime:f},i.no_KPI_TriggerDetails.push(d)),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(i.no_KPI_TriggerDetails))})),s(this,"FzyL",(function(e){var t,n=new he,r=d(e);try{for(r.s();!(t=r.n()).done;){var o=t.value;if(1===(null==o?void 0:o.length)||void 0===(null==o?void 0:o.length))n.unregisterFromEvent(S(null==o?void 0:o.INcP.wbLf)+"___"+(null==o?void 0:o.INcP.hLZq.kDEi),i.XRpi);else{var a,s=d(o);try{for(s.s();!(a=s.n()).done;){var l,u=a.value;n.unregisterFromEvent(S(null==u?void 0:u.INcP.wbLf)+"___"+(null==u||null===(l=u.INcP)||void 0===l?void 0:l.hLZq.kDEi),i.XRpi)}}catch(e){s.e(e)}finally{s.f()}}}}catch(e){r.e(e)}finally{r.f()}}))}return a(t,[{key:"_displayCampaign",value:function(e){var t=he.getInstance();this.WGJG=!0,this.WGJG&&(this.fYKk+=1,this.WGJG=this.geGB(this.fYKk,this.INcP.YScO,this.INcP.VOeF),this.WGJG&&(this.INcP.oqnK=e,t.validate(this.xEum,this.mbVI)))}}]),t}(),X=window.ApxorLogger,U=a((function t(){var i=this;r(this,t),s(this,"YScO",0),s(this,"xDzt",0),s(this,"WXJe","SESSION"),s(this,"NeCC",0),s(this,"WdWZ",0),s(this,"Gtnq",0),s(this,"_enable_repetition_gap",void 0),s(this,"_enable_days_limit",void 0),s(this,"_enable_session_limit",void 0),s(this,"uWIh",void 0),s(this,"kRsW",void 0),s(this,"rhPf",void 0),s(this,"DSLimits",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r,o,a,s,l,u,c;if(i.xEum=t._id,i.ersv=t.meta,i.YScO=t.frequency.count,-1===i.YScO&&(i.YScO=9999999),i.Gtnq=i.YScO,i.xDzt=t.frequency.time_interval,i.WXJe=t.frequency.validity,i.DSLimits=t.frequency.DSLimits,i.WdWZ=t.frequency.ses_lmt,i._enable_session_limit=null===(n=t.frequency)||void 0===n?void 0:n.enable_session_limit,i._enable_session_limit)i.uWIh=null===(l=t.frequency)||void 0===l?void 0:l.session_count;if(i._dayCount=null!==(r=t.frequency)&&void 0!==r&&r.day_lmt?null===(o=t.frequency)||void 0===o?void 0:o.day_lmt:0,i._enable_repetition_gap=!!t.frequency.enable_repetition_gap&&t.frequency.enable_repetition_gap,i._enable_repetition_gap)i._repetitionValue=null===(u=t.frequency)||void 0===u?void 0:u.repetition_gap.val,i._repetitionUnit=null===(c=t.frequency)||void 0===c?void 0:c.repetition_gap.unit;i._enable_days_limit=!(null===(a=t.frequency)||void 0===a||!a.enable_days_limit)&&(null===(s=t.frequency)||void 0===s?void 0:s.enable_days_limit),i._enable_days_limit&&(i.rhPf=t.frequency.days_limit.days?t.frequency.days_limit.days:1,i.kRsW=t.frequency.days_limit.limit);var v=he.getInstance().getQeState();if(!m(v)||!m(v[t._id]))return!0;if("SESSION"===i.WXJe){if(i.YScO=parseInt(i.YScO)-parseInt(v[t._id].SESSION),i.YScO<=0)return i.cBnv("Session limit reached"),console.warn("Max count limit reached for session:"+t._id),e.getController().isTestDevice()&&R("Maximum overall limit reached for campaign name ".concat(i.ersv.name)),!1}else{if("OVERALL"!==i.WXJe)return X.info("Invalid config."),!1;if(i.YScO=parseInt(i.YScO)-parseInt(v[t._id].OVERALL),i.YScO<=0)return i.cBnv("Overall limit reached"),console.warn("Max count limit reached for overall:"+t._id),e.getController().isTestDevice()&&R("Maximum overall limit reached for campaign name ".concat(i.ersv.name)),!1}}catch(e){return X.error(e),!1}return!0})),s(this,"SgqY",(function(){i.YScO=i.YScO-1})),s(this,"getFrequencyCount",(function(){return i.YScO})),s(this,"sJyg",(function(){"SESSION"===i.WXJe&&(i.YScO=i.Gtnq,X.info("Campaign Limit reset"))})),s(this,"NNyN",(function(t){try{if(i.YScO<=0)return"OVERALL"===i.WXJe?(i.cBnv("Overall limit reached"),e.getController().isTestDevice()&&R("Maximum overall limit reached for campaign name ".concat(i.ersv.name))):"SESSION"===i.WXJe&&(e.getController().isTestDevice()&&R("Maximum session limit reached for campaign name ".concat(i.ersv.name)),i.cBnv("Session limit reached")),!1;var n=he.getInstance().getQeState();if(!m(n)||!m(n[t]))return!0;if(i._enable_session_limit)if(parseInt(i.uWIh)-parseInt(n[t].SESSION)<=0)return i.cBnv("Session limit reached"),e.getController().isTestDevice()&&R("Maximum session limit reached for campaign name ".concat(i.ersv.name)),!1;if(i._enable_repetition_gap)if("session"!=i._repetitionUnit){var r=e.getController().getFromStorage("apx-last-shown-times");if(r=JSON.parse(r),!g(D(r,i.xEum))){var o=D(r,i.xEum)[i.xEum];if(Date.now()-o<L(i._repetitionUnit,i._repetitionValue))return i.cBnv("Config does not satisfy time difference "),e.getController().isTestDevice()&&R("Config does not satisfy time difference for campaign name ".concat(i.ersv.name)),!1}}else{var a=e.getController().getFromStorage("apx-last-shown-session");if(a=JSON.parse(a),!g(D(a,i.xEum))){var s=D(a,i.xEum)[i.xEum];if(e.getController().getFromStorage("apx_retained_session")-s<parseInt(i._repetitionValue))return i.cBnv("Config does not satisfy session difference "),e.getController().isTestDevice()&&R("Config does not satisfy session difference for campaign name ".concat(i.ersv.name)),!1}}if(0!==i.WdWZ&&i.DSLimits)if(parseInt(i.WdWZ)-parseInt(n[t].SESSION)<=0)return i.cBnv("Session limit reached"),e.getController().isTestDevice()&&R("Session limit reached for campaign name ".concat(i.ersv.name)),!1;if(0!==i._dayCount){var l,u=O();if(parseInt(i._dayCount)-parseInt((null===(l=n[t])||void 0===l?void 0:l.DATES[u])||0)<=0)return i.cBnv("Day limit reached"),e.getController().isTestDevice()&&R("Day limit reached for campaign name ".concat(i.ersv.name)),!1}if(i.rhPf>0&&i._enable_days_limit){var c=i.rhPf,v=0;if(function(e){for(var t=[],i=new Date,n=0;n<e;n++){var r=new Date(i);r.setDate(i.getDate()-n);var o=String(r.getDate()),a=String(r.getMonth()),s=r.getFullYear();t.push(o+"/"+a+"/"+s)}return t}(c).forEach((function(e){var i;v+=parseInt((null===(i=n[t])||void 0===i?void 0:i.DATES[e])||0)})),v>i.kRsW)return X.info("Shown Limit Crossed"),e.getController().isTestDevice()&&R("Days limit reached for campaign name ".concat(i.ersv.name)),!1}}catch(e){i.cBnv("Error validating the frequency: ".concat(e)),X.error("Error validating the frequency:"+e)}return!0})),s(this,"cBnv",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.ersv.type?"survey":"campaign",apx_nudge_id:i.xEum,apx_nudge_name:i.ersv.name,message_name:i.ersv.kDEi,id:i.xEum,apx_variant_code:i.ersv.isExperiment||i.ersv.only_context?null===(n=i.ersv.attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),H=window.ApxorLogger,Q=a((function e(){var t=this;r(this,e),s(this,"vmcx",[]),s(this,"CKFj",0),s(this,"EZuz",!1),s(this,"WuMK",void 0),s(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"unordered",o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:[],a=arguments.length>5?arguments[5]:void 0,s=arguments.length>6&&void 0!==arguments[6]&&arguments[6];t.xEum=i,t.mbVI=n,t.vprY=o,t.wJLZ=r,t.across_sessions=s;var l=[];t.CKFj=e.length;try{if(null!=l)return r=null==e?void 0:e.sequence_type,l=t.dCRj(e,t.CKFj),"unordered"!==a&&0!==t.mbVI||t.iiJG(),t.vmcx}catch(e){return H.error(e),!1}})),s(this,"dCRj",(function(e,i){for(var n=0;n<i;n++){t.WuMK=new z;try{t.WuMK.initialize(e[n],t.xEum,t.mbVI,t.wJLZ,t.xECp,t.across_sessions,"",-1,!1)&&(t.vmcx.push(t.WuMK),t.vmcx.sequence_type=t.wJLZ)}catch(e){H.error(e)}}return t.vmcx})),s(this,"iiJG",(function(){if("ordered"===t.wJLZ||"strictly_ordered"===t.wJLZ)t.vmcx[0].iiJG(0);else{var e,i=d(t.vmcx);try{for(i.s();!(e=i.n()).done;){e.value.iiJG()}}catch(e){i.e(e)}finally{i.f()}}})),s(this,"FzyL",(function(e){t.WuMK.FzyL(e)}))})),$=a((function e(){var t=this;r(this,e),s(this,"kDEi",""),s(this,"gMol",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,n;t.kDEi=e.meta.name,t.gMol=e.meta.type,t._only_context=e.meta.only_context,t._attr=(null===(i=e.meta)||void 0===i?void 0:i.attr)||{},t._isExperiment=null===(n=e.meta)||void 0===n?void 0:n.isExperiment}catch(e){return window.ApxorLogger.error(e),!1}return!0}))})),ee=window.ApxorLogger,te=a((function t(){var i=this;r(this,t),s(this,"NXzi",[]),s(this,"_ret_day",{}),s(this,"ITGK",{}),s(this,"Fpkl",!1),s(this,"cjEK",!1),s(this,"retainedDaysValidated",!0),s(this,"retainedSessionValidated",!0),s(this,"eventDoneInLT",!1),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{i.NXzi=e.overall_cfg.events,i._ret_day=e.overall_cfg.ret_day,i.ITGK=e.overall_cfg.session,i.Fpkl=e.overall_cfg.toggleRetDay,i.cjEK=e.overall_cfg.toggleSession}catch(e){return ee.error(e),!1}return!0})),s(this,"validate",(function(){var t=parseInt(e.getController().getFromStorage("apx_retained_days")),n=parseInt(e.getController().getFromStorage("apx_retained_session"));if(i.Fpkl&&!isNaN(t)&&!(t>=i._ret_day.from&&t<=i._ret_day.to))return i.retainedDaysValidated=!1,!1;if(i.cjEK&&!isNaN(n)&&!(n>=i.ITGK.from&&n<=i.ITGK.to))return i.retainedSessionValidated=!1,!1;try{for(var r=e.getController().getFromStorage("_apx_lt_count"),o=e.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(e){for(var t=new ArrayBuffer(e.length),i=new Uint8Array(t),n=0;n<e.length;n++)i[n]=e.charCodeAt(n);return t}(E(o,r)))),s=0;s<i.NXzi.length;s++){if(a[i.NXzi[s].name.replace("'","").replace("’","")])return i.eventDoneInLT=!0,!1}}catch(e){ee.error("Failed to validate the lt count:"+e)}return!0}))})),ie=window.ApxorLogger,ne=a((function e(){var t=this;r(this,e),s(this,"ecjf",[]),s(this,"TNqH",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(t.ecjf=e.attributes.user,t.TNqH=e.attributes.session,!Array.isArray(t.ecjf)||!Array.isArray(t.TNqH))return ie.error("No attributes"),!1}catch(e){return ie.error(e),!1}return!0})),s(this,"validate",(function(e,i){return t.RKBd(e,t.ecjf)&&t.RKBd(i,t.TNqH)})),s(this,"RKBd",(function(e,t){var i=t.length,n=!0;try{for(var r,o=function(){var i=t[a];if(!e[i.name]||!1===n)return{v:!1};var r=i.operator,o=i.type,s=i.value.map((function(e){return"s"===o?e:"l"===o?parseInt(e):"f"===o?parseFloat(e):void 0})),l=(Array.isArray(e[i.name])?e[i.name]:[e[i.name]]).some((function(e){return s.some((function(t){return N(e,t,r)}))}));n=n&&l},a=0;a<i;a++)if(r=o())return r.v}catch(e){ie.error(e),n=!1}return n}))})),re=a((function t(){var i=this;r(this,t),s(this,"HiRg",e.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"tsIl",1),s(this,"parse",(function(e){try{var t,n,r;if(i.gMol=null===(t=e.terminate_info.time_based)||void 0===t?void 0:t.type,i._duration_seconds=null===(n=e.terminate_info)||void 0===n?void 0:n.time_based.duration_seconds,i.tsIl=null===(r=e.terminate_info.time_based)||void 0===r?void 0:r.days,i.tUzK(e._id))return i.HiRg.persistTerminationInfoLocally(e._id),!1}catch(e){return!1}return!0})),s(this,"tUzK",(function(e){var t,n=JSON.parse(i.HiRg.getFromStorage("apx_termination_ID"));if(!n[e]||null===(t=n[e])||void 0===t||!t.startDate)return!1;var r,o=new Date(n[e].startDate),a=new Date((r=new Date).getMonth()+"/"+r.getDate()+"/"+r.getFullYear()),s=parseInt((a-o)/864e5,10),l=function(){var e=new Date;return{hours:e.getHours(),mins:e.getMinutes()}}(),u=n[e].QAzq;return s===i.tsIl&&l.hours>=u.hours||s>i.tsIl||n[e].goalAcheived}))})),oe=a((function e(){var t=this;r(this,e),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"Htpo",new ne),s(this,"LJwW",new re),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var i,n,r;if(t.enable_time_based=null==e||null===(i=e.terminate_info)||void 0===i?void 0:i.enable_time_based,t.enable_time_based&&!t.LJwW.parse(e))return!1;if(t.enable_goal_events=null==e||null===(n=e.terminate_info)||void 0===n?void 0:n.enable_goal_events,t.enable_attributes=null==e||null===(r=e.terminate_info)||void 0===r?void 0:r.enable_attributes,t.enable_attributes&&!t.Htpo.parse(e.terminate_info))return!1}catch(e){return window.ApxorLogger.error(e),!1}return!0})),s(this,"validate",(function(e,i){return t.Htpo.validate(e,i)}))})),ae=window.ApxorLogger,se=a((function t(){var i=this;r(this,t),s(this,"hQFG",-1),s(this,"eToT",-1),s(this,"QAzq",-1),s(this,"rHqF",-1),s(this,"juBX",-1),s(this,"dqsv",-1),s(this,"_is_user_timezone",void 0),s(this,"VVHi",!1),s(this,"ffDx",!1),s(this,"_nudge_expired",!1),s(this,"_not_yet_active",!1),s(this,"_not_in_specified_time",!1),s(this,"_days_in_week",[]),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,n;if(i.xEum=e._id,i.ersv=e.meta,isNaN(Date.parse(e.validity.start_date))||isNaN(Date.parse(e.validity.end_date))||!Array.isArray(e.validity.days_in_week))return ae.error("Not valid dates"),!1;if(i.hQFG=Date.parse(e.validity.start_date),i.eToT=Date.parse(e.validity.end_date),i._days_in_week=null!==(t=e.validity)&&void 0!==t&&t.days_in_week?null===(n=e.validity)||void 0===n?void 0:n.days_in_week:[1,2,3,4,5,6,7],i._is_user_timezone=!e.is_user_timezone||e.is_user_timezone,m(e.at_specific_time)&&(i.VVHi=e.at_specific_time,i.VVHi&&m(e.time_limits)&&(i.QAzq=e.time_limits.start_time,i.rHqF=e.time_limits.end_time,I(i.QAzq)||I(i.rHqF))))return ae.error("Not valid times"),!1;if(m(e.time_excludes_in_day)&&(i.ffDx=e.time_excludes_in_day,i.ffDx&&m(e.time_excludes)&&(i.juBX=e.time_excludes.start_time,i.dqsv=e.time_excludes.end_time,I(i.juBX)||I(i.dqsv))))return ae.error("Not valid exclude times"),!1}catch(e){return ae.error(e),!1}return!0})),s(this,"validate",(function(){var t=Date.now(),n=(new Date).getDay()+1,r=function(e){var t=new Date,i=t.getHours(),n=t.getMinutes(),r=(i=(i<10?"0":"")+i)+":"+(n=(n<10?"0":"")+n);if(!e){var o=t.getUTCHours(),a=t.getUTCMinutes();r=(o=(o<10?"0":"")+o)+":"+(a=(a<10?"0":"")+a)}return r}(i._is_user_timezone);if(t>i.hQFG&&t<i.eToT&&i._days_in_week.includes(n))return!i.VVHi||x(r,i.QAzq,"GT")&&x(r,i.rHqF,"LT")||(i._not_in_specified_time=!0),i.ffDx&&function(e,t,i){var n=l(e.split(":").map(Number),2),r=n[0],o=n[1],a=l(t.split(":").map(Number),2),s=a[0],u=a[1],c=l(i.split(":").map(Number),2),v=60*c[0]+c[1];return v>=60*r+o&&v<=60*s+u}(i.juBX,i.dqsv,r)?(i.cBnv("Exclude Time limits check failed"),e.getController().isTestDevice()&&R("Exclude Time Limits check failed for campaign name ".concat(i.ersv.name)),!1):!i.VVHi||x(r,i.QAzq,"GT")&&x(r,i.rHqF,"LT");if(t<i.hQFG)i._not_yet_active=!0;else if(t>i.eToT)i._nudge_expired=!0;else if(!i._days_in_week.includes(n))return i.cBnv("Current week day did not match with Configured Week day"),e.getController().isTestDevice()&&R("Current week day did not match with Configured Week day for campaign name ".concat(i.ersv.name)),!1;return!1})),s(this,"cBnv",(function(t){var n;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===i.ersv.type?"survey":"campaign",apx_nudge_id:i.xEum,apx_nudge_name:i.ersv.name,message_name:i.ersv.kDEi,id:i.xEum,apx_variant_code:i.ersv.isExperiment||i.ersv.only_context?null===(n=i.ersv.attr)||void 0===n?void 0:n.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),le=a((function e(){var t=this;r(this,e),s(this,"caEe",""),s(this,"UVFh",""),s(this,"iivU",""),s(this,"XWam",""),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return t.caEe=null==e?void 0:e.screen_binding,!t.caEe||(t.UVFh=null==e?void 0:e.binding.url,t.iivU=null==e?void 0:e.binding.var,t.XWam=null==e?void 0:e.binding.operator,!0)}catch(e){return window.ApxorLogger.error(e),!1}})),s(this,"validate",(function(){var e=t.UVFh,i=t.iivU,n=t.XWam,r=window.location.href;return!t.caEe||("EQ"===n?e.includes(i)?!!P(r,e,i,!1):r===e:"SW"===n?e.includes(i)?!!P(r,e,i,!0):!!r.startsWith(e):void 0)}))})),ue=window.ApxorLogger,ce=a((function t(){var n=this;r(this,t),s(this,"SsOR",[]),s(this,"SBVw",[]),s(this,"xEum",""),s(this,"ersv",new $),s(this,"Glqb",new Z),s(this,"WXJe",new se),s(this,"PeLS",new U),s(this,"zGBG",new te),s(this,"sKZQ",new oe),s(this,"GSpN",new le),s(this,"wJLZ",!1),s(this,"xECp",[]),s(this,"_variant_code",""),s(this,"EZuz",!1),s(this,"groupCombineOperator","OR"),s(this,"uGKB",!1),s(this,"Mwxd",!1),s(this,"yLEN",void 0),s(this,"timeForKPI",void 0),s(this,"kpiIndex",0),s(this,"sUaj",void 0),s(this,"_across_sessions",!1),s(this,"azbF",void 0),s(this,"hoOV",!1),s(this,"OPjG",void 0),s(this,"YJay",void 0),s(this,"oFhI",void 0),s(this,"azpt",void 0),s(this,"MUmv",void 0),s(this,"uBFN",void 0),s(this,"YaIz",void 0),s(this,"aypu",void 0),s(this,"NTZT",void 0),s(this,"RPRb",void 0),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var t,i;if(!m(e._id))return ue.error("No Id"),!1;if(!m(e.enabled)||!e.enabled)return ue.error("Not enabled"),!1;if(!(n.ersv.parse(e)&&n.WXJe.parse(e)&&n.PeLS.parse(e)&&n.Glqb.parse(e)&&n.zGBG.parse(e)&&n.sKZQ.parse(e)&&n.GSpN.parse(e)))return!1;if(n._variant_code=n.ersv._isExperiment||n.ersv._only_context?null===(t=n.ersv._attr)||void 0===t?void 0:t.apx_variant_code:"TG",n._across_sessions=!(null==e||!e.across_sessions)&&(null==e?void 0:e.across_sessions),n.enable_conditions=null==e?void 0:e.enable_conditions,n.enable_conditions_v2=null==e?void 0:e.enable_conditions_v2,!m(e.conditions)||!Array.isArray(e.conditions))return ue.error("No valid conditions",e.conditions),!1;n.xEum=e._id,n.wJLZ=!!m(e.sequence_enabled)&&e.sequence_enabled,m(e.conditions_v2)&&n.enable_conditions_v2&&(n.wJLZ=null==e?void 0:e.sequence_type),!0===n.wJLZ&&e.conditions.sort((function(e,t){return e.sequence<t.sequence})),m(e.conditions_v2)&&n.enable_conditions_v2?(i=e.conditions_v2,n.hoOV=!0):i=e.conditions,n.azbF=i;var r=i.length,o=null==e?void 0:e.no_context_enabled;if(0===r&&o&&setTimeout((function(){n.zEYk()}),10),n.RPRb=r,n.umlk(i,r),n.QtMk(),n.sKZQ.enable_goal_events)for(var a=e.terminate_info.goal_events.events,s=a.length,l=0;l<s;l++){var u=new z;u.initialize(a[l],n.xEum,l,!0,[],n._across_sessions,"termination")&&n.SBVw.push(u)}return n.SsOR.length>0}catch(e){return ue.error(e),!1}})),s(this,"umlk",(function(e,t){for(var i=function(){n.xECp=[];var t=e[r];if("group"===(null!=t&&t.condition_type?null==t?void 0:t.condition_type:"single")){var i=t.conditions_v2;n.groupCombineOperator=t.combine_operator;var o=null==t?void 0:t.sequence_type;n.NTZT=new Q;var a=n.NTZT.initialize(i,n.xEum,r,o,n.xECp,n.wJLZ,n._across_sessions);n.SsOR.push(a)}else{if("didn't"===t.type){var s,l={trigger_key:t.trigger.details.name,no_kpi_array:null==t||null===(s=t.details)||void 0===s||null===(s=s.additional_info)||void 0===s?void 0:s.nkpi,condition_id:null==t?void 0:t._id,time_bounds:t.time_bounds.upper};n.xECp=[].concat(u(n.xECp),[l])}if(n.NTZT=new z,n.NTZT.initialize(t,n.xEum,r,n.wJLZ,n.xECp,n._across_sessions)){n.SsOR.push(n.NTZT);var c=(null==t?void 0:t.timeout)/(null==t?void 0:t.findinterval),v=(null==t?void 0:t.frameid)||"",d=null==t?void 0:t.url;window.location.href===d&&"view_visibility"===t.event_type&&!0===G(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,c)&&n.zEYk(!0),window.addEventListener("navigate",(function(e){var i=null==t?void 0:t.url;window.location.href===i&&"view_visibility"===t.event_type&&!0===G(t.view_id,v,null==t?void 0:t.enable_retry,null==t?void 0:t.findinterval,c)&&n.zEYk(!0)}))}}},r=0;r<t;r++)i()})),s(this,"QtMk",(function(){if(n._across_sessions&&"ordered"===n.wJLZ){var t=!1,i=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(i=JSON.parse(i))&&null!=i)for(var r=function(e){var r,o,a;if(null!==(r=n.SsOR[e])&&void 0!==r&&null!==(r=r.INcP)&&void 0!==r&&r._timeEnabled&&void 0===n.SsOR[e].length){if("didn't"===n.SsOR[e].INcP.gMol){var s=n.SsOR[e].INcP._id,l=n.KFvC(s,i);if(l)if(Date.now()>l.finishTime)n.SsOR[e].WGJG=!0,n.SsOR[e].fYKk=l.satisfiedCount,t=!0;else{var u=l.finishTime-Date.now(),c=n.SsOR[e].INcP._eventCategory?n.SsOR[e].INcP._eventCategory:"specific_event",v=new he;"specific_event"===c?(v.registerForEvent(S(n.SsOR[e].INcP.wbLf)+"___"+n.SsOR[e].INcP.hLZq.kDEi,n.aylO),n.MUmv=n.SsOR[e]):n.IRSi(c),setTimeout((function(){e!==n.SsOR.length-1||n.uGKB||(n.SsOR[e].WGJG=!0,n.SsOR[e].fYKk=l.satisfiedCount,t=!0,"specific_event"===c?v.unregisterFromEvent(S(n.SsOR[e].INcP.wbLf)+"___"+n.SsOR[e].INcP.hLZq.kDEi,n.aylO):n.azYa(n.SsOR[e]),n.zEYk())}),u)}}if("did"===n.SsOR[e].INcP.gMol){var d=n.SsOR[e].INcP._id,f=n.KFvC(d,i);if(f)if(null==f.satisfiedCount){if(Date.now()<f.finishTime){n.oFhI=f,n.YJay=e;var _=f.finishTime-Date.now(),h=n.SsOR[e].INcP._eventCategory?n.SsOR[e].INcP._eventCategory:"specific_event",g=new he;"specific_event"===h?g.registerForEvent(S(n.SsOR[e].INcP.wbLf)+"___"+n.SsOR[e].INcP.hLZq.kDEi,n.FUGa):n.IRSi(h),setTimeout((function(){"specific_event"===h?g.unregisterFromEvent(S(n.SsOR[e].INcP.wbLf)+"___"+n.SsOR[e].INcP.hLZq.kDEi,n.FUGa):n.azYa(n.SsOR[e])}),_)}}else n.SsOR[e].fYKk=f.satisfiedCount,n.SsOR[e].WGJG=!0}}else t=n.YXdy(e,i);t&&(null===(o=n.SsOR[e])||void 0===o||null===(o=o.INcP)||void 0===o||!o._timeEnabled||(null===(a=n.SsOR[e])||void 0===a?void 0:a.length)>1)?e===n.SsOR.length-1&&n.zEYk():t||void 0===!n.SsOR[e].length&&n.SsOR[e].iiJG()},o=0;o<n.SsOR.length;o++)r(o)}else if(n._across_sessions&&"unordered"===n.wJLZ){var a=e.getController().getFromStorage("apx_nokpi_triggerdetails");if(null!=(a=JSON.parse(a))&&null!=a)for(var s=0;s<n.SsOR.length;s++)n.YXdy(s,a)}})),s(this,"YXdy",(function(e,t){if(void 0===n.SsOR[e].length||1===n.SsOR[e].length){var i=n.SsOR[e].INcP._id,r=!1,o=n.KFvC(i,t);if(o)n.OPjG=o,r=(new z).geGB(o.satisfiedCount,n.SsOR[e].INcP.YScO,n.SsOR[e].INcP.VOeF),o&&(r?n.SsOR[e].WGJG=!0:n.SsOR[e].fYKk=o.satisfiedCount);else n.SsOR[e].iiJG();return r}if(n.SsOR[e].length>=1){var a,s,l;if("ordered"===(s=null===(a=n.SsOR[e])||void 0===a?void 0:a.sequence_type)||"strictly_ordered"===s){for(var u=0;u<n.SsOR[e].length;u++){var c=n.SsOR[e][u],v=c.INcP._id;l=!1;var d=n.KFvC(v,t);if(d){if(l=(new z).geGB(d.satisfiedCount,c.INcP.YScO,c.INcP.VOeF),d)if(l){n.SsOR[e][u].WGJG=!0;var f=u+1,_=n.SsOR[e][u+1];void 0===_&&m(n.SsOR[e+1])&&(n.SsOR[e+1].iiJG(),l=!0),null!=_&&n.SsOR[e][u+1].iiJG(f)}else n.SsOR[e][u].fYKk=d.satisfiedCount}else(m(n.SsOR[e][u-1])&&!0===n.SsOR[e][u].WGJG||h(n.SsOR[e][u-1]))&&n.SsOR[e][u].iiJG()}return l}for(var g,p=0;p<n.SsOR[e].length;p++){var y=n.SsOR[e][0].INcP.csYK;g="OR"!==y;var E=n.SsOR[e][p],I=E.INcP._id;l=!1;var S=n.KFvC(I,t);if(S)l=(new z).geGB(S.satisfiedCount,E.INcP.YScO,E.INcP.VOeF),S&&(l?n.SsOR[e][p].WGJG=!0:n.SsOR[e][p].fYKk=S.satisfiedCount);else E.iiJG();g="AND"===y?g&&l:g||l}return g}})),s(this,"KFvC",(function(e,t){return t.find((function(t){return t.id===e}))})),s(this,"nVOZ",(function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1,r=he.getInstance();if(!(t<0)){var o=n.SsOR[t],a="unordered";if((null==o?void 0:o.length)>1&&(a=null==o?void 0:o.sequence_type),!0===n.wJLZ||"ordered"===n.wJLZ||"strictly_ordered"===n.wJLZ||"ordered"===a||"strictly_ordered"===a){n.kpiIndex=t+1;var s=n.SsOR[t];if((null==s?void 0:s.length)>0){if(m(s))if("unordered"===n.wJLZ&&"ordered"===a){var l=o[i-1];if(m(l))if(void 0===l.length||1==l.length){if(!l.WGJG)return}else if(l.length>1&&!n.tXym(l))return;var u,c=o[i+1];if(m(c)){if(c.iiJG(i+1),"strictly_ordered"===n.wJLZ){n._currentEventname=s[i].INcP.hLZq.kDEi;var v=e.getController();v.registerForEvent("APP_EVENT",n.kizd),v.registerForEvent("CLIENT_EVENT",n.kizd)}}else if("strictly_ordered"===a)1!=n.EZuz&&n.zEYk();else(null===(u=o[i])||void 0===u?void 0:u.length)>0?n.tXym(o)&&n.zEYk():n.zEYk()}else{var f,_=n.SsOR[t-1];if(m(_))if(void 0===_.length||1==_.length){if(!_.WGJG)return}else if(_.length>1&&!n.tXym(_))return;if(void 0===s.length||1===s.length?f=n.SsOR[t+1]:s.length>1&&("ordered"===a||"strictly_ordered"===a?f=i===s.length-1?n.SsOR[t+1]:n.SsOR[t][i+1]:n.tXym(s)&&(f=n.SsOR[t+1])),m(f)){if(void 0===f.length||1===f.length)f.iiJG(i+1);else if(n.tXym(s))if(void 0===f.length)f.iiJG();else if(f.length>1)if("unordered"===f.sequence_type)for(var h=0;h<f.length;h++)f[h].iiJG(h);else"ordered"!==f.sequence_type&&"strictly_ordered"!==f.sequence_type||f[0].iiJG(0);if("strictly_ordered"===n.wJLZ){n._currentEventname=s[i].INcP.hLZq.kDEi;var g=e.getController();g.registerForEvent("APP_EVENT",n.kizd),g.registerForEvent("CLIENT_EVENT",n.kizd)}}else"strictly_ordered"===n.wJLZ?1!=n.EZuz&&n.zEYk():n.tXym(s)&&n.zEYk()}}else if(m(s)&&s.WGJG){s.vdGl[s.INcP.hLZq.kDEi]=Date.now();var p=n.SsOR[t-1];if(m(p))if(void 0===p.length||1==p.length){if(!p.WGJG)return}else if(p.length>1&&!n.tXym(p))return;var y=n.SsOR[t+1];if(m(y)){var E,I;if(null!=y&&null!==(E=y.INcP)&&void 0!==E&&E._timeEnabled){if("session"!=(null===(I=y.INcP)||void 0===I?void 0:I._time.unit)){var w,N,b=L(y.INcP._time.unit,y.INcP._time.value);if("didn't"==(null===(w=y.INcP)||void 0===w?void 0:w.gMol)){if(n.YaIz=setTimeout((function(){if(n.uGKB)n.uGKB=!1;else{if(n.uGKB=!1,y.WGJG=!0,y.WGJG){y.fYKk+=1;var e=new z;if(y.WGJG=e.geGB(y.fYKk,y.INcP.YScO,y.INcP.VOeF),y.WGJG){y.INcP.oqnK=Date.now();var i=t+1,o=n.SsOR[i+1];m(o)?o.iiJG():n.zEYk()}}r.unregisterFromEvent(S(y.INcP.wbLf)+"___"+y.INcP.hLZq.kDEi,n.aylO),y.iTuS=!1}}),b),n._across_sessions){var O=L(y.INcP._time.unit,y.INcP._time.value),x=y.INcP._timeEnabled,P=y.INcP._id,G=new z;G.dDvy(y.INcP.gMol,y.INcP.hLZq.kDEi,Date.now(),y.INcP.hLZq.rdll,O,x,P)}"specific_event"===y.INcP._eventCategory?(r.registerForEvent(S(y.INcP.wbLf)+"___"+y.INcP.hLZq.kDEi,n.aylO),n.MUmv=y):n.IRSi(y)}else if("did"==(null===(N=y.INcP)||void 0===N?void 0:N.gMol)&&(n.uGKB=!1,n.sUaj=y,m(n.SsOR[t+2])&&n._across_sessions&&(n.azpt=n.SsOR[t+2]),n.aypu=setTimeout((function(){n.uGKB?n.uGKB=!1:(n.uGKB=!1,r.unregisterFromEvent(S(y.INcP.wbLf)+"___"+y.INcP.hLZq.kDEi,n.wATL))}),b),n.yLEN=s,n.timeForKPI=b,r.registerForEvent(S(y.INcP.wbLf)+"___"+y.INcP.hLZq.kDEi,n.wATL),n.uBFN=y,n._across_sessions)){var F=L(y.INcP._time.unit,y.INcP._time.value),k=y.INcP._timeEnabled,q=y.INcP._id,T=new z;T.dDvy(y.INcP.gMol,y.INcP.hLZq.kDEi,Date.now(),y.INcP.hLZq.rdll,F,k,q)}}}else if(y.length>0)if("ordered"===y.sequence_type||"strictly_ordered"===y.sequence_type)y[0].iiJG(i+1);else{var D,C=d(y);try{for(C.s();!(D=C.n()).done;){var R=D.value;R.iiJG()}}catch(e){C.e(e)}finally{C.f()}}else y.iiJG();if("strictly_ordered"===n.wJLZ){n._currentEventname=s.INcP.hLZq.kDEi;var Y=e.getController();Y.registerForEvent("APP_EVENT",n.kizd),Y.registerForEvent("CLIENT_EVENT",n.kizd)}}else"strictly_ordered"===n.wJLZ?1!=n.EZuz&&n.zEYk():n.zEYk()}}else n.dgRT(),n.zEYk()}})),s(this,"kizd",(function(e){e&&e.name!=n._currentEventname&&(n.EZuz=!0)})),s(this,"IRSi",(function(e){var t=new he,i=e.INcP._eventCategory;"apxor_event"===i?t.registerForEvent("apxor_event",n.aylO):"customer_event"===i?t.registerForEvent("customer_event",n.aylO):"any_event"===i?t.registerForEvent("any_event",n.aylO):"campaign_event"===i?t.registerForEvent("campaign_event",n.aylO):"survey_event"===i&&t.registerForEvent("survey_event",n.aylO)})),s(this,"azYa",(function(e){var t=new he,i=e.INcP._eventCategory;"apxor_event"===i?t.unregisterFromEvent("apxor_event",n.aylO):"customer_event"===i?t.unregisterFromEvent("customer_event",n.aylO):"any_event"===i?t.unregisterFromEvent("any_event",n.aylO):"campaign_event"===i?t.unregisterFromEvent("campaign_event",n.aylO):"survey_event"===i&&t.unregisterFromEvent("survey_event",n.aylO)})),s(this,"aylO",(function(){var e,t;n.YaIz&&(n.uGKB=!1,clearTimeout(n.YaIz));var i=new he;n.uGKB=!0,n._across_sessions&&null!==localStorage.getItem("apx_nokpi_triggerdetails")&&localStorage.removeItem("apx_nokpi_triggerdetails"),i.unregisterFromEvent(S(null===(e=n.MUmv)||void 0===e||null===(e=e.INcP)||void 0===e?void 0:e.wbLf)+"___"+(null===(t=n.MUmv)||void 0===t||null===(t=t.INcP)||void 0===t||null===(t=t.hLZq)||void 0===t?void 0:t.kDEi),n.aylO)})),s(this,"wATL",(function(){var t,i,r,o=new he;n.uGKB=!0,n.aypu&&clearTimeout(n.aypu);var a=new z;if(n.sUaj.fYKk+=1,n.sUaj.WGJG=a.geGB(n.sUaj.fYKk,n.sUaj.INcP.YScO,n.sUaj.INcP.VOeF),o.unregisterFromEvent(S(null===(t=n.uBFN)||void 0===t||null===(t=t.INcP)||void 0===t?void 0:t.wbLf)+"___"+(null===(i=n.uBFN)||void 0===i||null===(i=i.INcP)||void 0===i?void 0:i.hLZq.kDEi),n.wATL),n._across_sessions&&null!==(r=n.azpt)&&void 0!==r&&r.INcP._timeBased){var s,l,u,c=e.getController().getFromStorage("apx_nokpi_triggerdetails");c=null==c?[]:JSON.parse(c);for(var v=0;v<c.length;v++)if(n.no_KPI_TriggerDetails[v].id===n.azpt.INcP._id){s=!0,l=c[v];break}if(s)l.satisfiedCount+=1;else{var d=n.sUaj.INcP._id,f=n.sUaj.INcP.gMol,_=n.sUaj.INcP.hLZq.kDEi,h=n.sUaj.INcP.hLZq.rdll;u={id:d,type:f,time:Date.now(),name:_,additionalInfo:h,satisfiedCount:n.sUaj.INcP._timeEnabled,timeBased:n.sUaj.INcP._timeEnabled},n.no_KPI_TriggerDetails.push(u)}}if(n.sUaj.WGJG){var g=n.SsOR[n.kpiIndex+1];m(g)?g.iiJG():n.zEYk()}})),s(this,"FUGa",(function(){if(n.YJay===n.SsOR.length-1){n.Mwxd=!0;n.SsOR[n.YJay]&&(n.SsOR[n.YJay].fYKk=n.oFhI.satisfiedCount,n.SsOR[n.YJay].WGJG=!0,n.zEYk())}else{var t,i,r=e.getController().getFromStorage("apx_nokpi_triggerdetails");r=null==r?[]:JSON.parse(r);for(var o=0;o<r.length;o++)if(r[o].id===n.YJay){i=!0,t=r[o];break}if(i&&(t.satisfiedCount=1),e.getController().persistToStorage("apx_nokpi_triggerdetails",JSON.stringify(r)),n.SsOR[n.YJay].fYKk=n.oFhI.satisfiedCount,n.SsOR[n.YJay].WGJG=!0,n.SsOR[n.YJay+1].INcP._timeEnabled){var a=L(n.SsOR[n.YJay+1].INcP._time.unit,n.SsOR[n.YJay+1].INcP._time.value),s=n.SsOR[n.YJay+1].INcP._timeEnabled,l=n.SsOR[n.YJay+1].INcP._id,u=n.SsOR[n.YJay+1].fYKk,c=n.SsOR[n.YJay+1].INcP.hLZq.kDEi,v=n.SsOR[n.YJay+1].hLZq.rdll;(new z).dDvy(n.INcP.gMol,c,Date.now(),v,a,s,l,u)}}})),s(this,"dgRT",(function(){if(n._across_sessions&&n.hoOV){var t,i,r,o="single",a=!1,s=e.getController().getFromStorage("apx_nokpi_triggerdetails");if((s=JSON.parse(s)).length>0){var l,u=d(s);try{var c=function(){var e=l.value,s=e.id,u=e.satisfiedCount;if(t=n.SsOR.find((function(e,t){if(1===(null==e?void 0:e.length)||void 0===(null==e?void 0:e.length)){if(e.INcP._id===s)return o="single",i=t,!0}else if(e.length>0){var n=e.findIndex((function(e){return e.INcP._id===s}));if(-1!==n)return i=t,r=n,o="group",!0}return!1})),"single"===o&&t){var c=new z;a=c.geGB(u,t.INcP.YScO,t.INcP.VOeF);var v=n.SsOR.findIndex((function(e){var t;return(null==e||null===(t=e.INcP)||void 0===t?void 0:t._id)===s}));void 0===v&&(v=i),a&&(n.SsOR[v].WGJG=!0)}else if("group"===o&&t){var d=new z;(a=d.geGB(u,t[r].INcP.YScO,t[r].INcP.VOeF))&&(n.SsOR[i][r].WGJG=!0)}};for(u.s();!(l=u.n()).done;)c()}catch(e){u.e(e)}finally{u.f()}}}})),s(this,"QXbo",(function(e){e<0||n.NEzG()})),s(this,"zEYk",(function(){var t,r,o=arguments.length>0&&void 0!==arguments[0]&&arguments[0],a=e.getController().getUserAttributes(),s=e.getController().getSessionAttributes();if(null!==(t=window.ApxorRTM)&&void 0!==t&&t.isBadgePresent&&null!==(r=window.ApxorRTM)&&void 0!==r&&r.badgesLists.includes(n.xEum)&&e.getController().isBadgeTriggerSatisfied(n.xEum)||null==e||e.logEvent("apx_trigger_satisfied",{apx_nudge_type:"SURVEY"===n.ersv.gMol?"survey":"campaign",apx_nudge_id:n.xEum,apx_nudge_name:n.ersv.kDEi,message_name:n.ersv.kDEi,id:n.xEum,apx_variant_code:n.ersv._isExperiment||n.ersv._only_context?n.ersv._attr.apx_variant_code:"TG"}),!(n.WXJe.validate()&&n.Glqb.validate(a,s)&&n.zGBG.validate()&&n.GSpN.validate())){n.ersv.gMol;return n.zGBG.retainedDaysValidated?n.zGBG.retainedSessionValidated?n.zGBG.eventDoneInLT?void n.cBnv("Event done in life time"):n.Glqb.userAttributesValidated?n.Glqb.sessionAttributeValidated?n.WXJe._not_in_specified_time?void n.cBnv("Time limits check failed"):n.WXJe._not_yet_active?void n.cBnv("not in the scheduled time"):n.WXJe._nudge_expired?void n.cBnv("nudge expired"):void 0:void n.cBnv("Session property filter not met"):void n.cBnv("User property filter not met"):void n.cBnv("User session criteria not met"):void n.cBnv("Retained day criteria not met")}var l=n.SsOR.length,u=l<1,c="";0===l&&(u=!0);for(var v=0;v<l;v++){var f=void 0,_=n.SsOR[v];if(_.length>1){var h=_[0].INcP.csYK;f="AND"===h;for(var g=0;g<_.length;g++){var m=_[0].INcP.csYK;f="AND"===m?f&&_[g].WGJG:f||_[g].WGJG}}else f=_.WGJG;if(""===c.trim())u=f;else switch(c){case"AND":u=u&&f;break;case"OR":u=u||f}c=_.length>1?n.groupCombineOperator:_.csYK}if(!0===o&&(u=!0),u){if(console.debug("onCondition satisfied"),!n.PeLS.NNyN(n.xEum))return void console.warn("Maximum limit reached",n.xEum);n._across_sessions&&localStorage.removeItem("apx_nokpi_triggerdetails");var p,y=d(n.SsOR);try{for(y.s();!(p=y.n()).done;){var E=p.value;if(1===(null==E?void 0:E.length)||void 0===(null==E?void 0:E.length))E.WGJG=!1,E.fYKk=0;else{var I,S=d(E);try{for(S.s();!(I=S.n()).done;){var w=I.value;w.WGJG=!1,w.fYKk=0}}catch(e){S.e(e)}finally{S.f()}}}}catch(e){y.e(e)}finally{y.f()}if(n.NTZT=new z,n.NTZT.FzyL(n.SsOR),n.SsOR=[],n.umlk(n.azbF,n.RPRb),!0===n.ersv._only_context){var N="SURVEY"===n.ersv.gMol?"survey":"campaign";e.logEvent("apx_context_evaluated",i(i({},n.ersv._attr),{},{message_name:n.ersv.kDEi,apx_nudge_name:n.ersv.kDEi,apx_nudge_id:n.xEum,id:n.xEum}),!1,"",N)}e.getController().dispatchEvent(n.ersv.gMol,{name:n.ersv.gMol,additional_info:{uuid:n.xEum,name:n.ersv.kDEi}})}})),s(this,"NEzG",(function(){for(var t=n.SBVw.length,r=t<1,o="",a=0;a<t;a++){var s=n.SBVw[a],l=s.WGJG;if(""===o.trim())r=l;else switch(o){case"AND":r=r&&l;break;case"OR":r=r||l}o=s.iIVu}if(r){if(e.getController().persistTerminationInfoLocally(n.xEum),!0===n.ersv._only_context){var u="SURVEY"===n.ersv.gMol?"survey":"campaign";e.logEvent("apx_context_evaluated",i(i({},n.ersv._attr),{},{message_name:n.ersv.kDEi,apx_nudge_name:n.ersv.kDEi,apx_nudge_id:n.xEum,id:n.xEum}),!1,"apxor",u)}e.getController().dispatchEvent(n.ersv.gMol,{name:n.ersv.gMol,additional_info:{uuid:n.xEum,name:n.ersv.kDEi}})}})),s(this,"validateForTerminationAttributes",(function(){var t=e.getController().getUserAttributes(),i=e.getController().getSessionAttributes();return n.sKZQ.validate(t,i)})),s(this,"SgqY",(function(){n.PeLS.SgqY()})),s(this,"getFrequencyCount",(function(){return n.PeLS.getFrequencyCount()})),s(this,"hGaE",(function(){return n.PeLS.sJyg()})),s(this,"tXym",(function(e){var t;t="AND"===e[0].INcP.csYK;for(var i=0;i<e.length;i++){t="AND"===e[0].INcP.csYK?t&&e[i].WGJG:t||e[i].WGJG}return t})),s(this,"cBnv",(function(t){var i;null==e||e.logEvent("apx_non_eligible_user",{apx_nudge_type:"SURVEY"===n.ersv.gMol?"survey":"campaign",apx_nudge_id:n.xEum,apx_nudge_name:n.ersv.kDEi,message_name:n.ersv.kDEi,id:n.xEum,apx_variant_code:n.ersv._isExperiment||n.ersv._only_context?null===(i=n.ersv._attr)||void 0===i?void 0:i.apx_variant_code:"TG",apx_notshown_type:"warn",apx_reason:t})}))})),ve=a((function e(){var t=this;r(this,e),s(this,"YTMT",{}),s(this,"parse",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(m(e)&&m(e.configs)){var i=e.configs;if(!Array.isArray(i))return;i.sort((function(e,t){var i,n;return(null!==(i=e.prio)&&void 0!==i?i:-1)-(null!==(n=t.prio)&&void 0!==n?n:-1)}));for(var n=0;n<i.length;n++){var r=i[n],o=r._id,a=new ce;a.parse(r)?t.YTMT[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(e,i){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if(t.YTMT[e]){var r=t.YTMT[e];r.nVOZ(i,n)}})),s(this,"getVariantCode",(function(e){return t.YTMT[e]?t.YTMT[e]._variant_code:""})),s(this,"validateForTermination",(function(e,i){t.YTMT[e]&&t.YTMT[e].QXbo(i)})),s(this,"validateForTerminationAttributes",(function(e){return!!t.YTMT[e]&&t.YTMT[e].validateForTerminationAttributes()})),s(this,"SgqY",(function(e){t.YTMT[e].SgqY()})),s(this,"getFrequencyCount",(function(e){var i=t.YTMT[e];if(null!=i)return i.getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var e=t.YTMT;for(var i in e)e[i].hGaE()})),s(this,"MXGP",(function(e){try{if(t.YTMT){var i=t.YTMT[e];if(i&&i.ersv)return i.ersv}}catch(e){console.log("Error in getting the campaign meta ".concat(e))}return{}}))})),de=window.ApxorLogger,fe=a((function t(){var i=this;r(this,t),s(this,"ksdg",{}),s(this,"CpYl",[]),s(this,"Diki",!1),s(this,"initialize",(function(){var t=e.getController();t.registerForEvent("APP_EVENT",(function(e){return i.xqpF(e,"AE")})),t.registerForEvent("CLIENT_EVENT",(function(e){return i.xqpF(e,"CE")}))})),s(this,"CWVz",(function(){var e,t=d(i.CpYl);try{for(t.s();!(e=t.n()).done;){var n=e.value;i.yNFg(n.event,n.key,n.type)}}catch(e){t.e(e)}finally{t.f()}i.Diki=!0})),s(this,"MEbX",(function(e,t){var n;"function"==typeof t&&((n=i.ksdg[e]?i.ksdg[e]:[]).push(t),i.ksdg[e]=n,de.debug("Listeners list: ",i.ksdg))})),s(this,"unregisterFromEvent",(function(e,t){if(i.ksdg[e]){for(var n=i.ksdg[e],r=[],o=0;o<n.length;o++){var a=n[o];a!==t&&r.push(a)}i.ksdg[e]=r}})),s(this,"xqpF",(function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE";i.yNFg(e,"any_event",t),"apxor"===(null==e?void 0:e.loggedBy)?i.yNFg(e,"apxor_event",t):"customer"===(null==e?void 0:e.loggedBy)&&i.yNFg(e,"customer_event",t),"campaign"===(null==e?void 0:e.apx_nudge_type)?i.yNFg(e,"campaign_event",t):"survey"===(null==e?void 0:e.apx_nudge_type)&&i.yNFg(e,"survey_event",t);var n=t+"___"+e.name;i.yNFg(e,n,t)})),s(this,"yNFg",(function(t,n,r){if(i.Diki){if(de.debug("Notifying listeners for event: "+t+", "+n,i.ksdg),i.ksdg[n])for(var o=i.ksdg[n],a=e.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(r,t.name,a,t.additional_info)}}else i.CpYl.push({event:t,key:n,type:r})}))})),_e=window.ApxorLogger,he=function(){function t(){var i=this;return r(this,t),s(this,"HVjO",!1),s(this,"ZImt",null),s(this,"ckIJ",O()),s(this,"oMMP",new fe),s(this,"IuUv",e.getSiteId()),s(this,"jrvj",{}),s(this,"getQeState",(function(){try{var t=e.getController().getFromStorage("qe_state");return t?JSON.parse(E(i.IuUv,t)):(i.jrvj={},i.setQeState())}catch(e){return i.jrvj={},i.setQeState()}})),s(this,"setQeState",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{e.getController().persistToStorage("qe_state",i.jrvj,!0)}catch(n){""===t?i.jrvj={}:i.jrvj[t]={SESSION:0,OVERALL:0,DATES:{}},e.getController().persistToStorage("qe_state",i.jrvj,!0)}return i.jrvj})),s(this,"initialize",(function(){i.HVjO||(i.HVjO=!0,i.ZImt=new ve,i.oMMP.initialize(),i.jrvj=i.getQeState(),_e.info("QE Initialized.."))})),s(this,"parse",(function(e){i.effh()?(i.ZImt.parse(e),i.oMMP.CWVz()):_e.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;i.effh()&&i.ZImt.validate(e,t,n)})),s(this,"getVariantCode",(function(e){return i.ZImt.getVariantCode(e)})),s(this,"validateForTermination",(function(e,t){i.effh()&&i.ZImt.validateForTermination(e,t)})),s(this,"validateForTerminationAttributes",(function(e,t){return i.ZImt.validateForTerminationAttributes(e,t)})),s(this,"updateCount",(function(e){try{var t;m(i.jrvj[e])||i.createObjConfig(e),i.incrementFrequencies(e),i.setQeState(e),null===(t=i.ZImt)||void 0===t||t.SgqY(e)}catch(e){console.log("Could not update the count config:".concat(e))}})),s(this,"resetFrequencyCounts",(function(){i.ZImt.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(e){return i.ZImt.getFrequencyCount(e)})),s(this,"registerForEvent",(function(e,t){i.oMMP.MEbX(e,t)})),s(this,"unregisterFromEvent",(function(e,t){i.oMMP.unregisterFromEvent(e,t)})),s(this,"notifyEventListener",(function(e){i.oMMP.xqpF(e)})),s(this,"fetch",(function(t,i,n,r){e.getController().fetchConfiguration(t,i,n,r)})),s(this,"effh",(function(){return i.HVjO})),s(this,"getCampaignMetaFromQueryEngine",(function(e){return i.ZImt.MXGP(e)})),s(this,"nBMJ",(function(){return i.ckIJ})),t.instance||(t.instance=this),t.instance}return a(t,[{key:"createObjConfig",value:function(e){try{this.jrvj=this.getQeState(),m(this.jrvj[e])||(this.jrvj[e]={SESSION:0,OVERALL:0,DATES:{}},this.ckIJ&&(this.jrvj[e].DATES[this.ckIJ]=0),this.setQeState(e))}catch(e){_e.error("Can not create the frequency count object:"+e)}}},{key:"incrementFrequencies",value:function(e){this.jrvj=this.getQeState();var t=this.jrvj[e];t.SESSION=t.SESSION+1,t.OVERALL=t.OVERALL+1;var i=O();i===this.ckIJ&&t.DATES&&t.DATES[i]||(this.ckIJ=i,t.DATES={},t.DATES[this.ckIJ]=0),t.DATES[this.ckIJ]=t.DATES[this.ckIJ]+1}}],[{key:"getInstance",value:function(){return t.instance||(t.instance=new t),t.instance}}]),t}();s(he,"instance",void 0),window.ceVersion=208;try{void 0===exports&&null===exports||(exports.default=he,module.exports=exports.default)}catch(e){}return he}));
package/package.json CHANGED
@@ -1,8 +1,13 @@
1
1
  {
2
2
  "name": "apxor-qe",
3
- "version": "2.0.6",
3
+ "version": "2.0.8",
4
4
  "author": "Ravi Teja Akella <ravi.akella@apxor.com> (https://www.apxor.com)",
5
5
  "contributors": [
6
+ {
7
+ "name": "Mahesh Pikki",
8
+ "email": "mahesh.pikki@apxor.com",
9
+ "url": "https://www.apxor.com"
10
+ },
6
11
  {
7
12
  "name": "Raavi Venkata Sai Chaitanya",
8
13
  "email": "saichaitanya.raavi@apxor.com",
@@ -67,7 +72,7 @@
67
72
  },
68
73
  "dependencies": {
69
74
  "jsdom": "^22.1.0",
70
- "apxor": "3.1.0"
75
+ "apxor": "3.1.2"
71
76
  },
72
77
  "engines": {
73
78
  "pnpm": ">=8",