apxor-qe 1.4.1 → 1.4.2

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(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],e):(t=t||self)["apxor-qe"]=e(t.Apxor)}(this,(function(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,l(r.key),r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,e,n){return(e=l(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(t,e)}(t)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var h=function(t){return void 0!==t&&!function(t){return null===t}(t)},f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function d(t,e){return Array.from(e).map((function(e,n){return String.fromCharCode(e^function(t,e){return t.charCodeAt(Math.floor(e%t.length))}(t,n))})).join("")}var v=function(t,e){return d(t,e=function(t){var e,n,r,i,o,a,s=0,u=[];if(!t)return t;t+="";do{e=(a=f.indexOf(t.charAt(s++))<<18|f.indexOf(t.charAt(s++))<<12|(i=f.indexOf(t.charAt(s++)))<<6|(o=f.indexOf(t.charAt(s++))))>>16&255,n=a>>8&255,r=255&a,u.push(e),64!==i&&(u.push(n),64!==o&&u.push(r))}while(s<t.length);return u}(e))},g=function(t){switch(t){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE"}return"Unknown"},p=function(t){return t.toUpperCase()},y=function(t,e,n){switch(n){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;case"NEQ":return t!==e;case"R":return w(e).test(t);default:return!1}},w=function(t){var e=t.replace(/.*\/([gimuy]*)$/,"$1");e===t&&(e="");var n=e?t.replace(new RegExp("^/(.*?)/"+e+"$"),"$1"):t;return new RegExp(n,e)},m=function(){var t=new Date;return t.getDate()+"/"+t.getMonth()+"/"+t.getFullYear()},_=window.ApxorLogger,S=a((function e(){var n=this;i(this,e),s(this,"upBe","ALL"),s(this,"qHve",[]),s(this,"hfXD",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.upBe=t.audience.audience_type,n.qHve=t.audience.attributes.user,n.hfXD=t.audience.attributes.session,!Array.isArray(n.qHve)||!Array.isArray(n.hfXD))return _.error("No attributes"),!1}catch(t){return _.error(t),!1}return!0})),s(this,"validate",(function(e,r){var i=!0;return"FTU"===n.upBe&&(i=t.getController().getSessionInfo().is_first_session),i&&n.AYgA(e,n.qHve)&&n.AYgA(r,n.hfXD)})),s(this,"AYgA",(function(t,e){var n=e.length,r=!0;try{for(var i,o=function(){var n=e[a];if(!t[n.name]||!1===r)return{v:!1};var i=n.operator,o=n.type,s=n.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return y(t,e,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(t){_.error(t),r=!1}return r}))})),A=window.ApxorLogger,b=a((function t(){var e=this;i(this,t),s(this,"cyan",0),s(this,"xUCG",0),s(this,"TTrx","SESSION"),s(this,"dBjB",0),s(this,"QeCL",0),s(this,"voNY",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.cyan=t.frequency.count,-1===e.cyan&&(e.cyan=1e3),e.voNY=e.cyan,e.xUCG=t.frequency.time_interval,e.TTrx=t.frequency.validity,e.QeCL=t.frequency.ses_lmt,e._dayCount=t.frequency.day_lmt;var n=Y.getInstance().getQeState();if(!h(n)||!h(n[t._id]))return!0;if("SESSION"===e.TTrx){if(e.cyan=parseInt(e.cyan)-parseInt(n[t._id].SESSION),e.cyan<=0)return console.warn("Max count limit reached for session:"+t._id),!1}else{if("OVERALL"!==e.TTrx)return A.info("Invalid config."),!1;if(e.cyan=parseInt(e.cyan)-parseInt(n[t._id].OVERALL),e.cyan<=0)return console.warn("Max count limit reached for overall:"+t._id),!1}}catch(t){return A.error(t),!1}return!0})),s(this,"yGJs",(function(){e.cyan=e.cyan-1})),s(this,"getFrequencyCount",(function(){return e.cyan})),s(this,"NSSU",(function(){"SESSION"===e.TTrx&&(e.cyan=e.voNY,A.info("Campaign Limit reset"))})),s(this,"HBeu",(function(t){try{if(e.cyan<=0)return!1;var n=Y.getInstance().getQeState();if(!h(n)||!h(n[t]))return!0;if(0!==e.QeCL)if(parseInt(e.QeCL)-parseInt(n[t].SESSION)<=0)return!1;if(0!==e._dayCount){var r,i=m();if(parseInt(e._dayCount)-parseInt((null===(r=n[t])||void 0===r?void 0:r.DATES[i])||0)<=0)return!1}}catch(t){A.error("Error validating the frequency:"+t)}return!0}))})),E=a((function t(){var e=this;i(this,t),s(this,"dXou",""),s(this,"upBe",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n;e.dXou=t.meta.name,e.upBe=t.meta.type,e._only_context=t.meta.only_context,e._attr=(null===(n=t.meta)||void 0===n?void 0:n.attr)||{}}catch(t){return window.ApxorLogger.error(t),!1}return!0}))})),H=window.ApxorLogger,L=a((function t(){var e=this;i(this,t),s(this,"ZXIv",-1),s(this,"PYEw",-1),s(this,"gDYY",-1),s(this,"JWWv",-1),s(this,"WVbP",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(isNaN(Date.parse(t.validity.start_date))||isNaN(Date.parse(t.validity.end_date)))return H.error("Not valid dates"),!1;if(e.ZXIv=Date.parse(t.validity.start_date),e.PYEw=Date.parse(t.validity.end_date),h(t.time_limits_in_day)&&(e.WVbP=t.time_limits_in_day,e.WVbP&&h(t.time_limits))){var n=(new Date).toISOString().split("T")[0];if(e.gDYY=Date.parse(n+"T"+t.time_limits.start_time+".000Z"),e.JWWv=Date.parse(n+"T"+t.time_limits.end_time+".000Z"),isNaN(e.gDYY)||isNaN(e.JWWv))return H.error("Not valid times"),!1}}catch(t){return H.error(t),!1}return!0})),s(this,"validate",(function(){var t=Date.now();return t>e.ZXIv&&t<e.PYEw&&(!e.WVbP||t>=e.gDYY&&t<=e.JWWv)}))})),F=a((function t(){var e=this;i(this,t),s(this,"dXou",""),s(this,"PjLw",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.dXou=t.name,e.PjLw=t.additional_info}catch(t){return!1}return!0}))})),x=a((function t(){var e=this;i(this,t),s(this,"ubix",0),s(this,"xTww",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.ubix=Number(t.lower),e.xTww=Number(t.upper),isNaN(e.ubix)||isNaN(e.xTww))return!1}catch(t){return!1}return!0}))})),T=a((function t(){var e=this;i(this,t),s(this,"wLrd",0),s(this,"GwDz",""),s(this,"HJIQ",""),s(this,"LHnZ",new F),s(this,"pZbN",new x),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.GwDz=t.event_type,e.HJIQ=t.activity,e.LHnZ.parse(t.details)&&e.pZbN.parse(t.time_bounds)}catch(t){return!1}}))})),D=window.ApxorLogger,Z=a((function t(){var e=this;i(this,t),s(this,"wLrd",0),s(this,"BvTW",-1),s(this,"cyan",0),s(this,"FdOF",""),s(this,"HJIQ",""),s(this,"GwDz",""),s(this,"pZbN",new x),s(this,"LHnZ",new F),s(this,"idDI",new T),s(this,"Sdoc","AND"),s(this,"LnGT",!1),s(this,"upBe",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.BvTW=t.sequence,e.cyan=t.count_config.count,e.FdOF=t.count_config.operator,e.HJIQ=t.activity,e.GwDz=t.event_type,e.Sdoc=t.combine_operator,e.upBe=t.type,e.LHnZ.parse(t.details)&&e.idDI.parse(t.trigger)&&e.pZbN.parse(t.time_bounds)}catch(t){return D.error(t),!1}}))})),N=window.ApxorLogger,I=a((function t(){var e=this;i(this,t),s(this,"cyan",0),s(this,"FdOF",""),s(this,"GwDz",""),s(this,"pZbN",new x),s(this,"LHnZ",new F),s(this,"Sdoc","AND"),s(this,"parse",(function(t){try{return e.cyan=t.count_config.count,e.FdOF=t.count_config.operator,e.GwDz=t.event_type,e.Sdoc=t.combine_operator,e.LHnZ.parse(t.details)&&e.pZbN.parse(t.time_bounds)}catch(t){return N.error(t),!1}}))})),C=window.ApxorLogger,G=function(){function e(){var n=this;i(this,e),s(this,"AFha",0),s(this,"xWwF",""),s(this,"ZXgH",new Z),s(this,"AwpM",new I),s(this,"CTgi",!1),s(this,"dzHG",!1),s(this,"ewWl",0),s(this,"Sdoc","AND"),s(this,"gzxI","OR"),s(this,"Swao",-1),s(this,"SKdF",[]),s(this,"ATJy",{}),s(this,"qFlV",!1),s(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=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]:"";if(n.xWwF=r,n.ewWl=i,n.SKdF=a,"termination"===s&&""!==s){n.AwpM.parse(e);return n.gzxI=n.AwpM.Sdoc,n.cvYj(),!0}var u=n.ZXgH.parse(e);if(u){if(n.Sdoc=n.ZXgH.Sdoc,n.ZXgH.LnGT){var c=n.ZXgH.LHnZ.dXou;"APX_PAGE_OPENED"===c&&(c=n.ZXgH.LHnZ.PjLw.navigation_id,c=h(c)?c:n.ZXgH.LHnZ.dXou),n.Swao=t.getController().getEventCount(c);var l=n.ZXgH.cyan,f=n.ZXgH.FdOF;if(n.dzHG=n.TfGM(n.Swao-1,l,f,!1),n.CTgi=n.dzHG,n.dzHG&&"APX_PAGE_OPENED"===n.ZXgH.LHnZ.dXou)return!0}return o&&0!==i||n.DGaq(),!0}return!1})),s(this,"DGaq",(function(){var t=n.ZXgH,e=t.idDI,r=Y.getInstance();"app_start"===e.GwDz?(n.CTgi=!0,r.registerForEvent(g(t.GwDz)+"___"+t.LHnZ.dXou,n.ZNEJ)):r.registerForEvent(g(t.GwDz)+"___"+e.LHnZ.dXou,n.ZNEJ)})),s(this,"cvYj",(function(){var t=n.AwpM,e=Y.getInstance();n.CTgi=!0,e.registerForEvent(g(t.GwDz)+"___"+t.LHnZ.dXou,n.YBSM)})),s(this,"Ijls",(function(t,e,r,i){var o,a=(Date.now()-n.ATJy[e])/1e3;(null===(o=n.ZXgH)||void 0===o||null===(o=o.LHnZ)||void 0===o||null===(o=o.PjLw)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(r)})),s(this,"MKnM",(function(t,e,r,i){var o,a;n.qFlV=!0;var s=Date.now(),u=null===(o=n.ZXgH)||void 0===o||null===(o=o.idDI)||void 0===o?void 0:o.LHnZ.dXou,c=(s-n.ATJy[u])/1e3,l=null===(a=n.ZXgH)||void 0===a||null===(a=a.LHnZ)||void 0===a||null===(a=a.PjLw)||void 0===a?void 0:a.time;(l/=1e3)>c&&n._displayCampaign(r)})),s(this,"ZNEJ",(function(t,e,r,i){var o=Y.getInstance();if(n.CTgi)g(n.ZXgH.GwDz)===t&&n.gVIC(r-n.ZXgH.idDI.wLrd,n.ZXgH.pZbN)&&n.ZXgH.LHnZ.dXou===e&&n.XxaE(n.ZXgH.LHnZ.PjLw,i)&&(n.AFha+=1,n.dzHG=n.TfGM(n.AFha,n.ZXgH.cyan,n.ZXgH.FdOF),n.dzHG&&(n.ZXgH.wLrd=r,o.validate(n.xWwF,n.ewWl)));else if(n.CTgi=n.cAeN(t,e,r,i),n.CTgi){var a=n.ZXgH,s=a.idDI;if(s.wLrd=r,"activity_time"===(null==a?void 0:a.GwDz)){var u,c,l,h=null==a||null===(u=a.LHnZ)||void 0===u||null===(u=u.PjLw)||void 0===u?void 0:u.time;(null==a||null===(c=a.LHnZ)||void 0===c||null===(c=c.PjLw)||void 0===c?void 0:c.nkpi.length)>0&&(setTimeout((function(){n.qFlV||(n.dzHG=!0,n.dzHG&&(n.AFha+=1,n.dzHG=n.TfGM(n.AFha,n.ZXgH.cyan,n.ZXgH.FdOF),n.dzHG&&(n.ZXgH.wLrd=r,o.validate(n.xWwF,n.ewWl)))),a.LHnZ.PjLw.nkpi.map((function(t){o.unregisterFromEvent(p(a.LHnZ.PjLw.et)+"___"+t,n)}))}),h),a.LHnZ.PjLw.nkpi.map((function(t){o.registerForEvent(p(a.LHnZ.PjLw.et)+"___"+t,n.MKnM)}))),(null==a||null===(l=a.LHnZ)||void 0===l||null===(l=l.PjLw)||void 0===l?void 0:l.kpi.length)>0&&(setTimeout((function(){a.LHnZ.PjLw.kpi.map((function(t){o.unregisterFromEvent(p(a.LHnZ.PjLw.et)+"___"+t,n)}))}),h),a.LHnZ.PjLw.kpi.map((function(t){t===a.idDI.LHnZ.dXou?(o.unregisterFromEvent(g(s.GwDz)+"___"+s.LHnZ.dXou,n),o.registerForEvent(p(a.LHnZ.PjLw.et)+"___"+t,n.Ijls)):o.registerForEvent(p(a.LHnZ.PjLw.et)+"___"+t,n.MKnM)})))}else o.unregisterFromEvent(g(s.GwDz)+"___"+s.LHnZ.dXou,n),o.registerForEvent(g(a.GwDz)+"___"+a.LHnZ.dXou,n);n.ATJy[e]=Date.now()}})),s(this,"YBSM",(function(t,e,r,i){var o=Y.getInstance();g(n.AwpM.GwDz)===t&&n.gVIC(r,n.AwpM.pZbN)&&n.AwpM.LHnZ.dXou===e&&n.XxaE(n.AwpM.LHnZ.PjLw,i)&&(n.AFha+=1,n.dzHG=n.TfGM(n.AFha,n.AwpM.cyan,n.AwpM.FdOF),n.dzHG&&(n.AwpM.wLrd=r,o.validateForTermination(n.xWwF,n.ewWl)))})),s(this,"cAeN",(function(t,e,r,i){var o=n.ZXgH.idDI;return g(o.GwDz)===t&&o.LHnZ.dXou===e&&n.gVIC(r,o.pZbN)&&n.XxaE(o.LHnZ.PjLw,i)})),s(this,"gVIC",(function(t,e){var n=Math.ceil(t);return n>e.ubix&&n<e.xTww})),s(this,"TfGM",(function(t,e,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(i&&n.ZXgH.LnGT&&(t+=n.Swao),r){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;default:return!1}})),s(this,"XxaE",(function(t,e){var n=!0;try{var i,o=function(){if(!e[a]||!1===n)return{v:!1};if("object"===r(t[a])){var i,o=t[a].op,s=t[a].t;"s"===s?i=t[a].val:"l"!==s&&"f"!==s||(i=parseFloat(t[a].val));var u=(Array.isArray(e[a])?e[a]:[e[a]]).some((function(t){return y(t,i,o)}));n=n&&u}else n=n&&y(e[a],t[a],"EQ")};for(var a in t)if(i=o())return i.v}catch(t){C.error(t),n=!1}return n}))}return a(e,[{key:"_displayCampaign",value:function(t){var e=Y.getInstance();this.dzHG=!0,this.dzHG&&(this.AFha+=1,this.dzHG=this.TfGM(this.AFha,this.ZXgH.cyan,this.ZXgH.FdOF),this.dzHG&&(this.ZXgH.wLrd=t,e.validate(this.xWwF,this.ewWl)))}}]),e}(),q=window.ApxorLogger,X=a((function e(){var n=this;i(this,e),s(this,"PuiS",[]),s(this,"_ret_day",{}),s(this,"KMnE",{}),s(this,"TIdq",!1),s(this,"BItf",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.PuiS=t.overall_cfg.events,n._ret_day=t.overall_cfg.ret_day,n.KMnE=t.overall_cfg.session,n.TIdq=t.overall_cfg.toggleRetDay,n.PuiS=t.overall_cfg.events,n.BItf=t.overall_cfg.toggleSession}catch(t){return q.error(t),!1}return!0})),s(this,"validate",(function(){var e=parseInt(t.getController().getFromStorage("apx_retained_days")),r=parseInt(t.getController().getFromStorage("apx_retained_session"));if(n.TIdq&&!isNaN(e)&&!(e>=n._ret_day.from&&e<=n._ret_day.to))return!1;if(n.BItf&&!isNaN(r)&&!(r>=n.KMnE.from&&r<=n.KMnE.to))return!1;try{for(var i=t.getController().getFromStorage("_apx_lt_count"),o=t.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return e}(v(o,i)))),s=0;s<n.PuiS.length;s++){if(a[n.PuiS[s].name.replace("'","").replace("’","")])return!1}}catch(t){q.error("Failed to validate the lt count:"+t)}return!0}))})),M=window.ApxorLogger,O=a((function t(){var e=this;i(this,t),s(this,"qHve",[]),s(this,"hfXD",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.qHve=t.attributes.user,e.hfXD=t.attributes.session,!Array.isArray(e.qHve)||!Array.isArray(e.hfXD))return M.error("No attributes"),!1}catch(t){return M.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.AYgA(t,e.qHve)&&e.AYgA(n,e.hfXD)})),s(this,"AYgA",(function(t,e){var n=e.length,r=!0;try{for(var i,o=function(){var n=e[a];if(!t[n.name]||!1===r)return{v:!1};var i=n.operator,o=n.type,s=n.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return y(t,e,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(t){M.error(t),r=!1}return r}))})),j=a((function e(){var n=this;i(this,e),s(this,"mmqX",t.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"ebrV",1),s(this,"parse",(function(t){try{var e,r,i;if(n.upBe=null===(e=t.terminate_info.time_based)||void 0===e?void 0:e.type,n._duration_seconds=null===(r=t.terminate_info)||void 0===r?void 0:r.time_based.duration_seconds,n.ebrV=null===(i=t.terminate_info.time_based)||void 0===i?void 0:i.days,n.zuMV(t._id))return n.mmqX.persistTerminationInfoLocally(t._id),!1}catch(t){return!1}return!0})),s(this,"zuMV",(function(t){var e,r=JSON.parse(n.mmqX.getFromStorage("apx_termination_ID"));if(!r[t]||null===(e=r[t])||void 0===e||!e.startDate)return!1;var i,o=new Date(r[t].startDate),a=new Date((i=new Date).getMonth()+"/"+i.getDate()+"/"+i.getFullYear()),s=parseInt((a-o)/864e5,10),u=function(){var t=new Date;return{hours:t.getHours(),mins:t.getMinutes()}}(),c=r[t].gDYY;return s===n.ebrV&&u.hours>=c.hours||s>n.ebrV||r[t].goalAcheived}))})),P=a((function t(){var e=this;i(this,t),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"KDkd",new O),s(this,"uNVj",new j),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r,i;if(e.enable_time_based=null==t||null===(n=t.terminate_info)||void 0===n?void 0:n.enable_time_based,e.enable_time_based&&!e.uNVj.parse(t))return!1;if(e.enable_goal_events=null==t||null===(r=t.terminate_info)||void 0===r?void 0:r.enable_goal_events,e.enable_attributes=null==t||null===(i=t.terminate_info)||void 0===i?void 0:i.enable_attributes,e.enable_attributes&&!e.KDkd.parse(t.terminate_info))return!1}catch(t){return window.ApxorLogger.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.KDkd.validate(t,n)}))})),W=window.ApxorLogger,z=a((function e(){var r=this;i(this,e),s(this,"hmOw",[]),s(this,"mlaS",[]),s(this,"xWwF",""),s(this,"axSA",new E),s(this,"oypC",new S),s(this,"TTrx",new L),s(this,"ihSD",new b),s(this,"KUHf",new X),s(this,"qNqv",new P),s(this,"AKqc",!1),s(this,"NIKc",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(!h(t._id))return W.error("No Id"),!1;if(!h(t.enabled)||!t.enabled)return W.error("Not enabled"),!1;if(!(r.axSA.parse(t)&&r.TTrx.parse(t)&&r.ihSD.parse(t)&&r.oypC.parse(t)&&r.KUHf.parse(t)&&r.qNqv.parse(t)))return!1;if(!h(t.conditions)||!Array.isArray(t.conditions))return W.error("No valid conditions",t.conditions),!1;r.xWwF=t._id,r.AKqc=!!h(t.sequence_enabled)&&t.sequence_enabled,r.AKqc&&t.conditions.sort((function(t,e){return t.sequence<e.sequence}));for(var e=t.conditions,n=e.length,i=0;i<n;i++){r.NIKc=[];var o=e[i];if("didn't"===o.type){var a,s={trigger_key:o.trigger.details.name,no_kpi_array:null==o||null===(a=o.details)||void 0===a||null===(a=a.additional_info)||void 0===a?void 0:a.nkpi,condition_id:null==o?void 0:o._id,time_bounds:o.time_bounds.upper};r.NIKc=[].concat(u(r.NIKc),[s])}var c=new G;c.initialize(o,r.xWwF,i,r.AKqc,r.NIKc)&&r.hmOw.push(c)}if(r.qNqv.enable_goal_events)for(var l=t.terminate_info.goal_events.events,f=l.length,d=0;d<f;d++){var v=new G;v.initialize(l[d],r.xWwF,d,!0,[],"termination")&&r.mlaS.push(v)}return r.hmOw.length>0}catch(t){return W.error(t),!1}})),s(this,"SslG",(function(t){if(!(t<0))if(r.AKqc){var e=r.hmOw[t];if(h(e)&&e.dzHG){var n=r.hmOw[t-1];if(h(n)&&!n.dzHG)return;var i=r.hmOw[t+1];h(i)?i.DGaq():r.wUEZ()}}else r.wUEZ()})),s(this,"uDmd",(function(t){t<0||r.Fkcf()})),s(this,"wUEZ",(function(){var e=t.getController().getUserAttributes(),i=t.getController().getSessionAttributes();if(r.TTrx.validate()&&r.oypC.validate(e,i)&&r.KUHf.validate()){for(var o=r.hmOw.length,a=o<1,s="",u=0;u<o;u++){var c=r.hmOw[u],l=c.dzHG;if(""===s.trim())a=l;else switch(s){case"AND":a=a&&l;break;case"OR":a=a||l}s=c.Sdoc}if(a){if(console.debug("onCondition satisfied"),!r.ihSD.HBeu(r.xWwF))return void console.warn("Maximum limit reached",r.xWwF);console.log("Dispatching event",r.axSA.upBe),!0===r.axSA._only_context&&t.logEvent("apx_context_evaluated",n(n({},r.axSA._attr),{},{message_name:r.axSA.dXou,id:r.xWwF})),t.getController().dispatchEvent(r.axSA.upBe,{name:r.axSA.upBe,additional_info:{uuid:r.xWwF,name:r.axSA.dXou}})}}})),s(this,"Fkcf",(function(){for(var e=r.mlaS.length,i=e<1,o="",a=0;a<e;a++){var s=r.mlaS[a],u=s.dzHG;if(""===o.trim())i=u;else switch(o){case"AND":i=i&&u;break;case"OR":i=i||u}o=s.gzxI}i&&(console.log("Dispatching event",r.axSA.upBe),t.getController().persistTerminationInfoLocally(r.xWwF),!0===r.axSA._only_context&&t.logEvent("apx_context_evaluated",n(n({},r.axSA._attr),{},{message_name:r.axSA.dXou,id:r.xWwF})),t.getController().dispatchEvent(r.axSA.upBe,{name:r.axSA.upBe,additional_info:{uuid:r.xWwF,name:r.axSA.dXou}}))})),s(this,"validateForTerminationAttributes",(function(){var e=t.getController().getUserAttributes(),n=t.getController().getSessionAttributes();return r.qNqv.validate(e,n)})),s(this,"yGJs",(function(){r.ihSD.yGJs()})),s(this,"getFrequencyCount",(function(){return r.ihSD.getFrequencyCount()})),s(this,"vtVj",(function(){return r.ihSD.NSSU()}))})),R=a((function t(){var e=this;i(this,t),s(this,"aSMs",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(h(t)&&h(t.configs)){var n=t.configs;if(!Array.isArray(n))return;n.sort((function(t,e){var n,r;return(null!==(n=t.prio)&&void 0!==n?n:-1)-(null!==(r=e.prio)&&void 0!==r?r:-1)}));for(var r=0;r<n.length;r++){var i=n[r],o=i._id,a=new z;a.parse(i)?e.aSMs[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(t,n){e.aSMs[t]&&e.aSMs[t].SslG(n)})),s(this,"validateForTermination",(function(t,n){e.aSMs[t]&&e.aSMs[t].uDmd(n)})),s(this,"validateForTerminationAttributes",(function(t){return!!e.aSMs[t]&&e.aSMs[t].validateForTerminationAttributes()})),s(this,"yGJs",(function(t){e.aSMs[t].yGJs()})),s(this,"getFrequencyCount",(function(t){return e.aSMs[t].getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var t=e.aSMs;for(var n in t)t[n].vtVj()})),s(this,"iSci",(function(t){try{if(e.aSMs){var n=e.aSMs[t];if(n&&n.axSA)return n.axSA}}catch(t){console.log("Error in getting the campaign meta ".concat(t))}return{}}))})),K=window.ApxorLogger,B=a((function e(){var n=this;i(this,e),s(this,"MqKW",{}),s(this,"PZUh",[]),s(this,"CrNj",!1),s(this,"initialize",(function(){var e=t.getController();e.registerForEvent("APP_EVENT",(function(t){return n.Snah(t,"AE")})),e.registerForEvent("CLIENT_EVENT",(function(t){return n.Snah(t,"CE")}))})),s(this,"hUlQ",(function(){for(var t in n.PZUh)n.lMiM(t.event,t.key,t.type);n.CrNj=!0})),s(this,"colh",(function(t,e){var r;"function"==typeof e&&((r=n.MqKW[t]?n.MqKW[t]:[]).push(e),n.MqKW[t]=r,K.debug("Listeners list: ",n.MqKW))})),s(this,"unregisterFromEvent",(function(t,e){if(n.MqKW[t]){for(var r=n.MqKW[t],i=[],o=0;o<r.length;o++){var a=r[o];a!==e&&i.push(a)}n.MqKW[t]=i}})),s(this,"Snah",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE",r=e+"___"+t.name;n.lMiM(t,r,e)})),s(this,"lMiM",(function(e,r,i){if(n.CrNj){if(K.debug("Notifying listeners for event: "+e+", "+r,n.MqKW),n.MqKW[r])for(var o=n.MqKW[r],a=t.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(i,e.name,a,e.additional_info)}}else n.PZUh.push({event:e,key:r,type:i})}))})),V=window.ApxorLogger,Y=function(){function e(){var n=this;return i(this,e),s(this,"FyrB",!1),s(this,"EGlR",null),s(this,"Emjp",m()),s(this,"WpgE",new B),s(this,"kKtz",t.getSiteId()),s(this,"TsRo",{}),s(this,"getQeState",(function(){try{var e=t.getController().getFromStorage("qe_state");return e?JSON.parse(v(n.kKtz,e)):(n.TsRo={},n.setQeState())}catch(t){return n.TsRo={},n.setQeState()}})),s(this,"setQeState",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{t.getController().persistToStorage("qe_state",n.TsRo,!0)}catch(r){""===e?n.TsRo={}:n.TsRo[e]={SESSION:0,OVERALL:0,DATES:{}},t.getController().persistToStorage("qe_state",n.TsRo,!0)}return n.TsRo})),s(this,"initialize",(function(){n.FyrB||(n.FyrB=!0,n.EGlR=new R,n.WpgE.initialize(),n.TsRo=n.getQeState(),V.info("QE Initialized.."))})),s(this,"parse",(function(t){n.lHre()?(n.EGlR.parse(t),n.WpgE.hUlQ()):V.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(t,e){n.lHre()&&n.EGlR.validate(t,e)})),s(this,"validateForTermination",(function(t,e){n.lHre()&&n.EGlR.validateForTermination(t,e)})),s(this,"validateForTerminationAttributes",(function(t,e){return n.EGlR.validateForTerminationAttributes(t,e)})),s(this,"updateCount",(function(t){try{h(n.TsRo[t])||n.createObjConfig(t),n.incrementFrequencies(t),n.setQeState(t),n.EGlR.yGJs(t)}catch(t){console.log("Could not update the count config:".concat(t))}})),s(this,"resetFrequencyCounts",(function(){n.EGlR.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(t){return n.EGlR.getFrequencyCount(t)})),s(this,"registerForEvent",(function(t,e){n.WpgE.colh(t,e)})),s(this,"unregisterFromEvent",(function(t,e){n.WpgE.unregisterFromEvent(t,e)})),s(this,"fetch",(function(e,n,r,i){t.getController().fetchConfiguration(e,n,r,i)})),s(this,"lHre",(function(){return n.FyrB})),s(this,"getCampaignMetaFromQueryEngine",(function(t){return n.EGlR.iSci(t)})),s(this,"rvWz",(function(){return n.Emjp})),e.instance||(e.instance=this),e.instance}return a(e,[{key:"createObjConfig",value:function(t){try{this.TsRo=this.getQeState(),h(this.TsRo[t])||(this.TsRo[t]={SESSION:0,OVERALL:0,DATES:{}},this.Emjp&&(this.TsRo[t].DATES[this.Emjp]=0),this.setQeState(t))}catch(t){V.error("Can not create the frequency count object:"+t)}}},{key:"incrementFrequencies",value:function(t){this.TsRo=this.getQeState();var e=this.TsRo[t];e.SESSION=e.SESSION+1,e.OVERALL=e.OVERALL+1;var n=m();n===this.Emjp&&e.DATES&&e.DATES[n]||(this.Emjp=n,e.DATES={},e.DATES[this.Emjp]=0),e.DATES[this.Emjp]=e.DATES[this.Emjp]+1}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();s(Y,"instance",void 0),window.ceVersion=141;try{void 0===exports&&null===exports||(exports.default=Y,module.exports=exports.default)}catch(t){}return Y}));
1
+ !function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("apxor")):"function"==typeof define&&define.amd?define(["apxor"],e):(t=t||self)["apxor-qe"]=e(t.Apxor)}(this,(function(t){"use strict";function e(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,r)}return n}function n(t){for(var n=1;n<arguments.length;n++){var r=null!=arguments[n]?arguments[n]:{};n%2?e(Object(r),!0).forEach((function(e){s(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):e(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function i(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,l(r.key),r)}}function a(t,e,n){return e&&o(t.prototype,e),n&&o(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t}function s(t,e,n){return(e=l(e))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t){return function(t){if(Array.isArray(t))return c(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return c(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);"Object"===n&&t.constructor&&(n=t.constructor.name);if("Map"===n||"Set"===n)return Array.from(t);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return c(t,e)}(t)||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(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function l(t){var e=function(t,e){if("object"!=typeof t||null===t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var r=n.call(t,e||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==typeof e?e:String(e)}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;var f=function(t){return void 0!==t&&!function(t){return null===t}(t)},h="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";function v(t,e){return Array.from(e).map((function(e,n){return String.fromCharCode(e^function(t,e){return t.charCodeAt(Math.floor(e%t.length))}(t,n))})).join("")}var d=function(t,e){return v(t,e=function(t){var e,n,r,i,o,a,s=0,u=[];if(!t)return t;t+="";do{e=(a=h.indexOf(t.charAt(s++))<<18|h.indexOf(t.charAt(s++))<<12|(i=h.indexOf(t.charAt(s++)))<<6|(o=h.indexOf(t.charAt(s++))))>>16&255,n=a>>8&255,r=255&a,u.push(e),64!==i&&(u.push(n),64!==o&&u.push(r))}while(s<t.length);return u}(e))},g=function(t){switch(t){case"app_event":return"AE";case"client_event":return"CE";case"activity_time":case"activity_event":return"AE"}return"Unknown"},p=function(t){return t.toUpperCase()},_=function(t,e,n){switch(n){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;case"NEQ":return t!==e;case"R":return y(e).test(t);default:return!1}},y=function(t){var e=t.replace(/.*\/([gimuy]*)$/,"$1");e===t&&(e="");var n=e?t.replace(new RegExp("^/(.*?)/"+e+"$"),"$1"):t;return new RegExp(n,e)},m=function(){var t=new Date;return t.getDate()+"/"+t.getMonth()+"/"+t.getFullYear()},b=window.ApxorLogger,w=a((function e(){var n=this;i(this,e),s(this,"KSOj","ALL"),s(this,"MSCc",[]),s(this,"HuDN",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(n.KSOj=t.audience.audience_type,n.MSCc=t.audience.attributes.user,n.HuDN=t.audience.attributes.session,!Array.isArray(n.MSCc)||!Array.isArray(n.HuDN))return b.error("No attributes"),!1}catch(t){return b.error(t),!1}return!0})),s(this,"validate",(function(e,r){var i=!0;return"FTU"===n.KSOj&&(i=t.getController().getSessionInfo().is_first_session),i&&n.zQwl(e,n.MSCc)&&n.zQwl(r,n.HuDN)})),s(this,"zQwl",(function(t,e){var n=e.length,r=!0;try{for(var i,o=function(){var n=e[a];if(!t[n.name]||!1===r)return{v:!1};var i=n.operator,o=n.type,s=n.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return _(t,e,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(t){b.error(t),r=!1}return r}))})),S=window.ApxorLogger,N=a((function t(){var e=this;i(this,t),s(this,"oKkN",0),s(this,"uzZi",0),s(this,"Avzx","SESSION"),s(this,"CqAl",0),s(this,"ivKN",0),s(this,"cOKY",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.oKkN=t.frequency.count,-1===e.oKkN&&(e.oKkN=1e3),e.cOKY=e.oKkN,e.uzZi=t.frequency.time_interval,e.Avzx=t.frequency.validity,e.ivKN=t.frequency.ses_lmt,e._dayCount=t.frequency.day_lmt;var n=V.getInstance().getQeState();if(!f(n)||!f(n[t._id]))return!0;if("SESSION"===e.Avzx){if(e.oKkN=parseInt(e.oKkN)-parseInt(n[t._id].SESSION),e.oKkN<=0)return console.warn("Max count limit reached for session:"+t._id),!1}else{if("OVERALL"!==e.Avzx)return S.info("Invalid config."),!1;if(e.oKkN=parseInt(e.oKkN)-parseInt(n[t._id].OVERALL),e.oKkN<=0)return console.warn("Max count limit reached for overall:"+t._id),!1}}catch(t){return S.error(t),!1}return!0})),s(this,"ErGD",(function(){e.oKkN=e.oKkN-1})),s(this,"getFrequencyCount",(function(){return e.oKkN})),s(this,"Kbwh",(function(){"SESSION"===e.Avzx&&(e.oKkN=e.cOKY,S.info("Campaign Limit reset"))})),s(this,"TzLe",(function(t){try{if(e.oKkN<=0)return!1;var n=V.getInstance().getQeState();if(!f(n)||!f(n[t]))return!0;if(0!==e.ivKN)if(parseInt(e.ivKN)-parseInt(n[t].SESSION)<=0)return!1;if(0!==e._dayCount){var r,i=m();if(parseInt(e._dayCount)-parseInt((null===(r=n[t])||void 0===r?void 0:r.DATES[i])||0)<=0)return!1}}catch(t){S.error("Error validating the frequency:"+t)}return!0}))})),A=a((function t(){var e=this;i(this,t),s(this,"lKfZ",""),s(this,"KSOj",""),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n;e.lKfZ=t.meta.name,e.KSOj=t.meta.type,e._only_context=t.meta.only_context,e._attr=(null===(n=t.meta)||void 0===n?void 0:n.attr)||{}}catch(t){return window.ApxorLogger.error(t),!1}return!0}))})),O=window.ApxorLogger,k=a((function t(){var e=this;i(this,t),s(this,"TVeC",-1),s(this,"AsSy",-1),s(this,"Hztt",-1),s(this,"ZTNT",-1),s(this,"eGYo",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(isNaN(Date.parse(t.validity.start_date))||isNaN(Date.parse(t.validity.end_date)))return O.error("Not valid dates"),!1;if(e.TVeC=Date.parse(t.validity.start_date),e.AsSy=Date.parse(t.validity.end_date),f(t.time_limits_in_day)&&(e.eGYo=t.time_limits_in_day,e.eGYo&&f(t.time_limits))){var n=(new Date).toISOString().split("T")[0];if(e.Hztt=Date.parse(n+"T"+t.time_limits.start_time+".000Z"),e.ZTNT=Date.parse(n+"T"+t.time_limits.end_time+".000Z"),isNaN(e.Hztt)||isNaN(e.ZTNT))return O.error("Not valid times"),!1}}catch(t){return O.error(t),!1}return!0})),s(this,"validate",(function(){var t=Date.now();return t>e.TVeC&&t<e.AsSy&&(!e.eGYo||t>=e.Hztt&&t<=e.ZTNT)}))})),T=a((function t(){var e=this;i(this,t),s(this,"lKfZ",""),s(this,"xDaw",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{e.lKfZ=t.name,e.xDaw=t.additional_info}catch(t){return!1}return!0}))})),D=a((function t(){var e=this;i(this,t),s(this,"MZxZ",0),s(this,"gheX",0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.MZxZ=Number(t.lower),e.gheX=Number(t.upper),isNaN(e.MZxZ)||isNaN(e.gheX))return!1}catch(t){return!1}return!0}))})),x=a((function t(){var e=this;i(this,t),s(this,"SHrN",0),s(this,"rXTM",""),s(this,"bgoZ",""),s(this,"kuZn",new T),s(this,"tzep",new D),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.rXTM=t.event_type,e.bgoZ=t.activity,e.kuZn.parse(t.details)&&e.tzep.parse(t.time_bounds)}catch(t){return!1}}))})),E=window.ApxorLogger,C=a((function t(){var e=this;i(this,t),s(this,"SHrN",0),s(this,"eGRJ",-1),s(this,"oKkN",0),s(this,"CKgT",""),s(this,"bgoZ",""),s(this,"rXTM",""),s(this,"tzep",new D),s(this,"kuZn",new T),s(this,"xiSw",new x),s(this,"LNgq","AND"),s(this,"dWSg",!1),s(this,"KSOj",void 0),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{return e.eGRJ=t.sequence,e.oKkN=t.count_config.count,e.CKgT=t.count_config.operator,e.bgoZ=t.activity,e.rXTM=t.event_type,e.LNgq=t.combine_operator,e.KSOj=t.type,e.kuZn.parse(t.details)&&e.xiSw.parse(t.trigger)&&e.tzep.parse(t.time_bounds)}catch(t){return E.error(t),!1}}))})),F=window.ApxorLogger,Z=a((function t(){var e=this;i(this,t),s(this,"oKkN",0),s(this,"CKgT",""),s(this,"rXTM",""),s(this,"tzep",new D),s(this,"kuZn",new T),s(this,"LNgq","AND"),s(this,"parse",(function(t){try{return e.oKkN=t.count_config.count,e.CKgT=t.count_config.operator,e.rXTM=t.event_type,e.LNgq=t.combine_operator,e.kuZn.parse(t.details)&&e.tzep.parse(t.time_bounds)}catch(t){return F.error(t),!1}}))})),K=window.ApxorLogger,X=function(){function e(){var n=this;i(this,e),s(this,"akXD",0),s(this,"FqJf",""),s(this,"ehaO",new C),s(this,"rkRi",new Z),s(this,"RlJN",!1),s(this,"GJsb",!1),s(this,"WLVW",0),s(this,"LNgq","AND"),s(this,"WFrp","OR"),s(this,"sVTX",-1),s(this,"GzsF",[]),s(this,"HATm",{}),s(this,"bqgA",!1),s(this,"initialize",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",i=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]:"";if(n.FqJf=r,n.WLVW=i,n.GzsF=a,"termination"===s&&""!==s){n.rkRi.parse(e);return n.WFrp=n.rkRi.LNgq,n.FoZP(),!0}var u=n.ehaO.parse(e);if(u){if(n.LNgq=n.ehaO.LNgq,n.ehaO.dWSg){var c=n.ehaO.kuZn.lKfZ;"APX_PAGE_OPENED"===c&&(c=n.ehaO.kuZn.xDaw.navigation_id,c=f(c)?c:n.ehaO.kuZn.lKfZ),n.sVTX=t.getController().getEventCount(c);var l=n.ehaO.oKkN,h=n.ehaO.CKgT;if(n.GJsb=n.BcDf(n.sVTX-1,l,h,!1),n.RlJN=n.GJsb,n.GJsb&&"APX_PAGE_OPENED"===n.ehaO.kuZn.lKfZ)return!0}return o&&0!==i||n.hian(),!0}return!1})),s(this,"hian",(function(){var t,e=n.ehaO,r=e.xiSw,i=V.getInstance();"app_start"===r.rXTM?(n.RlJN=!0,i.registerForEvent(g(e.rXTM)+"___"+e.kuZn.lKfZ,n.LkAU)):i.registerForEvent(g(e.rXTM)+"___"+r.kuZn.lKfZ,n.LkAU),null!==(t=window.ApxorRTM)&&void 0!==t&&t.badgesLists.includes(n.FqJf)&&i.registerForEvent(g(e.rXTM)+"___"+"apxor-badge-container-".concat("-".concat(n.FqJf).replaceAll(" ","").replace(/[^\w\s]/gi,"")),n.LkAU)})),s(this,"FoZP",(function(){var t=n.rkRi,e=V.getInstance();n.RlJN=!0,e.registerForEvent(g(t.rXTM)+"___"+t.kuZn.lKfZ,n.xsmN)})),s(this,"JTwT",(function(t,e,r,i){var o,a=(Date.now()-n.HATm[e])/1e3;(null===(o=n.ehaO)||void 0===o||null===(o=o.kuZn)||void 0===o||null===(o=o.xDaw)||void 0===o?void 0:o.time)/1e3>a&&n._displayCampaign(r)})),s(this,"sSky",(function(t,e,r,i){var o,a;n.bqgA=!0;var s=Date.now(),u=null===(o=n.ehaO)||void 0===o||null===(o=o.xiSw)||void 0===o?void 0:o.kuZn.lKfZ,c=(s-n.HATm[u])/1e3,l=null===(a=n.ehaO)||void 0===a||null===(a=a.kuZn)||void 0===a||null===(a=a.xDaw)||void 0===a?void 0:a.time;(l/=1e3)>c&&n._displayCampaign(r)})),s(this,"LkAU",(function(e,r,i,o){var a,s=V.getInstance();if(n.RlJN){if(null!==(a=window.ApxorRTM)&&void 0!==a&&a.isBadgePresent&&t.getController().isBadgeTriggerSatisfied(n.FqJf))return n.GJsb=!0,n.ehaO.SHrN=i,void s.validate(n.FqJf,n.WLVW);g(n.ehaO.rXTM)===e&&n.IHQA(i-n.ehaO.xiSw.SHrN,n.ehaO.tzep)&&n.ehaO.kuZn.lKfZ===r&&n.YnRU(n.ehaO.kuZn.xDaw,o)&&(n.akXD+=1,n.GJsb=n.BcDf(n.akXD,n.ehaO.oKkN,n.ehaO.CKgT),n.GJsb&&(n.ehaO.SHrN=i,s.validate(n.FqJf,n.WLVW)))}else if(n.RlJN=n.PCkN(e,r,i,o),n.RlJN){var u=n.ehaO,c=u.xiSw;if(c.SHrN=i,"activity_time"===(null==u?void 0:u.rXTM)){var l,f,h,v=null==u||null===(l=u.kuZn)||void 0===l||null===(l=l.xDaw)||void 0===l?void 0:l.time;(null==u||null===(f=u.kuZn)||void 0===f||null===(f=f.xDaw)||void 0===f?void 0:f.nkpi.length)>0&&(setTimeout((function(){n.bqgA||(n.GJsb=!0,n.GJsb&&(n.akXD+=1,n.GJsb=n.BcDf(n.akXD,n.ehaO.oKkN,n.ehaO.CKgT),n.GJsb&&(n.ehaO.SHrN=i,s.validate(n.FqJf,n.WLVW)))),u.kuZn.xDaw.nkpi.map((function(t){s.unregisterFromEvent(p(u.kuZn.xDaw.et)+"___"+t,n)}))}),v),u.kuZn.xDaw.nkpi.map((function(t){s.registerForEvent(p(u.kuZn.xDaw.et)+"___"+t,n.sSky)}))),(null==u||null===(h=u.kuZn)||void 0===h||null===(h=h.xDaw)||void 0===h?void 0:h.kpi.length)>0&&(setTimeout((function(){u.kuZn.xDaw.kpi.map((function(t){s.unregisterFromEvent(p(u.kuZn.xDaw.et)+"___"+t,n)}))}),v),u.kuZn.xDaw.kpi.map((function(t){t===u.xiSw.kuZn.lKfZ?(s.unregisterFromEvent(g(c.rXTM)+"___"+c.kuZn.lKfZ,n),s.registerForEvent(p(u.kuZn.xDaw.et)+"___"+t,n.JTwT)):s.registerForEvent(p(u.kuZn.xDaw.et)+"___"+t,n.sSky)})))}else s.unregisterFromEvent(g(c.rXTM)+"___"+c.kuZn.lKfZ,n),s.registerForEvent(g(u.rXTM)+"___"+u.kuZn.lKfZ,n);n.HATm[r]=Date.now()}})),s(this,"xsmN",(function(t,e,r,i){var o=V.getInstance();g(n.rkRi.rXTM)===t&&n.IHQA(r,n.rkRi.tzep)&&n.rkRi.kuZn.lKfZ===e&&n.YnRU(n.rkRi.kuZn.xDaw,i)&&(n.akXD+=1,n.GJsb=n.BcDf(n.akXD,n.rkRi.oKkN,n.rkRi.CKgT),n.GJsb&&(n.rkRi.SHrN=r,o.validateForTermination(n.FqJf,n.WLVW)))})),s(this,"PCkN",(function(t,e,r,i){var o=n.ehaO.xiSw;return g(o.rXTM)===t&&o.kuZn.lKfZ===e&&n.IHQA(r,o.tzep)&&n.YnRU(o.kuZn.xDaw,i)})),s(this,"IHQA",(function(t,e){var n=Math.ceil(t);return n>e.MZxZ&&n<e.gheX})),s(this,"BcDf",(function(t,e,r){var i=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];switch(i&&n.ehaO.dWSg&&(t+=n.sVTX),r){case"EQ":return t===e;case"GT":return t>e;case"GTE":return t>=e;case"LT":return t<e;case"LTE":return t<=e;default:return!1}})),s(this,"YnRU",(function(t,e){var n=!0;try{var i,o=function(){if(!e[a]||!1===n)return{v:!1};if("object"===r(t[a])){var i,o=t[a].op,s=t[a].t;"s"===s?i=t[a].val:"l"!==s&&"f"!==s||(i=parseFloat(t[a].val));var u=(Array.isArray(e[a])?e[a]:[e[a]]).some((function(t){return _(t,i,o)}));n=n&&u}else n=n&&_(e[a],t[a],"EQ")};for(var a in t)if(i=o())return i.v}catch(t){K.error(t),n=!1}return n}))}return a(e,[{key:"_displayCampaign",value:function(t){var e=V.getInstance();this.GJsb=!0,this.GJsb&&(this.akXD+=1,this.GJsb=this.BcDf(this.akXD,this.ehaO.oKkN,this.ehaO.CKgT),this.GJsb&&(this.ehaO.SHrN=t,e.validate(this.FqJf,this.WLVW)))}}]),e}(),J=window.ApxorLogger,L=a((function e(){var n=this;i(this,e),s(this,"NpXz",[]),s(this,"_ret_day",{}),s(this,"MiYE",{}),s(this,"FLiS",!1),s(this,"DdTA",!1),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{n.NpXz=t.overall_cfg.events,n._ret_day=t.overall_cfg.ret_day,n.MiYE=t.overall_cfg.session,n.FLiS=t.overall_cfg.toggleRetDay,n.NpXz=t.overall_cfg.events,n.DdTA=t.overall_cfg.toggleSession}catch(t){return J.error(t),!1}return!0})),s(this,"validate",(function(){var e=parseInt(t.getController().getFromStorage("apx_retained_days")),r=parseInt(t.getController().getFromStorage("apx_retained_session"));if(n.FLiS&&!isNaN(e)&&!(e>=n._ret_day.from&&e<=n._ret_day.to))return!1;if(n.DdTA&&!isNaN(r)&&!(r>=n.MiYE.from&&r<=n.MiYE.to))return!1;try{for(var i=t.getController().getFromStorage("_apx_lt_count"),o=t.getSiteId(),a=JSON.parse((new TextDecoder).decode(function(t){for(var e=new ArrayBuffer(t.length),n=new Uint8Array(e),r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return e}(d(o,i)))),s=0;s<n.NpXz.length;s++){if(a[n.NpXz[s].name.replace("'","").replace("’","")])return!1}}catch(t){J.error("Failed to validate the lt count:"+t)}return!0}))})),z=window.ApxorLogger,q=a((function t(){var e=this;i(this,t),s(this,"MSCc",[]),s(this,"HuDN",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(e.MSCc=t.attributes.user,e.HuDN=t.attributes.session,!Array.isArray(e.MSCc)||!Array.isArray(e.HuDN))return z.error("No attributes"),!1}catch(t){return z.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.zQwl(t,e.MSCc)&&e.zQwl(n,e.HuDN)})),s(this,"zQwl",(function(t,e){var n=e.length,r=!0;try{for(var i,o=function(){var n=e[a];if(!t[n.name]||!1===r)return{v:!1};var i=n.operator,o=n.type,s=n.value.map((function(t){return"s"===o?t:"l"===o?parseInt(t):"f"===o?parseFloat(t):void 0})),u=(Array.isArray(t[n.name])?t[n.name]:[t[n.name]]).some((function(t){return s.some((function(e){return _(t,e,i)}))}));r=r&&u},a=0;a<n;a++)if(i=o())return i.v}catch(t){z.error(t),r=!1}return r}))})),M=a((function e(){var n=this;i(this,e),s(this,"OCNT",t.getController()),s(this,"type",""),s(this,"_duration_seconds",0),s(this,"dXMg",1),s(this,"parse",(function(t){try{var e,r,i;if(n.KSOj=null===(e=t.terminate_info.time_based)||void 0===e?void 0:e.type,n._duration_seconds=null===(r=t.terminate_info)||void 0===r?void 0:r.time_based.duration_seconds,n.dXMg=null===(i=t.terminate_info.time_based)||void 0===i?void 0:i.days,n.OjHn(t._id))return n.OCNT.persistTerminationInfoLocally(t._id),!1}catch(t){return!1}return!0})),s(this,"OjHn",(function(t){var e,r=JSON.parse(n.OCNT.getFromStorage("apx_termination_ID"));if(!r[t]||null===(e=r[t])||void 0===e||!e.startDate)return!1;var i,o=new Date(r[t].startDate),a=new Date((i=new Date).getMonth()+"/"+i.getDate()+"/"+i.getFullYear()),s=parseInt((a-o)/864e5,10),u=function(){var t=new Date;return{hours:t.getHours(),mins:t.getMinutes()}}(),c=r[t].Hztt;return s===n.dXMg&&u.hours>=c.hours||s>n.dXMg||r[t].goalAcheived}))})),G=a((function t(){var e=this;i(this,t),s(this,"enable_goal_events",!1),s(this,"attributes",{}),s(this,"hQNV",new q),s(this,"NQJh",new M),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{var n,r,i;if(e.enable_time_based=null==t||null===(n=t.terminate_info)||void 0===n?void 0:n.enable_time_based,e.enable_time_based&&!e.NQJh.parse(t))return!1;if(e.enable_goal_events=null==t||null===(r=t.terminate_info)||void 0===r?void 0:r.enable_goal_events,e.enable_attributes=null==t||null===(i=t.terminate_info)||void 0===i?void 0:i.enable_attributes,e.enable_attributes&&!e.hQNV.parse(t.terminate_info))return!1}catch(t){return window.ApxorLogger.error(t),!1}return!0})),s(this,"validate",(function(t,n){return e.hQNV.validate(t,n)}))})),H=window.ApxorLogger,j=a((function e(){var r=this;i(this,e),s(this,"xJBM",[]),s(this,"vlff",[]),s(this,"FqJf",""),s(this,"nWdU",new A),s(this,"NGHV",new w),s(this,"Avzx",new k),s(this,"znWc",new N),s(this,"TaRN",new L),s(this,"QowM",new G),s(this,"sajn",!1),s(this,"pzra",[]),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};try{if(!f(t._id))return H.error("No Id"),!1;if(!f(t.enabled)||!t.enabled)return H.error("Not enabled"),!1;if(!(r.nWdU.parse(t)&&r.Avzx.parse(t)&&r.znWc.parse(t)&&r.NGHV.parse(t)&&r.TaRN.parse(t)&&r.QowM.parse(t)))return!1;if(!f(t.conditions)||!Array.isArray(t.conditions))return H.error("No valid conditions",t.conditions),!1;r.FqJf=t._id,r.sajn=!!f(t.sequence_enabled)&&t.sequence_enabled,r.sajn&&t.conditions.sort((function(t,e){return t.sequence<e.sequence}));for(var e=t.conditions,n=e.length,i=0;i<n;i++){r.pzra=[];var o=e[i];if("didn't"===o.type){var a,s={trigger_key:o.trigger.details.name,no_kpi_array:null==o||null===(a=o.details)||void 0===a||null===(a=a.additional_info)||void 0===a?void 0:a.nkpi,condition_id:null==o?void 0:o._id,time_bounds:o.time_bounds.upper};r.pzra=[].concat(u(r.pzra),[s])}var c=new X;c.initialize(o,r.FqJf,i,r.sajn,r.pzra)&&r.xJBM.push(c)}if(r.QowM.enable_goal_events)for(var l=t.terminate_info.goal_events.events,h=l.length,v=0;v<h;v++){var d=new X;d.initialize(l[v],r.FqJf,v,!0,[],"termination")&&r.vlff.push(d)}return r.xJBM.length>0}catch(t){return H.error(t),!1}})),s(this,"GjfG",(function(t){if(!(t<0))if(r.sajn){var e=r.xJBM[t];if(f(e)&&e.GJsb){var n=r.xJBM[t-1];if(f(n)&&!n.GJsb)return;var i=r.xJBM[t+1];f(i)?i.hian():r.FnDf()}}else r.FnDf()})),s(this,"pYOs",(function(t){t<0||r.YpOv()})),s(this,"FnDf",(function(){var e=t.getController().getUserAttributes(),i=t.getController().getSessionAttributes();if(r.Avzx.validate()&&r.NGHV.validate(e,i)&&r.TaRN.validate()){for(var o=r.xJBM.length,a=o<1,s="",u=0;u<o;u++){var c=r.xJBM[u],l=c.GJsb;if(""===s.trim())a=l;else switch(s){case"AND":a=a&&l;break;case"OR":a=a||l}s=c.LNgq}if(a){if(console.debug("onCondition satisfied"),!r.znWc.TzLe(r.FqJf))return void console.warn("Maximum limit reached",r.FqJf);console.log("Dispatching event",r.nWdU.KSOj),!0===r.nWdU._only_context&&t.logEvent("apx_context_evaluated",n(n({},r.nWdU._attr),{},{message_name:r.nWdU.lKfZ,id:r.FqJf})),t.getController().dispatchEvent(r.nWdU.KSOj,{name:r.nWdU.KSOj,additional_info:{uuid:r.FqJf,name:r.nWdU.lKfZ}})}}})),s(this,"YpOv",(function(){for(var e=r.vlff.length,i=e<1,o="",a=0;a<e;a++){var s=r.vlff[a],u=s.GJsb;if(""===o.trim())i=u;else switch(o){case"AND":i=i&&u;break;case"OR":i=i||u}o=s.WFrp}i&&(console.log("Dispatching event",r.nWdU.KSOj),t.getController().persistTerminationInfoLocally(r.FqJf),!0===r.nWdU._only_context&&t.logEvent("apx_context_evaluated",n(n({},r.nWdU._attr),{},{message_name:r.nWdU.lKfZ,id:r.FqJf})),t.getController().dispatchEvent(r.nWdU.KSOj,{name:r.nWdU.KSOj,additional_info:{uuid:r.FqJf,name:r.nWdU.lKfZ}}))})),s(this,"validateForTerminationAttributes",(function(){var e=t.getController().getUserAttributes(),n=t.getController().getSessionAttributes();return r.QowM.validate(e,n)})),s(this,"ErGD",(function(){r.znWc.ErGD()})),s(this,"getFrequencyCount",(function(){return r.znWc.getFrequencyCount()})),s(this,"KnFr",(function(){return r.znWc.Kbwh()}))})),I=a((function t(){var e=this;i(this,t),s(this,"XvSv",{}),s(this,"parse",(function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{configs:[]};if(f(t)&&f(t.configs)){var n=t.configs;if(!Array.isArray(n))return;n.sort((function(t,e){var n,r;return(null!==(n=t.prio)&&void 0!==n?n:-1)-(null!==(r=e.prio)&&void 0!==r?r:-1)}));for(var r=0;r<n.length;r++){var i=n[r],o=i._id,a=new j;a.parse(i)?e.XvSv[o]=a:console.warn("Failed to parse cfg",o)}}})),s(this,"validate",(function(t,n){e.XvSv[t]&&e.XvSv[t].GjfG(n)})),s(this,"validateForTermination",(function(t,n){e.XvSv[t]&&e.XvSv[t].pYOs(n)})),s(this,"validateForTerminationAttributes",(function(t){return!!e.XvSv[t]&&e.XvSv[t].validateForTerminationAttributes()})),s(this,"ErGD",(function(t){e.XvSv[t].ErGD()})),s(this,"getFrequencyCount",(function(t){return e.XvSv[t].getFrequencyCount()})),s(this,"resetFrequencyCounts",(function(){var t=e.XvSv;for(var n in t)t[n].KnFr()})),s(this,"Asov",(function(t){try{if(e.XvSv){var n=e.XvSv[t];if(n&&n.nWdU)return n.nWdU}}catch(t){console.log("Error in getting the campaign meta ".concat(t))}return{}}))})),R=window.ApxorLogger,W=a((function e(){var n=this;i(this,e),s(this,"AZee",{}),s(this,"GHrG",[]),s(this,"HJfd",!1),s(this,"initialize",(function(){var e=t.getController();e.registerForEvent("APP_EVENT",(function(t){return n.gFEv(t,"AE")})),e.registerForEvent("CLIENT_EVENT",(function(t){return n.gFEv(t,"CE")}))})),s(this,"KqaR",(function(){for(var t in n.GHrG)n.wTap(t.event,t.key,t.type);n.HJfd=!0})),s(this,"HaQv",(function(t,e){var r;"function"==typeof e&&((r=n.AZee[t]?n.AZee[t]:[]).push(e),n.AZee[t]=r,R.debug("Listeners list: ",n.AZee))})),s(this,"unregisterFromEvent",(function(t,e){if(n.AZee[t]){for(var r=n.AZee[t],i=[],o=0;o<r.length;o++){var a=r[o];a!==e&&i.push(a)}n.AZee[t]=i}})),s(this,"gFEv",(function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"AE",r=e+"___"+t.name;n.wTap(t,r,e)})),s(this,"wTap",(function(e,r,i){if(n.HJfd){if(R.debug("Notifying listeners for event: "+e+", "+r,n.AZee),n.AZee[r])for(var o=n.AZee[r],a=t.getController().getSDKRunningTimeInSec(),s=0;s<o.length;s++){(0,o[s])(i,e.name,a,e.additional_info)}}else n.GHrG.push({event:e,key:r,type:i})}))})),Q=window.ApxorLogger,V=function(){function e(){var n=this;return i(this,e),s(this,"RNCW",!1),s(this,"vozs",null),s(this,"OpCt",m()),s(this,"HLag",new W),s(this,"mhlV",t.getSiteId()),s(this,"Xhbc",{}),s(this,"getQeState",(function(){try{var e=t.getController().getFromStorage("qe_state");return e?JSON.parse(d(n.mhlV,e)):(n.Xhbc={},n.setQeState())}catch(t){return n.Xhbc={},n.setQeState()}})),s(this,"setQeState",(function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";try{t.getController().persistToStorage("qe_state",n.Xhbc,!0)}catch(r){""===e?n.Xhbc={}:n.Xhbc[e]={SESSION:0,OVERALL:0,DATES:{}},t.getController().persistToStorage("qe_state",n.Xhbc,!0)}return n.Xhbc})),s(this,"initialize",(function(){n.RNCW||(n.RNCW=!0,n.vozs=new I,n.HLag.initialize(),n.Xhbc=n.getQeState(),Q.info("QE Initialized.."))})),s(this,"parse",(function(t){n.wVJP()?(n.vozs.parse(t),n.HLag.KqaR()):Q.warn("Must call init first. Unable to proceed")})),s(this,"validate",(function(t,e){n.wVJP()&&n.vozs.validate(t,e)})),s(this,"validateForTermination",(function(t,e){n.wVJP()&&n.vozs.validateForTermination(t,e)})),s(this,"validateForTerminationAttributes",(function(t,e){return n.vozs.validateForTerminationAttributes(t,e)})),s(this,"updateCount",(function(t){try{f(n.Xhbc[t])||n.createObjConfig(t),n.incrementFrequencies(t),n.setQeState(t),n.vozs.ErGD(t)}catch(t){console.log("Could not update the count config:".concat(t))}})),s(this,"resetFrequencyCounts",(function(){n.vozs.resetFrequencyCounts()})),s(this,"getFrequencyCount",(function(t){return n.vozs.getFrequencyCount(t)})),s(this,"registerForEvent",(function(t,e){n.HLag.HaQv(t,e)})),s(this,"unregisterFromEvent",(function(t,e){n.HLag.unregisterFromEvent(t,e)})),s(this,"notifyEventListener",(function(t){n.HLag.gFEv(t)})),s(this,"fetch",(function(e,n,r,i){t.getController().fetchConfiguration(e,n,r,i)})),s(this,"wVJP",(function(){return n.RNCW})),s(this,"getCampaignMetaFromQueryEngine",(function(t){return n.vozs.Asov(t)})),s(this,"CmBi",(function(){return n.OpCt})),e.instance||(e.instance=this),e.instance}return a(e,[{key:"createObjConfig",value:function(t){try{this.Xhbc=this.getQeState(),f(this.Xhbc[t])||(this.Xhbc[t]={SESSION:0,OVERALL:0,DATES:{}},this.OpCt&&(this.Xhbc[t].DATES[this.OpCt]=0),this.setQeState(t))}catch(t){Q.error("Can not create the frequency count object:"+t)}}},{key:"incrementFrequencies",value:function(t){this.Xhbc=this.getQeState();var e=this.Xhbc[t];e.SESSION=e.SESSION+1,e.OVERALL=e.OVERALL+1;var n=m();n===this.OpCt&&e.DATES&&e.DATES[n]||(this.OpCt=n,e.DATES={},e.DATES[this.OpCt]=0),e.DATES[this.OpCt]=e.DATES[this.OpCt]+1}}],[{key:"getInstance",value:function(){return e.instance||(e.instance=new e),e.instance}}]),e}();s(V,"instance",void 0),window.ceVersion=142;try{void 0===exports&&null===exports||(exports.default=V,module.exports=exports.default)}catch(t){}return V}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apxor-qe",
3
- "version": "1.4.1",
3
+ "version": "1.4.2",
4
4
  "author": "Uma Sankar Yedida <umasankar.yedida@apxor.com> (https://www.apxor.com)",
5
5
  "contributors": [
6
6
  {
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "dependencies": {
54
54
  "jsdom": "^22.1.0",
55
- "apxor": "2.3.1"
55
+ "apxor": "2.3.2"
56
56
  },
57
57
  "files": [
58
58
  "dist"